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
sequencelengths 20
832
| func_documentation_string
stringlengths 61
2k
| func_documentation_tokens
sequencelengths 1
647
| split_name
stringclasses 1
value | func_code_url
stringlengths 102
339
|
---|---|---|---|---|---|---|---|---|---|---|
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.ifHasProperty | public void ifHasProperty(String template, Properties attributes) throws XDocletException {
"""
Determines whether the current object on the specified level has a specific property, and if so, processes the
template
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param name="level" optional="false" description="The level for the current object"
values="class,field,reference,collection"
@doc.param name="name" optional="false" description="The name of the property"
"""
String value = getPropertyValue(attributes.getProperty(ATTRIBUTE_LEVEL), attributes.getProperty(ATTRIBUTE_NAME));
if (value != null)
{
generate(template);
}
} | java | public void ifHasProperty(String template, Properties attributes) throws XDocletException
{
String value = getPropertyValue(attributes.getProperty(ATTRIBUTE_LEVEL), attributes.getProperty(ATTRIBUTE_NAME));
if (value != null)
{
generate(template);
}
} | [
"public",
"void",
"ifHasProperty",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"value",
"=",
"getPropertyValue",
"(",
"attributes",
".",
"getProperty",
"(",
"ATTRIBUTE_LEVEL",
")",
",",
"attributes",
".",
"getProperty",
"(",
"ATTRIBUTE_NAME",
")",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"generate",
"(",
"template",
")",
";",
"}",
"}"
] | Determines whether the current object on the specified level has a specific property, and if so, processes the
template
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param name="level" optional="false" description="The level for the current object"
values="class,field,reference,collection"
@doc.param name="name" optional="false" description="The name of the property" | [
"Determines",
"whether",
"the",
"current",
"object",
"on",
"the",
"specified",
"level",
"has",
"a",
"specific",
"property",
"and",
"if",
"so",
"processes",
"the",
"template"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1490-L1498 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.checkConnectivity | public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
"""
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that determine how the connectivity check will be performed.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the ConnectivityInformationInner object if successful.
"""
return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} | java | public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} | [
"public",
"ConnectivityInformationInner",
"checkConnectivity",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"ConnectivityParameters",
"parameters",
")",
"{",
"return",
"checkConnectivityWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName",
",",
"parameters",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")",
".",
"body",
"(",
")",
";",
"}"
] | Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that determine how the connectivity check will be performed.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the ConnectivityInformationInner object if successful. | [
"Verifies",
"the",
"possibility",
"of",
"establishing",
"a",
"direct",
"TCP",
"connection",
"from",
"a",
"virtual",
"machine",
"to",
"a",
"given",
"endpoint",
"including",
"another",
"VM",
"or",
"an",
"arbitrary",
"remote",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2140-L2142 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java | NotificationHubsInner.getPnsCredentialsAsync | public Observable<NotificationHubResourceInner> getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
"""
Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NotificationHubResourceInner object
"""
return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<NotificationHubResourceInner>, NotificationHubResourceInner>() {
@Override
public NotificationHubResourceInner call(ServiceResponse<NotificationHubResourceInner> response) {
return response.body();
}
});
} | java | public Observable<NotificationHubResourceInner> getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<NotificationHubResourceInner>, NotificationHubResourceInner>() {
@Override
public NotificationHubResourceInner call(ServiceResponse<NotificationHubResourceInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"NotificationHubResourceInner",
">",
"getPnsCredentialsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"getPnsCredentialsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"namespaceName",
",",
"notificationHubName",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"NotificationHubResourceInner",
">",
",",
"NotificationHubResourceInner",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"NotificationHubResourceInner",
"call",
"(",
"ServiceResponse",
"<",
"NotificationHubResourceInner",
">",
"response",
")",
"{",
"return",
"response",
".",
"body",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
] | Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NotificationHubResourceInner object | [
"Lists",
"the",
"PNS",
"Credentials",
"associated",
"with",
"a",
"notification",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java#L1203-L1210 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.encodedOutputStreamWriter | public static Writer encodedOutputStreamWriter(OutputStream stream, String encoding) throws IOException {
"""
Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
@param stream An InputStream
@param encoding A charset encoding
@return A Reader
@throws IOException If any IO problem
"""
// OutputStreamWriter doesn't allow encoding to be null;
if (encoding == null) {
return new OutputStreamWriter(stream);
} else {
return new OutputStreamWriter(stream, encoding);
}
} | java | public static Writer encodedOutputStreamWriter(OutputStream stream, String encoding) throws IOException {
// OutputStreamWriter doesn't allow encoding to be null;
if (encoding == null) {
return new OutputStreamWriter(stream);
} else {
return new OutputStreamWriter(stream, encoding);
}
} | [
"public",
"static",
"Writer",
"encodedOutputStreamWriter",
"(",
"OutputStream",
"stream",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"// OutputStreamWriter doesn't allow encoding to be null;\r",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"return",
"new",
"OutputStreamWriter",
"(",
"stream",
")",
";",
"}",
"else",
"{",
"return",
"new",
"OutputStreamWriter",
"(",
"stream",
",",
"encoding",
")",
";",
"}",
"}"
] | Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
@param stream An InputStream
@param encoding A charset encoding
@return A Reader
@throws IOException If any IO problem | [
"Create",
"a",
"Reader",
"with",
"an",
"explicit",
"encoding",
"around",
"an",
"InputStream",
".",
"This",
"static",
"method",
"will",
"treat",
"null",
"as",
"meaning",
"to",
"use",
"the",
"platform",
"default",
"unlike",
"the",
"Java",
"library",
"methods",
"that",
"disallow",
"a",
"null",
"encoding",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1339-L1346 |
bushidowallet/bushido-java-service | bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java | CoinUtil.fullValueString | public static String fullValueString(long value, Denomination denomination) {
"""
Get the given value in satoshis as a string on the form "10.12345000"
using the specified denomination.
<p>
This method always returns a string with all decimal points. If you only
wish to have the necessary digits use
{@link CoinUtil#valueString(long, Denomination)}
@param value
The number of satoshis
@param denomination
The denomination to use
@return The given value in satoshis as a string on the form "10.12345000".
"""
BigDecimal d = BigDecimal.valueOf(value);
d = d.movePointLeft(denomination.getDecimalPlaces());
return d.toPlainString();
} | java | public static String fullValueString(long value, Denomination denomination) {
BigDecimal d = BigDecimal.valueOf(value);
d = d.movePointLeft(denomination.getDecimalPlaces());
return d.toPlainString();
} | [
"public",
"static",
"String",
"fullValueString",
"(",
"long",
"value",
",",
"Denomination",
"denomination",
")",
"{",
"BigDecimal",
"d",
"=",
"BigDecimal",
".",
"valueOf",
"(",
"value",
")",
";",
"d",
"=",
"d",
".",
"movePointLeft",
"(",
"denomination",
".",
"getDecimalPlaces",
"(",
")",
")",
";",
"return",
"d",
".",
"toPlainString",
"(",
")",
";",
"}"
] | Get the given value in satoshis as a string on the form "10.12345000"
using the specified denomination.
<p>
This method always returns a string with all decimal points. If you only
wish to have the necessary digits use
{@link CoinUtil#valueString(long, Denomination)}
@param value
The number of satoshis
@param denomination
The denomination to use
@return The given value in satoshis as a string on the form "10.12345000". | [
"Get",
"the",
"given",
"value",
"in",
"satoshis",
"as",
"a",
"string",
"on",
"the",
"form",
"10",
".",
"12345000",
"using",
"the",
"specified",
"denomination",
".",
"<p",
">",
"This",
"method",
"always",
"returns",
"a",
"string",
"with",
"all",
"decimal",
"points",
".",
"If",
"you",
"only",
"wish",
"to",
"have",
"the",
"necessary",
"digits",
"use",
"{",
"@link",
"CoinUtil#valueString",
"(",
"long",
"Denomination",
")",
"}"
] | train | https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java#L153-L157 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java | InvokerRunsPublisher.process | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
"""
/*
<ExecutionEvent type="MojoSucceeded" class="org.apache.maven.lifecycle.internal.DefaultExecutionEvent" _time="2017-06-25 20:47:25.741">
<project baseDir="/home/jenkins/workspace/aProject" file="/home/jenkins/workspace/aProject/pom.xml" groupId="org.myorg" name="My Project" artifactId="my-maven-plugin" version="1.0.0-SNAPSHOT">
<build sourceDirectory="/home/jenkins/workspace/aProject/src/main/java" directory="/home/jenkins/workspace/aProject/target"/>
</project>
<plugin executionId="integration-test" goal="run" groupId="org.apache.maven.plugins" artifactId="maven-invoker-plugin" version="2.0.0">
<projectsDirectory>${invoker.projectsDirectory}</projectsDirectory>
<cloneProjectsTo>/var/lib/jenkins/workspace/ncjira-maven-plugin-pipeline/target/it</cloneProjectsTo>
<reportsDirectory>${invoker.reportsDirectory}</reportsDirectory>
</plugin>
</ExecutionEvent>
"""
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warning("TaskListener is NULL, default to stderr");
listener = new StreamBuildListener((OutputStream) System.err);
}
List<Element> invokerRunRunEvents = XmlUtils.getExecutionEventsByPlugin(mavenSpyLogsElt, GROUP_ID, ARTIFACT_ID, RUN_GOAL, "MojoSucceeded", "MojoFailed");
List<Element> invokerRunIntegrationTestEvents = XmlUtils.getExecutionEventsByPlugin(mavenSpyLogsElt, GROUP_ID, ARTIFACT_ID, INTEGRATION_TEST_GOAL, "MojoSucceeded", "MojoFailed");
if (invokerRunRunEvents.isEmpty() && invokerRunIntegrationTestEvents.isEmpty()) {
if (LOGGER.isLoggable(Level.FINE)) {
listener.getLogger().println("[withMaven] invokerPublisher - " +
"No " + GROUP_ID + ":" + ARTIFACT_ID + ":" + RUN_GOAL +
" or " + GROUP_ID + ":" + ARTIFACT_ID + ":" + INTEGRATION_TEST_GOAL + " execution found");
}
return;
}
try {
Class.forName("org.jenkinsci.plugins.maveninvoker.MavenInvokerRecorder");
} catch (ClassNotFoundException e) {
listener.getLogger().print("[withMaven] invokerPublisher - Jenkins ");
listener.hyperlink("https://wiki.jenkins.io/display/JENKINS/Maven+Invoker+Plugin", "Maven Invoker Plugin");
listener.getLogger().println(" not found, don't display " + GROUP_ID + ":" + ARTIFACT_ID + ":" + RUN_GOAL + " results in pipeline screen.");
return;
}
executeReporter(context, listener, invokerRunRunEvents);
executeReporter(context, listener, invokerRunIntegrationTestEvents);
} | java | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warning("TaskListener is NULL, default to stderr");
listener = new StreamBuildListener((OutputStream) System.err);
}
List<Element> invokerRunRunEvents = XmlUtils.getExecutionEventsByPlugin(mavenSpyLogsElt, GROUP_ID, ARTIFACT_ID, RUN_GOAL, "MojoSucceeded", "MojoFailed");
List<Element> invokerRunIntegrationTestEvents = XmlUtils.getExecutionEventsByPlugin(mavenSpyLogsElt, GROUP_ID, ARTIFACT_ID, INTEGRATION_TEST_GOAL, "MojoSucceeded", "MojoFailed");
if (invokerRunRunEvents.isEmpty() && invokerRunIntegrationTestEvents.isEmpty()) {
if (LOGGER.isLoggable(Level.FINE)) {
listener.getLogger().println("[withMaven] invokerPublisher - " +
"No " + GROUP_ID + ":" + ARTIFACT_ID + ":" + RUN_GOAL +
" or " + GROUP_ID + ":" + ARTIFACT_ID + ":" + INTEGRATION_TEST_GOAL + " execution found");
}
return;
}
try {
Class.forName("org.jenkinsci.plugins.maveninvoker.MavenInvokerRecorder");
} catch (ClassNotFoundException e) {
listener.getLogger().print("[withMaven] invokerPublisher - Jenkins ");
listener.hyperlink("https://wiki.jenkins.io/display/JENKINS/Maven+Invoker+Plugin", "Maven Invoker Plugin");
listener.getLogger().println(" not found, don't display " + GROUP_ID + ":" + ARTIFACT_ID + ":" + RUN_GOAL + " results in pipeline screen.");
return;
}
executeReporter(context, listener, invokerRunRunEvents);
executeReporter(context, listener, invokerRunIntegrationTestEvents);
} | [
"@",
"Override",
"public",
"void",
"process",
"(",
"@",
"Nonnull",
"StepContext",
"context",
",",
"@",
"Nonnull",
"Element",
"mavenSpyLogsElt",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"TaskListener",
"listener",
"=",
"context",
".",
"get",
"(",
"TaskListener",
".",
"class",
")",
";",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"LOGGER",
".",
"warning",
"(",
"\"TaskListener is NULL, default to stderr\"",
")",
";",
"listener",
"=",
"new",
"StreamBuildListener",
"(",
"(",
"OutputStream",
")",
"System",
".",
"err",
")",
";",
"}",
"List",
"<",
"Element",
">",
"invokerRunRunEvents",
"=",
"XmlUtils",
".",
"getExecutionEventsByPlugin",
"(",
"mavenSpyLogsElt",
",",
"GROUP_ID",
",",
"ARTIFACT_ID",
",",
"RUN_GOAL",
",",
"\"MojoSucceeded\"",
",",
"\"MojoFailed\"",
")",
";",
"List",
"<",
"Element",
">",
"invokerRunIntegrationTestEvents",
"=",
"XmlUtils",
".",
"getExecutionEventsByPlugin",
"(",
"mavenSpyLogsElt",
",",
"GROUP_ID",
",",
"ARTIFACT_ID",
",",
"INTEGRATION_TEST_GOAL",
",",
"\"MojoSucceeded\"",
",",
"\"MojoFailed\"",
")",
";",
"if",
"(",
"invokerRunRunEvents",
".",
"isEmpty",
"(",
")",
"&&",
"invokerRunIntegrationTestEvents",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"listener",
".",
"getLogger",
"(",
")",
".",
"println",
"(",
"\"[withMaven] invokerPublisher - \"",
"+",
"\"No \"",
"+",
"GROUP_ID",
"+",
"\":\"",
"+",
"ARTIFACT_ID",
"+",
"\":\"",
"+",
"RUN_GOAL",
"+",
"\" or \"",
"+",
"GROUP_ID",
"+",
"\":\"",
"+",
"ARTIFACT_ID",
"+",
"\":\"",
"+",
"INTEGRATION_TEST_GOAL",
"+",
"\" execution found\"",
")",
";",
"}",
"return",
";",
"}",
"try",
"{",
"Class",
".",
"forName",
"(",
"\"org.jenkinsci.plugins.maveninvoker.MavenInvokerRecorder\"",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"listener",
".",
"getLogger",
"(",
")",
".",
"print",
"(",
"\"[withMaven] invokerPublisher - Jenkins \"",
")",
";",
"listener",
".",
"hyperlink",
"(",
"\"https://wiki.jenkins.io/display/JENKINS/Maven+Invoker+Plugin\"",
",",
"\"Maven Invoker Plugin\"",
")",
";",
"listener",
".",
"getLogger",
"(",
")",
".",
"println",
"(",
"\" not found, don't display \"",
"+",
"GROUP_ID",
"+",
"\":\"",
"+",
"ARTIFACT_ID",
"+",
"\":\"",
"+",
"RUN_GOAL",
"+",
"\" results in pipeline screen.\"",
")",
";",
"return",
";",
"}",
"executeReporter",
"(",
"context",
",",
"listener",
",",
"invokerRunRunEvents",
")",
";",
"executeReporter",
"(",
"context",
",",
"listener",
",",
"invokerRunIntegrationTestEvents",
")",
";",
"}"
] | /*
<ExecutionEvent type="MojoSucceeded" class="org.apache.maven.lifecycle.internal.DefaultExecutionEvent" _time="2017-06-25 20:47:25.741">
<project baseDir="/home/jenkins/workspace/aProject" file="/home/jenkins/workspace/aProject/pom.xml" groupId="org.myorg" name="My Project" artifactId="my-maven-plugin" version="1.0.0-SNAPSHOT">
<build sourceDirectory="/home/jenkins/workspace/aProject/src/main/java" directory="/home/jenkins/workspace/aProject/target"/>
</project>
<plugin executionId="integration-test" goal="run" groupId="org.apache.maven.plugins" artifactId="maven-invoker-plugin" version="2.0.0">
<projectsDirectory>${invoker.projectsDirectory}</projectsDirectory>
<cloneProjectsTo>/var/lib/jenkins/workspace/ncjira-maven-plugin-pipeline/target/it</cloneProjectsTo>
<reportsDirectory>${invoker.reportsDirectory}</reportsDirectory>
</plugin>
</ExecutionEvent> | [
"/",
"*",
"<ExecutionEvent",
"type",
"=",
"MojoSucceeded",
"class",
"=",
"org",
".",
"apache",
".",
"maven",
".",
"lifecycle",
".",
"internal",
".",
"DefaultExecutionEvent",
"_time",
"=",
"2017",
"-",
"06",
"-",
"25",
"20",
":",
"47",
":",
"25",
".",
"741",
">",
"<project",
"baseDir",
"=",
"/",
"home",
"/",
"jenkins",
"/",
"workspace",
"/",
"aProject",
"file",
"=",
"/",
"home",
"/",
"jenkins",
"/",
"workspace",
"/",
"aProject",
"/",
"pom",
".",
"xml",
"groupId",
"=",
"org",
".",
"myorg",
"name",
"=",
"My",
"Project",
"artifactId",
"=",
"my",
"-",
"maven",
"-",
"plugin",
"version",
"=",
"1",
".",
"0",
".",
"0",
"-",
"SNAPSHOT",
">",
"<build",
"sourceDirectory",
"=",
"/",
"home",
"/",
"jenkins",
"/",
"workspace",
"/",
"aProject",
"/",
"src",
"/",
"main",
"/",
"java",
"directory",
"=",
"/",
"home",
"/",
"jenkins",
"/",
"workspace",
"/",
"aProject",
"/",
"target",
"/",
">",
"<",
"/",
"project",
">",
"<plugin",
"executionId",
"=",
"integration",
"-",
"test",
"goal",
"=",
"run",
"groupId",
"=",
"org",
".",
"apache",
".",
"maven",
".",
"plugins",
"artifactId",
"=",
"maven",
"-",
"invoker",
"-",
"plugin",
"version",
"=",
"2",
".",
"0",
".",
"0",
">",
"<projectsDirectory",
">",
"$",
"{",
"invoker",
".",
"projectsDirectory",
"}",
"<",
"/",
"projectsDirectory",
">",
"<cloneProjectsTo",
">",
"/",
"var",
"/",
"lib",
"/",
"jenkins",
"/",
"workspace",
"/",
"ncjira",
"-",
"maven",
"-",
"plugin",
"-",
"pipeline",
"/",
"target",
"/",
"it<",
"/",
"cloneProjectsTo",
">",
"<reportsDirectory",
">",
"$",
"{",
"invoker",
".",
"reportsDirectory",
"}",
"<",
"/",
"reportsDirectory",
">",
"<",
"/",
"plugin",
">",
"<",
"/",
"ExecutionEvent",
">"
] | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java#L79-L112 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java | TrashFactory.createTrash | public static Trash createTrash(FileSystem fs, Properties props, String user)
throws IOException {
"""
Creates a {@link org.apache.gobblin.data.management.trash.Trash} instance.
@param fs {@link org.apache.hadoop.fs.FileSystem} where trash is located.
@param props {@link java.util.Properties} used to generate trash.
@param user $USER tokens in the trash path will be replaced by this string.
@return instance of {@link org.apache.gobblin.data.management.trash.Trash}.
@throws IOException
"""
if(props.containsKey(TRASH_TEST) && Boolean.parseBoolean(props.getProperty(TRASH_TEST))) {
LOG.info("Creating a test trash. Nothing will actually be deleted.");
return new TestTrash(fs, props, user);
}
if(props.containsKey(SIMULATE) && Boolean.parseBoolean(props.getProperty(SIMULATE))) {
LOG.info("Creating a simulate trash. Nothing will actually be deleted.");
return new MockTrash(fs, props, user);
}
if(props.containsKey(SKIP_TRASH) && Boolean.parseBoolean(props.getProperty(SKIP_TRASH))) {
LOG.info("Creating an immediate deletion trash. Files will be deleted immediately instead of moved to trash.");
return new ImmediateDeletionTrash(fs, props, user);
}
return new Trash(fs, props, user);
} | java | public static Trash createTrash(FileSystem fs, Properties props, String user)
throws IOException {
if(props.containsKey(TRASH_TEST) && Boolean.parseBoolean(props.getProperty(TRASH_TEST))) {
LOG.info("Creating a test trash. Nothing will actually be deleted.");
return new TestTrash(fs, props, user);
}
if(props.containsKey(SIMULATE) && Boolean.parseBoolean(props.getProperty(SIMULATE))) {
LOG.info("Creating a simulate trash. Nothing will actually be deleted.");
return new MockTrash(fs, props, user);
}
if(props.containsKey(SKIP_TRASH) && Boolean.parseBoolean(props.getProperty(SKIP_TRASH))) {
LOG.info("Creating an immediate deletion trash. Files will be deleted immediately instead of moved to trash.");
return new ImmediateDeletionTrash(fs, props, user);
}
return new Trash(fs, props, user);
} | [
"public",
"static",
"Trash",
"createTrash",
"(",
"FileSystem",
"fs",
",",
"Properties",
"props",
",",
"String",
"user",
")",
"throws",
"IOException",
"{",
"if",
"(",
"props",
".",
"containsKey",
"(",
"TRASH_TEST",
")",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"props",
".",
"getProperty",
"(",
"TRASH_TEST",
")",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Creating a test trash. Nothing will actually be deleted.\"",
")",
";",
"return",
"new",
"TestTrash",
"(",
"fs",
",",
"props",
",",
"user",
")",
";",
"}",
"if",
"(",
"props",
".",
"containsKey",
"(",
"SIMULATE",
")",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"props",
".",
"getProperty",
"(",
"SIMULATE",
")",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Creating a simulate trash. Nothing will actually be deleted.\"",
")",
";",
"return",
"new",
"MockTrash",
"(",
"fs",
",",
"props",
",",
"user",
")",
";",
"}",
"if",
"(",
"props",
".",
"containsKey",
"(",
"SKIP_TRASH",
")",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"props",
".",
"getProperty",
"(",
"SKIP_TRASH",
")",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Creating an immediate deletion trash. Files will be deleted immediately instead of moved to trash.\"",
")",
";",
"return",
"new",
"ImmediateDeletionTrash",
"(",
"fs",
",",
"props",
",",
"user",
")",
";",
"}",
"return",
"new",
"Trash",
"(",
"fs",
",",
"props",
",",
"user",
")",
";",
"}"
] | Creates a {@link org.apache.gobblin.data.management.trash.Trash} instance.
@param fs {@link org.apache.hadoop.fs.FileSystem} where trash is located.
@param props {@link java.util.Properties} used to generate trash.
@param user $USER tokens in the trash path will be replaced by this string.
@return instance of {@link org.apache.gobblin.data.management.trash.Trash}.
@throws IOException | [
"Creates",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java#L60-L75 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_smx_gsbvpx_image.java | xen_smx_gsbvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_smx_gsbvpx_image_responses result = (xen_smx_gsbvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_smx_gsbvpx_image_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_smx_gsbvpx_image_response_array);
}
xen_smx_gsbvpx_image[] result_xen_smx_gsbvpx_image = new xen_smx_gsbvpx_image[result.xen_smx_gsbvpx_image_response_array.length];
for(int i = 0; i < result.xen_smx_gsbvpx_image_response_array.length; i++)
{
result_xen_smx_gsbvpx_image[i] = result.xen_smx_gsbvpx_image_response_array[i].xen_smx_gsbvpx_image[0];
}
return result_xen_smx_gsbvpx_image;
} | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_smx_gsbvpx_image_responses result = (xen_smx_gsbvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_smx_gsbvpx_image_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_smx_gsbvpx_image_response_array);
}
xen_smx_gsbvpx_image[] result_xen_smx_gsbvpx_image = new xen_smx_gsbvpx_image[result.xen_smx_gsbvpx_image_response_array.length];
for(int i = 0; i < result.xen_smx_gsbvpx_image_response_array.length; i++)
{
result_xen_smx_gsbvpx_image[i] = result.xen_smx_gsbvpx_image_response_array[i].xen_smx_gsbvpx_image[0];
}
return result_xen_smx_gsbvpx_image;
} | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_smx_gsbvpx_image_responses",
"result",
"=",
"(",
"xen_smx_gsbvpx_image_responses",
")",
"service",
".",
"get_payload_formatter",
"(",
")",
".",
"string_to_resource",
"(",
"xen_smx_gsbvpx_image_responses",
".",
"class",
",",
"response",
")",
";",
"if",
"(",
"result",
".",
"errorcode",
"!=",
"0",
")",
"{",
"if",
"(",
"result",
".",
"errorcode",
"==",
"SESSION_NOT_EXISTS",
")",
"service",
".",
"clear_session",
"(",
")",
";",
"throw",
"new",
"nitro_exception",
"(",
"result",
".",
"message",
",",
"result",
".",
"errorcode",
",",
"(",
"base_response",
"[",
"]",
")",
"result",
".",
"xen_smx_gsbvpx_image_response_array",
")",
";",
"}",
"xen_smx_gsbvpx_image",
"[",
"]",
"result_xen_smx_gsbvpx_image",
"=",
"new",
"xen_smx_gsbvpx_image",
"[",
"result",
".",
"xen_smx_gsbvpx_image_response_array",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"result",
".",
"xen_smx_gsbvpx_image_response_array",
".",
"length",
";",
"i",
"++",
")",
"{",
"result_xen_smx_gsbvpx_image",
"[",
"i",
"]",
"=",
"result",
".",
"xen_smx_gsbvpx_image_response_array",
"[",
"i",
"]",
".",
"xen_smx_gsbvpx_image",
"[",
"0",
"]",
";",
"}",
"return",
"result_xen_smx_gsbvpx_image",
";",
"}"
] | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_smx_gsbvpx_image.java#L264-L281 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java | CommercePriceListAccountRelPersistenceImpl.findAll | @Override
public List<CommercePriceListAccountRel> findAll() {
"""
Returns all the commerce price list account rels.
@return the commerce price list account rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommercePriceListAccountRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceListAccountRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce price list account rels.
@return the commerce price list account rels | [
"Returns",
"all",
"the",
"commerce",
"price",
"list",
"account",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java#L2958-L2961 |
SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setActiveView | public void setActiveView(View v, int position) {
"""
Set the active view.
If the mdActiveIndicator attribute is set, this View will have the indicator drawn next to it.
@param v The active view.
@param position Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position)
must be called first.
"""
final View oldView = mActiveView;
mActiveView = v;
mActivePosition = position;
if (mAllowIndicatorAnimation && oldView != null) {
startAnimatingIndicator();
}
invalidate();
} | java | public void setActiveView(View v, int position) {
final View oldView = mActiveView;
mActiveView = v;
mActivePosition = position;
if (mAllowIndicatorAnimation && oldView != null) {
startAnimatingIndicator();
}
invalidate();
} | [
"public",
"void",
"setActiveView",
"(",
"View",
"v",
",",
"int",
"position",
")",
"{",
"final",
"View",
"oldView",
"=",
"mActiveView",
";",
"mActiveView",
"=",
"v",
";",
"mActivePosition",
"=",
"position",
";",
"if",
"(",
"mAllowIndicatorAnimation",
"&&",
"oldView",
"!=",
"null",
")",
"{",
"startAnimatingIndicator",
"(",
")",
";",
"}",
"invalidate",
"(",
")",
";",
"}"
] | Set the active view.
If the mdActiveIndicator attribute is set, this View will have the indicator drawn next to it.
@param v The active view.
@param position Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position)
must be called first. | [
"Set",
"the",
"active",
"view",
".",
"If",
"the",
"mdActiveIndicator",
"attribute",
"is",
"set",
"this",
"View",
"will",
"have",
"the",
"indicator",
"drawn",
"next",
"to",
"it",
"."
] | train | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1005-L1015 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.handleWriteException | private void handleWriteException(int responseCode, Write write) {
"""
Handles an exception after a Write operation, converts it to a Pravega Exception and completes the given future
exceptionally using it.
@param responseCode The BookKeeper response code to interpret.
@param write The Write that failed.
"""
assert responseCode != BKException.Code.OK : "cannot handle an exception when responseCode == " + BKException.Code.OK;
Exception ex = BKException.create(responseCode);
try {
if (ex instanceof BKException.BKLedgerFencedException) {
// We were fenced out.
ex = new DataLogWriterNotPrimaryException("BookKeeperLog is not primary anymore.", ex);
} else if (ex instanceof BKException.BKNotEnoughBookiesException) {
// Insufficient Bookies to complete the operation. This is a retryable exception.
ex = new DataLogNotAvailableException("BookKeeperLog is not available.", ex);
} else if (ex instanceof BKException.BKLedgerClosedException) {
// LedgerClosed can happen because we just rolled over the ledgers or because BookKeeper closed a ledger
// due to some error. In either case, this is a retryable exception.
ex = new WriteFailureException("Active Ledger is closed.", ex);
} else if (ex instanceof BKException.BKWriteException) {
// Write-related failure or current Ledger closed. This is a retryable exception.
ex = new WriteFailureException("Unable to write to active Ledger.", ex);
} else if (ex instanceof BKException.BKClientClosedException) {
// The BookKeeper client was closed externally. We cannot restart it here. We should close.
ex = new ObjectClosedException(this, ex);
} else {
// All the other kind of exceptions go in the same bucket.
ex = new DurableDataLogException("General exception while accessing BookKeeper.", ex);
}
} finally {
write.fail(ex, !isRetryable(ex));
}
} | java | private void handleWriteException(int responseCode, Write write) {
assert responseCode != BKException.Code.OK : "cannot handle an exception when responseCode == " + BKException.Code.OK;
Exception ex = BKException.create(responseCode);
try {
if (ex instanceof BKException.BKLedgerFencedException) {
// We were fenced out.
ex = new DataLogWriterNotPrimaryException("BookKeeperLog is not primary anymore.", ex);
} else if (ex instanceof BKException.BKNotEnoughBookiesException) {
// Insufficient Bookies to complete the operation. This is a retryable exception.
ex = new DataLogNotAvailableException("BookKeeperLog is not available.", ex);
} else if (ex instanceof BKException.BKLedgerClosedException) {
// LedgerClosed can happen because we just rolled over the ledgers or because BookKeeper closed a ledger
// due to some error. In either case, this is a retryable exception.
ex = new WriteFailureException("Active Ledger is closed.", ex);
} else if (ex instanceof BKException.BKWriteException) {
// Write-related failure or current Ledger closed. This is a retryable exception.
ex = new WriteFailureException("Unable to write to active Ledger.", ex);
} else if (ex instanceof BKException.BKClientClosedException) {
// The BookKeeper client was closed externally. We cannot restart it here. We should close.
ex = new ObjectClosedException(this, ex);
} else {
// All the other kind of exceptions go in the same bucket.
ex = new DurableDataLogException("General exception while accessing BookKeeper.", ex);
}
} finally {
write.fail(ex, !isRetryable(ex));
}
} | [
"private",
"void",
"handleWriteException",
"(",
"int",
"responseCode",
",",
"Write",
"write",
")",
"{",
"assert",
"responseCode",
"!=",
"BKException",
".",
"Code",
".",
"OK",
":",
"\"cannot handle an exception when responseCode == \"",
"+",
"BKException",
".",
"Code",
".",
"OK",
";",
"Exception",
"ex",
"=",
"BKException",
".",
"create",
"(",
"responseCode",
")",
";",
"try",
"{",
"if",
"(",
"ex",
"instanceof",
"BKException",
".",
"BKLedgerFencedException",
")",
"{",
"// We were fenced out.",
"ex",
"=",
"new",
"DataLogWriterNotPrimaryException",
"(",
"\"BookKeeperLog is not primary anymore.\"",
",",
"ex",
")",
";",
"}",
"else",
"if",
"(",
"ex",
"instanceof",
"BKException",
".",
"BKNotEnoughBookiesException",
")",
"{",
"// Insufficient Bookies to complete the operation. This is a retryable exception.",
"ex",
"=",
"new",
"DataLogNotAvailableException",
"(",
"\"BookKeeperLog is not available.\"",
",",
"ex",
")",
";",
"}",
"else",
"if",
"(",
"ex",
"instanceof",
"BKException",
".",
"BKLedgerClosedException",
")",
"{",
"// LedgerClosed can happen because we just rolled over the ledgers or because BookKeeper closed a ledger",
"// due to some error. In either case, this is a retryable exception.",
"ex",
"=",
"new",
"WriteFailureException",
"(",
"\"Active Ledger is closed.\"",
",",
"ex",
")",
";",
"}",
"else",
"if",
"(",
"ex",
"instanceof",
"BKException",
".",
"BKWriteException",
")",
"{",
"// Write-related failure or current Ledger closed. This is a retryable exception.",
"ex",
"=",
"new",
"WriteFailureException",
"(",
"\"Unable to write to active Ledger.\"",
",",
"ex",
")",
";",
"}",
"else",
"if",
"(",
"ex",
"instanceof",
"BKException",
".",
"BKClientClosedException",
")",
"{",
"// The BookKeeper client was closed externally. We cannot restart it here. We should close.",
"ex",
"=",
"new",
"ObjectClosedException",
"(",
"this",
",",
"ex",
")",
";",
"}",
"else",
"{",
"// All the other kind of exceptions go in the same bucket.",
"ex",
"=",
"new",
"DurableDataLogException",
"(",
"\"General exception while accessing BookKeeper.\"",
",",
"ex",
")",
";",
"}",
"}",
"finally",
"{",
"write",
".",
"fail",
"(",
"ex",
",",
"!",
"isRetryable",
"(",
"ex",
")",
")",
";",
"}",
"}"
] | Handles an exception after a Write operation, converts it to a Pravega Exception and completes the given future
exceptionally using it.
@param responseCode The BookKeeper response code to interpret.
@param write The Write that failed. | [
"Handles",
"an",
"exception",
"after",
"a",
"Write",
"operation",
"converts",
"it",
"to",
"a",
"Pravega",
"Exception",
"and",
"completes",
"the",
"given",
"future",
"exceptionally",
"using",
"it",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L616-L643 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XTEView.java | XTEView.printData | public boolean printData(PrintWriter out, int iPrintOptions) {
"""
Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
if ((this.getScreenField().getConverter().getField() instanceof XmlField)
|| (this.getScreenField().getConverter().getField() instanceof HtmlField)
|| (this.getScreenField().getConverter().getField() instanceof XMLPropertiesField))
{
boolean bFieldsFound = false;
String strFieldName = this.getScreenField().getSFieldParam();
// Do NOT encode the data!
String strFieldData = this.getScreenField().getSFieldValue(true, false);
out.println(" <" + strFieldName + '>' + strFieldData + "</" + strFieldName + '>');
return bFieldsFound;
}
else
return super.printData(out, iPrintOptions);
} | java | public boolean printData(PrintWriter out, int iPrintOptions)
{
if ((this.getScreenField().getConverter().getField() instanceof XmlField)
|| (this.getScreenField().getConverter().getField() instanceof HtmlField)
|| (this.getScreenField().getConverter().getField() instanceof XMLPropertiesField))
{
boolean bFieldsFound = false;
String strFieldName = this.getScreenField().getSFieldParam();
// Do NOT encode the data!
String strFieldData = this.getScreenField().getSFieldValue(true, false);
out.println(" <" + strFieldName + '>' + strFieldData + "</" + strFieldName + '>');
return bFieldsFound;
}
else
return super.printData(out, iPrintOptions);
} | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
"instanceof",
"XmlField",
")",
"||",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
"instanceof",
"HtmlField",
")",
"||",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
"instanceof",
"XMLPropertiesField",
")",
")",
"{",
"boolean",
"bFieldsFound",
"=",
"false",
";",
"String",
"strFieldName",
"=",
"this",
".",
"getScreenField",
"(",
")",
".",
"getSFieldParam",
"(",
")",
";",
"// Do NOT encode the data!",
"String",
"strFieldData",
"=",
"this",
".",
"getScreenField",
"(",
")",
".",
"getSFieldValue",
"(",
"true",
",",
"false",
")",
";",
"out",
".",
"println",
"(",
"\" <\"",
"+",
"strFieldName",
"+",
"'",
"'",
"+",
"strFieldData",
"+",
"\"</\"",
"+",
"strFieldName",
"+",
"'",
"'",
")",
";",
"return",
"bFieldsFound",
";",
"}",
"else",
"return",
"super",
".",
"printData",
"(",
"out",
",",
"iPrintOptions",
")",
";",
"}"
] | Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Print",
"this",
"field",
"s",
"data",
"in",
"XML",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XTEView.java#L73-L88 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asList | @SuppressWarnings("unchecked")
public <T> List<T> asList(Class<T> itemType) {
"""
Converts the object to a List
@param <T> the type parameter
@param itemType The class of the item in the List
@return The object as a List
"""
return asCollection(List.class, itemType);
} | java | @SuppressWarnings("unchecked")
public <T> List<T> asList(Class<T> itemType) {
return asCollection(List.class, itemType);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"asList",
"(",
"Class",
"<",
"T",
">",
"itemType",
")",
"{",
"return",
"asCollection",
"(",
"List",
".",
"class",
",",
"itemType",
")",
";",
"}"
] | Converts the object to a List
@param <T> the type parameter
@param itemType The class of the item in the List
@return The object as a List | [
"Converts",
"the",
"object",
"to",
"a",
"List"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L730-L733 |
Credntia/MVBarcodeReader | mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java | BarcodeGraphicTracker.onNewItem | @Override
public void onNewItem(int id, Barcode item) {
"""
Start tracking the detected item instance within the item overlay.
"""
mGraphic.setId(id);
if (mListener != null) mListener.onNewBarcodeDetected(id, item);
} | java | @Override
public void onNewItem(int id, Barcode item) {
mGraphic.setId(id);
if (mListener != null) mListener.onNewBarcodeDetected(id, item);
} | [
"@",
"Override",
"public",
"void",
"onNewItem",
"(",
"int",
"id",
",",
"Barcode",
"item",
")",
"{",
"mGraphic",
".",
"setId",
"(",
"id",
")",
";",
"if",
"(",
"mListener",
"!=",
"null",
")",
"mListener",
".",
"onNewBarcodeDetected",
"(",
"id",
",",
"item",
")",
";",
"}"
] | Start tracking the detected item instance within the item overlay. | [
"Start",
"tracking",
"the",
"detected",
"item",
"instance",
"within",
"the",
"item",
"overlay",
"."
] | train | https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java#L50-L54 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java | AnalyticsQuery.parameterized | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonArray positionalParams) {
"""
Creates an {@link AnalyticsQuery} with positional parameters as part of the query.
@param statement the statement to send.
@param positionalParams the positional parameters which will be put in for the placeholders.
@return a {@link AnalyticsQuery}.
"""
return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null);
} | java | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonArray positionalParams) {
return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null);
} | [
"public",
"static",
"ParameterizedAnalyticsQuery",
"parameterized",
"(",
"final",
"String",
"statement",
",",
"final",
"JsonArray",
"positionalParams",
")",
"{",
"return",
"new",
"ParameterizedAnalyticsQuery",
"(",
"statement",
",",
"positionalParams",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates an {@link AnalyticsQuery} with positional parameters as part of the query.
@param statement the statement to send.
@param positionalParams the positional parameters which will be put in for the placeholders.
@return a {@link AnalyticsQuery}. | [
"Creates",
"an",
"{",
"@link",
"AnalyticsQuery",
"}",
"with",
"positional",
"parameters",
"as",
"part",
"of",
"the",
"query",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java#L80-L83 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeChanged | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
"""
Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count.
"""
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount - 1) + "] is not within the position bounds for footer items [0 - "
+ (footerItemCount - 1) + "].");
}
notifyItemRangeChanged(positionStart + headerItemCount + contentItemCount, itemCount);
} | java | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount - 1) + "] is not within the position bounds for footer items [0 - "
+ (footerItemCount - 1) + "].");
}
notifyItemRangeChanged(positionStart + headerItemCount + contentItemCount, itemCount);
} | [
"public",
"final",
"void",
"notifyFooterItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given range [\"",
"+",
"positionStart",
"+",
"\" - \"",
"+",
"(",
"positionStart",
"+",
"itemCount",
"-",
"1",
")",
"+",
"\"] is not within the position bounds for footer items [0 - \"",
"+",
"(",
"footerItemCount",
"-",
"1",
")",
"+",
"\"].\"",
")",
";",
"}",
"notifyItemRangeChanged",
"(",
"positionStart",
"+",
"headerItemCount",
"+",
"contentItemCount",
",",
"itemCount",
")",
";",
"}"
] | Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"changed",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L361-L368 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java | DfuBaseService.report | private void report(final int error) {
"""
Creates or updates the notification in the Notification Manager. Sends broadcast with given
error number to the activity.
@param error the error number.
"""
sendErrorBroadcast(error);
if (mDisableNotification)
return;
// create or update notification:
final String deviceAddress = mDeviceAddress;
final String deviceName = mDeviceName != null ? mDeviceName : getString(R.string.dfu_unknown_name);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_DFU)
.setSmallIcon(android.R.drawable.stat_sys_upload)
.setOnlyAlertOnce(true)
.setColor(Color.RED)
.setOngoing(false)
.setContentTitle(getString(R.string.dfu_status_error))
.setSmallIcon(android.R.drawable.stat_sys_upload_done)
.setContentText(getString(R.string.dfu_status_error_msg))
.setAutoCancel(true);
// update the notification
final Intent intent = new Intent(this, getNotificationTarget());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_DEVICE_ADDRESS, deviceAddress);
intent.putExtra(EXTRA_DEVICE_NAME, deviceName);
intent.putExtra(EXTRA_PROGRESS, error); // this may contains ERROR_CONNECTION_MASK bit!
final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(pendingIntent);
// Any additional configuration?
updateErrorNotification(builder);
final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(NOTIFICATION_ID, builder.build());
} | java | private void report(final int error) {
sendErrorBroadcast(error);
if (mDisableNotification)
return;
// create or update notification:
final String deviceAddress = mDeviceAddress;
final String deviceName = mDeviceName != null ? mDeviceName : getString(R.string.dfu_unknown_name);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_DFU)
.setSmallIcon(android.R.drawable.stat_sys_upload)
.setOnlyAlertOnce(true)
.setColor(Color.RED)
.setOngoing(false)
.setContentTitle(getString(R.string.dfu_status_error))
.setSmallIcon(android.R.drawable.stat_sys_upload_done)
.setContentText(getString(R.string.dfu_status_error_msg))
.setAutoCancel(true);
// update the notification
final Intent intent = new Intent(this, getNotificationTarget());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_DEVICE_ADDRESS, deviceAddress);
intent.putExtra(EXTRA_DEVICE_NAME, deviceName);
intent.putExtra(EXTRA_PROGRESS, error); // this may contains ERROR_CONNECTION_MASK bit!
final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(pendingIntent);
// Any additional configuration?
updateErrorNotification(builder);
final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(NOTIFICATION_ID, builder.build());
} | [
"private",
"void",
"report",
"(",
"final",
"int",
"error",
")",
"{",
"sendErrorBroadcast",
"(",
"error",
")",
";",
"if",
"(",
"mDisableNotification",
")",
"return",
";",
"// create or update notification:",
"final",
"String",
"deviceAddress",
"=",
"mDeviceAddress",
";",
"final",
"String",
"deviceName",
"=",
"mDeviceName",
"!=",
"null",
"?",
"mDeviceName",
":",
"getString",
"(",
"R",
".",
"string",
".",
"dfu_unknown_name",
")",
";",
"final",
"NotificationCompat",
".",
"Builder",
"builder",
"=",
"new",
"NotificationCompat",
".",
"Builder",
"(",
"this",
",",
"NOTIFICATION_CHANNEL_DFU",
")",
".",
"setSmallIcon",
"(",
"android",
".",
"R",
".",
"drawable",
".",
"stat_sys_upload",
")",
".",
"setOnlyAlertOnce",
"(",
"true",
")",
".",
"setColor",
"(",
"Color",
".",
"RED",
")",
".",
"setOngoing",
"(",
"false",
")",
".",
"setContentTitle",
"(",
"getString",
"(",
"R",
".",
"string",
".",
"dfu_status_error",
")",
")",
".",
"setSmallIcon",
"(",
"android",
".",
"R",
".",
"drawable",
".",
"stat_sys_upload_done",
")",
".",
"setContentText",
"(",
"getString",
"(",
"R",
".",
"string",
".",
"dfu_status_error_msg",
")",
")",
".",
"setAutoCancel",
"(",
"true",
")",
";",
"// update the notification",
"final",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"this",
",",
"getNotificationTarget",
"(",
")",
")",
";",
"intent",
".",
"addFlags",
"(",
"Intent",
".",
"FLAG_ACTIVITY_NEW_TASK",
")",
";",
"intent",
".",
"putExtra",
"(",
"EXTRA_DEVICE_ADDRESS",
",",
"deviceAddress",
")",
";",
"intent",
".",
"putExtra",
"(",
"EXTRA_DEVICE_NAME",
",",
"deviceName",
")",
";",
"intent",
".",
"putExtra",
"(",
"EXTRA_PROGRESS",
",",
"error",
")",
";",
"// this may contains ERROR_CONNECTION_MASK bit!",
"final",
"PendingIntent",
"pendingIntent",
"=",
"PendingIntent",
".",
"getActivity",
"(",
"this",
",",
"0",
",",
"intent",
",",
"PendingIntent",
".",
"FLAG_UPDATE_CURRENT",
")",
";",
"builder",
".",
"setContentIntent",
"(",
"pendingIntent",
")",
";",
"// Any additional configuration?",
"updateErrorNotification",
"(",
"builder",
")",
";",
"final",
"NotificationManager",
"manager",
"=",
"(",
"NotificationManager",
")",
"getSystemService",
"(",
"Context",
".",
"NOTIFICATION_SERVICE",
")",
";",
"manager",
".",
"notify",
"(",
"NOTIFICATION_ID",
",",
"builder",
".",
"build",
"(",
")",
")",
";",
"}"
] | Creates or updates the notification in the Notification Manager. Sends broadcast with given
error number to the activity.
@param error the error number. | [
"Creates",
"or",
"updates",
"the",
"notification",
"in",
"the",
"Notification",
"Manager",
".",
"Sends",
"broadcast",
"with",
"given",
"error",
"number",
"to",
"the",
"activity",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1741-L1775 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/method/InvocableWampHandlerMethod.java | InvocableWampHandlerMethod.assertTargetBean | private void assertTargetBean(Method method, Object targetBean, Object[] args) {
"""
Assert that the target bean class is an instance of the class where the given
method is declared. In some cases the actual controller instance at request-
processing time may be a JDK dynamic proxy (lazy initialization, prototype beans,
and others). {@code @Controller}'s that require proxying should prefer class-based
proxy mechanisms.
"""
Class<?> methodDeclaringClass = method.getDeclaringClass();
Class<?> targetBeanClass = targetBean.getClass();
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
String msg = "The mapped controller method class '"
+ methodDeclaringClass.getName()
+ "' is not an instance of the actual controller bean instance '"
+ targetBeanClass.getName()
+ "'. If the controller requires proxying "
+ "(e.g. due to @Transactional), please use class-based proxying.";
throw new IllegalStateException(getInvocationErrorMessage(msg, args));
}
} | java | private void assertTargetBean(Method method, Object targetBean, Object[] args) {
Class<?> methodDeclaringClass = method.getDeclaringClass();
Class<?> targetBeanClass = targetBean.getClass();
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
String msg = "The mapped controller method class '"
+ methodDeclaringClass.getName()
+ "' is not an instance of the actual controller bean instance '"
+ targetBeanClass.getName()
+ "'. If the controller requires proxying "
+ "(e.g. due to @Transactional), please use class-based proxying.";
throw new IllegalStateException(getInvocationErrorMessage(msg, args));
}
} | [
"private",
"void",
"assertTargetBean",
"(",
"Method",
"method",
",",
"Object",
"targetBean",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Class",
"<",
"?",
">",
"methodDeclaringClass",
"=",
"method",
".",
"getDeclaringClass",
"(",
")",
";",
"Class",
"<",
"?",
">",
"targetBeanClass",
"=",
"targetBean",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"!",
"methodDeclaringClass",
".",
"isAssignableFrom",
"(",
"targetBeanClass",
")",
")",
"{",
"String",
"msg",
"=",
"\"The mapped controller method class '\"",
"+",
"methodDeclaringClass",
".",
"getName",
"(",
")",
"+",
"\"' is not an instance of the actual controller bean instance '\"",
"+",
"targetBeanClass",
".",
"getName",
"(",
")",
"+",
"\"'. If the controller requires proxying \"",
"+",
"\"(e.g. due to @Transactional), please use class-based proxying.\"",
";",
"throw",
"new",
"IllegalStateException",
"(",
"getInvocationErrorMessage",
"(",
"msg",
",",
"args",
")",
")",
";",
"}",
"}"
] | Assert that the target bean class is an instance of the class where the given
method is declared. In some cases the actual controller instance at request-
processing time may be a JDK dynamic proxy (lazy initialization, prototype beans,
and others). {@code @Controller}'s that require proxying should prefer class-based
proxy mechanisms. | [
"Assert",
"that",
"the",
"target",
"bean",
"class",
"is",
"an",
"instance",
"of",
"the",
"class",
"where",
"the",
"given",
"method",
"is",
"declared",
".",
"In",
"some",
"cases",
"the",
"actual",
"controller",
"instance",
"at",
"request",
"-",
"processing",
"time",
"may",
"be",
"a",
"JDK",
"dynamic",
"proxy",
"(",
"lazy",
"initialization",
"prototype",
"beans",
"and",
"others",
")",
".",
"{"
] | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/method/InvocableWampHandlerMethod.java#L202-L214 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginCreate | public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
"""
Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@param parameters Parameters that define the create packet capture operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the PacketCaptureResultInner object if successful.
"""
return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body();
} | java | public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body();
} | [
"public",
"PacketCaptureResultInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
",",
"PacketCaptureInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName",
",",
"packetCaptureName",
",",
"parameters",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
"}"
] | Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@param parameters Parameters that define the create packet capture operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the PacketCaptureResultInner object if successful. | [
"Create",
"and",
"start",
"a",
"packet",
"capture",
"on",
"the",
"specified",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java#L200-L202 |
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findInputStreamForResource | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
"""
Get input stream for resource in zip file.
@param zipFile zip file
@param resourcePath path to resource
@return input stream for resource or null if not found or directory
@throws IOException if there is any transport error
"""
final ZipEntry entry = zipFile.getEntry(resourcePath);
InputStream result = null;
if (entry != null && !entry.isDirectory()) {
result = zipFile.getInputStream(entry);
}
return result;
} | java | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
final ZipEntry entry = zipFile.getEntry(resourcePath);
InputStream result = null;
if (entry != null && !entry.isDirectory()) {
result = zipFile.getInputStream(entry);
}
return result;
} | [
"@",
"Nullable",
"public",
"static",
"InputStream",
"findInputStreamForResource",
"(",
"@",
"Nonnull",
"final",
"ZipFile",
"zipFile",
",",
"@",
"Nonnull",
"final",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"final",
"ZipEntry",
"entry",
"=",
"zipFile",
".",
"getEntry",
"(",
"resourcePath",
")",
";",
"InputStream",
"result",
"=",
"null",
";",
"if",
"(",
"entry",
"!=",
"null",
"&&",
"!",
"entry",
".",
"isDirectory",
"(",
")",
")",
"{",
"result",
"=",
"zipFile",
".",
"getInputStream",
"(",
"entry",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Get input stream for resource in zip file.
@param zipFile zip file
@param resourcePath path to resource
@return input stream for resource or null if not found or directory
@throws IOException if there is any transport error | [
"Get",
"input",
"stream",
"for",
"resource",
"in",
"zip",
"file",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L99-L110 |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java | EventProcessorHost.registerEventProcessor | public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType) {
"""
Register class for event processor and start processing.
<p>
This overload uses the default event processor factory, which simply creates new instances of
the registered event processor class, and uses all the default options.
<p>
The returned CompletableFuture completes when host initialization is finished. Initialization failures are
reported by completing the future with an exception, so it is important to call get() on the future and handle
any exceptions thrown.
<pre>
class MyEventProcessor implements IEventProcessor { ... }
EventProcessorHost host = new EventProcessorHost(...);
{@literal CompletableFuture<Void>} foo = host.registerEventProcessor(MyEventProcessor.class);
foo.get();
</pre>
@param <T> Not actually a parameter. Represents the type of your class that implements IEventProcessor.
@param eventProcessorType Class that implements IEventProcessor.
@return Future that completes when initialization is finished.
"""
DefaultEventProcessorFactory<T> defaultFactory = new DefaultEventProcessorFactory<T>();
defaultFactory.setEventProcessorClass(eventProcessorType);
return registerEventProcessorFactory(defaultFactory, EventProcessorOptions.getDefaultOptions());
} | java | public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType) {
DefaultEventProcessorFactory<T> defaultFactory = new DefaultEventProcessorFactory<T>();
defaultFactory.setEventProcessorClass(eventProcessorType);
return registerEventProcessorFactory(defaultFactory, EventProcessorOptions.getDefaultOptions());
} | [
"public",
"<",
"T",
"extends",
"IEventProcessor",
">",
"CompletableFuture",
"<",
"Void",
">",
"registerEventProcessor",
"(",
"Class",
"<",
"T",
">",
"eventProcessorType",
")",
"{",
"DefaultEventProcessorFactory",
"<",
"T",
">",
"defaultFactory",
"=",
"new",
"DefaultEventProcessorFactory",
"<",
"T",
">",
"(",
")",
";",
"defaultFactory",
".",
"setEventProcessorClass",
"(",
"eventProcessorType",
")",
";",
"return",
"registerEventProcessorFactory",
"(",
"defaultFactory",
",",
"EventProcessorOptions",
".",
"getDefaultOptions",
"(",
")",
")",
";",
"}"
] | Register class for event processor and start processing.
<p>
This overload uses the default event processor factory, which simply creates new instances of
the registered event processor class, and uses all the default options.
<p>
The returned CompletableFuture completes when host initialization is finished. Initialization failures are
reported by completing the future with an exception, so it is important to call get() on the future and handle
any exceptions thrown.
<pre>
class MyEventProcessor implements IEventProcessor { ... }
EventProcessorHost host = new EventProcessorHost(...);
{@literal CompletableFuture<Void>} foo = host.registerEventProcessor(MyEventProcessor.class);
foo.get();
</pre>
@param <T> Not actually a parameter. Represents the type of your class that implements IEventProcessor.
@param eventProcessorType Class that implements IEventProcessor.
@return Future that completes when initialization is finished. | [
"Register",
"class",
"for",
"event",
"processor",
"and",
"start",
"processing",
".",
"<p",
">",
"This",
"overload",
"uses",
"the",
"default",
"event",
"processor",
"factory",
"which",
"simply",
"creates",
"new",
"instances",
"of",
"the",
"registered",
"event",
"processor",
"class",
"and",
"uses",
"all",
"the",
"default",
"options",
".",
"<p",
">",
"The",
"returned",
"CompletableFuture",
"completes",
"when",
"host",
"initialization",
"is",
"finished",
".",
"Initialization",
"failures",
"are",
"reported",
"by",
"completing",
"the",
"future",
"with",
"an",
"exception",
"so",
"it",
"is",
"important",
"to",
"call",
"get",
"()",
"on",
"the",
"future",
"and",
"handle",
"any",
"exceptions",
"thrown",
".",
"<pre",
">",
"class",
"MyEventProcessor",
"implements",
"IEventProcessor",
"{",
"...",
"}",
"EventProcessorHost",
"host",
"=",
"new",
"EventProcessorHost",
"(",
"...",
")",
";",
"{",
"@literal",
"CompletableFuture<Void",
">",
"}",
"foo",
"=",
"host",
".",
"registerEventProcessor",
"(",
"MyEventProcessor",
".",
"class",
")",
";",
"foo",
".",
"get",
"()",
";",
"<",
"/",
"pre",
">"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java#L404-L408 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java | DockerUtils.findImageByTag | public static Image findImageByTag( String imageTag, List<Image> images ) {
"""
Finds an image by tag.
@param imageTag the image tag (not null)
@param images a non-null list of images
@return an image, or null if none was found
"""
Image result = null;
for( Image img : images ) {
String[] tags = img.getRepoTags();
if( tags == null )
continue;
for( String s : tags ) {
if( s.contains( imageTag )) {
result = img;
break;
}
}
}
return result;
} | java | public static Image findImageByTag( String imageTag, List<Image> images ) {
Image result = null;
for( Image img : images ) {
String[] tags = img.getRepoTags();
if( tags == null )
continue;
for( String s : tags ) {
if( s.contains( imageTag )) {
result = img;
break;
}
}
}
return result;
} | [
"public",
"static",
"Image",
"findImageByTag",
"(",
"String",
"imageTag",
",",
"List",
"<",
"Image",
">",
"images",
")",
"{",
"Image",
"result",
"=",
"null",
";",
"for",
"(",
"Image",
"img",
":",
"images",
")",
"{",
"String",
"[",
"]",
"tags",
"=",
"img",
".",
"getRepoTags",
"(",
")",
";",
"if",
"(",
"tags",
"==",
"null",
")",
"continue",
";",
"for",
"(",
"String",
"s",
":",
"tags",
")",
"{",
"if",
"(",
"s",
".",
"contains",
"(",
"imageTag",
")",
")",
"{",
"result",
"=",
"img",
";",
"break",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}"
] | Finds an image by tag.
@param imageTag the image tag (not null)
@param images a non-null list of images
@return an image, or null if none was found | [
"Finds",
"an",
"image",
"by",
"tag",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java#L161-L178 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/cmd/AbstractDMRResourcePathCommand.java | AbstractDMRResourcePathCommand.setServerRefreshIndicator | protected void setServerRefreshIndicator(OperationResult<?> opResults, RESP response) {
"""
Given the results of an operation, this will set the {@link ServerRefreshIndicator}
found in those results in the given response.
@param opResults contains the DMR results
@param response the response message
"""
Optional<String> processState = opResults.getOptionalProcessState();
if (processState.isPresent()) {
try {
response.setServerRefreshIndicator(ServerRefreshIndicator.fromValue(processState.get().toUpperCase()));
} catch (Exception e) {
log.warnf("Cannot set server refresh indicator - process state is invalid", e);
}
}
} | java | protected void setServerRefreshIndicator(OperationResult<?> opResults, RESP response) {
Optional<String> processState = opResults.getOptionalProcessState();
if (processState.isPresent()) {
try {
response.setServerRefreshIndicator(ServerRefreshIndicator.fromValue(processState.get().toUpperCase()));
} catch (Exception e) {
log.warnf("Cannot set server refresh indicator - process state is invalid", e);
}
}
} | [
"protected",
"void",
"setServerRefreshIndicator",
"(",
"OperationResult",
"<",
"?",
">",
"opResults",
",",
"RESP",
"response",
")",
"{",
"Optional",
"<",
"String",
">",
"processState",
"=",
"opResults",
".",
"getOptionalProcessState",
"(",
")",
";",
"if",
"(",
"processState",
".",
"isPresent",
"(",
")",
")",
"{",
"try",
"{",
"response",
".",
"setServerRefreshIndicator",
"(",
"ServerRefreshIndicator",
".",
"fromValue",
"(",
"processState",
".",
"get",
"(",
")",
".",
"toUpperCase",
"(",
")",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warnf",
"(",
"\"Cannot set server refresh indicator - process state is invalid\"",
",",
"e",
")",
";",
"}",
"}",
"}"
] | Given the results of an operation, this will set the {@link ServerRefreshIndicator}
found in those results in the given response.
@param opResults contains the DMR results
@param response the response message | [
"Given",
"the",
"results",
"of",
"an",
"operation",
"this",
"will",
"set",
"the",
"{",
"@link",
"ServerRefreshIndicator",
"}",
"found",
"in",
"those",
"results",
"in",
"the",
"given",
"response",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/cmd/AbstractDMRResourcePathCommand.java#L171-L180 |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java | VertexCentricIteration.setInput | @Override
public void setInput(DataSet<Tuple2<VertexKey, VertexValue>> inputData) {
"""
Sets the input data set for this operator. In the case of this operator this input data set represents
the set of vertices with their initial state.
@param inputData The input data set, which in the case of this operator represents the set of
vertices with their initial state.
@see eu.stratosphere.api.java.operators.CustomUnaryOperation#setInput(eu.stratosphere.api.java.DataSet)
"""
// sanity check that we really have two tuples
TypeInformation<Tuple2<VertexKey, VertexValue>> inputType = inputData.getType();
Validate.isTrue(inputType.isTupleType() && inputType.getArity() == 2, "The input data set (the initial vertices) must consist of 2-tuples.");
// check that the key type here is the same as for the edges
TypeInformation<VertexKey> keyType = ((TupleTypeInfo<?>) inputType).getTypeAt(0);
TypeInformation<?> edgeType = edgesWithoutValue != null ? edgesWithoutValue.getType() : edgesWithValue.getType();
TypeInformation<VertexKey> edgeKeyType = ((TupleTypeInfo<?>) edgeType).getTypeAt(0);
Validate.isTrue(keyType.equals(edgeKeyType), "The first tuple field (the vertex id) of the input data set (the initial vertices) " +
"must be the same data type as the first fields of the edge data set (the source vertex id). " +
"Here, the key type for the vertex ids is '%s' and the key type for the edges is '%s'.", keyType, edgeKeyType);
this.initialVertices = inputData;
} | java | @Override
public void setInput(DataSet<Tuple2<VertexKey, VertexValue>> inputData) {
// sanity check that we really have two tuples
TypeInformation<Tuple2<VertexKey, VertexValue>> inputType = inputData.getType();
Validate.isTrue(inputType.isTupleType() && inputType.getArity() == 2, "The input data set (the initial vertices) must consist of 2-tuples.");
// check that the key type here is the same as for the edges
TypeInformation<VertexKey> keyType = ((TupleTypeInfo<?>) inputType).getTypeAt(0);
TypeInformation<?> edgeType = edgesWithoutValue != null ? edgesWithoutValue.getType() : edgesWithValue.getType();
TypeInformation<VertexKey> edgeKeyType = ((TupleTypeInfo<?>) edgeType).getTypeAt(0);
Validate.isTrue(keyType.equals(edgeKeyType), "The first tuple field (the vertex id) of the input data set (the initial vertices) " +
"must be the same data type as the first fields of the edge data set (the source vertex id). " +
"Here, the key type for the vertex ids is '%s' and the key type for the edges is '%s'.", keyType, edgeKeyType);
this.initialVertices = inputData;
} | [
"@",
"Override",
"public",
"void",
"setInput",
"(",
"DataSet",
"<",
"Tuple2",
"<",
"VertexKey",
",",
"VertexValue",
">",
">",
"inputData",
")",
"{",
"// sanity check that we really have two tuples",
"TypeInformation",
"<",
"Tuple2",
"<",
"VertexKey",
",",
"VertexValue",
">",
">",
"inputType",
"=",
"inputData",
".",
"getType",
"(",
")",
";",
"Validate",
".",
"isTrue",
"(",
"inputType",
".",
"isTupleType",
"(",
")",
"&&",
"inputType",
".",
"getArity",
"(",
")",
"==",
"2",
",",
"\"The input data set (the initial vertices) must consist of 2-tuples.\"",
")",
";",
"// check that the key type here is the same as for the edges",
"TypeInformation",
"<",
"VertexKey",
">",
"keyType",
"=",
"(",
"(",
"TupleTypeInfo",
"<",
"?",
">",
")",
"inputType",
")",
".",
"getTypeAt",
"(",
"0",
")",
";",
"TypeInformation",
"<",
"?",
">",
"edgeType",
"=",
"edgesWithoutValue",
"!=",
"null",
"?",
"edgesWithoutValue",
".",
"getType",
"(",
")",
":",
"edgesWithValue",
".",
"getType",
"(",
")",
";",
"TypeInformation",
"<",
"VertexKey",
">",
"edgeKeyType",
"=",
"(",
"(",
"TupleTypeInfo",
"<",
"?",
">",
")",
"edgeType",
")",
".",
"getTypeAt",
"(",
"0",
")",
";",
"Validate",
".",
"isTrue",
"(",
"keyType",
".",
"equals",
"(",
"edgeKeyType",
")",
",",
"\"The first tuple field (the vertex id) of the input data set (the initial vertices) \"",
"+",
"\"must be the same data type as the first fields of the edge data set (the source vertex id). \"",
"+",
"\"Here, the key type for the vertex ids is '%s' and the key type for the edges is '%s'.\"",
",",
"keyType",
",",
"edgeKeyType",
")",
";",
"this",
".",
"initialVertices",
"=",
"inputData",
";",
"}"
] | Sets the input data set for this operator. In the case of this operator this input data set represents
the set of vertices with their initial state.
@param inputData The input data set, which in the case of this operator represents the set of
vertices with their initial state.
@see eu.stratosphere.api.java.operators.CustomUnaryOperation#setInput(eu.stratosphere.api.java.DataSet) | [
"Sets",
"the",
"input",
"data",
"set",
"for",
"this",
"operator",
".",
"In",
"the",
"case",
"of",
"this",
"operator",
"this",
"input",
"data",
"set",
"represents",
"the",
"set",
"of",
"vertices",
"with",
"their",
"initial",
"state",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java#L244-L260 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.getParameterOrDefault | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
"""
Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, take the default value instead.
"""
return getParameter(parameters, paramName, false, defaultValue);
} | java | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
return getParameter(parameters, paramName, false, defaultValue);
} | [
"protected",
"String",
"getParameterOrDefault",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getParameter",
"(",
"parameters",
",",
"paramName",
",",
"false",
",",
"defaultValue",
")",
";",
"}"
] | Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, take the default value instead. | [
"Get",
"the",
"parameter",
"with",
"the",
"given",
"parameter",
"name",
"from",
"the",
"parameter",
"map",
".",
"If",
"the",
"parameters",
"does",
"not",
"contain",
"such",
"a",
"parameter",
"take",
"the",
"default",
"value",
"instead",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L85-L88 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.parseDurationInThousanthsOfMinutes | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit) {
"""
Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@return Duration instance
"""
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
} | java | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
} | [
"public",
"static",
"final",
"Duration",
"parseDurationInThousanthsOfMinutes",
"(",
"ProjectProperties",
"properties",
",",
"Number",
"value",
",",
"TimeUnit",
"targetTimeUnit",
")",
"{",
"return",
"parseDurationInFractionsOfMinutes",
"(",
"properties",
",",
"value",
",",
"targetTimeUnit",
",",
"1000",
")",
";",
"}"
] | Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@return Duration instance | [
"Parse",
"duration",
"represented",
"in",
"thousandths",
"of",
"minutes",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1309-L1312 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setRowId | @Override
public void setRowId(int parameterIndex, RowId x) throws SQLException {
"""
Sets the designated parameter to the given java.sql.RowId object.
"""
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | java | @Override
public void setRowId(int parameterIndex, RowId x) throws SQLException
{
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setRowId",
"(",
"int",
"parameterIndex",
",",
"RowId",
"x",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.RowId object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"RowId",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L526-L531 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java | JmxExecRequest.newCreator | static RequestCreator<JmxExecRequest> newCreator() {
"""
Creator for {@link JmxExecRequest}s
@return the creator implementation
"""
return new RequestCreator<JmxExecRequest>() {
/** {@inheritDoc} */
public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxExecRequest(
pStack.pop(), // Object name
pStack.pop(), // Operation name
convertSpecialStringTags(prepareExtraArgs(pStack)), // arguments
pParams);
}
/** {@inheritDoc} */
public JmxExecRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
throws MalformedObjectNameException {
return new JmxExecRequest(requestMap,pParams);
}
};
} | java | static RequestCreator<JmxExecRequest> newCreator() {
return new RequestCreator<JmxExecRequest>() {
/** {@inheritDoc} */
public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxExecRequest(
pStack.pop(), // Object name
pStack.pop(), // Operation name
convertSpecialStringTags(prepareExtraArgs(pStack)), // arguments
pParams);
}
/** {@inheritDoc} */
public JmxExecRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
throws MalformedObjectNameException {
return new JmxExecRequest(requestMap,pParams);
}
};
} | [
"static",
"RequestCreator",
"<",
"JmxExecRequest",
">",
"newCreator",
"(",
")",
"{",
"return",
"new",
"RequestCreator",
"<",
"JmxExecRequest",
">",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JmxExecRequest",
"create",
"(",
"Stack",
"<",
"String",
">",
"pStack",
",",
"ProcessingParameters",
"pParams",
")",
"throws",
"MalformedObjectNameException",
"{",
"return",
"new",
"JmxExecRequest",
"(",
"pStack",
".",
"pop",
"(",
")",
",",
"// Object name",
"pStack",
".",
"pop",
"(",
")",
",",
"// Operation name",
"convertSpecialStringTags",
"(",
"prepareExtraArgs",
"(",
"pStack",
")",
")",
",",
"// arguments",
"pParams",
")",
";",
"}",
"/** {@inheritDoc} */",
"public",
"JmxExecRequest",
"create",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"requestMap",
",",
"ProcessingParameters",
"pParams",
")",
"throws",
"MalformedObjectNameException",
"{",
"return",
"new",
"JmxExecRequest",
"(",
"requestMap",
",",
"pParams",
")",
";",
"}",
"}",
";",
"}"
] | Creator for {@link JmxExecRequest}s
@return the creator implementation | [
"Creator",
"for",
"{",
"@link",
"JmxExecRequest",
"}",
"s"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java#L111-L128 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java | Dtd.saveSchema | public static void saveSchema(final LmlParser parser, final Appendable appendable) {
"""
Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development.
@param parser contains parsing data. Used to create mock-up actors. The skin MUST be fully loaded and contain all
used actors' styles for the generator to work properly.
@param appendable a reference to the file.
@see #getDtdSchema(LmlParser, Appendable)
@see #saveMinifiedSchema(LmlParser, Appendable)
"""
try {
new Dtd().getDtdSchema(parser, appendable);
} catch (final IOException exception) {
throw new GdxRuntimeException("Unable to append to file.", exception);
}
} | java | public static void saveSchema(final LmlParser parser, final Appendable appendable) {
try {
new Dtd().getDtdSchema(parser, appendable);
} catch (final IOException exception) {
throw new GdxRuntimeException("Unable to append to file.", exception);
}
} | [
"public",
"static",
"void",
"saveSchema",
"(",
"final",
"LmlParser",
"parser",
",",
"final",
"Appendable",
"appendable",
")",
"{",
"try",
"{",
"new",
"Dtd",
"(",
")",
".",
"getDtdSchema",
"(",
"parser",
",",
"appendable",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"exception",
")",
"{",
"throw",
"new",
"GdxRuntimeException",
"(",
"\"Unable to append to file.\"",
",",
"exception",
")",
";",
"}",
"}"
] | Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development.
@param parser contains parsing data. Used to create mock-up actors. The skin MUST be fully loaded and contain all
used actors' styles for the generator to work properly.
@param appendable a reference to the file.
@see #getDtdSchema(LmlParser, Appendable)
@see #saveMinifiedSchema(LmlParser, Appendable) | [
"Saves",
"DTD",
"schema",
"file",
"containing",
"all",
"possible",
"tags",
"and",
"their",
"attributes",
".",
"Any",
"problems",
"with",
"the",
"generation",
"will",
"be",
"logged",
".",
"This",
"is",
"a",
"relatively",
"heavy",
"operation",
"and",
"should",
"be",
"done",
"only",
"during",
"development",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java#L54-L60 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java | StringRandomizer.aNewStringRandomizer | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int minLength, final int maxLength, final long seed) {
"""
Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param minLength of the String to generate
@param seed initial seed
@return a new {@link StringRandomizer}.
"""
if (minLength > maxLength) {
throw new IllegalArgumentException("minLength should be less than or equal to maxLength");
}
return new StringRandomizer(charset, minLength, maxLength, seed);
} | java | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int minLength, final int maxLength, final long seed) {
if (minLength > maxLength) {
throw new IllegalArgumentException("minLength should be less than or equal to maxLength");
}
return new StringRandomizer(charset, minLength, maxLength, seed);
} | [
"public",
"static",
"StringRandomizer",
"aNewStringRandomizer",
"(",
"final",
"Charset",
"charset",
",",
"final",
"int",
"minLength",
",",
"final",
"int",
"maxLength",
",",
"final",
"long",
"seed",
")",
"{",
"if",
"(",
"minLength",
">",
"maxLength",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"minLength should be less than or equal to maxLength\"",
")",
";",
"}",
"return",
"new",
"StringRandomizer",
"(",
"charset",
",",
"minLength",
",",
"maxLength",
",",
"seed",
")",
";",
"}"
] | Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param minLength of the String to generate
@param seed initial seed
@return a new {@link StringRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"StringRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java#L246-L251 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.writeStream | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS, @Nonnull final byte [] aBuf) {
"""
Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param aBuf
The byte array to be written. May not be <code>null</code>.
@return {@link ESuccess}
"""
return writeStream (aOS, aBuf, 0, aBuf.length);
} | java | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS, @Nonnull final byte [] aBuf)
{
return writeStream (aOS, aBuf, 0, aBuf.length);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeStream",
"(",
"@",
"WillClose",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
",",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aBuf",
")",
"{",
"return",
"writeStream",
"(",
"aOS",
",",
"aBuf",
",",
"0",
",",
"aBuf",
".",
"length",
")",
";",
"}"
] | Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param aBuf
The byte array to be written. May not be <code>null</code>.
@return {@link ESuccess} | [
"Write",
"bytes",
"to",
"an",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1303-L1307 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/Protobuf.java | Protobuf.writeStream | public static <MSG extends Message> void writeStream(Iterable<MSG> messages, OutputStream output) {
"""
Streams multiple messages to {@code output}. Reading the messages back requires to
call methods {@code readStream(...)}.
<p>
See https://developers.google.com/protocol-buffers/docs/techniques#streaming
</p>
"""
try {
for (Message message : messages) {
message.writeDelimitedTo(output);
}
} catch (Exception e) {
throw ContextException.of("Unable to write messages", e);
}
} | java | public static <MSG extends Message> void writeStream(Iterable<MSG> messages, OutputStream output) {
try {
for (Message message : messages) {
message.writeDelimitedTo(output);
}
} catch (Exception e) {
throw ContextException.of("Unable to write messages", e);
}
} | [
"public",
"static",
"<",
"MSG",
"extends",
"Message",
">",
"void",
"writeStream",
"(",
"Iterable",
"<",
"MSG",
">",
"messages",
",",
"OutputStream",
"output",
")",
"{",
"try",
"{",
"for",
"(",
"Message",
"message",
":",
"messages",
")",
"{",
"message",
".",
"writeDelimitedTo",
"(",
"output",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"ContextException",
".",
"of",
"(",
"\"Unable to write messages\"",
",",
"e",
")",
";",
"}",
"}"
] | Streams multiple messages to {@code output}. Reading the messages back requires to
call methods {@code readStream(...)}.
<p>
See https://developers.google.com/protocol-buffers/docs/techniques#streaming
</p> | [
"Streams",
"multiple",
"messages",
"to",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/Protobuf.java#L111-L119 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementExecutor.java | StatementExecutor.callBatchTasks | public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException {
"""
Call batch tasks inside of a connection which may, or may not, have been "saved".
"""
if (connectionSource.isSingleConnection(tableInfo.getTableName())) {
synchronized (this) {
return doCallBatchTasks(connectionSource, callable);
}
} else {
return doCallBatchTasks(connectionSource, callable);
}
} | java | public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException {
if (connectionSource.isSingleConnection(tableInfo.getTableName())) {
synchronized (this) {
return doCallBatchTasks(connectionSource, callable);
}
} else {
return doCallBatchTasks(connectionSource, callable);
}
} | [
"public",
"<",
"CT",
">",
"CT",
"callBatchTasks",
"(",
"ConnectionSource",
"connectionSource",
",",
"Callable",
"<",
"CT",
">",
"callable",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"connectionSource",
".",
"isSingleConnection",
"(",
"tableInfo",
".",
"getTableName",
"(",
")",
")",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"return",
"doCallBatchTasks",
"(",
"connectionSource",
",",
"callable",
")",
";",
"}",
"}",
"else",
"{",
"return",
"doCallBatchTasks",
"(",
"connectionSource",
",",
"callable",
")",
";",
"}",
"}"
] | Call batch tasks inside of a connection which may, or may not, have been "saved". | [
"Call",
"batch",
"tasks",
"inside",
"of",
"a",
"connection",
"which",
"may",
"or",
"may",
"not",
"have",
"been",
"saved",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L594-L602 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/CSVExporter.java | CSVExporter.writeCSVRows | public static void writeCSVRows(XYSeries series, String path2Dir) {
"""
Export a XYChart series into rows in a CSV file.
@param series
@param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end
"""
File newFile = new File(path2Dir + series.getName() + ".csv");
Writer out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newFile), "UTF8"));
String csv = join(series.getXData(), ",") + System.getProperty("line.separator");
out.write(csv);
csv = join(series.getYData(), ",") + System.getProperty("line.separator");
out.write(csv);
if (series.getExtraValues() != null) {
csv = join(series.getExtraValues(), ",") + System.getProperty("line.separator");
out.write(csv);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
// NOP
}
}
}
} | java | public static void writeCSVRows(XYSeries series, String path2Dir) {
File newFile = new File(path2Dir + series.getName() + ".csv");
Writer out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newFile), "UTF8"));
String csv = join(series.getXData(), ",") + System.getProperty("line.separator");
out.write(csv);
csv = join(series.getYData(), ",") + System.getProperty("line.separator");
out.write(csv);
if (series.getExtraValues() != null) {
csv = join(series.getExtraValues(), ",") + System.getProperty("line.separator");
out.write(csv);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
// NOP
}
}
}
} | [
"public",
"static",
"void",
"writeCSVRows",
"(",
"XYSeries",
"series",
",",
"String",
"path2Dir",
")",
"{",
"File",
"newFile",
"=",
"new",
"File",
"(",
"path2Dir",
"+",
"series",
".",
"getName",
"(",
")",
"+",
"\".csv\"",
")",
";",
"Writer",
"out",
"=",
"null",
";",
"try",
"{",
"out",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"(",
"newFile",
")",
",",
"\"UTF8\"",
")",
")",
";",
"String",
"csv",
"=",
"join",
"(",
"series",
".",
"getXData",
"(",
")",
",",
"\",\"",
")",
"+",
"System",
".",
"getProperty",
"(",
"\"line.separator\"",
")",
";",
"out",
".",
"write",
"(",
"csv",
")",
";",
"csv",
"=",
"join",
"(",
"series",
".",
"getYData",
"(",
")",
",",
"\",\"",
")",
"+",
"System",
".",
"getProperty",
"(",
"\"line.separator\"",
")",
";",
"out",
".",
"write",
"(",
"csv",
")",
";",
"if",
"(",
"series",
".",
"getExtraValues",
"(",
")",
"!=",
"null",
")",
"{",
"csv",
"=",
"join",
"(",
"series",
".",
"getExtraValues",
"(",
")",
",",
"\",\"",
")",
"+",
"System",
".",
"getProperty",
"(",
"\"line.separator\"",
")",
";",
"out",
".",
"write",
"(",
"csv",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"out",
"!=",
"null",
")",
"{",
"try",
"{",
"out",
".",
"flush",
"(",
")",
";",
"out",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// NOP",
"}",
"}",
"}",
"}"
] | Export a XYChart series into rows in a CSV file.
@param series
@param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end | [
"Export",
"a",
"XYChart",
"series",
"into",
"rows",
"in",
"a",
"CSV",
"file",
"."
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/CSVExporter.java#L33-L60 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.createOrUpdateAsync | public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) {
"""
Create a file resource.
The PUT method creates a new file or updates an existing one.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@param parameters Information about the file
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ProjectFileInner object
"""
return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1<ServiceResponse<ProjectFileInner>, ProjectFileInner>() {
@Override
public ProjectFileInner call(ServiceResponse<ProjectFileInner> response) {
return response.body();
}
});
} | java | public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) {
return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1<ServiceResponse<ProjectFileInner>, ProjectFileInner>() {
@Override
public ProjectFileInner call(ServiceResponse<ProjectFileInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ProjectFileInner",
">",
"createOrUpdateAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
",",
"ProjectFileInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
",",
"projectName",
",",
"fileName",
",",
"parameters",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"ProjectFileInner",
">",
",",
"ProjectFileInner",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"ProjectFileInner",
"call",
"(",
"ServiceResponse",
"<",
"ProjectFileInner",
">",
"response",
")",
"{",
"return",
"response",
".",
"body",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
] | Create a file resource.
The PUT method creates a new file or updates an existing one.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@param parameters Information about the file
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ProjectFileInner object | [
"Create",
"a",
"file",
"resource",
".",
"The",
"PUT",
"method",
"creates",
"a",
"new",
"file",
"or",
"updates",
"an",
"existing",
"one",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L387-L394 |
aol/micro-server | micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java | ReadUtils.getInputStream | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
"""
Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files.
@param bucketName
@param key
@return
@throws AmazonServiceException
@throws AmazonClientException
@throws InterruptedException
@throws IOException
"""
Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault()
.getPath(tmpDirectory),
"micro-s3",
"file")
.toFile());
return getInputStream(bucketName, key, tempFileSupplier);
} | java | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault()
.getPath(tmpDirectory),
"micro-s3",
"file")
.toFile());
return getInputStream(bucketName, key, tempFileSupplier);
} | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"bucketName",
",",
"String",
"key",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
",",
"InterruptedException",
",",
"IOException",
"{",
"Supplier",
"<",
"File",
">",
"tempFileSupplier",
"=",
"ExceptionSoftener",
".",
"softenSupplier",
"(",
"(",
")",
"->",
"Files",
".",
"createTempFile",
"(",
"FileSystems",
".",
"getDefault",
"(",
")",
".",
"getPath",
"(",
"tmpDirectory",
")",
",",
"\"micro-s3\"",
",",
"\"file\"",
")",
".",
"toFile",
"(",
")",
")",
";",
"return",
"getInputStream",
"(",
"bucketName",
",",
"key",
",",
"tempFileSupplier",
")",
";",
"}"
] | Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files.
@param bucketName
@param key
@return
@throws AmazonServiceException
@throws AmazonClientException
@throws InterruptedException
@throws IOException | [
"Method",
"returns",
"InputStream",
"from",
"S3Object",
".",
"Multi",
"-",
"part",
"download",
"is",
"used",
"to",
"get",
"file",
".",
"s3",
".",
"tmp",
".",
"dir",
"property",
"used",
"to",
"store",
"temporary",
"files",
"."
] | train | https://github.com/aol/micro-server/blob/5c7103c5b43d2f4d16350dbd2f9802af307c63f7/micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java#L68-L76 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/params/Content.java | Content.setImages | public Content setImages(Map<String, Map<String, String>> images) {
"""
/*
A map of image names to { “url” : <url> } image maps.
Use the name “full” to denote the full-sized image, and “thumb” to denote
the thumbnail-sized image. Other image names are not reserved.
Or use setFullImage and setThumbImage to set them separately.
"""
this.images = images;
return this;
} | java | public Content setImages(Map<String, Map<String, String>> images) {
this.images = images;
return this;
} | [
"public",
"Content",
"setImages",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"images",
")",
"{",
"this",
".",
"images",
"=",
"images",
";",
"return",
"this",
";",
"}"
] | /*
A map of image names to { “url” : <url> } image maps.
Use the name “full” to denote the full-sized image, and “thumb” to denote
the thumbnail-sized image. Other image names are not reserved.
Or use setFullImage and setThumbImage to set them separately. | [
"/",
"*",
"A",
"map",
"of",
"image",
"names",
"to",
"{",
"“url”",
":",
"<url",
">",
"}",
"image",
"maps",
".",
"Use",
"the",
"name",
"“full”",
"to",
"denote",
"the",
"full",
"-",
"sized",
"image",
"and",
"“thumb”",
"to",
"denote",
"the",
"thumbnail",
"-",
"sized",
"image",
".",
"Other",
"image",
"names",
"are",
"not",
"reserved",
".",
"Or",
"use",
"setFullImage",
"and",
"setThumbImage",
"to",
"set",
"them",
"separately",
"."
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/params/Content.java#L109-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java | LTPATokenizer.convertStringToArrayList | private static final ArrayList<String> convertStringToArrayList(String value) {
"""
/*
Convert a String form of an array to the array list
@param value The String form of an array
@return The array list
"""
if (value != null && value.length() > 0) {
ArrayList<String> result = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(value, STRING_ATTRIB_DELIM);
while (st.hasMoreTokens()) {
String nextString = unescape(st.nextToken());
if (nextString != null) {
result.add(nextString);
}
}
return result;
}
return null;
} | java | private static final ArrayList<String> convertStringToArrayList(String value) {
if (value != null && value.length() > 0) {
ArrayList<String> result = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(value, STRING_ATTRIB_DELIM);
while (st.hasMoreTokens()) {
String nextString = unescape(st.nextToken());
if (nextString != null) {
result.add(nextString);
}
}
return result;
}
return null;
} | [
"private",
"static",
"final",
"ArrayList",
"<",
"String",
">",
"convertStringToArrayList",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"ArrayList",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"value",
",",
"STRING_ATTRIB_DELIM",
")",
";",
"while",
"(",
"st",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"String",
"nextString",
"=",
"unescape",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
";",
"if",
"(",
"nextString",
"!=",
"null",
")",
"{",
"result",
".",
"add",
"(",
"nextString",
")",
";",
"}",
"}",
"return",
"result",
";",
"}",
"return",
"null",
";",
"}"
] | /*
Convert a String form of an array to the array list
@param value The String form of an array
@return The array list | [
"/",
"*",
"Convert",
"a",
"String",
"form",
"of",
"an",
"array",
"to",
"the",
"array",
"list"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java#L198-L211 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AbstractResource.java | AbstractResource.validateResourceAuthorization | protected void validateResourceAuthorization(HttpServletRequest req, PrincipalUser actualOwner, PrincipalUser currentOwner) {
"""
Validates the resource authorization. Throws exception if the user is not authorized to access the resource.
@param req The HTTP request.
@param actualOwner The owner of the resource.
@param currentOwner The logged in user.
@throws WebApplicationException Throws exception if user is not authorized to access the resource.
"""
if (!getRemoteUser(req).isPrivileged() && !actualOwner.equals(currentOwner)) {
throw new WebApplicationException(Status.FORBIDDEN.getReasonPhrase(), Status.FORBIDDEN);
}
} | java | protected void validateResourceAuthorization(HttpServletRequest req, PrincipalUser actualOwner, PrincipalUser currentOwner) {
if (!getRemoteUser(req).isPrivileged() && !actualOwner.equals(currentOwner)) {
throw new WebApplicationException(Status.FORBIDDEN.getReasonPhrase(), Status.FORBIDDEN);
}
} | [
"protected",
"void",
"validateResourceAuthorization",
"(",
"HttpServletRequest",
"req",
",",
"PrincipalUser",
"actualOwner",
",",
"PrincipalUser",
"currentOwner",
")",
"{",
"if",
"(",
"!",
"getRemoteUser",
"(",
"req",
")",
".",
"isPrivileged",
"(",
")",
"&&",
"!",
"actualOwner",
".",
"equals",
"(",
"currentOwner",
")",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"Status",
".",
"FORBIDDEN",
".",
"getReasonPhrase",
"(",
")",
",",
"Status",
".",
"FORBIDDEN",
")",
";",
"}",
"}"
] | Validates the resource authorization. Throws exception if the user is not authorized to access the resource.
@param req The HTTP request.
@param actualOwner The owner of the resource.
@param currentOwner The logged in user.
@throws WebApplicationException Throws exception if user is not authorized to access the resource. | [
"Validates",
"the",
"resource",
"authorization",
".",
"Throws",
"exception",
"if",
"the",
"user",
"is",
"not",
"authorized",
"to",
"access",
"the",
"resource",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AbstractResource.java#L221-L225 |
eBay/parallec | src/main/java/io/parallec/core/FilterRegex.java | FilterRegex.stringMatcherByPattern | public static String stringMatcherByPattern(String input, String patternStr) {
"""
this remove the linebreak.
@param input
the input
@param patternStr
the pattern str
@return the string
"""
String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX;
// 20140105: fix the NPE issue
if (patternStr == null) {
logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at "
+ PcDateUtils.getNowDateTimeStrStandard());
return output;
}
if (input == null) {
logger.error("input (Expected when the response is null and now try to match on response) is NULL in stringMatcherByPattern() at "
+ PcDateUtils.getNowDateTimeStrStandard());
return output;
} else {
input = input.replace("\n", "").replace("\r", "");
}
logger.debug("input: " + input);
logger.debug("patternStr: " + patternStr);
Pattern patternMetric = Pattern.compile(patternStr, Pattern.MULTILINE);
final Matcher matcher = patternMetric.matcher(input);
if (matcher.matches()) {
output = matcher.group(1);
}
return output;
} | java | public static String stringMatcherByPattern(String input, String patternStr) {
String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX;
// 20140105: fix the NPE issue
if (patternStr == null) {
logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at "
+ PcDateUtils.getNowDateTimeStrStandard());
return output;
}
if (input == null) {
logger.error("input (Expected when the response is null and now try to match on response) is NULL in stringMatcherByPattern() at "
+ PcDateUtils.getNowDateTimeStrStandard());
return output;
} else {
input = input.replace("\n", "").replace("\r", "");
}
logger.debug("input: " + input);
logger.debug("patternStr: " + patternStr);
Pattern patternMetric = Pattern.compile(patternStr, Pattern.MULTILINE);
final Matcher matcher = patternMetric.matcher(input);
if (matcher.matches()) {
output = matcher.group(1);
}
return output;
} | [
"public",
"static",
"String",
"stringMatcherByPattern",
"(",
"String",
"input",
",",
"String",
"patternStr",
")",
"{",
"String",
"output",
"=",
"PcConstants",
".",
"SYSTEM_FAIL_MATCH_REGEX",
";",
"// 20140105: fix the NPE issue",
"if",
"(",
"patternStr",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
"\"patternStr is NULL! (Expected when the aggregation rule is not defined at \"",
"+",
"PcDateUtils",
".",
"getNowDateTimeStrStandard",
"(",
")",
")",
";",
"return",
"output",
";",
"}",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
"\"input (Expected when the response is null and now try to match on response) is NULL in stringMatcherByPattern() at \"",
"+",
"PcDateUtils",
".",
"getNowDateTimeStrStandard",
"(",
")",
")",
";",
"return",
"output",
";",
"}",
"else",
"{",
"input",
"=",
"input",
".",
"replace",
"(",
"\"\\n\"",
",",
"\"\"",
")",
".",
"replace",
"(",
"\"\\r\"",
",",
"\"\"",
")",
";",
"}",
"logger",
".",
"debug",
"(",
"\"input: \"",
"+",
"input",
")",
";",
"logger",
".",
"debug",
"(",
"\"patternStr: \"",
"+",
"patternStr",
")",
";",
"Pattern",
"patternMetric",
"=",
"Pattern",
".",
"compile",
"(",
"patternStr",
",",
"Pattern",
".",
"MULTILINE",
")",
";",
"final",
"Matcher",
"matcher",
"=",
"patternMetric",
".",
"matcher",
"(",
"input",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"output",
"=",
"matcher",
".",
"group",
"(",
"1",
")",
";",
"}",
"return",
"output",
";",
"}"
] | this remove the linebreak.
@param input
the input
@param patternStr
the pattern str
@return the string | [
"this",
"remove",
"the",
"linebreak",
"."
] | train | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/FilterRegex.java#L65-L94 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.inclusiveBetween | public long inclusiveBetween(long start, long end, long value) {
"""
Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception.
<pre>Validate.inclusiveBetween(0, 2, 1);</pre>
@param start
the inclusive start value
@param end
the inclusive end value
@param value
the value to validate
@return the value
@throws IllegalArgumentValidationException
if the value falls outside the boundaries (inclusive)
"""
if (value < start || value > end) {
fail(String.format(DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
}
return value;
} | java | public long inclusiveBetween(long start, long end, long value) {
if (value < start || value > end) {
fail(String.format(DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
}
return value;
} | [
"public",
"long",
"inclusiveBetween",
"(",
"long",
"start",
",",
"long",
"end",
",",
"long",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"start",
"||",
"value",
">",
"end",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE",
",",
"value",
",",
"start",
",",
"end",
")",
")",
";",
"}",
"return",
"value",
";",
"}"
] | Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception.
<pre>Validate.inclusiveBetween(0, 2, 1);</pre>
@param start
the inclusive start value
@param end
the inclusive end value
@param value
the value to validate
@return the value
@throws IllegalArgumentValidationException
if the value falls outside the boundaries (inclusive) | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"inclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
".",
"<pre",
">",
"Validate",
".",
"inclusiveBetween",
"(",
"0",
"2",
"1",
")",
";",
"<",
"/",
"pre",
">"
] | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1283-L1288 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java | JDBCRepository.selectIsolationLevel | IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel desiredLevel) {
"""
Returns the highest supported level for the given desired level.
@return null if not supported
"""
if (desiredLevel == null) {
if (parent == null) {
desiredLevel = mDefaultIsolationLevel;
} else {
desiredLevel = parent.getIsolationLevel();
}
} else if (parent != null) {
IsolationLevel parentLevel = parent.getIsolationLevel();
// Can promote to higher level, but not lower.
if (parentLevel.compareTo(desiredLevel) >= 0) {
desiredLevel = parentLevel;
} else {
return null;
}
}
switch (desiredLevel) {
case NONE:
return IsolationLevel.NONE;
case READ_UNCOMMITTED:
return mReadUncommittedLevel;
case READ_COMMITTED:
return mReadCommittedLevel;
case REPEATABLE_READ:
return mRepeatableReadLevel;
case SERIALIZABLE:
return mSerializableLevel;
}
return null;
} | java | IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel desiredLevel) {
if (desiredLevel == null) {
if (parent == null) {
desiredLevel = mDefaultIsolationLevel;
} else {
desiredLevel = parent.getIsolationLevel();
}
} else if (parent != null) {
IsolationLevel parentLevel = parent.getIsolationLevel();
// Can promote to higher level, but not lower.
if (parentLevel.compareTo(desiredLevel) >= 0) {
desiredLevel = parentLevel;
} else {
return null;
}
}
switch (desiredLevel) {
case NONE:
return IsolationLevel.NONE;
case READ_UNCOMMITTED:
return mReadUncommittedLevel;
case READ_COMMITTED:
return mReadCommittedLevel;
case REPEATABLE_READ:
return mRepeatableReadLevel;
case SERIALIZABLE:
return mSerializableLevel;
}
return null;
} | [
"IsolationLevel",
"selectIsolationLevel",
"(",
"Transaction",
"parent",
",",
"IsolationLevel",
"desiredLevel",
")",
"{",
"if",
"(",
"desiredLevel",
"==",
"null",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"desiredLevel",
"=",
"mDefaultIsolationLevel",
";",
"}",
"else",
"{",
"desiredLevel",
"=",
"parent",
".",
"getIsolationLevel",
"(",
")",
";",
"}",
"}",
"else",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"IsolationLevel",
"parentLevel",
"=",
"parent",
".",
"getIsolationLevel",
"(",
")",
";",
"// Can promote to higher level, but not lower.\r",
"if",
"(",
"parentLevel",
".",
"compareTo",
"(",
"desiredLevel",
")",
">=",
"0",
")",
"{",
"desiredLevel",
"=",
"parentLevel",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"switch",
"(",
"desiredLevel",
")",
"{",
"case",
"NONE",
":",
"return",
"IsolationLevel",
".",
"NONE",
";",
"case",
"READ_UNCOMMITTED",
":",
"return",
"mReadUncommittedLevel",
";",
"case",
"READ_COMMITTED",
":",
"return",
"mReadCommittedLevel",
";",
"case",
"REPEATABLE_READ",
":",
"return",
"mRepeatableReadLevel",
";",
"case",
"SERIALIZABLE",
":",
"return",
"mSerializableLevel",
";",
"}",
"return",
"null",
";",
"}"
] | Returns the highest supported level for the given desired level.
@return null if not supported | [
"Returns",
"the",
"highest",
"supported",
"level",
"for",
"the",
"given",
"desired",
"level",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java#L548-L579 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.isKeepAlive | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
"""
Check whether a connection should alive or not.
@param keepAliveConfig of the connection
@param outboundRequestMsg of this particular transaction
@return true if the connection should be kept alive
@throws ConfigurationException for invalid configurations
"""
switch (keepAliveConfig) {
case AUTO:
return Float.valueOf((String) outboundRequestMsg.getProperty(Constants.HTTP_VERSION)) > Constants.HTTP_1_0;
case ALWAYS:
return true;
case NEVER:
return false;
default:
// The execution will never reach here. In case execution reach here means it should be an invalid value
// for keep-alive configurations.
throw new ConfigurationException("Invalid keep-alive configuration value : "
+ keepAliveConfig.toString());
}
} | java | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
switch (keepAliveConfig) {
case AUTO:
return Float.valueOf((String) outboundRequestMsg.getProperty(Constants.HTTP_VERSION)) > Constants.HTTP_1_0;
case ALWAYS:
return true;
case NEVER:
return false;
default:
// The execution will never reach here. In case execution reach here means it should be an invalid value
// for keep-alive configurations.
throw new ConfigurationException("Invalid keep-alive configuration value : "
+ keepAliveConfig.toString());
}
} | [
"public",
"static",
"boolean",
"isKeepAlive",
"(",
"KeepAliveConfig",
"keepAliveConfig",
",",
"HttpCarbonMessage",
"outboundRequestMsg",
")",
"throws",
"ConfigurationException",
"{",
"switch",
"(",
"keepAliveConfig",
")",
"{",
"case",
"AUTO",
":",
"return",
"Float",
".",
"valueOf",
"(",
"(",
"String",
")",
"outboundRequestMsg",
".",
"getProperty",
"(",
"Constants",
".",
"HTTP_VERSION",
")",
")",
">",
"Constants",
".",
"HTTP_1_0",
";",
"case",
"ALWAYS",
":",
"return",
"true",
";",
"case",
"NEVER",
":",
"return",
"false",
";",
"default",
":",
"// The execution will never reach here. In case execution reach here means it should be an invalid value",
"// for keep-alive configurations.",
"throw",
"new",
"ConfigurationException",
"(",
"\"Invalid keep-alive configuration value : \"",
"+",
"keepAliveConfig",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | Check whether a connection should alive or not.
@param keepAliveConfig of the connection
@param outboundRequestMsg of this particular transaction
@return true if the connection should be kept alive
@throws ConfigurationException for invalid configurations | [
"Check",
"whether",
"a",
"connection",
"should",
"alive",
"or",
"not",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L771-L786 |
xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java | AbstractXHTMLLinkTypeRenderer.handleTargetAttribute | private void handleTargetAttribute(Map<String, String> anchorAttributes) {
"""
When a link is open in an other window or in an other frame, the loaded page has some restricted access to the
parent window. Among other things, it has the ability to redirect it to an other page, which can lead to
dangerous phishing attacks.
See: https://mathiasbynens.github.io/rel-noopener/ or https://dev.to/phishing or
https://jira.xwiki.org/browse/XRENDERING-462
To avoid this vulnerability, we automatically add the "noopener" value to the "rel" attribute of the anchor.
But because Firefox does not handle it, we also need to add the "noreferer" value.
@param anchorAttributes the anchor attributes (that going to be changed)
@since 7.4.5
@since 8.2.2
@since 8.3M2
"""
String target = anchorAttributes.get("target");
// Target can have these values:
//
// "_blank" which opens the link in a new window
// "_self" which opens the link in the same window (default)
// "_top" and "_parent" which control the top or the parent window of some frame
// "frame-name" (it could be anything) which opens the link in the frame called "frame-name".
//
// "_self", "_top" and "_parent" are the only safe values. So we need to handle any other value...
if (StringUtils.isNotBlank(target)
&& !"_self".equals(target) && !"_parent".equals(target) && !"_top".equals(target)) {
List<String> relAttributes = new ArrayList<>();
// Parse the current values
String relAttribute = anchorAttributes.get(REL);
if (relAttribute != null) {
relAttributes.addAll(Arrays.asList(relAttribute.split(" ")));
}
// Add the "noopener" attribute
if (!relAttributes.contains(NOOPENER)) {
relAttributes.add(NOOPENER);
}
// Add the "noreferrer" attribute
if (!relAttributes.contains(NOREFERRER)) {
relAttributes.add(NOREFERRER);
}
// Serialize the attributes
if (!relAttributes.isEmpty()) {
anchorAttributes.put(REL, String.join(" ", relAttributes));
}
}
} | java | private void handleTargetAttribute(Map<String, String> anchorAttributes)
{
String target = anchorAttributes.get("target");
// Target can have these values:
//
// "_blank" which opens the link in a new window
// "_self" which opens the link in the same window (default)
// "_top" and "_parent" which control the top or the parent window of some frame
// "frame-name" (it could be anything) which opens the link in the frame called "frame-name".
//
// "_self", "_top" and "_parent" are the only safe values. So we need to handle any other value...
if (StringUtils.isNotBlank(target)
&& !"_self".equals(target) && !"_parent".equals(target) && !"_top".equals(target)) {
List<String> relAttributes = new ArrayList<>();
// Parse the current values
String relAttribute = anchorAttributes.get(REL);
if (relAttribute != null) {
relAttributes.addAll(Arrays.asList(relAttribute.split(" ")));
}
// Add the "noopener" attribute
if (!relAttributes.contains(NOOPENER)) {
relAttributes.add(NOOPENER);
}
// Add the "noreferrer" attribute
if (!relAttributes.contains(NOREFERRER)) {
relAttributes.add(NOREFERRER);
}
// Serialize the attributes
if (!relAttributes.isEmpty()) {
anchorAttributes.put(REL, String.join(" ", relAttributes));
}
}
} | [
"private",
"void",
"handleTargetAttribute",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"anchorAttributes",
")",
"{",
"String",
"target",
"=",
"anchorAttributes",
".",
"get",
"(",
"\"target\"",
")",
";",
"// Target can have these values:",
"//",
"// \"_blank\" which opens the link in a new window",
"// \"_self\" which opens the link in the same window (default)",
"// \"_top\" and \"_parent\" which control the top or the parent window of some frame",
"// \"frame-name\" (it could be anything) which opens the link in the frame called \"frame-name\".",
"//",
"// \"_self\", \"_top\" and \"_parent\" are the only safe values. So we need to handle any other value...",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"target",
")",
"&&",
"!",
"\"_self\"",
".",
"equals",
"(",
"target",
")",
"&&",
"!",
"\"_parent\"",
".",
"equals",
"(",
"target",
")",
"&&",
"!",
"\"_top\"",
".",
"equals",
"(",
"target",
")",
")",
"{",
"List",
"<",
"String",
">",
"relAttributes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Parse the current values",
"String",
"relAttribute",
"=",
"anchorAttributes",
".",
"get",
"(",
"REL",
")",
";",
"if",
"(",
"relAttribute",
"!=",
"null",
")",
"{",
"relAttributes",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"relAttribute",
".",
"split",
"(",
"\" \"",
")",
")",
")",
";",
"}",
"// Add the \"noopener\" attribute",
"if",
"(",
"!",
"relAttributes",
".",
"contains",
"(",
"NOOPENER",
")",
")",
"{",
"relAttributes",
".",
"add",
"(",
"NOOPENER",
")",
";",
"}",
"// Add the \"noreferrer\" attribute",
"if",
"(",
"!",
"relAttributes",
".",
"contains",
"(",
"NOREFERRER",
")",
")",
"{",
"relAttributes",
".",
"add",
"(",
"NOREFERRER",
")",
";",
"}",
"// Serialize the attributes",
"if",
"(",
"!",
"relAttributes",
".",
"isEmpty",
"(",
")",
")",
"{",
"anchorAttributes",
".",
"put",
"(",
"REL",
",",
"String",
".",
"join",
"(",
"\" \"",
",",
"relAttributes",
")",
")",
";",
"}",
"}",
"}"
] | When a link is open in an other window or in an other frame, the loaded page has some restricted access to the
parent window. Among other things, it has the ability to redirect it to an other page, which can lead to
dangerous phishing attacks.
See: https://mathiasbynens.github.io/rel-noopener/ or https://dev.to/phishing or
https://jira.xwiki.org/browse/XRENDERING-462
To avoid this vulnerability, we automatically add the "noopener" value to the "rel" attribute of the anchor.
But because Firefox does not handle it, we also need to add the "noreferer" value.
@param anchorAttributes the anchor attributes (that going to be changed)
@since 7.4.5
@since 8.2.2
@since 8.3M2 | [
"When",
"a",
"link",
"is",
"open",
"in",
"an",
"other",
"window",
"or",
"in",
"an",
"other",
"frame",
"the",
"loaded",
"page",
"has",
"some",
"restricted",
"access",
"to",
"the",
"parent",
"window",
".",
"Among",
"other",
"things",
"it",
"has",
"the",
"ability",
"to",
"redirect",
"it",
"to",
"an",
"other",
"page",
"which",
"can",
"lead",
"to",
"dangerous",
"phishing",
"attacks",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java#L180-L217 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initLayouts | protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
"""
Initializes the layout for this content handler.<p>
Unless otherwise instructed, the editor uses one specific GUI widget for each
XML value schema type. For example, for a {@link org.opencms.xml.types.CmsXmlStringValue}
the default widget is the {@link org.opencms.widgets.CmsInputWidget}.
However, certain values can also use more then one widget, for example you may
also use a {@link org.opencms.widgets.CmsCheckboxWidget} for a String value,
and as a result the Strings possible values would be either <code>"false"</code> or <code>"true"</code>,
but nevertheless be a String.<p>
The widget to use can further be controlled using the <code>widget</code> attribute.
You can specify either a valid widget alias such as <code>StringWidget</code>,
or the name of a Java class that implements <code>{@link I_CmsWidget}</code>.<p>
Configuration options to the widget can be passed using the <code>configuration</code>
attribute. You can specify any String as configuration. This String is then passed
to the widget during initialization. It's up to the individual widget implementation
to interpret this configuration String.<p>
@param root the "layouts" element from the appinfo node of the XML content definition
@param contentDefinition the content definition the layout belongs to
@throws CmsXmlException if something goes wrong
"""
m_useAcacia = safeParseBoolean(root.attributeValue(ATTR_USE_ACACIA), true);
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_LAYOUT);
while (i.hasNext()) {
// iterate all "layout" elements in the "layouts" node
Element element = i.next();
String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
String widgetClassOrAlias = element.attributeValue(APPINFO_ATTR_WIDGET);
String configuration = element.attributeValue(APPINFO_ATTR_CONFIGURATION);
String displayStr = element.attributeValue(APPINFO_ATTR_DISPLAY);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(displayStr) && (elementName != null)) {
addDisplayType(contentDefinition, elementName, DisplayType.valueOf(displayStr));
}
if ((elementName != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(widgetClassOrAlias)) {
// add a widget mapping for the element
addWidget(contentDefinition, elementName, widgetClassOrAlias);
if (configuration != null) {
addConfiguration(contentDefinition, elementName, configuration);
}
}
}
} | java | protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
m_useAcacia = safeParseBoolean(root.attributeValue(ATTR_USE_ACACIA), true);
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_LAYOUT);
while (i.hasNext()) {
// iterate all "layout" elements in the "layouts" node
Element element = i.next();
String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
String widgetClassOrAlias = element.attributeValue(APPINFO_ATTR_WIDGET);
String configuration = element.attributeValue(APPINFO_ATTR_CONFIGURATION);
String displayStr = element.attributeValue(APPINFO_ATTR_DISPLAY);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(displayStr) && (elementName != null)) {
addDisplayType(contentDefinition, elementName, DisplayType.valueOf(displayStr));
}
if ((elementName != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(widgetClassOrAlias)) {
// add a widget mapping for the element
addWidget(contentDefinition, elementName, widgetClassOrAlias);
if (configuration != null) {
addConfiguration(contentDefinition, elementName, configuration);
}
}
}
} | [
"protected",
"void",
"initLayouts",
"(",
"Element",
"root",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"throws",
"CmsXmlException",
"{",
"m_useAcacia",
"=",
"safeParseBoolean",
"(",
"root",
".",
"attributeValue",
"(",
"ATTR_USE_ACACIA",
")",
",",
"true",
")",
";",
"Iterator",
"<",
"Element",
">",
"i",
"=",
"CmsXmlGenericWrapper",
".",
"elementIterator",
"(",
"root",
",",
"APPINFO_LAYOUT",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"// iterate all \"layout\" elements in the \"layouts\" node",
"Element",
"element",
"=",
"i",
".",
"next",
"(",
")",
";",
"String",
"elementName",
"=",
"element",
".",
"attributeValue",
"(",
"APPINFO_ATTR_ELEMENT",
")",
";",
"String",
"widgetClassOrAlias",
"=",
"element",
".",
"attributeValue",
"(",
"APPINFO_ATTR_WIDGET",
")",
";",
"String",
"configuration",
"=",
"element",
".",
"attributeValue",
"(",
"APPINFO_ATTR_CONFIGURATION",
")",
";",
"String",
"displayStr",
"=",
"element",
".",
"attributeValue",
"(",
"APPINFO_ATTR_DISPLAY",
")",
";",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"displayStr",
")",
"&&",
"(",
"elementName",
"!=",
"null",
")",
")",
"{",
"addDisplayType",
"(",
"contentDefinition",
",",
"elementName",
",",
"DisplayType",
".",
"valueOf",
"(",
"displayStr",
")",
")",
";",
"}",
"if",
"(",
"(",
"elementName",
"!=",
"null",
")",
"&&",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"widgetClassOrAlias",
")",
")",
"{",
"// add a widget mapping for the element",
"addWidget",
"(",
"contentDefinition",
",",
"elementName",
",",
"widgetClassOrAlias",
")",
";",
"if",
"(",
"configuration",
"!=",
"null",
")",
"{",
"addConfiguration",
"(",
"contentDefinition",
",",
"elementName",
",",
"configuration",
")",
";",
"}",
"}",
"}",
"}"
] | Initializes the layout for this content handler.<p>
Unless otherwise instructed, the editor uses one specific GUI widget for each
XML value schema type. For example, for a {@link org.opencms.xml.types.CmsXmlStringValue}
the default widget is the {@link org.opencms.widgets.CmsInputWidget}.
However, certain values can also use more then one widget, for example you may
also use a {@link org.opencms.widgets.CmsCheckboxWidget} for a String value,
and as a result the Strings possible values would be either <code>"false"</code> or <code>"true"</code>,
but nevertheless be a String.<p>
The widget to use can further be controlled using the <code>widget</code> attribute.
You can specify either a valid widget alias such as <code>StringWidget</code>,
or the name of a Java class that implements <code>{@link I_CmsWidget}</code>.<p>
Configuration options to the widget can be passed using the <code>configuration</code>
attribute. You can specify any String as configuration. This String is then passed
to the widget during initialization. It's up to the individual widget implementation
to interpret this configuration String.<p>
@param root the "layouts" element from the appinfo node of the XML content definition
@param contentDefinition the content definition the layout belongs to
@throws CmsXmlException if something goes wrong | [
"Initializes",
"the",
"layout",
"for",
"this",
"content",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2702-L2724 |
ysc/HtmlExtractor | html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java | ExtractFunctionExecutor.executeSubstring | public static String executeSubstring(String text, String parseExpression) {
"""
截取指定范围的文本 使用方法:substring(0,19)
括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19,即[0 - 19)
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本
"""
LOGGER.debug("substring抽取函数之前:" + text);
String parameter = parseExpression.replace("substring(", "");
parameter = parameter.substring(0, parameter.length() - 1);
String[] attr = parameter.split(",");
if (attr != null && attr.length == 2) {
int beginIndex = Integer.parseInt(attr[0]);
int endIndex = Integer.parseInt(attr[1]);
text = text.substring(beginIndex, endIndex);
}
LOGGER.debug("substring抽取函数之后:" + text);
return text;
} | java | public static String executeSubstring(String text, String parseExpression) {
LOGGER.debug("substring抽取函数之前:" + text);
String parameter = parseExpression.replace("substring(", "");
parameter = parameter.substring(0, parameter.length() - 1);
String[] attr = parameter.split(",");
if (attr != null && attr.length == 2) {
int beginIndex = Integer.parseInt(attr[0]);
int endIndex = Integer.parseInt(attr[1]);
text = text.substring(beginIndex, endIndex);
}
LOGGER.debug("substring抽取函数之后:" + text);
return text;
} | [
"public",
"static",
"String",
"executeSubstring",
"(",
"String",
"text",
",",
"String",
"parseExpression",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"substring抽取函数之前:\" + text);",
"",
"",
"",
"",
"String",
"parameter",
"=",
"parseExpression",
".",
"replace",
"(",
"\"substring(\"",
",",
"\"\"",
")",
";",
"parameter",
"=",
"parameter",
".",
"substring",
"(",
"0",
",",
"parameter",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"String",
"[",
"]",
"attr",
"=",
"parameter",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"attr",
"!=",
"null",
"&&",
"attr",
".",
"length",
"==",
"2",
")",
"{",
"int",
"beginIndex",
"=",
"Integer",
".",
"parseInt",
"(",
"attr",
"[",
"0",
"]",
")",
";",
"int",
"endIndex",
"=",
"Integer",
".",
"parseInt",
"(",
"attr",
"[",
"1",
"]",
")",
";",
"text",
"=",
"text",
".",
"substring",
"(",
"beginIndex",
",",
"endIndex",
")",
";",
"}",
"LOGGER",
".",
"debug",
"(",
"\"substring抽取函数之后:\" + text);",
"",
"",
"",
"",
"return",
"text",
";",
"}"
] | 截取指定范围的文本 使用方法:substring(0,19)
括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19,即[0 - 19)
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本 | [
"截取指定范围的文本",
"使用方法:substring",
"(",
"0",
"19",
")",
"括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19",
"即",
"[",
"0",
"-",
"19",
")"
] | train | https://github.com/ysc/HtmlExtractor/blob/5378bc5f94138562c55506cf81de1ffe72ab701e/html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java#L74-L86 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java | Stage.withMethodSettings | public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) {
"""
<p>
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code>
for an individual method override, or <code>/\*/\*</code> for overriding all methods in the stage.
</p>
@param methodSettings
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as
<code>{resource_path}/{http_method}</code> for an individual method override, or <code>/\*/\*</code>
for overriding all methods in the stage.
@return Returns a reference to this object so that method calls can be chained together.
"""
setMethodSettings(methodSettings);
return this;
} | java | public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) {
setMethodSettings(methodSettings);
return this;
} | [
"public",
"Stage",
"withMethodSettings",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MethodSetting",
">",
"methodSettings",
")",
"{",
"setMethodSettings",
"(",
"methodSettings",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code>
for an individual method override, or <code>/\*/\*</code> for overriding all methods in the stage.
</p>
@param methodSettings
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as
<code>{resource_path}/{http_method}</code> for an individual method override, or <code>/\*/\*</code>
for overriding all methods in the stage.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"that",
"defines",
"the",
"method",
"settings",
"for",
"a",
"<a",
">",
"Stage<",
"/",
"a",
">",
"resource",
".",
"Keys",
"(",
"designated",
"as",
"<code",
">",
"/",
"{",
"method_setting_key<",
"/",
"code",
">",
"below",
")",
"are",
"method",
"paths",
"defined",
"as",
"<code",
">",
"{",
"resource_path",
"}",
"/",
"{",
"http_method",
"}",
"<",
"/",
"code",
">",
"for",
"an",
"individual",
"method",
"override",
"or",
"<code",
">",
"/",
"\\",
"*",
"/",
";",
"\\",
"*",
"<",
"/",
"code",
">",
"for",
"overriding",
"all",
"methods",
"in",
"the",
"stage",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java#L518-L521 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java | NotDimFilter.getDimensionRangeSet | @Override
public RangeSet<String> getDimensionRangeSet(String dimension) {
"""
There are some special cases involving null that require special casing for And and Or instead of simply taking
the complement
Example 1 : "NOT ( [0,INF) OR null)" The inside of NOT would evaluate to null, and the complement would also
be null. However, by breaking the NOT, this statement is "NOT([0,INF)) AND NOT(null)", which means it should
actually evaluate to (-INF, 0).
Example 2 : "NOT ( [0,INF) AND null )" The inside of NOT would evaluate to [0,INF), and the complement would be
(-INF, 0). However the statement is actually "NOT([0,INF)) OR NOT(null)", and it should be evaluated to null.
"""
if (field instanceof AndDimFilter) {
List<DimFilter> fields = ((AndDimFilter) field).getFields();
return new OrDimFilter(Lists.transform(fields, NotDimFilter::new)).getDimensionRangeSet(dimension);
}
if (field instanceof OrDimFilter) {
List<DimFilter> fields = ((OrDimFilter) field).getFields();
return new AndDimFilter(Lists.transform(fields, NotDimFilter::new)).getDimensionRangeSet(dimension);
}
if (field instanceof NotDimFilter) {
return ((NotDimFilter) field).getField().getDimensionRangeSet(dimension);
}
RangeSet<String> rangeSet = field.getDimensionRangeSet(dimension);
return rangeSet == null ? null : rangeSet.complement();
} | java | @Override
public RangeSet<String> getDimensionRangeSet(String dimension)
{
if (field instanceof AndDimFilter) {
List<DimFilter> fields = ((AndDimFilter) field).getFields();
return new OrDimFilter(Lists.transform(fields, NotDimFilter::new)).getDimensionRangeSet(dimension);
}
if (field instanceof OrDimFilter) {
List<DimFilter> fields = ((OrDimFilter) field).getFields();
return new AndDimFilter(Lists.transform(fields, NotDimFilter::new)).getDimensionRangeSet(dimension);
}
if (field instanceof NotDimFilter) {
return ((NotDimFilter) field).getField().getDimensionRangeSet(dimension);
}
RangeSet<String> rangeSet = field.getDimensionRangeSet(dimension);
return rangeSet == null ? null : rangeSet.complement();
} | [
"@",
"Override",
"public",
"RangeSet",
"<",
"String",
">",
"getDimensionRangeSet",
"(",
"String",
"dimension",
")",
"{",
"if",
"(",
"field",
"instanceof",
"AndDimFilter",
")",
"{",
"List",
"<",
"DimFilter",
">",
"fields",
"=",
"(",
"(",
"AndDimFilter",
")",
"field",
")",
".",
"getFields",
"(",
")",
";",
"return",
"new",
"OrDimFilter",
"(",
"Lists",
".",
"transform",
"(",
"fields",
",",
"NotDimFilter",
"::",
"new",
")",
")",
".",
"getDimensionRangeSet",
"(",
"dimension",
")",
";",
"}",
"if",
"(",
"field",
"instanceof",
"OrDimFilter",
")",
"{",
"List",
"<",
"DimFilter",
">",
"fields",
"=",
"(",
"(",
"OrDimFilter",
")",
"field",
")",
".",
"getFields",
"(",
")",
";",
"return",
"new",
"AndDimFilter",
"(",
"Lists",
".",
"transform",
"(",
"fields",
",",
"NotDimFilter",
"::",
"new",
")",
")",
".",
"getDimensionRangeSet",
"(",
"dimension",
")",
";",
"}",
"if",
"(",
"field",
"instanceof",
"NotDimFilter",
")",
"{",
"return",
"(",
"(",
"NotDimFilter",
")",
"field",
")",
".",
"getField",
"(",
")",
".",
"getDimensionRangeSet",
"(",
"dimension",
")",
";",
"}",
"RangeSet",
"<",
"String",
">",
"rangeSet",
"=",
"field",
".",
"getDimensionRangeSet",
"(",
"dimension",
")",
";",
"return",
"rangeSet",
"==",
"null",
"?",
"null",
":",
"rangeSet",
".",
"complement",
"(",
")",
";",
"}"
] | There are some special cases involving null that require special casing for And and Or instead of simply taking
the complement
Example 1 : "NOT ( [0,INF) OR null)" The inside of NOT would evaluate to null, and the complement would also
be null. However, by breaking the NOT, this statement is "NOT([0,INF)) AND NOT(null)", which means it should
actually evaluate to (-INF, 0).
Example 2 : "NOT ( [0,INF) AND null )" The inside of NOT would evaluate to [0,INF), and the complement would be
(-INF, 0). However the statement is actually "NOT([0,INF)) OR NOT(null)", and it should be evaluated to null. | [
"There",
"are",
"some",
"special",
"cases",
"involving",
"null",
"that",
"require",
"special",
"casing",
"for",
"And",
"and",
"Or",
"instead",
"of",
"simply",
"taking",
"the",
"complement"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java#L86-L102 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.meterTaskAttemptUnprotected | @SuppressWarnings("deprecation")
private void meterTaskAttemptUnprotected(TaskInProgress tip, TaskStatus status) {
"""
Metering: Occupied Slots * (Finish - Start)
@param tip {@link TaskInProgress} to be metered which just completed,
cannot be <code>null</code>
@param status {@link TaskStatus} of the completed task, cannot be
<code>null</code>
"""
Counter slotCounter =
(tip.isMapTask()) ? Counter.SLOTS_MILLIS_MAPS :
Counter.SLOTS_MILLIS_REDUCES;
jobCounters.incrCounter(slotCounter,
tip.getNumSlotsRequired() *
(status.getFinishTime() - status.getStartTime()));
if (!tip.isMapTask()) {
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_COPY,
tip.getNumSlotsRequired() *
(status.getShuffleFinishTime() - status.getStartTime()));
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_SORT,
tip.getNumSlotsRequired() *
(status.getSortFinishTime() - status.getShuffleFinishTime()));
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_REDUCE,
tip.getNumSlotsRequired() *
(status.getFinishTime() - status.getSortFinishTime()));
}
} | java | @SuppressWarnings("deprecation")
private void meterTaskAttemptUnprotected(TaskInProgress tip, TaskStatus status) {
Counter slotCounter =
(tip.isMapTask()) ? Counter.SLOTS_MILLIS_MAPS :
Counter.SLOTS_MILLIS_REDUCES;
jobCounters.incrCounter(slotCounter,
tip.getNumSlotsRequired() *
(status.getFinishTime() - status.getStartTime()));
if (!tip.isMapTask()) {
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_COPY,
tip.getNumSlotsRequired() *
(status.getShuffleFinishTime() - status.getStartTime()));
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_SORT,
tip.getNumSlotsRequired() *
(status.getSortFinishTime() - status.getShuffleFinishTime()));
jobCounters.incrCounter(Counter.SLOTS_MILLIS_REDUCES_REDUCE,
tip.getNumSlotsRequired() *
(status.getFinishTime() - status.getSortFinishTime()));
}
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"meterTaskAttemptUnprotected",
"(",
"TaskInProgress",
"tip",
",",
"TaskStatus",
"status",
")",
"{",
"Counter",
"slotCounter",
"=",
"(",
"tip",
".",
"isMapTask",
"(",
")",
")",
"?",
"Counter",
".",
"SLOTS_MILLIS_MAPS",
":",
"Counter",
".",
"SLOTS_MILLIS_REDUCES",
";",
"jobCounters",
".",
"incrCounter",
"(",
"slotCounter",
",",
"tip",
".",
"getNumSlotsRequired",
"(",
")",
"*",
"(",
"status",
".",
"getFinishTime",
"(",
")",
"-",
"status",
".",
"getStartTime",
"(",
")",
")",
")",
";",
"if",
"(",
"!",
"tip",
".",
"isMapTask",
"(",
")",
")",
"{",
"jobCounters",
".",
"incrCounter",
"(",
"Counter",
".",
"SLOTS_MILLIS_REDUCES_COPY",
",",
"tip",
".",
"getNumSlotsRequired",
"(",
")",
"*",
"(",
"status",
".",
"getShuffleFinishTime",
"(",
")",
"-",
"status",
".",
"getStartTime",
"(",
")",
")",
")",
";",
"jobCounters",
".",
"incrCounter",
"(",
"Counter",
".",
"SLOTS_MILLIS_REDUCES_SORT",
",",
"tip",
".",
"getNumSlotsRequired",
"(",
")",
"*",
"(",
"status",
".",
"getSortFinishTime",
"(",
")",
"-",
"status",
".",
"getShuffleFinishTime",
"(",
")",
")",
")",
";",
"jobCounters",
".",
"incrCounter",
"(",
"Counter",
".",
"SLOTS_MILLIS_REDUCES_REDUCE",
",",
"tip",
".",
"getNumSlotsRequired",
"(",
")",
"*",
"(",
"status",
".",
"getFinishTime",
"(",
")",
"-",
"status",
".",
"getSortFinishTime",
"(",
")",
")",
")",
";",
"}",
"}"
] | Metering: Occupied Slots * (Finish - Start)
@param tip {@link TaskInProgress} to be metered which just completed,
cannot be <code>null</code>
@param status {@link TaskStatus} of the completed task, cannot be
<code>null</code> | [
"Metering",
":",
"Occupied",
"Slots",
"*",
"(",
"Finish",
"-",
"Start",
")"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L2052-L2071 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java | TreeHelpers.processTreeRequest | public static void processTreeRequest(String treeId, TreeElement treeRoot, HttpServletRequest request, HttpServletResponse response) {
"""
If this tree was selected or expanded this will handle that processing.
@param treeId
@param treeRoot
@param request
"""
assert(treeId != null) : "parameter treeId must not be null.";
assert(treeRoot != null) : "parameter treeRoot must not be null.";
assert(request != null) : "paramater request must not be null.";
// check the root node to see if it is a TreeRootElement. if it is, then we
// use it to change the selected node. Otherwise we will do a recursive search
// of the tree to select the node.
String selectNode = request.getParameter(TreeElement.SELECTED_NODE);
if (selectNode != null) {
if (treeRoot instanceof ITreeRootElement) {
ITreeRootElement root = (ITreeRootElement) treeRoot;
root.changeSelected(selectNode, request);
}
else {
setSelected(treeRoot, selectNode, request);
}
}
// handle auto expand.
String expandNode = null;
// our we auto expanding this node?
expandNode = request.getParameter(TreeElement.EXPAND_NODE);
// if we are auto expanding flip the expand of this node if it was expanded
if (expandNode != null) {
TreeElement n = treeRoot.findNode(expandNode);
if (n != null) {
n.onExpand(request, response);
n.setExpanded(!n.isExpanded());
}
}
} | java | public static void processTreeRequest(String treeId, TreeElement treeRoot, HttpServletRequest request, HttpServletResponse response)
{
assert(treeId != null) : "parameter treeId must not be null.";
assert(treeRoot != null) : "parameter treeRoot must not be null.";
assert(request != null) : "paramater request must not be null.";
// check the root node to see if it is a TreeRootElement. if it is, then we
// use it to change the selected node. Otherwise we will do a recursive search
// of the tree to select the node.
String selectNode = request.getParameter(TreeElement.SELECTED_NODE);
if (selectNode != null) {
if (treeRoot instanceof ITreeRootElement) {
ITreeRootElement root = (ITreeRootElement) treeRoot;
root.changeSelected(selectNode, request);
}
else {
setSelected(treeRoot, selectNode, request);
}
}
// handle auto expand.
String expandNode = null;
// our we auto expanding this node?
expandNode = request.getParameter(TreeElement.EXPAND_NODE);
// if we are auto expanding flip the expand of this node if it was expanded
if (expandNode != null) {
TreeElement n = treeRoot.findNode(expandNode);
if (n != null) {
n.onExpand(request, response);
n.setExpanded(!n.isExpanded());
}
}
} | [
"public",
"static",
"void",
"processTreeRequest",
"(",
"String",
"treeId",
",",
"TreeElement",
"treeRoot",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"assert",
"(",
"treeId",
"!=",
"null",
")",
":",
"\"parameter treeId must not be null.\"",
";",
"assert",
"(",
"treeRoot",
"!=",
"null",
")",
":",
"\"parameter treeRoot must not be null.\"",
";",
"assert",
"(",
"request",
"!=",
"null",
")",
":",
"\"paramater request must not be null.\"",
";",
"// check the root node to see if it is a TreeRootElement. if it is, then we",
"// use it to change the selected node. Otherwise we will do a recursive search",
"// of the tree to select the node.",
"String",
"selectNode",
"=",
"request",
".",
"getParameter",
"(",
"TreeElement",
".",
"SELECTED_NODE",
")",
";",
"if",
"(",
"selectNode",
"!=",
"null",
")",
"{",
"if",
"(",
"treeRoot",
"instanceof",
"ITreeRootElement",
")",
"{",
"ITreeRootElement",
"root",
"=",
"(",
"ITreeRootElement",
")",
"treeRoot",
";",
"root",
".",
"changeSelected",
"(",
"selectNode",
",",
"request",
")",
";",
"}",
"else",
"{",
"setSelected",
"(",
"treeRoot",
",",
"selectNode",
",",
"request",
")",
";",
"}",
"}",
"// handle auto expand.",
"String",
"expandNode",
"=",
"null",
";",
"// our we auto expanding this node?",
"expandNode",
"=",
"request",
".",
"getParameter",
"(",
"TreeElement",
".",
"EXPAND_NODE",
")",
";",
"// if we are auto expanding flip the expand of this node if it was expanded",
"if",
"(",
"expandNode",
"!=",
"null",
")",
"{",
"TreeElement",
"n",
"=",
"treeRoot",
".",
"findNode",
"(",
"expandNode",
")",
";",
"if",
"(",
"n",
"!=",
"null",
")",
"{",
"n",
".",
"onExpand",
"(",
"request",
",",
"response",
")",
";",
"n",
".",
"setExpanded",
"(",
"!",
"n",
".",
"isExpanded",
"(",
")",
")",
";",
"}",
"}",
"}"
] | If this tree was selected or expanded this will handle that processing.
@param treeId
@param treeRoot
@param request | [
"If",
"this",
"tree",
"was",
"selected",
"or",
"expanded",
"this",
"will",
"handle",
"that",
"processing",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java#L41-L75 |
riversun/string-grabber | src/main/java/org/riversun/string_grabber/StringCropper.java | StringCropper.getBeforeOf | public String getBeforeOf(String srcStr, String token) {
"""
returns the string that is cropped before token with position-detail-info<br>
@param srcStr
@param token
@return
"""
return getBeforeOfWithDetails(srcStr, token).str;
} | java | public String getBeforeOf(String srcStr, String token) {
return getBeforeOfWithDetails(srcStr, token).str;
} | [
"public",
"String",
"getBeforeOf",
"(",
"String",
"srcStr",
",",
"String",
"token",
")",
"{",
"return",
"getBeforeOfWithDetails",
"(",
"srcStr",
",",
"token",
")",
".",
"str",
";",
"}"
] | returns the string that is cropped before token with position-detail-info<br>
@param srcStr
@param token
@return | [
"returns",
"the",
"string",
"that",
"is",
"cropped",
"before",
"token",
"with",
"position",
"-",
"detail",
"-",
"info<br",
">"
] | train | https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringCropper.java#L221-L223 |
sdl/Testy | src/main/java/com/sdl/selenium/web/XPathBuilder.java | XPathBuilder.setLabel | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setLabel(final String label, final SearchType... searchTypes) {
"""
<p><b>Used for finding element process (to generate xpath address)</b></p>
@param label text label element
@param searchTypes type search text element: see more details see {@link SearchType}
@param <T> the element which calls this method
@return this element
"""
this.label = label;
if (searchTypes != null && searchTypes.length > 0) {
setSearchLabelType(searchTypes);
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setLabel(final String label, final SearchType... searchTypes) {
this.label = label;
if (searchTypes != null && searchTypes.length > 0) {
setSearchLabelType(searchTypes);
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"XPathBuilder",
">",
"T",
"setLabel",
"(",
"final",
"String",
"label",
",",
"final",
"SearchType",
"...",
"searchTypes",
")",
"{",
"this",
".",
"label",
"=",
"label",
";",
"if",
"(",
"searchTypes",
"!=",
"null",
"&&",
"searchTypes",
".",
"length",
">",
"0",
")",
"{",
"setSearchLabelType",
"(",
"searchTypes",
")",
";",
"}",
"return",
"(",
"T",
")",
"this",
";",
"}"
] | <p><b>Used for finding element process (to generate xpath address)</b></p>
@param label text label element
@param searchTypes type search text element: see more details see {@link SearchType}
@param <T> the element which calls this method
@return this element | [
"<p",
">",
"<b",
">",
"Used",
"for",
"finding",
"element",
"process",
"(",
"to",
"generate",
"xpath",
"address",
")",
"<",
"/",
"b",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/XPathBuilder.java#L525-L532 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.calcHiLoValues | private void calcHiLoValues(double y, int index) {
"""
Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index
"""
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
hi = y;
hiIndex = index;
}
} | java | private void calcHiLoValues(double y, int index) {
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
hi = y;
hiIndex = index;
}
} | [
"private",
"void",
"calcHiLoValues",
"(",
"double",
"y",
",",
"int",
"index",
")",
"{",
"if",
"(",
"y",
"<",
"lo",
")",
"{",
"lo",
"=",
"y",
";",
"loIndex",
"=",
"index",
";",
"}",
"if",
"(",
"y",
">",
"hi",
")",
"{",
"hi",
"=",
"y",
";",
"hiIndex",
"=",
"index",
";",
"}",
"}"
] | Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index | [
"Calculates",
"the",
"max",
"and",
"min",
"measured",
"values",
"and",
"stores",
"the",
"index",
"of",
"the",
"related",
"values",
"in",
"in",
"loIndex",
"and",
"hiIndex",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1036-L1046 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountAdjustments | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state, final QueryParams params) {
"""
Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@param state {@link com.ning.billing.recurly.model.Adjustments.AdjustmentState}
@param params {@link QueryParams}
@return the adjustments on the account
"""
final String url = Account.ACCOUNT_RESOURCE + "/" + accountCode + Adjustments.ADJUSTMENTS_RESOURCE;
if (type != null) params.put("type", type.getType());
if (state != null) params.put("state", state.getState());
return doGET(url, Adjustments.class, params);
} | java | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state, final QueryParams params) {
final String url = Account.ACCOUNT_RESOURCE + "/" + accountCode + Adjustments.ADJUSTMENTS_RESOURCE;
if (type != null) params.put("type", type.getType());
if (state != null) params.put("state", state.getState());
return doGET(url, Adjustments.class, params);
} | [
"public",
"Adjustments",
"getAccountAdjustments",
"(",
"final",
"String",
"accountCode",
",",
"final",
"Adjustments",
".",
"AdjustmentType",
"type",
",",
"final",
"Adjustments",
".",
"AdjustmentState",
"state",
",",
"final",
"QueryParams",
"params",
")",
"{",
"final",
"String",
"url",
"=",
"Account",
".",
"ACCOUNT_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
"Adjustments",
".",
"ADJUSTMENTS_RESOURCE",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"params",
".",
"put",
"(",
"\"type\"",
",",
"type",
".",
"getType",
"(",
")",
")",
";",
"if",
"(",
"state",
"!=",
"null",
")",
"params",
".",
"put",
"(",
"\"state\"",
",",
"state",
".",
"getState",
"(",
")",
")",
";",
"return",
"doGET",
"(",
"url",
",",
"Adjustments",
".",
"class",
",",
"params",
")",
";",
"}"
] | Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@param state {@link com.ning.billing.recurly.model.Adjustments.AdjustmentState}
@param params {@link QueryParams}
@return the adjustments on the account | [
"Get",
"Account",
"Adjustments",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L414-L421 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.elementDiv | public static void elementDiv( DMatrix2 a , DMatrix2 b) {
"""
<p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified.
"""
a.a1 /= b.a1;
a.a2 /= b.a2;
} | java | public static void elementDiv( DMatrix2 a , DMatrix2 b) {
a.a1 /= b.a1;
a.a2 /= b.a2;
} | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrix2",
"a",
",",
"DMatrix2",
"b",
")",
"{",
"a",
".",
"a1",
"/=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"/=",
"b",
".",
"a2",
";",
"}"
] | <p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified. | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"i<",
"/",
"sub",
">",
"<br",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L933-L936 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.beginUpdateAsync | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
"""
Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@param appPatch The IoT Central application metadata and security metadata.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AppInner object
"""
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(ServiceResponse<AppInner> response) {
return response.body();
}
});
} | java | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(ServiceResponse<AppInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"AppInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AppPatch",
"appPatch",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"appPatch",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"AppInner",
">",
",",
"AppInner",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"AppInner",
"call",
"(",
"ServiceResponse",
"<",
"AppInner",
">",
"response",
")",
"{",
"return",
"response",
".",
"body",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
] | Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@param appPatch The IoT Central application metadata and security metadata.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AppInner object | [
"Update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L495-L502 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Marshaller.java | Marshaller.isValidId | private static boolean isValidId(Object idValue, DataType identifierType) {
"""
Checks to see if the given value is a valid identifier for the given ID type.
@param idValue
the ID value
@param identifierType
the identifier type
@return <code>true</code>, if the given value is a valid identifier; <code>false</code>,
otherwise. For STRING type, the ID is valid if it it contains at least one printable
character. In other words, if ((String) idValue).trim().length() > 0. For numeric
types, the ID is valid if it is not <code>null</code> or zero.
"""
boolean validId = false;
if (idValue != null) {
switch (identifierType) {
case LONG:
case LONG_OBJECT:
validId = (long) idValue != 0;
break;
case STRING:
validId = ((String) idValue).trim().length() > 0;
break;
default:
// we should never get here
break;
}
}
return validId;
} | java | private static boolean isValidId(Object idValue, DataType identifierType) {
boolean validId = false;
if (idValue != null) {
switch (identifierType) {
case LONG:
case LONG_OBJECT:
validId = (long) idValue != 0;
break;
case STRING:
validId = ((String) idValue).trim().length() > 0;
break;
default:
// we should never get here
break;
}
}
return validId;
} | [
"private",
"static",
"boolean",
"isValidId",
"(",
"Object",
"idValue",
",",
"DataType",
"identifierType",
")",
"{",
"boolean",
"validId",
"=",
"false",
";",
"if",
"(",
"idValue",
"!=",
"null",
")",
"{",
"switch",
"(",
"identifierType",
")",
"{",
"case",
"LONG",
":",
"case",
"LONG_OBJECT",
":",
"validId",
"=",
"(",
"long",
")",
"idValue",
"!=",
"0",
";",
"break",
";",
"case",
"STRING",
":",
"validId",
"=",
"(",
"(",
"String",
")",
"idValue",
")",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
";",
"break",
";",
"default",
":",
"// we should never get here",
"break",
";",
"}",
"}",
"return",
"validId",
";",
"}"
] | Checks to see if the given value is a valid identifier for the given ID type.
@param idValue
the ID value
@param identifierType
the identifier type
@return <code>true</code>, if the given value is a valid identifier; <code>false</code>,
otherwise. For STRING type, the ID is valid if it it contains at least one printable
character. In other words, if ((String) idValue).trim().length() > 0. For numeric
types, the ID is valid if it is not <code>null</code> or zero. | [
"Checks",
"to",
"see",
"if",
"the",
"given",
"value",
"is",
"a",
"valid",
"identifier",
"for",
"the",
"given",
"ID",
"type",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L322-L339 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | @Deprecated
public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull File file) throws IOException {
"""
Writes the word vectors to the given path. Note that this assumes an in memory cache
@param vec the word2vec to write
@param file the file to write
@throws IOException
"""
try (BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
writeWordVectors(vec, write);
}
} | java | @Deprecated
public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull File file) throws IOException {
try (BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
writeWordVectors(vec, write);
}
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"writeWordVectors",
"(",
"@",
"NonNull",
"Word2Vec",
"vec",
",",
"@",
"NonNull",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"write",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
",",
"StandardCharsets",
".",
"UTF_8",
")",
")",
")",
"{",
"writeWordVectors",
"(",
"vec",
",",
"write",
")",
";",
"}",
"}"
] | Writes the word vectors to the given path. Note that this assumes an in memory cache
@param vec the word2vec to write
@param file the file to write
@throws IOException | [
"Writes",
"the",
"word",
"vectors",
"to",
"the",
"given",
"path",
".",
"Note",
"that",
"this",
"assumes",
"an",
"in",
"memory",
"cache"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1496-L1501 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java | SslUtils.getSSLSocketFactory | @Nonnull
public static SSLSocketFactory getSSLSocketFactory(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
"""
Build an {@link SSLSocketFactory} with the given trust store and key store.
@param keyStore path to the given JKS key store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param keyStorePassword password to open the key store
@param trustStore path to the given JKS trust store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param trustStorePassword password to open the trust store
@return the {@link SSLSocketFactory}
"""
SSLContext sslContext = getSslContext(keyStore, keyStorePassword, trustStore, trustStorePassword);
return sslContext.getSocketFactory();
} | java | @Nonnull
public static SSLSocketFactory getSSLSocketFactory(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
SSLContext sslContext = getSslContext(keyStore, keyStorePassword, trustStore, trustStorePassword);
return sslContext.getSocketFactory();
} | [
"@",
"Nonnull",
"public",
"static",
"SSLSocketFactory",
"getSSLSocketFactory",
"(",
"@",
"Nullable",
"String",
"keyStore",
",",
"@",
"Nullable",
"String",
"keyStorePassword",
",",
"@",
"Nullable",
"String",
"trustStore",
",",
"@",
"Nullable",
"String",
"trustStorePassword",
")",
"{",
"SSLContext",
"sslContext",
"=",
"getSslContext",
"(",
"keyStore",
",",
"keyStorePassword",
",",
"trustStore",
",",
"trustStorePassword",
")",
";",
"return",
"sslContext",
".",
"getSocketFactory",
"(",
")",
";",
"}"
] | Build an {@link SSLSocketFactory} with the given trust store and key store.
@param keyStore path to the given JKS key store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param keyStorePassword password to open the key store
@param trustStore path to the given JKS trust store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param trustStorePassword password to open the trust store
@return the {@link SSLSocketFactory} | [
"Build",
"an",
"{",
"@link",
"SSLSocketFactory",
"}",
"with",
"the",
"given",
"trust",
"store",
"and",
"key",
"store",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java#L55-L59 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java | LabelProcessor.getBestMatch | public static String getBestMatch(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
"""
Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale by calling
{@link Locale#getLanguage()}. If no label matches the languageCode, than the first label of any other provided language is returned.
@param locale the locale from which a language code is extracted
@param label the label type which is searched for labels in the language
@return the first label from the label type for the locale
@throws NotAvailableException if no label is provided by the {@code label} argument.
"""
try {
// resolve label via preferred locale.
return getLabelByLanguage(locale.getLanguage(), label);
} catch (NotAvailableException ex) {
try {
// resolve world language label.
return getLabelByLanguage(Locale.ENGLISH, label);
} catch (NotAvailableException exx) {
// resolve any label.
return getFirstLabel(label);
}
}
} | java | public static String getBestMatch(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
try {
// resolve label via preferred locale.
return getLabelByLanguage(locale.getLanguage(), label);
} catch (NotAvailableException ex) {
try {
// resolve world language label.
return getLabelByLanguage(Locale.ENGLISH, label);
} catch (NotAvailableException exx) {
// resolve any label.
return getFirstLabel(label);
}
}
} | [
"public",
"static",
"String",
"getBestMatch",
"(",
"final",
"Locale",
"locale",
",",
"final",
"LabelOrBuilder",
"label",
")",
"throws",
"NotAvailableException",
"{",
"try",
"{",
"// resolve label via preferred locale.",
"return",
"getLabelByLanguage",
"(",
"locale",
".",
"getLanguage",
"(",
")",
",",
"label",
")",
";",
"}",
"catch",
"(",
"NotAvailableException",
"ex",
")",
"{",
"try",
"{",
"// resolve world language label.",
"return",
"getLabelByLanguage",
"(",
"Locale",
".",
"ENGLISH",
",",
"label",
")",
";",
"}",
"catch",
"(",
"NotAvailableException",
"exx",
")",
"{",
"// resolve any label.",
"return",
"getFirstLabel",
"(",
"label",
")",
";",
"}",
"}",
"}"
] | Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale by calling
{@link Locale#getLanguage()}. If no label matches the languageCode, than the first label of any other provided language is returned.
@param locale the locale from which a language code is extracted
@param label the label type which is searched for labels in the language
@return the first label from the label type for the locale
@throws NotAvailableException if no label is provided by the {@code label} argument. | [
"Get",
"the",
"first",
"label",
"for",
"a",
"languageCode",
"from",
"a",
"label",
"type",
".",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#getLabelByLanguage",
"(",
"String",
"LabelOrBuilder",
")",
"}",
"but",
"the",
"language",
"code",
"is",
"extracted",
"from",
"the",
"locale",
"by",
"calling",
"{",
"@link",
"Locale#getLanguage",
"()",
"}",
".",
"If",
"no",
"label",
"matches",
"the",
"languageCode",
"than",
"the",
"first",
"label",
"of",
"any",
"other",
"provided",
"language",
"is",
"returned",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java#L215-L228 |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java | BeanPropertyTypeProvider.setPropertyDestinationType | public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
"""
set the property destination type for given property
@param propertyName
@param destinationType
"""
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType);
} | java | public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType);
} | [
"public",
"void",
"setPropertyDestinationType",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"propertyName",
",",
"TypeReference",
"<",
"?",
">",
"destinationType",
")",
"{",
"propertiesDestinationTypes",
".",
"put",
"(",
"new",
"ClassProperty",
"(",
"clazz",
",",
"propertyName",
")",
",",
"destinationType",
")",
";",
"}"
] | set the property destination type for given property
@param propertyName
@param destinationType | [
"set",
"the",
"property",
"destination",
"type",
"for",
"given",
"property"
] | train | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java#L40-L43 |
wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java | EmbeddedProcessFactory.createStandaloneServer | public static StandaloneServer createStandaloneServer(ModuleLoader moduleLoader, File jbossHomeDir, String... cmdargs) {
"""
Create an embedded standalone server with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root of server installation. Cannot be {@code null} or empty.
@param cmdargs any additional arguments to pass to the embedded server (e.g. -b=192.168.100.10)
@return the running embedded server. Will not be {@code null}
"""
return createStandaloneServer(
Configuration.Builder.of(jbossHomeDir)
.setCommandArguments(cmdargs)
.setModuleLoader(moduleLoader)
.build()
);
} | java | public static StandaloneServer createStandaloneServer(ModuleLoader moduleLoader, File jbossHomeDir, String... cmdargs) {
return createStandaloneServer(
Configuration.Builder.of(jbossHomeDir)
.setCommandArguments(cmdargs)
.setModuleLoader(moduleLoader)
.build()
);
} | [
"public",
"static",
"StandaloneServer",
"createStandaloneServer",
"(",
"ModuleLoader",
"moduleLoader",
",",
"File",
"jbossHomeDir",
",",
"String",
"...",
"cmdargs",
")",
"{",
"return",
"createStandaloneServer",
"(",
"Configuration",
".",
"Builder",
".",
"of",
"(",
"jbossHomeDir",
")",
".",
"setCommandArguments",
"(",
"cmdargs",
")",
".",
"setModuleLoader",
"(",
"moduleLoader",
")",
".",
"build",
"(",
")",
")",
";",
"}"
] | Create an embedded standalone server with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root of server installation. Cannot be {@code null} or empty.
@param cmdargs any additional arguments to pass to the embedded server (e.g. -b=192.168.100.10)
@return the running embedded server. Will not be {@code null} | [
"Create",
"an",
"embedded",
"standalone",
"server",
"with",
"an",
"already",
"established",
"module",
"loader",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java#L133-L140 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskInProgress.java | TaskInProgress.getTaskToRun | public Task getTaskToRun(String taskTracker) {
"""
Return a Task that can be sent to a TaskTracker for execution.
"""
// Create the 'taskid'; do not count the 'killed' tasks against the job!
TaskAttemptID taskid = null;
if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
// Make sure that the attempts are unqiue across restarts
int attemptId = job.getNumRestarts() * NUM_ATTEMPTS_PER_RESTART + nextTaskId;
taskid = new TaskAttemptID( id, attemptId);
++nextTaskId;
} else {
LOG.warn("Exceeded limit of " + (MAX_TASK_EXECS + maxTaskAttempts) +
" (plus " + numKilledTasks + " killed)" +
" attempts for the tip '" + getTIPId() + "'");
return null;
}
//keep track of the last time we started an attempt at this TIP
//used to calculate the progress rate of this TIP
setDispatchTime(taskid, JobTracker.getClock().getTime());
if (0 == execStartTime){
// assume task starts running now
execStartTime = JobTracker.getClock().getTime();
}
return addRunningTask(taskid, taskTracker);
} | java | public Task getTaskToRun(String taskTracker) {
// Create the 'taskid'; do not count the 'killed' tasks against the job!
TaskAttemptID taskid = null;
if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
// Make sure that the attempts are unqiue across restarts
int attemptId = job.getNumRestarts() * NUM_ATTEMPTS_PER_RESTART + nextTaskId;
taskid = new TaskAttemptID( id, attemptId);
++nextTaskId;
} else {
LOG.warn("Exceeded limit of " + (MAX_TASK_EXECS + maxTaskAttempts) +
" (plus " + numKilledTasks + " killed)" +
" attempts for the tip '" + getTIPId() + "'");
return null;
}
//keep track of the last time we started an attempt at this TIP
//used to calculate the progress rate of this TIP
setDispatchTime(taskid, JobTracker.getClock().getTime());
if (0 == execStartTime){
// assume task starts running now
execStartTime = JobTracker.getClock().getTime();
}
return addRunningTask(taskid, taskTracker);
} | [
"public",
"Task",
"getTaskToRun",
"(",
"String",
"taskTracker",
")",
"{",
"// Create the 'taskid'; do not count the 'killed' tasks against the job!",
"TaskAttemptID",
"taskid",
"=",
"null",
";",
"if",
"(",
"nextTaskId",
"<",
"(",
"MAX_TASK_EXECS",
"+",
"maxTaskAttempts",
"+",
"numKilledTasks",
")",
")",
"{",
"// Make sure that the attempts are unqiue across restarts",
"int",
"attemptId",
"=",
"job",
".",
"getNumRestarts",
"(",
")",
"*",
"NUM_ATTEMPTS_PER_RESTART",
"+",
"nextTaskId",
";",
"taskid",
"=",
"new",
"TaskAttemptID",
"(",
"id",
",",
"attemptId",
")",
";",
"++",
"nextTaskId",
";",
"}",
"else",
"{",
"LOG",
".",
"warn",
"(",
"\"Exceeded limit of \"",
"+",
"(",
"MAX_TASK_EXECS",
"+",
"maxTaskAttempts",
")",
"+",
"\" (plus \"",
"+",
"numKilledTasks",
"+",
"\" killed)\"",
"+",
"\" attempts for the tip '\"",
"+",
"getTIPId",
"(",
")",
"+",
"\"'\"",
")",
";",
"return",
"null",
";",
"}",
"//keep track of the last time we started an attempt at this TIP",
"//used to calculate the progress rate of this TIP",
"setDispatchTime",
"(",
"taskid",
",",
"JobTracker",
".",
"getClock",
"(",
")",
".",
"getTime",
"(",
")",
")",
";",
"if",
"(",
"0",
"==",
"execStartTime",
")",
"{",
"// assume task starts running now",
"execStartTime",
"=",
"JobTracker",
".",
"getClock",
"(",
")",
".",
"getTime",
"(",
")",
";",
"}",
"return",
"addRunningTask",
"(",
"taskid",
",",
"taskTracker",
")",
";",
"}"
] | Return a Task that can be sent to a TaskTracker for execution. | [
"Return",
"a",
"Task",
"that",
"can",
"be",
"sent",
"to",
"a",
"TaskTracker",
"for",
"execution",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1223-L1246 |
mapbox/mapbox-plugins-android | plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java | MapLocale.addMapLocale | public static void addMapLocale(@NonNull Locale locale, @NonNull MapLocale mapLocale) {
"""
When creating a new MapLocale, you'll need to associate a {@link Locale} so that
{@link Locale#getDefault()} will find the correct corresponding {@link MapLocale}.
@param locale a valid {@link Locale} instance shares a 1 to 1 relationship with the
{@link MapLocale}
@param mapLocale the {@link MapLocale} which shares a 1 to 1 relationship with the
{@link Locale}
@since 0.1.0
"""
LOCALE_SET.put(locale, mapLocale);
} | java | public static void addMapLocale(@NonNull Locale locale, @NonNull MapLocale mapLocale) {
LOCALE_SET.put(locale, mapLocale);
} | [
"public",
"static",
"void",
"addMapLocale",
"(",
"@",
"NonNull",
"Locale",
"locale",
",",
"@",
"NonNull",
"MapLocale",
"mapLocale",
")",
"{",
"LOCALE_SET",
".",
"put",
"(",
"locale",
",",
"mapLocale",
")",
";",
"}"
] | When creating a new MapLocale, you'll need to associate a {@link Locale} so that
{@link Locale#getDefault()} will find the correct corresponding {@link MapLocale}.
@param locale a valid {@link Locale} instance shares a 1 to 1 relationship with the
{@link MapLocale}
@param mapLocale the {@link MapLocale} which shares a 1 to 1 relationship with the
{@link Locale}
@since 0.1.0 | [
"When",
"creating",
"a",
"new",
"MapLocale",
"you",
"ll",
"need",
"to",
"associate",
"a",
"{",
"@link",
"Locale",
"}",
"so",
"that",
"{",
"@link",
"Locale#getDefault",
"()",
"}",
"will",
"find",
"the",
"correct",
"corresponding",
"{",
"@link",
"MapLocale",
"}",
"."
] | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java#L384-L386 |
alibaba/canal | driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java | UUIDSet.parseInterval | public static Interval parseInterval(String str) {
"""
解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 =>
Interval{start:1, stop:4} 注意!字符串格式表达时[n,m]是两侧都包含的,Interval表达时[n,m)右侧开
@param str
@return
"""
String[] ss = str.split("-");
Interval interval = new Interval();
switch (ss.length) {
case 1:
interval.start = Long.parseLong(ss[0]);
interval.stop = interval.start + 1;
break;
case 2:
interval.start = Long.parseLong(ss[0]);
interval.stop = Long.parseLong(ss[1]) + 1;
break;
default:
throw new RuntimeException(String.format("parseInterval failed due to wrong format: %s", str));
}
return interval;
} | java | public static Interval parseInterval(String str) {
String[] ss = str.split("-");
Interval interval = new Interval();
switch (ss.length) {
case 1:
interval.start = Long.parseLong(ss[0]);
interval.stop = interval.start + 1;
break;
case 2:
interval.start = Long.parseLong(ss[0]);
interval.stop = Long.parseLong(ss[1]) + 1;
break;
default:
throw new RuntimeException(String.format("parseInterval failed due to wrong format: %s", str));
}
return interval;
} | [
"public",
"static",
"Interval",
"parseInterval",
"(",
"String",
"str",
")",
"{",
"String",
"[",
"]",
"ss",
"=",
"str",
".",
"split",
"(",
"\"-\"",
")",
";",
"Interval",
"interval",
"=",
"new",
"Interval",
"(",
")",
";",
"switch",
"(",
"ss",
".",
"length",
")",
"{",
"case",
"1",
":",
"interval",
".",
"start",
"=",
"Long",
".",
"parseLong",
"(",
"ss",
"[",
"0",
"]",
")",
";",
"interval",
".",
"stop",
"=",
"interval",
".",
"start",
"+",
"1",
";",
"break",
";",
"case",
"2",
":",
"interval",
".",
"start",
"=",
"Long",
".",
"parseLong",
"(",
"ss",
"[",
"0",
"]",
")",
";",
"interval",
".",
"stop",
"=",
"Long",
".",
"parseLong",
"(",
"ss",
"[",
"1",
"]",
")",
"+",
"1",
";",
"break",
";",
"default",
":",
"throw",
"new",
"RuntimeException",
"(",
"String",
".",
"format",
"(",
"\"parseInterval failed due to wrong format: %s\"",
",",
"str",
")",
")",
";",
"}",
"return",
"interval",
";",
"}"
] | 解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 =>
Interval{start:1, stop:4} 注意!字符串格式表达时[n,m]是两侧都包含的,Interval表达时[n,m)右侧开
@param str
@return | [
"解析如下格式字符串为Interval",
":",
"1",
"=",
">",
"Interval",
"{",
"start",
":",
"1",
"stop",
":",
"2",
"}",
"1",
"-",
"3",
"=",
">",
"Interval",
"{",
"start",
":",
"1",
"stop",
":",
"4",
"}",
"注意!字符串格式表达时",
"[",
"n",
"m",
"]",
"是两侧都包含的,Interval表达时",
"[",
"n",
"m",
")",
"右侧开"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java#L147-L165 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java | ApplicationManager.modified | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
"""
DS method to modify the configuration of this component
@param compcontext the context of this component
@param properties the updated configuration properties
"""
Boolean autoExpandValue = (Boolean) properties.get("autoExpand");
setExpandApps(autoExpandValue == null ? false : autoExpandValue);
Boolean useJandexValue = getProperty(properties, "useJandex", false);
setUseJandex(useJandexValue == null ? false : useJandexValue);
//System.setProperty("com.ibm.ws.jandex.enable", useJandexValue.toString()); // Temporary -- REMOVE THIS LATER ////
long startTimeoutValue = getProperty(properties, "startTimeout", 30L);
setStartTimeout(startTimeoutValue);
long stopTimeoutValue = getProperty(properties, "stopTimeout", 30L);
setStopTimeout(stopTimeoutValue);
ApplicationStateCoordinator.setApplicationStartTimeout(startTimeoutValue);
ApplicationStateCoordinator.setApplicationStopTimeout(stopTimeoutValue);
} | java | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
Boolean autoExpandValue = (Boolean) properties.get("autoExpand");
setExpandApps(autoExpandValue == null ? false : autoExpandValue);
Boolean useJandexValue = getProperty(properties, "useJandex", false);
setUseJandex(useJandexValue == null ? false : useJandexValue);
//System.setProperty("com.ibm.ws.jandex.enable", useJandexValue.toString()); // Temporary -- REMOVE THIS LATER ////
long startTimeoutValue = getProperty(properties, "startTimeout", 30L);
setStartTimeout(startTimeoutValue);
long stopTimeoutValue = getProperty(properties, "stopTimeout", 30L);
setStopTimeout(stopTimeoutValue);
ApplicationStateCoordinator.setApplicationStartTimeout(startTimeoutValue);
ApplicationStateCoordinator.setApplicationStopTimeout(stopTimeoutValue);
} | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"ComponentContext",
"compcontext",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Boolean",
"autoExpandValue",
"=",
"(",
"Boolean",
")",
"properties",
".",
"get",
"(",
"\"autoExpand\"",
")",
";",
"setExpandApps",
"(",
"autoExpandValue",
"==",
"null",
"?",
"false",
":",
"autoExpandValue",
")",
";",
"Boolean",
"useJandexValue",
"=",
"getProperty",
"(",
"properties",
",",
"\"useJandex\"",
",",
"false",
")",
";",
"setUseJandex",
"(",
"useJandexValue",
"==",
"null",
"?",
"false",
":",
"useJandexValue",
")",
";",
"//System.setProperty(\"com.ibm.ws.jandex.enable\", useJandexValue.toString()); // Temporary -- REMOVE THIS LATER ////",
"long",
"startTimeoutValue",
"=",
"getProperty",
"(",
"properties",
",",
"\"startTimeout\"",
",",
"30L",
")",
";",
"setStartTimeout",
"(",
"startTimeoutValue",
")",
";",
"long",
"stopTimeoutValue",
"=",
"getProperty",
"(",
"properties",
",",
"\"stopTimeout\"",
",",
"30L",
")",
";",
"setStopTimeout",
"(",
"stopTimeoutValue",
")",
";",
"ApplicationStateCoordinator",
".",
"setApplicationStartTimeout",
"(",
"startTimeoutValue",
")",
";",
"ApplicationStateCoordinator",
".",
"setApplicationStopTimeout",
"(",
"stopTimeoutValue",
")",
";",
"}"
] | DS method to modify the configuration of this component
@param compcontext the context of this component
@param properties the updated configuration properties | [
"DS",
"method",
"to",
"modify",
"the",
"configuration",
"of",
"this",
"component"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java#L53-L68 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java | ParagraphBuilder.styledLink | public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) {
"""
Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param url the destination
@return this for fluent style
"""
final ParagraphElement paragraphElement = Link.create(text, ts, url);
this.paragraphElements.add(paragraphElement);
return this;
} | java | public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) {
final ParagraphElement paragraphElement = Link.create(text, ts, url);
this.paragraphElements.add(paragraphElement);
return this;
} | [
"public",
"ParagraphBuilder",
"styledLink",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"URL",
"url",
")",
"{",
"final",
"ParagraphElement",
"paragraphElement",
"=",
"Link",
".",
"create",
"(",
"text",
",",
"ts",
",",
"url",
")",
";",
"this",
".",
"paragraphElements",
".",
"add",
"(",
"paragraphElement",
")",
";",
"return",
"this",
";",
"}"
] | Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param url the destination
@return this for fluent style | [
"Create",
"a",
"styled",
"link",
"in",
"the",
"current",
"paragraph",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java#L161-L165 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.setCurrentLocationToNextValidPosition | private void setCurrentLocationToNextValidPosition(Point aLocation) {
"""
Sets current col/row to valid(empty) pos after addCell/Table
@param aLocation a location in the Table
"""
// set latest location to next valid position
int i, j;
i = aLocation.x;
j = aLocation.y;
do {
if ( (j + 1) == columns ) { // goto next row
i++;
j = 0;
}
else {
j++;
}
}
while (
(i < rows.size()) && (j < columns) && (((Row) rows.get(i)).isReserved(j))
);
curPosition = new Point(i, j);
} | java | private void setCurrentLocationToNextValidPosition(Point aLocation) {
// set latest location to next valid position
int i, j;
i = aLocation.x;
j = aLocation.y;
do {
if ( (j + 1) == columns ) { // goto next row
i++;
j = 0;
}
else {
j++;
}
}
while (
(i < rows.size()) && (j < columns) && (((Row) rows.get(i)).isReserved(j))
);
curPosition = new Point(i, j);
} | [
"private",
"void",
"setCurrentLocationToNextValidPosition",
"(",
"Point",
"aLocation",
")",
"{",
"// set latest location to next valid position",
"int",
"i",
",",
"j",
";",
"i",
"=",
"aLocation",
".",
"x",
";",
"j",
"=",
"aLocation",
".",
"y",
";",
"do",
"{",
"if",
"(",
"(",
"j",
"+",
"1",
")",
"==",
"columns",
")",
"{",
"// goto next row",
"i",
"++",
";",
"j",
"=",
"0",
";",
"}",
"else",
"{",
"j",
"++",
";",
"}",
"}",
"while",
"(",
"(",
"i",
"<",
"rows",
".",
"size",
"(",
")",
")",
"&&",
"(",
"j",
"<",
"columns",
")",
"&&",
"(",
"(",
"(",
"Row",
")",
"rows",
".",
"get",
"(",
"i",
")",
")",
".",
"isReserved",
"(",
"j",
")",
")",
")",
";",
"curPosition",
"=",
"new",
"Point",
"(",
"i",
",",
"j",
")",
";",
"}"
] | Sets current col/row to valid(empty) pos after addCell/Table
@param aLocation a location in the Table | [
"Sets",
"current",
"col",
"/",
"row",
"to",
"valid",
"(",
"empty",
")",
"pos",
"after",
"addCell",
"/",
"Table"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L1294-L1312 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/BGZFSplitCompressionInputStream.java | BGZFSplitCompressionInputStream.readWithinBlock | private int readWithinBlock(byte[] b, int off, int len) throws IOException {
"""
Read up to <code>len</code> bytes from the stream, but no further than the end of the
compressed block. If at the end of the block then no bytes will be read and a return
value of -2 will be returned; on the next call to read, bytes from the next block
will be returned. This is the same contract as CBZip2InputStream in Hadoop.
@return int The return value greater than 0 are the bytes read. A value
of -1 means end of stream while -2 represents end of block.
"""
if (input.endOfBlock()) {
final int available = input.available(); // this will read the next block, if there is one
processedPosition = input.getPosition() >> 16;
if (available == 0) { // end of stream
return -1;
}
return END_OF_BLOCK;
}
// return up to end of block (at most)
int available = input.available();
return input.read(b, off, Math.min(available, len));
} | java | private int readWithinBlock(byte[] b, int off, int len) throws IOException {
if (input.endOfBlock()) {
final int available = input.available(); // this will read the next block, if there is one
processedPosition = input.getPosition() >> 16;
if (available == 0) { // end of stream
return -1;
}
return END_OF_BLOCK;
}
// return up to end of block (at most)
int available = input.available();
return input.read(b, off, Math.min(available, len));
} | [
"private",
"int",
"readWithinBlock",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
".",
"endOfBlock",
"(",
")",
")",
"{",
"final",
"int",
"available",
"=",
"input",
".",
"available",
"(",
")",
";",
"// this will read the next block, if there is one",
"processedPosition",
"=",
"input",
".",
"getPosition",
"(",
")",
">>",
"16",
";",
"if",
"(",
"available",
"==",
"0",
")",
"{",
"// end of stream",
"return",
"-",
"1",
";",
"}",
"return",
"END_OF_BLOCK",
";",
"}",
"// return up to end of block (at most)",
"int",
"available",
"=",
"input",
".",
"available",
"(",
")",
";",
"return",
"input",
".",
"read",
"(",
"b",
",",
"off",
",",
"Math",
".",
"min",
"(",
"available",
",",
"len",
")",
")",
";",
"}"
] | Read up to <code>len</code> bytes from the stream, but no further than the end of the
compressed block. If at the end of the block then no bytes will be read and a return
value of -2 will be returned; on the next call to read, bytes from the next block
will be returned. This is the same contract as CBZip2InputStream in Hadoop.
@return int The return value greater than 0 are the bytes read. A value
of -1 means end of stream while -2 represents end of block. | [
"Read",
"up",
"to",
"<code",
">",
"len<",
"/",
"code",
">",
"bytes",
"from",
"the",
"stream",
"but",
"no",
"further",
"than",
"the",
"end",
"of",
"the",
"compressed",
"block",
".",
"If",
"at",
"the",
"end",
"of",
"the",
"block",
"then",
"no",
"bytes",
"will",
"be",
"read",
"and",
"a",
"return",
"value",
"of",
"-",
"2",
"will",
"be",
"returned",
";",
"on",
"the",
"next",
"call",
"to",
"read",
"bytes",
"from",
"the",
"next",
"block",
"will",
"be",
"returned",
".",
"This",
"is",
"the",
"same",
"contract",
"as",
"CBZip2InputStream",
"in",
"Hadoop",
"."
] | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/BGZFSplitCompressionInputStream.java#L70-L83 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.findAll | @Override
public List<CommerceShippingMethod> findAll() {
"""
Returns all the commerce shipping methods.
@return the commerce shipping methods
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShippingMethod> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShippingMethod",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce shipping methods.
@return the commerce shipping methods | [
"Returns",
"all",
"the",
"commerce",
"shipping",
"methods",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L2007-L2010 |
jblas-project/jblas | src/main/java/org/jblas/util/LibraryLoader.java | LibraryLoader.fatJarLibraryPath | private String fatJarLibraryPath(String linkage, String flavor) {
"""
Compute the path to the library. The path is basically
"/" + os.name + "/" + os.arch + "/" + libname.
"""
String sep = "/"; //System.getProperty("file.separator");
String os_name = getUnifiedOSName();
String os_arch = System.getProperty("os.arch");
String path = sep + "lib" + sep + linkage + sep + os_name + sep + os_arch + sep;
if (null != flavor)
path += flavor + sep;
return path;
} | java | private String fatJarLibraryPath(String linkage, String flavor) {
String sep = "/"; //System.getProperty("file.separator");
String os_name = getUnifiedOSName();
String os_arch = System.getProperty("os.arch");
String path = sep + "lib" + sep + linkage + sep + os_name + sep + os_arch + sep;
if (null != flavor)
path += flavor + sep;
return path;
} | [
"private",
"String",
"fatJarLibraryPath",
"(",
"String",
"linkage",
",",
"String",
"flavor",
")",
"{",
"String",
"sep",
"=",
"\"/\"",
";",
"//System.getProperty(\"file.separator\");\r",
"String",
"os_name",
"=",
"getUnifiedOSName",
"(",
")",
";",
"String",
"os_arch",
"=",
"System",
".",
"getProperty",
"(",
"\"os.arch\"",
")",
";",
"String",
"path",
"=",
"sep",
"+",
"\"lib\"",
"+",
"sep",
"+",
"linkage",
"+",
"sep",
"+",
"os_name",
"+",
"sep",
"+",
"os_arch",
"+",
"sep",
";",
"if",
"(",
"null",
"!=",
"flavor",
")",
"path",
"+=",
"flavor",
"+",
"sep",
";",
"return",
"path",
";",
"}"
] | Compute the path to the library. The path is basically
"/" + os.name + "/" + os.arch + "/" + libname. | [
"Compute",
"the",
"path",
"to",
"the",
"library",
".",
"The",
"path",
"is",
"basically",
"/",
"+",
"os",
".",
"name",
"+",
"/",
"+",
"os",
".",
"arch",
"+",
"/",
"+",
"libname",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L220-L228 |
ACRA/acra | acra-core/src/main/java/org/acra/util/ToastSender.java | ToastSender.sendToast | public static void sendToast(@NonNull Context context, String toast, @IntRange(from = 0, to = 1) int toastLength) {
"""
Sends a Toast and ensures that any Exception thrown during sending is handled.
@param context Application context.
@param toast toast message.
@param toastLength Length of the Toast.
"""
try {
Toast.makeText(context, toast, toastLength).show();
} catch (RuntimeException e) {
ACRA.log.w(LOG_TAG, "Could not send crash Toast", e);
}
} | java | public static void sendToast(@NonNull Context context, String toast, @IntRange(from = 0, to = 1) int toastLength) {
try {
Toast.makeText(context, toast, toastLength).show();
} catch (RuntimeException e) {
ACRA.log.w(LOG_TAG, "Could not send crash Toast", e);
}
} | [
"public",
"static",
"void",
"sendToast",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"String",
"toast",
",",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"1",
")",
"int",
"toastLength",
")",
"{",
"try",
"{",
"Toast",
".",
"makeText",
"(",
"context",
",",
"toast",
",",
"toastLength",
")",
".",
"show",
"(",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"ACRA",
".",
"log",
".",
"w",
"(",
"LOG_TAG",
",",
"\"Could not send crash Toast\"",
",",
"e",
")",
";",
"}",
"}"
] | Sends a Toast and ensures that any Exception thrown during sending is handled.
@param context Application context.
@param toast toast message.
@param toastLength Length of the Toast. | [
"Sends",
"a",
"Toast",
"and",
"ensures",
"that",
"any",
"Exception",
"thrown",
"during",
"sending",
"is",
"handled",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/util/ToastSender.java#L45-L51 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.deleteList | public StatusCode deleteList(String sessionId, String listId) throws MovieDbException {
"""
This method lets users delete a list that they created. A valid session id is required.
@param sessionId
@param listId
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, listId);
parameters.add(Param.SESSION_ID, sessionId);
URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters);
String webpage = httpTools.deleteRequest(url);
try {
return MAPPER.readValue(webpage, StatusCode.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to delete list", url, ex);
}
} | java | public StatusCode deleteList(String sessionId, String listId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, listId);
parameters.add(Param.SESSION_ID, sessionId);
URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters);
String webpage = httpTools.deleteRequest(url);
try {
return MAPPER.readValue(webpage, StatusCode.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to delete list", url, ex);
}
} | [
"public",
"StatusCode",
"deleteList",
"(",
"String",
"sessionId",
",",
"String",
"listId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
",",
"listId",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"SESSION_ID",
",",
"sessionId",
")",
";",
"URL",
"url",
"=",
"new",
"ApiUrl",
"(",
"apiKey",
",",
"MethodBase",
".",
"LIST",
")",
".",
"buildUrl",
"(",
"parameters",
")",
";",
"String",
"webpage",
"=",
"httpTools",
".",
"deleteRequest",
"(",
"url",
")",
";",
"try",
"{",
"return",
"MAPPER",
".",
"readValue",
"(",
"webpage",
",",
"StatusCode",
".",
"class",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"throw",
"new",
"MovieDbException",
"(",
"ApiExceptionType",
".",
"MAPPING_FAILED",
",",
"\"Failed to delete list\"",
",",
"url",
",",
"ex",
")",
";",
"}",
"}"
] | This method lets users delete a list that they created. A valid session id is required.
@param sessionId
@param listId
@return
@throws MovieDbException | [
"This",
"method",
"lets",
"users",
"delete",
"a",
"list",
"that",
"they",
"created",
".",
"A",
"valid",
"session",
"id",
"is",
"required",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L140-L153 |
couchbaselabs/couchbase-lite-java-forestdb | src/main/java/com/couchbase/lite/store/ForestBridge.java | ForestBridge.revisionObject | public static RevisionInternal revisionObject(
Document doc,
String docID,
String revID,
boolean withBody) {
"""
in CBLForestBridge.m
+ (CBL_MutableRevision*) revisionObjectFromForestDoc: (VersionedDocument&)doc
revID: (NSString*)revID
withBody: (BOOL)withBody
"""
boolean deleted = doc.selectedRevDeleted();
if (revID == null)
revID = doc.getSelectedRevID();
RevisionInternal rev = new RevisionInternal(docID, revID, deleted);
rev.setSequence(doc.getSelectedSequence());
if (withBody) {
Status status = loadBodyOfRevisionObject(rev, doc);
if (status.isError() && status.getCode() != Status.GONE)
return null;
}
return rev;
} | java | public static RevisionInternal revisionObject(
Document doc,
String docID,
String revID,
boolean withBody) {
boolean deleted = doc.selectedRevDeleted();
if (revID == null)
revID = doc.getSelectedRevID();
RevisionInternal rev = new RevisionInternal(docID, revID, deleted);
rev.setSequence(doc.getSelectedSequence());
if (withBody) {
Status status = loadBodyOfRevisionObject(rev, doc);
if (status.isError() && status.getCode() != Status.GONE)
return null;
}
return rev;
} | [
"public",
"static",
"RevisionInternal",
"revisionObject",
"(",
"Document",
"doc",
",",
"String",
"docID",
",",
"String",
"revID",
",",
"boolean",
"withBody",
")",
"{",
"boolean",
"deleted",
"=",
"doc",
".",
"selectedRevDeleted",
"(",
")",
";",
"if",
"(",
"revID",
"==",
"null",
")",
"revID",
"=",
"doc",
".",
"getSelectedRevID",
"(",
")",
";",
"RevisionInternal",
"rev",
"=",
"new",
"RevisionInternal",
"(",
"docID",
",",
"revID",
",",
"deleted",
")",
";",
"rev",
".",
"setSequence",
"(",
"doc",
".",
"getSelectedSequence",
"(",
")",
")",
";",
"if",
"(",
"withBody",
")",
"{",
"Status",
"status",
"=",
"loadBodyOfRevisionObject",
"(",
"rev",
",",
"doc",
")",
";",
"if",
"(",
"status",
".",
"isError",
"(",
")",
"&&",
"status",
".",
"getCode",
"(",
")",
"!=",
"Status",
".",
"GONE",
")",
"return",
"null",
";",
"}",
"return",
"rev",
";",
"}"
] | in CBLForestBridge.m
+ (CBL_MutableRevision*) revisionObjectFromForestDoc: (VersionedDocument&)doc
revID: (NSString*)revID
withBody: (BOOL)withBody | [
"in",
"CBLForestBridge",
".",
"m",
"+",
"(",
"CBL_MutableRevision",
"*",
")",
"revisionObjectFromForestDoc",
":",
"(",
"VersionedDocument&",
")",
"doc",
"revID",
":",
"(",
"NSString",
"*",
")",
"revID",
"withBody",
":",
"(",
"BOOL",
")",
"withBody"
] | train | https://github.com/couchbaselabs/couchbase-lite-java-forestdb/blob/fd806b251dd7dcc7a76ab7a8db618e30c3419f06/src/main/java/com/couchbase/lite/store/ForestBridge.java#L40-L57 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.sendNackToPebble | public static void sendNackToPebble(final Context context, final int transactionId)
throws IllegalArgumentException {
"""
Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. To
avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received messages.
@param context
The context used to send the broadcast.
@param transactionId
The transaction id of the message in which the data was received. Valid transaction IDs are between (0,
255).
@throws IllegalArgumentException
Thrown if an invalid transaction id is specified.
"""
if ((transactionId & ~0xff) != 0) {
throw new IllegalArgumentException(String.format(
"transaction id must be between (0, 255); got '%d'", transactionId));
}
final Intent nackIntent = new Intent(INTENT_APP_NACK);
nackIntent.putExtra(TRANSACTION_ID, transactionId);
context.sendBroadcast(nackIntent);
} | java | public static void sendNackToPebble(final Context context, final int transactionId)
throws IllegalArgumentException {
if ((transactionId & ~0xff) != 0) {
throw new IllegalArgumentException(String.format(
"transaction id must be between (0, 255); got '%d'", transactionId));
}
final Intent nackIntent = new Intent(INTENT_APP_NACK);
nackIntent.putExtra(TRANSACTION_ID, transactionId);
context.sendBroadcast(nackIntent);
} | [
"public",
"static",
"void",
"sendNackToPebble",
"(",
"final",
"Context",
"context",
",",
"final",
"int",
"transactionId",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"(",
"transactionId",
"&",
"~",
"0xff",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"transaction id must be between (0, 255); got '%d'\"",
",",
"transactionId",
")",
")",
";",
"}",
"final",
"Intent",
"nackIntent",
"=",
"new",
"Intent",
"(",
"INTENT_APP_NACK",
")",
";",
"nackIntent",
".",
"putExtra",
"(",
"TRANSACTION_ID",
",",
"transactionId",
")",
";",
"context",
".",
"sendBroadcast",
"(",
"nackIntent",
")",
";",
"}"
] | Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. To
avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received messages.
@param context
The context used to send the broadcast.
@param transactionId
The transaction id of the message in which the data was received. Valid transaction IDs are between (0,
255).
@throws IllegalArgumentException
Thrown if an invalid transaction id is specified. | [
"Send",
"a",
"message",
"to",
"the",
"connected",
"watch",
"that",
"the",
"previously",
"sent",
"PebbleDictionary",
"was",
"not",
"received",
"successfully",
".",
"To",
"avoid",
"protocol",
"timeouts",
"on",
"the",
"watch",
"applications",
"<em",
">",
"must<",
"/",
"em",
">",
"ACK",
"or",
"NACK",
"all",
"received",
"messages",
"."
] | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L357-L368 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java | AppPackageUrl.clonePackageUrl | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields) {
"""
Get Resource Url for ClonePackage
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param packageName
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url
"""
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}");
formatter.formatUrl("applicationKey", applicationKey);
formatter.formatUrl("packageName", packageName);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}");
formatter.formatUrl("applicationKey", applicationKey);
formatter.formatUrl("packageName", packageName);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"clonePackageUrl",
"(",
"String",
"applicationKey",
",",
"String",
"packageName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}\"",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"applicationKey\"",
",",
"applicationKey",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"packageName\"",
",",
"packageName",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"responseFields\"",
",",
"responseFields",
")",
";",
"return",
"new",
"MozuUrl",
"(",
"formatter",
".",
"getResourceUrl",
"(",
")",
",",
"MozuUrl",
".",
"UrlLocation",
".",
"TENANT_POD",
")",
";",
"}"
] | Get Resource Url for ClonePackage
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param packageName
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"ClonePackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java#L115-L122 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesUtils.java | PropertiesUtils.loadProperties | public static Properties loadProperties(final URL baseUrl, final String filename) {
"""
Load a file from an directory.
@param baseUrl
Directory URL - Cannot be <code>null</code>.
@param filename
Filename without path - Cannot be <code>null</code>.
@return Properties.
"""
return loadProperties(createUrl(baseUrl, "", filename));
} | java | public static Properties loadProperties(final URL baseUrl, final String filename) {
return loadProperties(createUrl(baseUrl, "", filename));
} | [
"public",
"static",
"Properties",
"loadProperties",
"(",
"final",
"URL",
"baseUrl",
",",
"final",
"String",
"filename",
")",
"{",
"return",
"loadProperties",
"(",
"createUrl",
"(",
"baseUrl",
",",
"\"\"",
",",
"filename",
")",
")",
";",
"}"
] | Load a file from an directory.
@param baseUrl
Directory URL - Cannot be <code>null</code>.
@param filename
Filename without path - Cannot be <code>null</code>.
@return Properties. | [
"Load",
"a",
"file",
"from",
"an",
"directory",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L147-L149 |
roboconf/roboconf-platform | core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java | AllHelper.apply | @Override
public CharSequence apply( final Object computedContext, final Options options ) throws IOException {
"""
Selects instances according to a selection path.
<p>For example:</p>
<pre>
{{#all children path="/VM/Apache" installer="script"}}
{{path}}
{{/all}}
</pre>
"""
// Get parameters
Object context = options.context.model();
String componentPath = null;
if( computedContext instanceof String )
componentPath = (String) computedContext;
if( Utils.isEmptyOrWhitespaces( componentPath ))
componentPath = InstanceFilter.JOKER;
// Process them
CharSequence result = StringUtils.EMPTY;
if (context instanceof ApplicationContextBean) {
// Implicit: all instances of the application.
result = safeApply(((ApplicationContextBean) context).getInstances(), options, componentPath );
} else if (context instanceof InstanceContextBean) {
// Implicit: all descendants of the instance.
result = safeApply( descendantInstances((InstanceContextBean) context), options, componentPath );
} else {
this.logger.warning( "An unexpected context was received: " + (context == null ? null : context.getClass()));
}
return result;
} | java | @Override
public CharSequence apply( final Object computedContext, final Options options ) throws IOException {
// Get parameters
Object context = options.context.model();
String componentPath = null;
if( computedContext instanceof String )
componentPath = (String) computedContext;
if( Utils.isEmptyOrWhitespaces( componentPath ))
componentPath = InstanceFilter.JOKER;
// Process them
CharSequence result = StringUtils.EMPTY;
if (context instanceof ApplicationContextBean) {
// Implicit: all instances of the application.
result = safeApply(((ApplicationContextBean) context).getInstances(), options, componentPath );
} else if (context instanceof InstanceContextBean) {
// Implicit: all descendants of the instance.
result = safeApply( descendantInstances((InstanceContextBean) context), options, componentPath );
} else {
this.logger.warning( "An unexpected context was received: " + (context == null ? null : context.getClass()));
}
return result;
} | [
"@",
"Override",
"public",
"CharSequence",
"apply",
"(",
"final",
"Object",
"computedContext",
",",
"final",
"Options",
"options",
")",
"throws",
"IOException",
"{",
"// Get parameters",
"Object",
"context",
"=",
"options",
".",
"context",
".",
"model",
"(",
")",
";",
"String",
"componentPath",
"=",
"null",
";",
"if",
"(",
"computedContext",
"instanceof",
"String",
")",
"componentPath",
"=",
"(",
"String",
")",
"computedContext",
";",
"if",
"(",
"Utils",
".",
"isEmptyOrWhitespaces",
"(",
"componentPath",
")",
")",
"componentPath",
"=",
"InstanceFilter",
".",
"JOKER",
";",
"// Process them",
"CharSequence",
"result",
"=",
"StringUtils",
".",
"EMPTY",
";",
"if",
"(",
"context",
"instanceof",
"ApplicationContextBean",
")",
"{",
"// Implicit: all instances of the application.",
"result",
"=",
"safeApply",
"(",
"(",
"(",
"ApplicationContextBean",
")",
"context",
")",
".",
"getInstances",
"(",
")",
",",
"options",
",",
"componentPath",
")",
";",
"}",
"else",
"if",
"(",
"context",
"instanceof",
"InstanceContextBean",
")",
"{",
"// Implicit: all descendants of the instance.",
"result",
"=",
"safeApply",
"(",
"descendantInstances",
"(",
"(",
"InstanceContextBean",
")",
"context",
")",
",",
"options",
",",
"componentPath",
")",
";",
"}",
"else",
"{",
"this",
".",
"logger",
".",
"warning",
"(",
"\"An unexpected context was received: \"",
"+",
"(",
"context",
"==",
"null",
"?",
"null",
":",
"context",
".",
"getClass",
"(",
")",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Selects instances according to a selection path.
<p>For example:</p>
<pre>
{{#all children path="/VM/Apache" installer="script"}}
{{path}}
{{/all}}
</pre> | [
"Selects",
"instances",
"according",
"to",
"a",
"selection",
"path",
".",
"<p",
">",
"For",
"example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"{{",
"#all",
"children",
"path",
"=",
"/",
"VM",
"/",
"Apache",
"installer",
"=",
"script",
"}}",
"{{",
"path",
"}}",
"{{",
"/",
"all",
"}}",
"<",
"/",
"pre",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L62-L89 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.writeObjectToFile | public static File writeObjectToFile(final Object o, final String fileName)
throws IOException {
"""
Serialize java object to a file.
@param o
the java object
@param fileName
the name of the file
@return the file
@throws IOException
if io problems
"""
final File outFile = new File(fileName);
OutputStream outputStream = new FileOutputStream(outFile);
if (fileName.endsWith(".gz")) {
outputStream = new GZIPOutputStream(outputStream);
}
outputStream = new BufferedOutputStream(outputStream);
final ObjectOutputStream oos = new ObjectOutputStream(outputStream);
oos.writeObject(o);
oos.close();
return outFile;
} | java | public static File writeObjectToFile(final Object o, final String fileName)
throws IOException {
final File outFile = new File(fileName);
OutputStream outputStream = new FileOutputStream(outFile);
if (fileName.endsWith(".gz")) {
outputStream = new GZIPOutputStream(outputStream);
}
outputStream = new BufferedOutputStream(outputStream);
final ObjectOutputStream oos = new ObjectOutputStream(outputStream);
oos.writeObject(o);
oos.close();
return outFile;
} | [
"public",
"static",
"File",
"writeObjectToFile",
"(",
"final",
"Object",
"o",
",",
"final",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"final",
"File",
"outFile",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"OutputStream",
"outputStream",
"=",
"new",
"FileOutputStream",
"(",
"outFile",
")",
";",
"if",
"(",
"fileName",
".",
"endsWith",
"(",
"\".gz\"",
")",
")",
"{",
"outputStream",
"=",
"new",
"GZIPOutputStream",
"(",
"outputStream",
")",
";",
"}",
"outputStream",
"=",
"new",
"BufferedOutputStream",
"(",
"outputStream",
")",
";",
"final",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputStream",
"(",
"outputStream",
")",
";",
"oos",
".",
"writeObject",
"(",
"o",
")",
";",
"oos",
".",
"close",
"(",
")",
";",
"return",
"outFile",
";",
"}"
] | Serialize java object to a file.
@param o
the java object
@param fileName
the name of the file
@return the file
@throws IOException
if io problems | [
"Serialize",
"java",
"object",
"to",
"a",
"file",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L307-L319 |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java | GlobalProperties.setRangePartitioned | public void setRangePartitioned(Ordering ordering, DataDistribution distribution) {
"""
Set the parameters for range partition.
@param ordering Order of the partitioned fields
@param distribution The data distribution for range partition. User can supply a customized data distribution,
also the data distribution can be null.
"""
if (ordering == null) {
throw new NullPointerException();
}
this.partitioning = PartitioningProperty.RANGE_PARTITIONED;
this.ordering = ordering;
this.partitioningFields = ordering.getInvolvedIndexes();
this.distribution = distribution;
} | java | public void setRangePartitioned(Ordering ordering, DataDistribution distribution) {
if (ordering == null) {
throw new NullPointerException();
}
this.partitioning = PartitioningProperty.RANGE_PARTITIONED;
this.ordering = ordering;
this.partitioningFields = ordering.getInvolvedIndexes();
this.distribution = distribution;
} | [
"public",
"void",
"setRangePartitioned",
"(",
"Ordering",
"ordering",
",",
"DataDistribution",
"distribution",
")",
"{",
"if",
"(",
"ordering",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"this",
".",
"partitioning",
"=",
"PartitioningProperty",
".",
"RANGE_PARTITIONED",
";",
"this",
".",
"ordering",
"=",
"ordering",
";",
"this",
".",
"partitioningFields",
"=",
"ordering",
".",
"getInvolvedIndexes",
"(",
")",
";",
"this",
".",
"distribution",
"=",
"distribution",
";",
"}"
] | Set the parameters for range partition.
@param ordering Order of the partitioned fields
@param distribution The data distribution for range partition. User can supply a customized data distribution,
also the data distribution can be null. | [
"Set",
"the",
"parameters",
"for",
"range",
"partition",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java#L109-L118 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/XMLMergePlugin.java | XMLMergePlugin.getDirectory | public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
"""
从DefaultShellCallback中借用的解析文件夹的函数
@param targetProject target project
@param targetPackage target package
@return file instance
@throws ShellException Cannot get infos form environment
"""
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
// created
// if it does not already exist
File project = new File(targetProject);
if (!project.isDirectory()) {
throw new ShellException(getString("Warning.9", //$NON-NLS-1$
targetProject));
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException(getString("Warning.10", //$NON-NLS-1$
directory.getAbsolutePath()));
}
}
return directory;
} | java | public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
// created
// if it does not already exist
File project = new File(targetProject);
if (!project.isDirectory()) {
throw new ShellException(getString("Warning.9", //$NON-NLS-1$
targetProject));
}
StringBuilder sb = new StringBuilder();
StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
while (st.hasMoreTokens()) {
sb.append(st.nextToken());
sb.append(File.separatorChar);
}
File directory = new File(project, sb.toString());
if (!directory.isDirectory()) {
boolean rc = directory.mkdirs();
if (!rc) {
throw new ShellException(getString("Warning.10", //$NON-NLS-1$
directory.getAbsolutePath()));
}
}
return directory;
} | [
"public",
"File",
"getDirectory",
"(",
"String",
"targetProject",
",",
"String",
"targetPackage",
")",
"throws",
"ShellException",
"{",
"// targetProject is interpreted as a directory that must exist",
"//",
"// targetPackage is interpreted as a sub directory, but in package",
"// format (with dots instead of slashes). The sub directory will be",
"// created",
"// if it does not already exist",
"File",
"project",
"=",
"new",
"File",
"(",
"targetProject",
")",
";",
"if",
"(",
"!",
"project",
".",
"isDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"ShellException",
"(",
"getString",
"(",
"\"Warning.9\"",
",",
"//$NON-NLS-1$",
"targetProject",
")",
")",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"targetPackage",
",",
"\".\"",
")",
";",
"//$NON-NLS-1$",
"while",
"(",
"st",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"sb",
".",
"append",
"(",
"st",
".",
"nextToken",
"(",
")",
")",
";",
"sb",
".",
"append",
"(",
"File",
".",
"separatorChar",
")",
";",
"}",
"File",
"directory",
"=",
"new",
"File",
"(",
"project",
",",
"sb",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"!",
"directory",
".",
"isDirectory",
"(",
")",
")",
"{",
"boolean",
"rc",
"=",
"directory",
".",
"mkdirs",
"(",
")",
";",
"if",
"(",
"!",
"rc",
")",
"{",
"throw",
"new",
"ShellException",
"(",
"getString",
"(",
"\"Warning.10\"",
",",
"//$NON-NLS-1$",
"directory",
".",
"getAbsolutePath",
"(",
")",
")",
")",
";",
"}",
"}",
"return",
"directory",
";",
"}"
] | 从DefaultShellCallback中借用的解析文件夹的函数
@param targetProject target project
@param targetPackage target package
@return file instance
@throws ShellException Cannot get infos form environment | [
"从DefaultShellCallback中借用的解析文件夹的函数"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/XMLMergePlugin.java#L61-L93 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java | ExpressRouteCircuitAuthorizationsInner.beginCreateOrUpdateAsync | public Observable<ExpressRouteCircuitAuthorizationInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) {
"""
Creates or updates an authorization in the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param authorizationName The name of the authorization.
@param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ExpressRouteCircuitAuthorizationInner object
"""
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1<ServiceResponse<ExpressRouteCircuitAuthorizationInner>, ExpressRouteCircuitAuthorizationInner>() {
@Override
public ExpressRouteCircuitAuthorizationInner call(ServiceResponse<ExpressRouteCircuitAuthorizationInner> response) {
return response.body();
}
});
} | java | public Observable<ExpressRouteCircuitAuthorizationInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1<ServiceResponse<ExpressRouteCircuitAuthorizationInner>, ExpressRouteCircuitAuthorizationInner>() {
@Override
public ExpressRouteCircuitAuthorizationInner call(ServiceResponse<ExpressRouteCircuitAuthorizationInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"authorizationName",
",",
"ExpressRouteCircuitAuthorizationInner",
"authorizationParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"circuitName",
",",
"authorizationName",
",",
"authorizationParameters",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
",",
"ExpressRouteCircuitAuthorizationInner",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"ExpressRouteCircuitAuthorizationInner",
"call",
"(",
"ServiceResponse",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
"response",
")",
"{",
"return",
"response",
".",
"body",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
] | Creates or updates an authorization in the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param authorizationName The name of the authorization.
@param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ExpressRouteCircuitAuthorizationInner object | [
"Creates",
"or",
"updates",
"an",
"authorization",
"in",
"the",
"specified",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L473-L480 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/TransformingTreebank.java | TransformingTreebank.main | public static void main(String[] args) {
"""
Loads treebank grammar from first argument and prints it.
Just a demonstration of functionality. <br>
<code>usage: java MemoryTreebank treebankFilesPath</code>
@param args array of command-line arguments
"""
Timing.startTime();
Treebank treebank = new DiskTreebank(new TreeReaderFactory() {
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in);
}
});
Treebank treebank2 = new MemoryTreebank(new TreeReaderFactory() {
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in);
}
});
treebank.loadPath(args[0]);
treebank2.loadPath(args[0]);
CompositeTreebank c = new CompositeTreebank(treebank, treebank2);
Timing.endTime();
TreeTransformer myTransformer = new MyTreeTransformer();
TreeTransformer myTransformer2 = new MyTreeTransformer2();
TreeTransformer myTransformer3 = new MyTreeTransformer3();
Treebank tf1 = c.transform(myTransformer).transform(myTransformer2).transform(myTransformer3);
Treebank tf2 = new TransformingTreebank(new TransformingTreebank(new TransformingTreebank(c, myTransformer), myTransformer2), myTransformer3);
TreeTransformer[] tta = { myTransformer, myTransformer2, myTransformer3 };
TreeTransformer tt3 = new CompositeTreeTransformer(Arrays.asList(tta));
Treebank tf3 = c.transform(tt3);
System.out.println("-------------------------");
System.out.println("COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK");
System.out.println(c);
System.out.println("-------------------------");
System.out.println("SLOWLY TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR");
Treebank tx1 = new TransformingTreebank(c, myTransformer);
System.out.println(tx1);
System.out.println("-----");
Treebank tx2 = new TransformingTreebank(tx1, myTransformer2);
System.out.println(tx2);
System.out.println("-----");
Treebank tx3 = new TransformingTreebank(tx2, myTransformer3);
System.out.println(tx3);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING Treebank.transform()");
System.out.println(tf1);
System.out.println("-------------------------");
System.out.println("PRINTING AGAIN TRANSFORMED TREEBANK, USING Treebank.transform()");
System.out.println(tf1);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR");
System.out.println(tf2);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING CompositeTreeTransformer");
System.out.println(tf3);
System.out.println("-------------------------");
System.out.println("COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK");
System.out.println(c);
System.out.println("-------------------------");
} | java | public static void main(String[] args) {
Timing.startTime();
Treebank treebank = new DiskTreebank(new TreeReaderFactory() {
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in);
}
});
Treebank treebank2 = new MemoryTreebank(new TreeReaderFactory() {
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in);
}
});
treebank.loadPath(args[0]);
treebank2.loadPath(args[0]);
CompositeTreebank c = new CompositeTreebank(treebank, treebank2);
Timing.endTime();
TreeTransformer myTransformer = new MyTreeTransformer();
TreeTransformer myTransformer2 = new MyTreeTransformer2();
TreeTransformer myTransformer3 = new MyTreeTransformer3();
Treebank tf1 = c.transform(myTransformer).transform(myTransformer2).transform(myTransformer3);
Treebank tf2 = new TransformingTreebank(new TransformingTreebank(new TransformingTreebank(c, myTransformer), myTransformer2), myTransformer3);
TreeTransformer[] tta = { myTransformer, myTransformer2, myTransformer3 };
TreeTransformer tt3 = new CompositeTreeTransformer(Arrays.asList(tta));
Treebank tf3 = c.transform(tt3);
System.out.println("-------------------------");
System.out.println("COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK");
System.out.println(c);
System.out.println("-------------------------");
System.out.println("SLOWLY TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR");
Treebank tx1 = new TransformingTreebank(c, myTransformer);
System.out.println(tx1);
System.out.println("-----");
Treebank tx2 = new TransformingTreebank(tx1, myTransformer2);
System.out.println(tx2);
System.out.println("-----");
Treebank tx3 = new TransformingTreebank(tx2, myTransformer3);
System.out.println(tx3);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING Treebank.transform()");
System.out.println(tf1);
System.out.println("-------------------------");
System.out.println("PRINTING AGAIN TRANSFORMED TREEBANK, USING Treebank.transform()");
System.out.println(tf1);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR");
System.out.println(tf2);
System.out.println("-------------------------");
System.out.println("TRANSFORMED TREEBANK, USING CompositeTreeTransformer");
System.out.println(tf3);
System.out.println("-------------------------");
System.out.println("COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK");
System.out.println(c);
System.out.println("-------------------------");
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Timing",
".",
"startTime",
"(",
")",
";",
"Treebank",
"treebank",
"=",
"new",
"DiskTreebank",
"(",
"new",
"TreeReaderFactory",
"(",
")",
"{",
"public",
"TreeReader",
"newTreeReader",
"(",
"Reader",
"in",
")",
"{",
"return",
"new",
"PennTreeReader",
"(",
"in",
")",
";",
"}",
"}",
")",
";",
"Treebank",
"treebank2",
"=",
"new",
"MemoryTreebank",
"(",
"new",
"TreeReaderFactory",
"(",
")",
"{",
"public",
"TreeReader",
"newTreeReader",
"(",
"Reader",
"in",
")",
"{",
"return",
"new",
"PennTreeReader",
"(",
"in",
")",
";",
"}",
"}",
")",
";",
"treebank",
".",
"loadPath",
"(",
"args",
"[",
"0",
"]",
")",
";",
"treebank2",
".",
"loadPath",
"(",
"args",
"[",
"0",
"]",
")",
";",
"CompositeTreebank",
"c",
"=",
"new",
"CompositeTreebank",
"(",
"treebank",
",",
"treebank2",
")",
";",
"Timing",
".",
"endTime",
"(",
")",
";",
"TreeTransformer",
"myTransformer",
"=",
"new",
"MyTreeTransformer",
"(",
")",
";",
"TreeTransformer",
"myTransformer2",
"=",
"new",
"MyTreeTransformer2",
"(",
")",
";",
"TreeTransformer",
"myTransformer3",
"=",
"new",
"MyTreeTransformer3",
"(",
")",
";",
"Treebank",
"tf1",
"=",
"c",
".",
"transform",
"(",
"myTransformer",
")",
".",
"transform",
"(",
"myTransformer2",
")",
".",
"transform",
"(",
"myTransformer3",
")",
";",
"Treebank",
"tf2",
"=",
"new",
"TransformingTreebank",
"(",
"new",
"TransformingTreebank",
"(",
"new",
"TransformingTreebank",
"(",
"c",
",",
"myTransformer",
")",
",",
"myTransformer2",
")",
",",
"myTransformer3",
")",
";",
"TreeTransformer",
"[",
"]",
"tta",
"=",
"{",
"myTransformer",
",",
"myTransformer2",
",",
"myTransformer3",
"}",
";",
"TreeTransformer",
"tt3",
"=",
"new",
"CompositeTreeTransformer",
"(",
"Arrays",
".",
"asList",
"(",
"tta",
")",
")",
";",
"Treebank",
"tf3",
"=",
"c",
".",
"transform",
"(",
"tt3",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"c",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"SLOWLY TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR\"",
")",
";",
"Treebank",
"tx1",
"=",
"new",
"TransformingTreebank",
"(",
"c",
",",
"myTransformer",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tx1",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-----\"",
")",
";",
"Treebank",
"tx2",
"=",
"new",
"TransformingTreebank",
"(",
"tx1",
",",
"myTransformer2",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tx2",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-----\"",
")",
";",
"Treebank",
"tx3",
"=",
"new",
"TransformingTreebank",
"(",
"tx2",
",",
"myTransformer3",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tx3",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"TRANSFORMED TREEBANK, USING Treebank.transform()\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tf1",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"PRINTING AGAIN TRANSFORMED TREEBANK, USING Treebank.transform()\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tf1",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"TRANSFORMED TREEBANK, USING TransformingTreebank() CONSTRUCTOR\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tf2",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"TRANSFORMED TREEBANK, USING CompositeTreeTransformer\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"tf3",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"COMPOSITE (DISK THEN MEMORY REPEATED VERSION OF) INPUT TREEBANK\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"c",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"-------------------------\"",
")",
";",
"}"
] | Loads treebank grammar from first argument and prints it.
Just a demonstration of functionality. <br>
<code>usage: java MemoryTreebank treebankFilesPath</code>
@param args array of command-line arguments | [
"Loads",
"treebank",
"grammar",
"from",
"first",
"argument",
"and",
"prints",
"it",
".",
"Just",
"a",
"demonstration",
"of",
"functionality",
".",
"<br",
">",
"<code",
">",
"usage",
":",
"java",
"MemoryTreebank",
"treebankFilesPath<",
"/",
"code",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TransformingTreebank.java#L127-L181 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java | CategoryGraph.getLCS | public Category getLCS(Category category1, Category category2) throws WikiApiException {
"""
Gets the lowest common subsumer (LCS) of two nodes.
The LCS of two nodes is first node on the path to the root, that has both nodes as sons.
Nodes that are not in the same connected component as the root node are defined to have no LCS.
@param category1 The first category node.
@param category2 The second category node.
@return The lowest common subsumer of the two nodes, or null if there is no LCS.
"""
return getLCS(category1.getPageId(),category2.getPageId());
} | java | public Category getLCS(Category category1, Category category2) throws WikiApiException {
return getLCS(category1.getPageId(),category2.getPageId());
} | [
"public",
"Category",
"getLCS",
"(",
"Category",
"category1",
",",
"Category",
"category2",
")",
"throws",
"WikiApiException",
"{",
"return",
"getLCS",
"(",
"category1",
".",
"getPageId",
"(",
")",
",",
"category2",
".",
"getPageId",
"(",
")",
")",
";",
"}"
] | Gets the lowest common subsumer (LCS) of two nodes.
The LCS of two nodes is first node on the path to the root, that has both nodes as sons.
Nodes that are not in the same connected component as the root node are defined to have no LCS.
@param category1 The first category node.
@param category2 The second category node.
@return The lowest common subsumer of the two nodes, or null if there is no LCS. | [
"Gets",
"the",
"lowest",
"common",
"subsumer",
"(",
"LCS",
")",
"of",
"two",
"nodes",
".",
"The",
"LCS",
"of",
"two",
"nodes",
"is",
"first",
"node",
"on",
"the",
"path",
"to",
"the",
"root",
"that",
"has",
"both",
"nodes",
"as",
"sons",
".",
"Nodes",
"that",
"are",
"not",
"in",
"the",
"same",
"connected",
"component",
"as",
"the",
"root",
"node",
"are",
"defined",
"to",
"have",
"no",
"LCS",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L397-L399 |
linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java | MockMethodAdvice.isOverridden | public boolean isOverridden(Object instance, Method origin) {
"""
Check if a method is overridden.
@param instance mocked instance
@param origin method that might be overridden
@return {@code true} iff the method is overridden
"""
Class<?> currentType = instance.getClass();
do {
try {
return !origin.equals(currentType.getDeclaredMethod(origin.getName(),
origin.getParameterTypes()));
} catch (NoSuchMethodException ignored) {
currentType = currentType.getSuperclass();
}
} while (currentType != null);
return true;
} | java | public boolean isOverridden(Object instance, Method origin) {
Class<?> currentType = instance.getClass();
do {
try {
return !origin.equals(currentType.getDeclaredMethod(origin.getName(),
origin.getParameterTypes()));
} catch (NoSuchMethodException ignored) {
currentType = currentType.getSuperclass();
}
} while (currentType != null);
return true;
} | [
"public",
"boolean",
"isOverridden",
"(",
"Object",
"instance",
",",
"Method",
"origin",
")",
"{",
"Class",
"<",
"?",
">",
"currentType",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"do",
"{",
"try",
"{",
"return",
"!",
"origin",
".",
"equals",
"(",
"currentType",
".",
"getDeclaredMethod",
"(",
"origin",
".",
"getName",
"(",
")",
",",
"origin",
".",
"getParameterTypes",
"(",
")",
")",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodException",
"ignored",
")",
"{",
"currentType",
"=",
"currentType",
".",
"getSuperclass",
"(",
")",
";",
"}",
"}",
"while",
"(",
"currentType",
"!=",
"null",
")",
";",
"return",
"true",
";",
"}"
] | Check if a method is overridden.
@param instance mocked instance
@param origin method that might be overridden
@return {@code true} iff the method is overridden | [
"Check",
"if",
"a",
"method",
"is",
"overridden",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java#L239-L252 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.getCertificate | public static Certificate getCertificate(KeyStore keyStore, String alias) {
"""
获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate}
"""
return KeyUtil.getCertificate(keyStore, alias);
} | java | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | [
"public",
"static",
"Certificate",
"getCertificate",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
")",
"{",
"return",
"KeyUtil",
".",
"getCertificate",
"(",
"keyStore",
",",
"alias",
")",
";",
"}"
] | 获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate} | [
"获得",
"Certification"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L388-L390 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.replaceOrPushUserParam | private void replaceOrPushUserParam(QName qname, XObject xval) {
"""
NEEDSDOC Method replaceOrPushUserParam
NEEDSDOC @param qname
NEEDSDOC @param xval
"""
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--)
{
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname))
{
m_userParams.setElementAt(new Arg(qname, xval, true), i);
return;
}
}
m_userParams.addElement(new Arg(qname, xval, true));
} | java | private void replaceOrPushUserParam(QName qname, XObject xval)
{
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--)
{
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname))
{
m_userParams.setElementAt(new Arg(qname, xval, true), i);
return;
}
}
m_userParams.addElement(new Arg(qname, xval, true));
} | [
"private",
"void",
"replaceOrPushUserParam",
"(",
"QName",
"qname",
",",
"XObject",
"xval",
")",
"{",
"int",
"n",
"=",
"m_userParams",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"n",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"Arg",
"arg",
"=",
"(",
"Arg",
")",
"m_userParams",
".",
"elementAt",
"(",
"i",
")",
";",
"if",
"(",
"arg",
".",
"getQName",
"(",
")",
".",
"equals",
"(",
"qname",
")",
")",
"{",
"m_userParams",
".",
"setElementAt",
"(",
"new",
"Arg",
"(",
"qname",
",",
"xval",
",",
"true",
")",
",",
"i",
")",
";",
"return",
";",
"}",
"}",
"m_userParams",
".",
"addElement",
"(",
"new",
"Arg",
"(",
"qname",
",",
"xval",
",",
"true",
")",
")",
";",
"}"
] | NEEDSDOC Method replaceOrPushUserParam
NEEDSDOC @param qname
NEEDSDOC @param xval | [
"NEEDSDOC",
"Method",
"replaceOrPushUserParam"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1461-L1479 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java | AccessibilityNodeInfoUtils.isClickable | public static boolean isClickable(AccessibilityNodeInfoCompat node) {
"""
Returns whether a node is clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_CLICK}</li>
</ul>
@param node The node to examine.
@return {@code true} if node is clickable.
"""
if (node == null) {
return false;
}
if (node.isClickable()) {
return true;
}
return supportsAnyAction(node, AccessibilityNodeInfoCompat.ACTION_CLICK);
} | java | public static boolean isClickable(AccessibilityNodeInfoCompat node) {
if (node == null) {
return false;
}
if (node.isClickable()) {
return true;
}
return supportsAnyAction(node, AccessibilityNodeInfoCompat.ACTION_CLICK);
} | [
"public",
"static",
"boolean",
"isClickable",
"(",
"AccessibilityNodeInfoCompat",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
".",
"isClickable",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"supportsAnyAction",
"(",
"node",
",",
"AccessibilityNodeInfoCompat",
".",
"ACTION_CLICK",
")",
";",
"}"
] | Returns whether a node is clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_CLICK}</li>
</ul>
@param node The node to examine.
@return {@code true} if node is clickable. | [
"Returns",
"whether",
"a",
"node",
"is",
"clickable",
".",
"That",
"is",
"the",
"node",
"supports",
"at",
"least",
"one",
"of",
"the",
"following",
":",
"<ul",
">",
"<li",
">",
"{",
"@link",
"AccessibilityNodeInfoCompat#isClickable",
"()",
"}",
"<",
"/",
"li",
">",
"<li",
">",
"{",
"@link",
"AccessibilityNodeInfoCompat#ACTION_CLICK",
"}",
"<",
"/",
"li",
">",
"<",
"/",
"ul",
">"
] | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java#L364-L374 |
pierre/serialization | thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java | ThriftToThriftEnvelopeEvent.extractEvent | public static ThriftEnvelopeEvent extractEvent(final String type, final byte[] payload) throws TException {
"""
Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param payload serialized Thrift
@return ThriftEnvelopeEvent representing the Thrift (the event timestamp defaults to now())
@throws TException if the payload is not a valid Thrift
"""
return extractEvent(type, new DateTime(), payload);
} | java | public static ThriftEnvelopeEvent extractEvent(final String type, final byte[] payload) throws TException
{
return extractEvent(type, new DateTime(), payload);
} | [
"public",
"static",
"ThriftEnvelopeEvent",
"extractEvent",
"(",
"final",
"String",
"type",
",",
"final",
"byte",
"[",
"]",
"payload",
")",
"throws",
"TException",
"{",
"return",
"extractEvent",
"(",
"type",
",",
"new",
"DateTime",
"(",
")",
",",
"payload",
")",
";",
"}"
] | Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param payload serialized Thrift
@return ThriftEnvelopeEvent representing the Thrift (the event timestamp defaults to now())
@throws TException if the payload is not a valid Thrift | [
"Given",
"a",
"serialized",
"Thrift",
"generate",
"a",
"ThrifTEnvelopeEvent"
] | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java#L86-L89 |
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java | JSONObject.writeAttribute | private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
throws IOException {
"""
Internal method to write out a proper JSON attribute string.
@param writer The writer to use while serializing
@param name The attribute name to use.
@param value The value to assign to the attribute.
@param depth How far to indent the JSON text.
@param compact Flag to denote whether or not to use pretty indention, or compact format, when writing.
@throws IOException Trhown if an error occurs on write.
"""
if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeAttribute(Writer, String, String, int)");
if (!compact)
{
writeIndention(writer, depth);
}
try
{
if (!compact)
{
writer.write("\"" + name + "\"" + " : " + "\"" + escapeStringSpecialCharacters(value) + "\"");
}
else
{
writer.write("\"" + name + "\"" + ":" + "\"" + escapeStringSpecialCharacters(value) + "\"");
}
}
catch (Exception ex)
{
IOException iox = new IOException("Error occurred on serialization of JSON text.");
iox.initCause(ex);
throw iox;
}
if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeAttribute(Writer, String, String, int)");
} | java | private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
throws IOException
{
if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeAttribute(Writer, String, String, int)");
if (!compact)
{
writeIndention(writer, depth);
}
try
{
if (!compact)
{
writer.write("\"" + name + "\"" + " : " + "\"" + escapeStringSpecialCharacters(value) + "\"");
}
else
{
writer.write("\"" + name + "\"" + ":" + "\"" + escapeStringSpecialCharacters(value) + "\"");
}
}
catch (Exception ex)
{
IOException iox = new IOException("Error occurred on serialization of JSON text.");
iox.initCause(ex);
throw iox;
}
if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeAttribute(Writer, String, String, int)");
} | [
"private",
"void",
"writeAttribute",
"(",
"Writer",
"writer",
",",
"String",
"name",
",",
"String",
"value",
",",
"int",
"depth",
",",
"boolean",
"compact",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"logger",
".",
"entering",
"(",
"className",
",",
"\"writeAttribute(Writer, String, String, int)\"",
")",
";",
"if",
"(",
"!",
"compact",
")",
"{",
"writeIndention",
"(",
"writer",
",",
"depth",
")",
";",
"}",
"try",
"{",
"if",
"(",
"!",
"compact",
")",
"{",
"writer",
".",
"write",
"(",
"\"\\\"\"",
"+",
"name",
"+",
"\"\\\"\"",
"+",
"\" : \"",
"+",
"\"\\\"\"",
"+",
"escapeStringSpecialCharacters",
"(",
"value",
")",
"+",
"\"\\\"\"",
")",
";",
"}",
"else",
"{",
"writer",
".",
"write",
"(",
"\"\\\"\"",
"+",
"name",
"+",
"\"\\\"\"",
"+",
"\":\"",
"+",
"\"\\\"\"",
"+",
"escapeStringSpecialCharacters",
"(",
"value",
")",
"+",
"\"\\\"\"",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"IOException",
"iox",
"=",
"new",
"IOException",
"(",
"\"Error occurred on serialization of JSON text.\"",
")",
";",
"iox",
".",
"initCause",
"(",
"ex",
")",
";",
"throw",
"iox",
";",
"}",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"logger",
".",
"exiting",
"(",
"className",
",",
"\"writeAttribute(Writer, String, String, int)\"",
")",
";",
"}"
] | Internal method to write out a proper JSON attribute string.
@param writer The writer to use while serializing
@param name The attribute name to use.
@param value The value to assign to the attribute.
@param depth How far to indent the JSON text.
@param compact Flag to denote whether or not to use pretty indention, or compact format, when writing.
@throws IOException Trhown if an error occurs on write. | [
"Internal",
"method",
"to",
"write",
"out",
"a",
"proper",
"JSON",
"attribute",
"string",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java#L205-L234 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withBody | public HttpRequest withBody(String body, Charset charset) {
"""
The exact string body to match on such as "this is an exact string body"
@param body the body on such as "this is an exact string body"
@param charset character set the string will be encoded in
"""
if (body != null) {
this.body = new StringBody(body, charset);
}
return this;
} | java | public HttpRequest withBody(String body, Charset charset) {
if (body != null) {
this.body = new StringBody(body, charset);
}
return this;
} | [
"public",
"HttpRequest",
"withBody",
"(",
"String",
"body",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"body",
"!=",
"null",
")",
"{",
"this",
".",
"body",
"=",
"new",
"StringBody",
"(",
"body",
",",
"charset",
")",
";",
"}",
"return",
"this",
";",
"}"
] | The exact string body to match on such as "this is an exact string body"
@param body the body on such as "this is an exact string body"
@param charset character set the string will be encoded in | [
"The",
"exact",
"string",
"body",
"to",
"match",
"on",
"such",
"as",
"this",
"is",
"an",
"exact",
"string",
"body"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L249-L254 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.task_contactChange_id_GET | public net.minidev.ovh.api.nichandle.contactchange.OvhTask task_contactChange_id_GET(Long id) throws IOException {
"""
Get this object properties
REST: GET /me/task/contactChange/{id}
@param id [required]
"""
String qPath = "/me/task/contactChange/{id}";
StringBuilder sb = path(qPath, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, net.minidev.ovh.api.nichandle.contactchange.OvhTask.class);
} | java | public net.minidev.ovh.api.nichandle.contactchange.OvhTask task_contactChange_id_GET(Long id) throws IOException {
String qPath = "/me/task/contactChange/{id}";
StringBuilder sb = path(qPath, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, net.minidev.ovh.api.nichandle.contactchange.OvhTask.class);
} | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"nichandle",
".",
"contactchange",
".",
"OvhTask",
"task_contactChange_id_GET",
"(",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/task/contactChange/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
"qPath",
",",
"\"GET\"",
",",
"sb",
".",
"toString",
"(",
")",
",",
"null",
")",
";",
"return",
"convertTo",
"(",
"resp",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"nichandle",
".",
"contactchange",
".",
"OvhTask",
".",
"class",
")",
";",
"}"
] | Get this object properties
REST: GET /me/task/contactChange/{id}
@param id [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2491-L2496 |
apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java | FluoConfigurationImpl.getTxIfoCacheTimeout | public static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu) {
"""
Gets the time before stale entries in the cache are evicted based on age. This method returns a
long representing the time converted from the TimeUnit passed in.
@param conf The FluoConfiguration
@param tu The TimeUnit desired to represent the cache timeout
"""
long millis = conf.getLong(TX_INFO_CACHE_TIMEOUT, TX_INFO_CACHE_TIMEOUT_DEFAULT);
if (millis <= 0) {
throw new IllegalArgumentException("Timeout must positive for " + TX_INFO_CACHE_TIMEOUT);
}
return tu.convert(millis, TimeUnit.MILLISECONDS);
} | java | public static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu) {
long millis = conf.getLong(TX_INFO_CACHE_TIMEOUT, TX_INFO_CACHE_TIMEOUT_DEFAULT);
if (millis <= 0) {
throw new IllegalArgumentException("Timeout must positive for " + TX_INFO_CACHE_TIMEOUT);
}
return tu.convert(millis, TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"long",
"getTxIfoCacheTimeout",
"(",
"FluoConfiguration",
"conf",
",",
"TimeUnit",
"tu",
")",
"{",
"long",
"millis",
"=",
"conf",
".",
"getLong",
"(",
"TX_INFO_CACHE_TIMEOUT",
",",
"TX_INFO_CACHE_TIMEOUT_DEFAULT",
")",
";",
"if",
"(",
"millis",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Timeout must positive for \"",
"+",
"TX_INFO_CACHE_TIMEOUT",
")",
";",
"}",
"return",
"tu",
".",
"convert",
"(",
"millis",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
";",
"}"
] | Gets the time before stale entries in the cache are evicted based on age. This method returns a
long representing the time converted from the TimeUnit passed in.
@param conf The FluoConfiguration
@param tu The TimeUnit desired to represent the cache timeout | [
"Gets",
"the",
"time",
"before",
"stale",
"entries",
"in",
"the",
"cache",
"are",
"evicted",
"based",
"on",
"age",
".",
"This",
"method",
"returns",
"a",
"long",
"representing",
"the",
"time",
"converted",
"from",
"the",
"TimeUnit",
"passed",
"in",
"."
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L138-L144 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/historic/AbstractChartBuilder.java | AbstractChartBuilder.addSubTitle | protected void addSubTitle(JFreeChart chart, String subTitle, Font font) {
"""
<p>addSubTitle.</p>
@param chart a {@link org.jfree.chart.JFreeChart} object.
@param subTitle a {@link java.lang.String} object.
@param font a {@link java.awt.Font} object.
"""
if (StringUtils.isNotEmpty(subTitle))
{
TextTitle chartSubTitle = new TextTitle(subTitle);
customizeTitle(chartSubTitle, font);
chart.addSubtitle(chartSubTitle);
}
} | java | protected void addSubTitle(JFreeChart chart, String subTitle, Font font)
{
if (StringUtils.isNotEmpty(subTitle))
{
TextTitle chartSubTitle = new TextTitle(subTitle);
customizeTitle(chartSubTitle, font);
chart.addSubtitle(chartSubTitle);
}
} | [
"protected",
"void",
"addSubTitle",
"(",
"JFreeChart",
"chart",
",",
"String",
"subTitle",
",",
"Font",
"font",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"subTitle",
")",
")",
"{",
"TextTitle",
"chartSubTitle",
"=",
"new",
"TextTitle",
"(",
"subTitle",
")",
";",
"customizeTitle",
"(",
"chartSubTitle",
",",
"font",
")",
";",
"chart",
".",
"addSubtitle",
"(",
"chartSubTitle",
")",
";",
"}",
"}"
] | <p>addSubTitle.</p>
@param chart a {@link org.jfree.chart.JFreeChart} object.
@param subTitle a {@link java.lang.String} object.
@param font a {@link java.awt.Font} object. | [
"<p",
">",
"addSubTitle",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/historic/AbstractChartBuilder.java#L180-L188 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAllEnterpriseUsers | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
"""
Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields
to retrieve from the API.
@param api the API connection to be used when retrieving the users.
@param filterTerm used to filter the results to only users starting with this string in either the name or the
login. Can be null to not filter the results.
@param fields the fields to retrieve. Leave this out for the standard fields.
@return an iterable containing all the enterprise users that matches the filter.
"""
return getUsersInfoForType(api, filterTerm, null, null, fields);
} | java | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
return getUsersInfoForType(api, filterTerm, null, null, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getAllEnterpriseUsers",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"filterTerm",
",",
"final",
"String",
"...",
"fields",
")",
"{",
"return",
"getUsersInfoForType",
"(",
"api",
",",
"filterTerm",
",",
"null",
",",
"null",
",",
"fields",
")",
";",
"}"
] | Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields
to retrieve from the API.
@param api the API connection to be used when retrieving the users.
@param filterTerm used to filter the results to only users starting with this string in either the name or the
login. Can be null to not filter the results.
@param fields the fields to retrieve. Leave this out for the standard fields.
@return an iterable containing all the enterprise users that matches the filter. | [
"Returns",
"an",
"iterable",
"containing",
"all",
"the",
"enterprise",
"users",
"that",
"matches",
"the",
"filter",
"and",
"specifies",
"which",
"child",
"fields",
"to",
"retrieve",
"from",
"the",
"API",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L191-L194 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java | PolicyAssignmentsInner.createAsync | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
"""
Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment.
@param parameters Parameters for the policy assignment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PolicyAssignmentInner object
"""
return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
} | java | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner call(ServiceResponse<PolicyAssignmentInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"PolicyAssignmentInner",
">",
"createAsync",
"(",
"String",
"scope",
",",
"String",
"policyAssignmentName",
",",
"PolicyAssignmentInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"scope",
",",
"policyAssignmentName",
",",
"parameters",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"PolicyAssignmentInner",
">",
",",
"PolicyAssignmentInner",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"PolicyAssignmentInner",
"call",
"(",
"ServiceResponse",
"<",
"PolicyAssignmentInner",
">",
"response",
")",
"{",
"return",
"response",
".",
"body",
"(",
")",
";",
"}",
"}",
")",
";",
"}"
] | Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment.
@param parameters Parameters for the policy assignment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PolicyAssignmentInner object | [
"Creates",
"a",
"policy",
"assignment",
".",
"Policy",
"assignments",
"are",
"inherited",
"by",
"child",
"resources",
".",
"For",
"example",
"when",
"you",
"apply",
"a",
"policy",
"to",
"a",
"resource",
"group",
"that",
"policy",
"is",
"assigned",
"to",
"all",
"resources",
"in",
"the",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java#L241-L248 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withDiskStoreThreadPool | public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) {
"""
Adds a {@link ServiceConfiguration} for the {@link org.ehcache.impl.internal.store.disk.OffHeapDiskStore.Provider}
indicating thread pool alias and write concurrency.
@param threadPoolAlias the thread pool alias
@param concurrency the write concurrency
@return a new builder with the added configuration
"""
return addOrReplaceConfiguration(new OffHeapDiskStoreConfiguration(threadPoolAlias, concurrency));
} | java | public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) {
return addOrReplaceConfiguration(new OffHeapDiskStoreConfiguration(threadPoolAlias, concurrency));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withDiskStoreThreadPool",
"(",
"String",
"threadPoolAlias",
",",
"int",
"concurrency",
")",
"{",
"return",
"addOrReplaceConfiguration",
"(",
"new",
"OffHeapDiskStoreConfiguration",
"(",
"threadPoolAlias",
",",
"concurrency",
")",
")",
";",
"}"
] | Adds a {@link ServiceConfiguration} for the {@link org.ehcache.impl.internal.store.disk.OffHeapDiskStore.Provider}
indicating thread pool alias and write concurrency.
@param threadPoolAlias the thread pool alias
@param concurrency the write concurrency
@return a new builder with the added configuration | [
"Adds",
"a",
"{",
"@link",
"ServiceConfiguration",
"}",
"for",
"the",
"{",
"@link",
"org",
".",
"ehcache",
".",
"impl",
".",
"internal",
".",
"store",
".",
"disk",
".",
"OffHeapDiskStore",
".",
"Provider",
"}",
"indicating",
"thread",
"pool",
"alias",
"and",
"write",
"concurrency",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L526-L528 |
alkacon/opencms-core | src-gwt/org/opencms/ugc/client/CmsRpcCallHelper.java | CmsRpcCallHelper.executeRpc | @SuppressWarnings("synthetic-access")
public void executeRpc(RequestBuilder requestBuilder) {
"""
Executes the RPC call.<p>
@param requestBuilder the request builder returned by the service interface
"""
final RequestCallback callback = requestBuilder.getCallback();
RequestCallback callbackWrapper = new RequestCallback() {
public void onError(com.google.gwt.http.client.Request request, Throwable exception) {
m_requestCounter.decrement();
callback.onError(request, exception);
}
public void onResponseReceived(
com.google.gwt.http.client.Request request,
com.google.gwt.http.client.Response response) {
m_requestCounter.decrement();
callback.onResponseReceived(request, response);
}
};
requestBuilder.setCallback(callbackWrapper);
m_requestCounter.increment();
try {
requestBuilder.send();
} catch (Exception e) {
m_requestCounter.decrement();
}
} | java | @SuppressWarnings("synthetic-access")
public void executeRpc(RequestBuilder requestBuilder) {
final RequestCallback callback = requestBuilder.getCallback();
RequestCallback callbackWrapper = new RequestCallback() {
public void onError(com.google.gwt.http.client.Request request, Throwable exception) {
m_requestCounter.decrement();
callback.onError(request, exception);
}
public void onResponseReceived(
com.google.gwt.http.client.Request request,
com.google.gwt.http.client.Response response) {
m_requestCounter.decrement();
callback.onResponseReceived(request, response);
}
};
requestBuilder.setCallback(callbackWrapper);
m_requestCounter.increment();
try {
requestBuilder.send();
} catch (Exception e) {
m_requestCounter.decrement();
}
} | [
"@",
"SuppressWarnings",
"(",
"\"synthetic-access\"",
")",
"public",
"void",
"executeRpc",
"(",
"RequestBuilder",
"requestBuilder",
")",
"{",
"final",
"RequestCallback",
"callback",
"=",
"requestBuilder",
".",
"getCallback",
"(",
")",
";",
"RequestCallback",
"callbackWrapper",
"=",
"new",
"RequestCallback",
"(",
")",
"{",
"public",
"void",
"onError",
"(",
"com",
".",
"google",
".",
"gwt",
".",
"http",
".",
"client",
".",
"Request",
"request",
",",
"Throwable",
"exception",
")",
"{",
"m_requestCounter",
".",
"decrement",
"(",
")",
";",
"callback",
".",
"onError",
"(",
"request",
",",
"exception",
")",
";",
"}",
"public",
"void",
"onResponseReceived",
"(",
"com",
".",
"google",
".",
"gwt",
".",
"http",
".",
"client",
".",
"Request",
"request",
",",
"com",
".",
"google",
".",
"gwt",
".",
"http",
".",
"client",
".",
"Response",
"response",
")",
"{",
"m_requestCounter",
".",
"decrement",
"(",
")",
";",
"callback",
".",
"onResponseReceived",
"(",
"request",
",",
"response",
")",
";",
"}",
"}",
";",
"requestBuilder",
".",
"setCallback",
"(",
"callbackWrapper",
")",
";",
"m_requestCounter",
".",
"increment",
"(",
")",
";",
"try",
"{",
"requestBuilder",
".",
"send",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"m_requestCounter",
".",
"decrement",
"(",
")",
";",
"}",
"}"
] | Executes the RPC call.<p>
@param requestBuilder the request builder returned by the service interface | [
"Executes",
"the",
"RPC",
"call",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/CmsRpcCallHelper.java#L57-L84 |
hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Traversal.java | Traversal.getSingle | protected BE getSingle(Query query, SegmentType entityType) {
"""
A helper method to retrieve a single result from the query or throw an exception if the query yields no results.
@param query the query to run
@param entityType the expected type of the entity (used only for error reporting)
@return the single result
@throws EntityNotFoundException if the query doesn't return any results
"""
return inTx(tx -> Util.getSingle(tx, query, entityType));
} | java | protected BE getSingle(Query query, SegmentType entityType) {
return inTx(tx -> Util.getSingle(tx, query, entityType));
} | [
"protected",
"BE",
"getSingle",
"(",
"Query",
"query",
",",
"SegmentType",
"entityType",
")",
"{",
"return",
"inTx",
"(",
"tx",
"->",
"Util",
".",
"getSingle",
"(",
"tx",
",",
"query",
",",
"entityType",
")",
")",
";",
"}"
] | A helper method to retrieve a single result from the query or throw an exception if the query yields no results.
@param query the query to run
@param entityType the expected type of the entity (used only for error reporting)
@return the single result
@throws EntityNotFoundException if the query doesn't return any results | [
"A",
"helper",
"method",
"to",
"retrieve",
"a",
"single",
"result",
"from",
"the",
"query",
"or",
"throw",
"an",
"exception",
"if",
"the",
"query",
"yields",
"no",
"results",
"."
] | train | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Traversal.java#L62-L64 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcFileMinAge | public EnvironmentConfig setGcFileMinAge(int minAge) throws InvalidSettingException {
"""
Returns the minimum age of a {@code Log} file (.xd file) to consider it for cleaning by the database garbage
collector. The age of the last (the newest, the rightmost) {@code Log} file is {@code 0}, the age of previous
file is {@code 1}, etc. Default value is {@code 2}. The age cannot be less than {@code 1}.
<p>Mutable at runtime: yes
@param minAge minimum age of .xd file to consider it for cleaning by the database garbage collector
@return this {@code EnvironmentConfig} instance
@throws InvalidSettingException minAge is less than {@code 1}.
"""
if (minAge < 1) {
throw new InvalidSettingException("Invalid file minimum age: " + minAge);
}
return setSetting(GC_MIN_FILE_AGE, minAge);
} | java | public EnvironmentConfig setGcFileMinAge(int minAge) throws InvalidSettingException {
if (minAge < 1) {
throw new InvalidSettingException("Invalid file minimum age: " + minAge);
}
return setSetting(GC_MIN_FILE_AGE, minAge);
} | [
"public",
"EnvironmentConfig",
"setGcFileMinAge",
"(",
"int",
"minAge",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"minAge",
"<",
"1",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"Invalid file minimum age: \"",
"+",
"minAge",
")",
";",
"}",
"return",
"setSetting",
"(",
"GC_MIN_FILE_AGE",
",",
"minAge",
")",
";",
"}"
] | Returns the minimum age of a {@code Log} file (.xd file) to consider it for cleaning by the database garbage
collector. The age of the last (the newest, the rightmost) {@code Log} file is {@code 0}, the age of previous
file is {@code 1}, etc. Default value is {@code 2}. The age cannot be less than {@code 1}.
<p>Mutable at runtime: yes
@param minAge minimum age of .xd file to consider it for cleaning by the database garbage collector
@return this {@code EnvironmentConfig} instance
@throws InvalidSettingException minAge is less than {@code 1}. | [
"Returns",
"the",
"minimum",
"age",
"of",
"a",
"{",
"@code",
"Log",
"}",
"file",
"(",
".",
"xd",
"file",
")",
"to",
"consider",
"it",
"for",
"cleaning",
"by",
"the",
"database",
"garbage",
"collector",
".",
"The",
"age",
"of",
"the",
"last",
"(",
"the",
"newest",
"the",
"rightmost",
")",
"{",
"@code",
"Log",
"}",
"file",
"is",
"{",
"@code",
"0",
"}",
"the",
"age",
"of",
"previous",
"file",
"is",
"{",
"@code",
"1",
"}",
"etc",
".",
"Default",
"value",
"is",
"{",
"@code",
"2",
"}",
".",
"The",
"age",
"cannot",
"be",
"less",
"than",
"{",
"@code",
"1",
"}",
".",
"<p",
">",
"Mutable",
"at",
"runtime",
":",
"yes"
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L1925-L1930 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.