repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java | TransliteratorParser.appendVariableDef | private void appendVariableDef(String name, StringBuffer buf) {
char[] ch = variableNames.get(name);
if (ch == null) {
// We allow one undefined variable so that variable definition
// statements work. For the first undefined variable we return
// the special placeho... | java | private void appendVariableDef(String name, StringBuffer buf) {
char[] ch = variableNames.get(name);
if (ch == null) {
// We allow one undefined variable so that variable definition
// statements work. For the first undefined variable we return
// the special placeho... | [
"private",
"void",
"appendVariableDef",
"(",
"String",
"name",
",",
"StringBuffer",
"buf",
")",
"{",
"char",
"[",
"]",
"ch",
"=",
"variableNames",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"ch",
"==",
"null",
")",
"{",
"// We allow one undefined variab... | Append the value of the given variable name to the given
StringBuffer.
@exception IllegalIcuArgumentException if the name is unknown. | [
"Append",
"the",
"value",
"of",
"the",
"given",
"variable",
"name",
"to",
"the",
"given",
"StringBuffer",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java#L1542-L1562 | train | Append a variable definition to the StringBuffer. | Of course, here is the Java code you requested:
```java
private void appendVariableDef(String name, StringBuffer buf) {
char[] ch = variableNames.get(name);
if (ch == null) {
// We allow one undefined variable so that variable definition
// statements work. For the first undefi... |
abmargb/jamppa | src/main/java/org/jamppa/component/utils/XMPPUtils.java | XMPPUtils.error | public static IQ error(IQ iq, String errorMessage) {
return XMPPUtils.createErrorResponse(iq, errorMessage,
Condition.bad_request, Type.modify);
} | java | public static IQ error(IQ iq, String errorMessage) {
return XMPPUtils.createErrorResponse(iq, errorMessage,
Condition.bad_request, Type.modify);
} | [
"public",
"static",
"IQ",
"error",
"(",
"IQ",
"iq",
",",
"String",
"errorMessage",
")",
"{",
"return",
"XMPPUtils",
".",
"createErrorResponse",
"(",
"iq",
",",
"errorMessage",
",",
"Condition",
".",
"bad_request",
",",
"Type",
".",
"modify",
")",
";",
"}"
... | Logs the error and returns an IQ error response
@param iq
@param errorMessage
@param logger
@return | [
"Logs",
"the",
"error",
"and",
"returns",
"an",
"IQ",
"error",
"response"
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/utils/XMPPUtils.java#L47-L50 | test | Create an error response for a CID language request. | Of course, here is the Java code you requested:
```java
public static IQ error(IQ iq, String errorMessage) {
return XMPPUtils.createErrorResponse(iq, errorMessage,
Condition.bad_request, Type.modify);
}
```
Hope this helps! |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ZooActionBuilder.java | ZooActionBuilder.validate | public ZooActionBuilder validate(String jsonPath, String expectedValue) {
JsonPathMessageValidationContext validationContext = action.getJsonPathMessageValidationContext();
if (validationContext == null) {
validationContext = new JsonPathMessageValidationContext();
action.setJson... | java | public ZooActionBuilder validate(String jsonPath, String expectedValue) {
JsonPathMessageValidationContext validationContext = action.getJsonPathMessageValidationContext();
if (validationContext == null) {
validationContext = new JsonPathMessageValidationContext();
action.setJson... | [
"public",
"ZooActionBuilder",
"validate",
"(",
"String",
"jsonPath",
",",
"String",
"expectedValue",
")",
"{",
"JsonPathMessageValidationContext",
"validationContext",
"=",
"action",
".",
"getJsonPathMessageValidationContext",
"(",
")",
";",
"if",
"(",
"validationContext"... | Adds variable extractor for extracting variable from command response.
@param jsonPath the json path to reference the value to be extracted
@param expectedValue the expected value (or variable to retrieve the expected value from)
@return | [
"Adds",
"variable",
"extractor",
"for",
"extracting",
"variable",
"from",
"command",
"response",
"."
] | 55c58ef74c01d511615e43646ca25c1b2301c56d | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ZooActionBuilder.java#L176-L184 | train | Validate the given JSON path expression. | Of course, here is the Java code you requested:
```java
public ZooActionBuilder validate(String jsonPath, String expectedValue) {
JsonPathMessageValidationContext validationContext = action.getJsonPathMessageValidationContext();
if (validationContext == null) {
validationContext = new JsonP... |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java | ResourceAdapterContainerBase.setResourceAdapterXML | @Override
public T setResourceAdapterXML(Package resourcePackage, String resourceName) throws IllegalArgumentException {
Validate.notNull(resourcePackage, "ResourcePackage must be specified");
Validate.notNull(resourceName, "ResourceName must be specified");
return addAsManifestResource(res... | java | @Override
public T setResourceAdapterXML(Package resourcePackage, String resourceName) throws IllegalArgumentException {
Validate.notNull(resourcePackage, "ResourcePackage must be specified");
Validate.notNull(resourceName, "ResourceName must be specified");
return addAsManifestResource(res... | [
"@",
"Override",
"public",
"T",
"setResourceAdapterXML",
"(",
"Package",
"resourcePackage",
",",
"String",
"resourceName",
")",
"throws",
"IllegalArgumentException",
"{",
"Validate",
".",
"notNull",
"(",
"resourcePackage",
",",
"\"ResourcePackage must be specified\"",
")"... | /*
(non-Javadoc)
@see org.jboss.shrinkwrap.api.container.ResourceAdapterContainer#setResourceAdapterXML(java.lang.Package,
java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 3f8a1a6d344651428c709a63ebb52d35343c5387 | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java#L106-L112 | train | Sets the resource adapter XML file. | Of course, here is the Java code you requested:
```java
@Override
public T setResourceAdapterXML(Package resourcePackage, String resourceName) throws IllegalArgumentException {
Validate.notNull(resourcePackage, "ResourcePackage must be specified");
Validate.notNull(resourceName, "ResourceName must ... |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/AWSXRayClient.java | AWSXRayClient.getSamplingRules | @Override
public GetSamplingRulesResult getSamplingRules(GetSamplingRulesRequest request) {
request = beforeClientExecution(request);
return executeGetSamplingRules(request);
} | java | @Override
public GetSamplingRulesResult getSamplingRules(GetSamplingRulesRequest request) {
request = beforeClientExecution(request);
return executeGetSamplingRules(request);
} | [
"@",
"Override",
"public",
"GetSamplingRulesResult",
"getSamplingRules",
"(",
"GetSamplingRulesRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGetSamplingRules",
"(",
"request",
")",
";",
"}"
] | <p>
Retrieves all sampling rules.
</p>
@param getSamplingRulesRequest
@return Result of the GetSamplingRules operation returned by the service.
@throws InvalidRequestException
The request is missing required parameters or has invalid parameters.
@throws ThrottledException
The request exceeds the maximum number of requ... | [
"<p",
">",
"Retrieves",
"all",
"sampling",
"rules",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/AWSXRayClient.java#L760-L764 | train | Retrieves the rules for a specific base class. | Of course, here is the Java code you requested:
```java
@Override
public GetSamplingRulesResult getSamplingRules(GetSamplingRulesRequest request) {
request = beforeClientExecution(request);
return executeGetSamplingRules(request);
}
```
Hope this helps! |
samskivert/samskivert | src/main/java/com/samskivert/swing/Controller.java | Controller.generateArguments | protected Object[] generateArguments (
Method method, Object source, Object argument)
{
// figure out what sort of arguments are required by the method
Class<?>[] atypes = method.getParameterTypes();
if (atypes == null || atypes.length == 0) {
return new Object[0];
... | java | protected Object[] generateArguments (
Method method, Object source, Object argument)
{
// figure out what sort of arguments are required by the method
Class<?>[] atypes = method.getParameterTypes();
if (atypes == null || atypes.length == 0) {
return new Object[0];
... | [
"protected",
"Object",
"[",
"]",
"generateArguments",
"(",
"Method",
"method",
",",
"Object",
"source",
",",
"Object",
"argument",
")",
"{",
"// figure out what sort of arguments are required by the method",
"Class",
"<",
"?",
">",
"[",
"]",
"atypes",
"=",
"method",... | Used by {@link #handleAction} to generate arguments to the action
handler method. | [
"Used",
"by",
"{"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Controller.java#L339-L361 | train | Generate the arguments for the method | Of course, here is the Java code you requested:
```java
protected Object[] generateArguments (
Method method, Object source, Object argument)
{
// figure out what sort of arguments are required by the method
Class<?>[] atypes = method.getParameterTypes();
if (atypes == null || atyp... |
pushtorefresh/storio | storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/ui/fragment/TweetsContentResolverFragment.java | TweetsContentResolverFragment.onUpdateTweet | @Override
public void onUpdateTweet(@NonNull final Long tweetId) {
// 1.
disposeOnStop(storIOContentResolver
.get()
.object(Tweet.class)
.withQuery(Query.builder()
.uri(TweetMeta.CONTENT_URI)
.where(Tweet... | java | @Override
public void onUpdateTweet(@NonNull final Long tweetId) {
// 1.
disposeOnStop(storIOContentResolver
.get()
.object(Tweet.class)
.withQuery(Query.builder()
.uri(TweetMeta.CONTENT_URI)
.where(Tweet... | [
"@",
"Override",
"public",
"void",
"onUpdateTweet",
"(",
"@",
"NonNull",
"final",
"Long",
"tweetId",
")",
"{",
"// 1.",
"disposeOnStop",
"(",
"storIOContentResolver",
".",
"get",
"(",
")",
".",
"object",
"(",
"Tweet",
".",
"class",
")",
".",
"withQuery",
"... | This method from {@link TweetsAdapter.OnUpdateTweetListener}
interface.
It updates specific tweet by adding '+' to the end of tweet author
every time when is called.
It has chain of 3 steps in ReactiveX-way:
1. getting tweet via its id
2. mapping with changing author
3. putting result back to database | [
"This",
"method",
"from",
"{"
] | 58f53d81bcc7b069c8bb271c46a90e37775abe8d | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/ui/fragment/TweetsContentResolverFragment.java#L193-L243 | train | Update the content of the Tweet. | Of course, here is the Java code you requested:
```java
@Override
public void onUpdateTweet(@NonNull final Long tweetId) {
// 1.
disposeOnStop(storIOContentResolver
.get()
.object(Tweet.class)
.withQuery(Query.builder()
.uri(Tw... |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpClient.java | TcpClient.connectNow | public final Connection connectNow(Duration timeout) {
Objects.requireNonNull(timeout, "timeout");
try {
return Objects.requireNonNull(connect().block(timeout), "aborted");
}
catch (IllegalStateException e) {
if (e.getMessage().contains("blocking read")) {
throw new IllegalStateException("TcpClient co... | java | public final Connection connectNow(Duration timeout) {
Objects.requireNonNull(timeout, "timeout");
try {
return Objects.requireNonNull(connect().block(timeout), "aborted");
}
catch (IllegalStateException e) {
if (e.getMessage().contains("blocking read")) {
throw new IllegalStateException("TcpClient co... | [
"public",
"final",
"Connection",
"connectNow",
"(",
"Duration",
"timeout",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"timeout",
",",
"\"timeout\"",
")",
";",
"try",
"{",
"return",
"Objects",
".",
"requireNonNull",
"(",
"connect",
"(",
")",
".",
"block... | Block the {@link TcpClient} and return a {@link Connection}. Disposing must be
done by the user via {@link Connection#dispose()}.
@param timeout connect timeout
@return a {@link Mono} of {@link Connection} | [
"Block",
"the",
"{",
"@link",
"TcpClient",
"}",
"and",
"return",
"a",
"{",
"@link",
"Connection",
"}",
".",
"Disposing",
"must",
"be",
"done",
"by",
"the",
"user",
"via",
"{",
"@link",
"Connection#dispose",
"()",
"}",
"."
] | 4ed14316e1d7fca3cecd18d6caa5f2251e159e49 | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpClient.java#L217-L229 | train | Connects to the server and blocks until the connection is established. | Of course, here is the Java code you requested:
```java
public final Connection connectNow(Duration timeout) {
Objects.requireNonNull(timeout, "timeout");
try {
return Objects.requireNonNull(connect().block(timeout), "aborted");
}
catch (IllegalStateException e) {
if (e.getMessage().contains("blocking re... |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/JarUnsignMojo.java | JarUnsignMojo.execute | @Override
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().info( "Skipping JAR unsigning for file: " + jarPath.getAbsolutePath() );
return;
}
if ( jarPath.isDirectory() )
{
for ( File jar : jarPat... | java | @Override
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().info( "Skipping JAR unsigning for file: " + jarPath.getAbsolutePath() );
return;
}
if ( jarPath.isDirectory() )
{
for ( File jar : jarPat... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"skip",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Skipping JAR unsigning for file: \"",
"+",
"jarPath",
".",
"getAbsolutePath",
"(",
")",
")",
... | ---------------------------------------------------------------------- | [
"----------------------------------------------------------------------"
] | 38fdd1d21f063f21716cfcd61ebeabd963487576 | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/JarUnsignMojo.java#L93-L120 | train | Execute the unsigning process. | Of course, here is the Java code you requested:
```java
@Override
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().info( "Skipping JAR unsigning for file: " + jarPath.getAbsolutePath() );
return;
}
if ( jarPath.isDi... |
arquillian/arquillian-cube | docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java | DockerContainerObjectBuilder.withContainerObjectConfiguration | public DockerContainerObjectBuilder<T> withContainerObjectConfiguration(ContainerObjectConfiguration configuration) {
if (configuration == null) {
throw new IllegalArgumentException("configuration cannot be null");
}
if (configuration != null && !(configuration instanceof CubeContain... | java | public DockerContainerObjectBuilder<T> withContainerObjectConfiguration(ContainerObjectConfiguration configuration) {
if (configuration == null) {
throw new IllegalArgumentException("configuration cannot be null");
}
if (configuration != null && !(configuration instanceof CubeContain... | [
"public",
"DockerContainerObjectBuilder",
"<",
"T",
">",
"withContainerObjectConfiguration",
"(",
"ContainerObjectConfiguration",
"configuration",
")",
"{",
"if",
"(",
"configuration",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"configurati... | Specifies a configuration (can be partial) to be used to override the default configuration set using annotations
on the container object. The received configuration will be merged with the configuration extracted from the
container object, and the resulting configuration will be used to build the docker container.
<p>... | [
"Specifies",
"a",
"configuration",
"(",
"can",
"be",
"partial",
")",
"to",
"be",
"used",
"to",
"override",
"the",
"default",
"configuration",
"set",
"using",
"annotations",
"on",
"the",
"container",
"object",
".",
"The",
"received",
"configuration",
"will",
"b... | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/docker/src/main/java/org/arquillian/cube/docker/impl/client/containerobject/DockerContainerObjectBuilder.java#L258-L272 | train | Sets the container object configuration. | Of course, here is the Java code you requested:
```java
public DockerContainerObjectBuilder<T> withContainerObjectConfiguration(ContainerObjectConfiguration configuration) {
if (configuration == null) {
throw new IllegalArgumentException("configuration cannot be null");
}
if (config... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskInProgress.java | TaskInProgress.canBeSpeculatedUsingProcessingRate | boolean canBeSpeculatedUsingProcessingRate(long currentTime) {
TaskStatus.Phase p = getProcessingPhase();
// check if the task is on one of following four phases
if ((p != TaskStatus.Phase.MAP) &&
(p != TaskStatus.Phase.SHUFFLE) &&
(p != TaskStatus.Phase.SORT) &&
(p != TaskStatus.P... | java | boolean canBeSpeculatedUsingProcessingRate(long currentTime) {
TaskStatus.Phase p = getProcessingPhase();
// check if the task is on one of following four phases
if ((p != TaskStatus.Phase.MAP) &&
(p != TaskStatus.Phase.SHUFFLE) &&
(p != TaskStatus.Phase.SORT) &&
(p != TaskStatus.P... | [
"boolean",
"canBeSpeculatedUsingProcessingRate",
"(",
"long",
"currentTime",
")",
"{",
"TaskStatus",
".",
"Phase",
"p",
"=",
"getProcessingPhase",
"(",
")",
";",
"// check if the task is on one of following four phases",
"if",
"(",
"(",
"p",
"!=",
"TaskStatus",
".",
"... | For the map task, using the bytes processed/sec as the processing rate
For the reduce task, using different rate for different phase:
copy: using the bytes copied/sec as the processing rate
sort: using the accumulated progress rate as the processing rate
reduce: using the the bytes processed/sec as the processing rate
... | [
"For",
"the",
"map",
"task",
"using",
"the",
"bytes",
"processed",
"/",
"sec",
"as",
"the",
"processing",
"rate",
"For",
"the",
"reduce",
"task",
"using",
"different",
"rate",
"for",
"different",
"phase",
":",
"copy",
":",
"using",
"the",
"bytes",
"copied"... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1188-L1218 | train | Check if the task can be speculated using processing rate. | Of course, here is the Java code you requested:
```java
boolean canBeSpeculatedUsingProcessingRate(long currentTime) {
TaskStatus.Phase p = getProcessingPhase();
// check if the task is on one of following four phases
if ((p != TaskStatus.Phase.MAP) &&
(p != TaskStatus.Phase.SHUFFLE) &&
(... |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java | WriterUtils.getTableNameWriterFilePath | public static Path getTableNameWriterFilePath(State state) {
Preconditions.checkArgument(state.contains(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
return new Path(state.getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
} | java | public static Path getTableNameWriterFilePath(State state) {
Preconditions.checkArgument(state.contains(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
return new Path(state.getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
} | [
"public",
"static",
"Path",
"getTableNameWriterFilePath",
"(",
"State",
"state",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"state",
".",
"contains",
"(",
"ConfigurationKeys",
".",
"EXTRACT_TABLE_NAME_KEY",
")",
")",
";",
"return",
"new",
"Path",
"(",
... | Creates {@link Path} for the {@link ConfigurationKeys#WRITER_FILE_PATH} key according to
{@link ConfigurationKeys#EXTRACT_TABLE_NAME_KEY}.
@param state
@return | [
"Creates",
"{"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java#L198-L201 | train | Gets the tableName writer file path. | Of course, here is the Java code you requested:
```java
public static Path getTableNameWriterFilePath(State state) {
Preconditions.checkArgument(state.contains(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
return new Path(state.getProp(ConfigurationKeys.EXTRACT_TABLE_NAME_KEY));
}
```
Hope this helps! |
esigate/esigate | esigate-core/src/main/java/org/esigate/util/HttpRequestHelper.java | HttpRequestHelper.getHost | public static HttpHost getHost(HttpRequest request) {
HttpHost httpHost = UriUtils.extractHost(request.getRequestLine().getUri());
String scheme = httpHost.getSchemeName();
String host = httpHost.getHostName();
int port = httpHost.getPort();
Header[] headers = request.getHeaders(... | java | public static HttpHost getHost(HttpRequest request) {
HttpHost httpHost = UriUtils.extractHost(request.getRequestLine().getUri());
String scheme = httpHost.getSchemeName();
String host = httpHost.getHostName();
int port = httpHost.getPort();
Header[] headers = request.getHeaders(... | [
"public",
"static",
"HttpHost",
"getHost",
"(",
"HttpRequest",
"request",
")",
"{",
"HttpHost",
"httpHost",
"=",
"UriUtils",
".",
"extractHost",
"(",
"request",
".",
"getRequestLine",
"(",
")",
".",
"getUri",
"(",
")",
")",
";",
"String",
"scheme",
"=",
"h... | Returns the target host as defined in the Host header or extracted from the request URI.
Usefull to generate Host header in a HttpRequest
@param request
@return the host formatted as host:port | [
"Returns",
"the",
"target",
"host",
"as",
"defined",
"in",
"the",
"Host",
"header",
"or",
"extracted",
"from",
"the",
"request",
"URI",
"."
] | 50421fb224f16e1ec42715425109a72b3b55527b | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/util/HttpRequestHelper.java#L64-L81 | train | Gets the host from the request. | Of course, here is the Java code you requested:
```java
public static HttpHost getHost(HttpRequest request) {
HttpHost httpHost = UriUtils.extractHost(request.getRequestLine().getUri());
String scheme = httpHost.getSchemeName();
String host = httpHost.getHostName();
int port = httpHost.... |
calimero-project/calimero-core | src/tuwien/auto/calimero/mgmt/ManagementClientImpl.java | ManagementClientImpl.makeDOAs | private static List<byte[]> makeDOAs(final List<byte[]> l)
{
for (int i = 0; i < l.size(); ++i) {
final byte[] pdu = l.get(i);
l.set(i, Arrays.copyOfRange(pdu, 2, pdu.length));
}
return l;
} | java | private static List<byte[]> makeDOAs(final List<byte[]> l)
{
for (int i = 0; i < l.size(); ++i) {
final byte[] pdu = l.get(i);
l.set(i, Arrays.copyOfRange(pdu, 2, pdu.length));
}
return l;
} | [
"private",
"static",
"List",
"<",
"byte",
"[",
"]",
">",
"makeDOAs",
"(",
"final",
"List",
"<",
"byte",
"[",
"]",
">",
"l",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"l",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{",
"... | cut domain addresses out of APDUs | [
"cut",
"domain",
"addresses",
"out",
"of",
"APDUs"
] | 7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8 | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/ManagementClientImpl.java#L1127-L1134 | train | Make DOAs. | Of course, here is the Java code you requested:
```java
private static List<byte[]> makeDOAs(final List<byte[]> l)
{
for (int i = 0; i < l.size(); ++i) {
final byte[] pdu = l.get(i);
l.set(i, Arrays.copyOfRange(pdu, 2, pdu.length));
}
return l;
}
```
Hope this helps! |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/Timer.java | Timer.addMeasurement | public void addMeasurement(long durationInMillis) {
count.addAndGet(1);
timerSum.addAndGet(durationInMillis);
timerSumOfSquares.addAndGet(durationInMillis * durationInMillis);
} | java | public void addMeasurement(long durationInMillis) {
count.addAndGet(1);
timerSum.addAndGet(durationInMillis);
timerSumOfSquares.addAndGet(durationInMillis * durationInMillis);
} | [
"public",
"void",
"addMeasurement",
"(",
"long",
"durationInMillis",
")",
"{",
"count",
".",
"addAndGet",
"(",
"1",
")",
";",
"timerSum",
".",
"addAndGet",
"(",
"durationInMillis",
")",
";",
"timerSumOfSquares",
".",
"addAndGet",
"(",
"durationInMillis",
"*",
... | Add a timer measurement for this timer.<br>
The application decides which unit to use for timing.
Milliseconds are suggested and some {@link ReportVisitor} implementations
may imply this.
@param durationInMillis | [
"Add",
"a",
"timer",
"measurement",
"for",
"this",
"timer",
".",
"<br",
">",
"The",
"application",
"decides",
"which",
"unit",
"to",
"use",
"for",
"timing",
".",
"Milliseconds",
"are",
"suggested",
"and",
"some",
"{"
] | a662e5123805ea455cfd01e1b9ae5d808f83529c | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/Timer.java#L55-L59 | train | Add a measurement to the count and timer sum. | Of course, here is the Java code you requested:
```java
public void addMeasurement(long durationInMillis) {
count.addAndGet(1);
timerSum.addAndGet(durationInMillis);
timerSumOfSquares.addAndGet(durationInMillis * durationInMillis);
}
```
Hope this helps! |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/StoreException.java | StoreException.create | public static StoreException create(final Type type, final Throwable cause, final String errorMessage) {
Preconditions.checkArgument(cause != null || (errorMessage != null && !errorMessage.isEmpty()),
"Either cause or errorMessage should be non-empty");
StoreException exception;
... | java | public static StoreException create(final Type type, final Throwable cause, final String errorMessage) {
Preconditions.checkArgument(cause != null || (errorMessage != null && !errorMessage.isEmpty()),
"Either cause or errorMessage should be non-empty");
StoreException exception;
... | [
"public",
"static",
"StoreException",
"create",
"(",
"final",
"Type",
"type",
",",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"errorMessage",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"cause",
"!=",
"null",
"||",
"(",
"errorMessage",
"!... | Factory method to construct Store exceptions.
@param type Type of Exception.
@param cause Exception cause.
@param errorMessage The detailed error message.
@return Instance of type of StoreException. | [
"Factory",
"method",
"to",
"construct",
"Store",
"exceptions",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/StoreException.java#L81-L114 | train | Create a new exception instance with the specified type and error message. | Of course, here is the Java code you requested:
```java
public static StoreException create(final Type type, final Throwable cause, final String errorMessage) {
Preconditions.checkArgument(cause != null || (errorMessage != null && !errorMessage.isEmpty()),
"Either cause or errorMessage should b... |
jblas-project/jblas | src/main/java/org/jblas/SimpleBlas.java | SimpleBlas.ger | public static FloatMatrix ger(float alpha, FloatMatrix x,
FloatMatrix y, FloatMatrix a) {
NativeBlas.sger(a.rows, a.columns, alpha, x.data, 0, 1, y.data, 0, 1, a.data,
0, a.rows);
return a;
} | java | public static FloatMatrix ger(float alpha, FloatMatrix x,
FloatMatrix y, FloatMatrix a) {
NativeBlas.sger(a.rows, a.columns, alpha, x.data, 0, 1, y.data, 0, 1, a.data,
0, a.rows);
return a;
} | [
"public",
"static",
"FloatMatrix",
"ger",
"(",
"float",
"alpha",
",",
"FloatMatrix",
"x",
",",
"FloatMatrix",
"y",
",",
"FloatMatrix",
"a",
")",
"{",
"NativeBlas",
".",
"sger",
"(",
"a",
".",
"rows",
",",
"a",
".",
"columns",
",",
"alpha",
",",
"x",
... | Compute A <- alpha * x * y^T + A (general rank-1 update) | [
"Compute",
"A",
"<",
"-",
"alpha",
"*",
"x",
"*",
"y^T",
"+",
"A",
"(",
"general",
"rank",
"-",
"1",
"update",
")"
] | 2818f231228e655cda80dfd8e0b87709fdfd8a70 | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/SimpleBlas.java#L638-L643 | train | Sger method. | Of course, here is the Java code you requested:
```java
public static FloatMatrix ger(float alpha, FloatMatrix x,
FloatMatrix y, FloatMatrix a) {
NativeBlas.sger(a.rows, a.columns, alpha, x.data, 0, 1, y.data, 0, 1, a.data,
0, a.rows);
return a;
}
```
Hope this helps! |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java | CQJDBCStorageConnection.addValues | @Override
protected void addValues(String cid, PropertyData data, ChangedSizeHandler sizeHandler) throws IOException,
SQLException, RepositoryException
{
addOrUpdateValues(cid, data, 0, sizeHandler);
} | java | @Override
protected void addValues(String cid, PropertyData data, ChangedSizeHandler sizeHandler) throws IOException,
SQLException, RepositoryException
{
addOrUpdateValues(cid, data, 0, sizeHandler);
} | [
"@",
"Override",
"protected",
"void",
"addValues",
"(",
"String",
"cid",
",",
"PropertyData",
"data",
",",
"ChangedSizeHandler",
"sizeHandler",
")",
"throws",
"IOException",
",",
"SQLException",
",",
"RepositoryException",
"{",
"addOrUpdateValues",
"(",
"cid",
",",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java#L887-L892 | train | Add values to the index. | Of course, here is the Java code you requested:
```java
@Override
protected void addValues(String cid, PropertyData data, ChangedSizeHandler sizeHandler) throws IOException,
SQLException, RepositoryException
{
addOrUpdateValues(cid, data, 0, sizeHandler);
}
```
Hope this helps! |
sebastiangraf/treetank | coremodules/commons/src/main/java/org/treetank/aspects/logging/LoggerAspect.java | LoggerAspect.advice | @Around("@annotation(org.treetank.aspects.logging.Logging)")
public Object advice(ProceedingJoinPoint pjp) throws Throwable {
final Signature sig = pjp.getSignature();
final Logger logger = FACTORY.getLogger(sig.getDeclaringTypeName());
logger.debug(new StringBuilder("Entering ").append(sig.... | java | @Around("@annotation(org.treetank.aspects.logging.Logging)")
public Object advice(ProceedingJoinPoint pjp) throws Throwable {
final Signature sig = pjp.getSignature();
final Logger logger = FACTORY.getLogger(sig.getDeclaringTypeName());
logger.debug(new StringBuilder("Entering ").append(sig.... | [
"@",
"Around",
"(",
"\"@annotation(org.treetank.aspects.logging.Logging)\"",
")",
"public",
"Object",
"advice",
"(",
"ProceedingJoinPoint",
"pjp",
")",
"throws",
"Throwable",
"{",
"final",
"Signature",
"sig",
"=",
"pjp",
".",
"getSignature",
"(",
")",
";",
"final",
... | Injection point for logging aspect
@param pjp
where the inject takes pace
@return the point reaches
@throws Throwable
if anything happens | [
"Injection",
"point",
"for",
"logging",
"aspect"
] | 9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60 | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/commons/src/main/java/org/treetank/aspects/logging/LoggerAspect.java#L51-L59 | train | Audits a method invocation of a CIDCTYPE. | Of course, here is the Java code you requested:
```java
@Around("@annotation(org.treetank.aspects.logging.Logging)")
public Object advice(ProceedingJoinPoint pjp) throws Throwable {
final Signature sig = pjp.getSignature();
final Logger logger = FACTORY.getLogger(sig.getDeclaringTypeName());
... |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreatePolicyRequestMarshaller.java | CreatePolicyRequestMarshaller.marshall | public void marshall(CreatePolicyRequest createPolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (createPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createPolicyRequest.ge... | java | public void marshall(CreatePolicyRequest createPolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (createPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createPolicyRequest.ge... | [
"public",
"void",
"marshall",
"(",
"CreatePolicyRequest",
"createPolicyRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"createPolicyRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to m... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreatePolicyRequestMarshaller.java#L44-L56 | train | marshalls the given CreatePolicyRequest to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(CreatePolicyRequest createPolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (createPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... |
renepickhardt/metalcon | autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Retrieve/ProcessRetrieveRequest.java | ProcessRetrieveRequest.checkNumItems | private static Integer checkNumItems(HttpServletRequest request,
ProcessRetrieveResponse response) {
String tmp = request.getParameter(ProtocolConstants.NUM_ITEMS);
Integer numItems = null;
if (tmp != null) {
try {
numItems = Integer.parseInt(tmp);
if ((numItems < 1)
|| (numItems > ProtocolCon... | java | private static Integer checkNumItems(HttpServletRequest request,
ProcessRetrieveResponse response) {
String tmp = request.getParameter(ProtocolConstants.NUM_ITEMS);
Integer numItems = null;
if (tmp != null) {
try {
numItems = Integer.parseInt(tmp);
if ((numItems < 1)
|| (numItems > ProtocolCon... | [
"private",
"static",
"Integer",
"checkNumItems",
"(",
"HttpServletRequest",
"request",
",",
"ProcessRetrieveResponse",
"response",
")",
"{",
"String",
"tmp",
"=",
"request",
".",
"getParameter",
"(",
"ProtocolConstants",
".",
"NUM_ITEMS",
")",
";",
"Integer",
"numIt... | checks the ASTP request for the number of items that should be retrieved
If the parameter is not set we use the default value If the parameter is
not set correctly (no integer or bigger than the maximum allowed Integer
or negative) we use the default value
@param request
@param response | [
"checks",
"the",
"ASTP",
"request",
"for",
"the",
"number",
"of",
"items",
"that",
"should",
"be",
"retrieved",
"If",
"the",
"parameter",
"is",
"not",
"set",
"we",
"use",
"the",
"default",
"value",
"If",
"the",
"parameter",
"is",
"not",
"set",
"correctly",... | 26a7bd89d2225fe2172dc958d10f64a1bd9cf52f | https://github.com/renepickhardt/metalcon/blob/26a7bd89d2225fe2172dc958d10f64a1bd9cf52f/autocompleteServer/src/main/java/de/metalcon/autocompleteServer/Retrieve/ProcessRetrieveRequest.java#L50-L72 | train | Check the number of items in the request. | Of course, here is the Java code you requested:
```java
private static Integer checkNumItems(HttpServletRequest request,
ProcessRetrieveResponse response) {
String tmp = request.getParameter(ProtocolConstants.NUM_ITEMS);
Integer numItems = null;
if (tmp != null) {
try {
numItems = Integer.parseInt(tmp)... |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/VpcPeeringConnectionVpcInfo.java | VpcPeeringConnectionVpcInfo.withCidrBlockSet | public VpcPeeringConnectionVpcInfo withCidrBlockSet(CidrBlock... cidrBlockSet) {
if (this.cidrBlockSet == null) {
setCidrBlockSet(new com.amazonaws.internal.SdkInternalList<CidrBlock>(cidrBlockSet.length));
}
for (CidrBlock ele : cidrBlockSet) {
this.cidrBlockSet.add(ele)... | java | public VpcPeeringConnectionVpcInfo withCidrBlockSet(CidrBlock... cidrBlockSet) {
if (this.cidrBlockSet == null) {
setCidrBlockSet(new com.amazonaws.internal.SdkInternalList<CidrBlock>(cidrBlockSet.length));
}
for (CidrBlock ele : cidrBlockSet) {
this.cidrBlockSet.add(ele)... | [
"public",
"VpcPeeringConnectionVpcInfo",
"withCidrBlockSet",
"(",
"CidrBlock",
"...",
"cidrBlockSet",
")",
"{",
"if",
"(",
"this",
".",
"cidrBlockSet",
"==",
"null",
")",
"{",
"setCidrBlockSet",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInte... | <p>
Information about the IPv4 CIDR blocks for the VPC.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setCidrBlockSet(java.util.Collection)} or {@link #withCidrBlockSet(java.util.Collection)} if you want to
override the existing values.
</p>
@param cidrBlockSet
Informa... | [
"<p",
">",
"Information",
"about",
"the",
"IPv4",
"CIDR",
"blocks",
"for",
"the",
"VPC",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/VpcPeeringConnectionVpcInfo.java#L233-L241 | train | Sets the cidrBlockSet value for this VpcPeeringConnectionVpcInfo. | Of course, here is the Java code you requested:
```java
public VpcPeeringConnectionVpcInfo withCidrBlockSet(CidrBlock... cidrBlockSet) {
if (this.cidrBlockSet == null) {
setCidrBlockSet(new com.amazonaws.internal.SdkInternalList<CidrBlock>(cidrBlockSet.length));
}
for (CidrBlock ele... |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageHelper.java | ImageHelper.invertImageColor | public static BufferedImage invertImageColor(BufferedImage image) {
BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null);
return invertOp.filter(image, tmp);
} | java | public static BufferedImage invertImageColor(BufferedImage image) {
BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null);
return invertOp.filter(image, tmp);
} | [
"public",
"static",
"BufferedImage",
"invertImageColor",
"(",
"BufferedImage",
"image",
")",
"{",
"BufferedImage",
"tmp",
"=",
"new",
"BufferedImage",
"(",
"image",
".",
"getWidth",
"(",
")",
",",
"image",
".",
"getHeight",
"(",
")",
",",
"image",
".",
"getT... | Inverts image color.
@param image input image
@return an inverted-color image | [
"Inverts",
"image",
"color",
"."
] | cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1 | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageHelper.java#L151-L155 | train | Invert the image color. | Of course, here is the Java code you requested:
```java
public static BufferedImage invertImageColor(BufferedImage image) {
BufferedImage tmp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invertTable), null);... |
strator-dev/greenpepper | greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/DefaultLogbackConfigurator.java | DefaultLogbackConfigurator.addError | @Override
public void addError(String msg, Throwable ex) {
context.getStatusManager().add(new ErrorStatus(msg, context, ex));
} | java | @Override
public void addError(String msg, Throwable ex) {
context.getStatusManager().add(new ErrorStatus(msg, context, ex));
} | [
"@",
"Override",
"public",
"void",
"addError",
"(",
"String",
"msg",
",",
"Throwable",
"ex",
")",
"{",
"context",
".",
"getStatusManager",
"(",
")",
".",
"add",
"(",
"new",
"ErrorStatus",
"(",
"msg",
",",
"context",
",",
"ex",
")",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/DefaultLogbackConfigurator.java#L99-L102 | train | Add an error to the status manager. | Of course, here is the Java code you requested:
```java
@Override
public void addError(String msg, Throwable ex) {
context.getStatusManager().add(new ErrorStatus(msg, context, ex));
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeBundleTasksRequest.java | DescribeBundleTasksRequest.setBundleIds | public void setBundleIds(java.util.Collection<String> bundleIds) {
if (bundleIds == null) {
this.bundleIds = null;
return;
}
this.bundleIds = new com.amazonaws.internal.SdkInternalList<String>(bundleIds);
} | java | public void setBundleIds(java.util.Collection<String> bundleIds) {
if (bundleIds == null) {
this.bundleIds = null;
return;
}
this.bundleIds = new com.amazonaws.internal.SdkInternalList<String>(bundleIds);
} | [
"public",
"void",
"setBundleIds",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"bundleIds",
")",
"{",
"if",
"(",
"bundleIds",
"==",
"null",
")",
"{",
"this",
".",
"bundleIds",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"bu... | <p>
The bundle task IDs.
</p>
<p>
Default: Describes all your bundle tasks.
</p>
@param bundleIds
The bundle task IDs.</p>
<p>
Default: Describes all your bundle tasks. | [
"<p",
">",
"The",
"bundle",
"task",
"IDs",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Default",
":",
"Describes",
"all",
"your",
"bundle",
"tasks",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeBundleTasksRequest.java#L132-L139 | train | Sets the value of the bundleIds property. | Of course, here is the Java code you requested:
```java
public void setBundleIds(java.util.Collection<String> bundleIds) {
if (bundleIds == null) {
this.bundleIds = null;
return;
}
this.bundleIds = new com.amazonaws.internal.SdkInternalList<String>(bundleIds);
}
```... |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java | Namespace.findByQualifier | public static Namespace findByQualifier(EntityManager em, String qualifier) {
SystemAssert.requireArgument(em != null, "EntityManager cannot be null.");
SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty.");
TypedQuery<Namespace>... | java | public static Namespace findByQualifier(EntityManager em, String qualifier) {
SystemAssert.requireArgument(em != null, "EntityManager cannot be null.");
SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty.");
TypedQuery<Namespace>... | [
"public",
"static",
"Namespace",
"findByQualifier",
"(",
"EntityManager",
"em",
",",
"String",
"qualifier",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"EntityManager cannot be null.\"",
")",
";",
"SystemAssert",
".",
"requireAr... | Returns a namespace entity using the provided namespace qualifier.
@param em The entity manager. Cannot be null.
@param qualifier The qualifier. Cannot be null or empty.
@return The namespace or null if no corresponding namespace is found. | [
"Returns",
"a",
"namespace",
"entity",
"using",
"the",
"provided",
"namespace",
"qualifier",
"."
] | 121b59a268da264316cded6a3e9271366a23cd86 | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L137-L148 | train | Finds a namespace by qualifier. | Of course, here is the Java code you requested:
```java
public static Namespace findByQualifier(EntityManager em, String qualifier) {
SystemAssert.requireArgument(em != null, "EntityManager cannot be null.");
SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier c... |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Cartographer.java | Cartographer.toJson | public void toJson(Map<?, ?> map, Writer writer) throws IOException {
if (map == null) {
throw new IllegalArgumentException("map == null");
}
if (writer == null) {
throw new IllegalArgumentException("writer == null");
}
JsonWriter jsonWriter = new JsonWriter(writer);
jsonWriter.setL... | java | public void toJson(Map<?, ?> map, Writer writer) throws IOException {
if (map == null) {
throw new IllegalArgumentException("map == null");
}
if (writer == null) {
throw new IllegalArgumentException("writer == null");
}
JsonWriter jsonWriter = new JsonWriter(writer);
jsonWriter.setL... | [
"public",
"void",
"toJson",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"map == null\"",
")",
";",
... | Serializes the map into it's json representation into the provided {@link Writer}. If you want
to retrieve the json as a string, use {@link #toJson(Map)} instead. | [
"Serializes",
"the",
"map",
"into",
"it",
"s",
"json",
"representation",
"into",
"the",
"provided",
"{"
] | 93c7d5bb09b593440a2347a6089db3e9f74012da | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Cartographer.java#L105-L123 | train | Write a Map to a Writer. | Of course, here is the Java code you requested:
```java
public void toJson(Map<?, ?> map, Writer writer) throws IOException {
if (map == null) {
throw new IllegalArgumentException("map == null");
}
if (writer == null) {
throw new IllegalArgumentException("writer == null");
}
JsonWriter... |
eclipse/xtext-core | org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java | InternalXtextParser.ruleNamedArgument | public final void ruleNamedArgument() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:583:2: ( ( ( rule__NamedArgument__Group__0 ) ) )
// InternalXtext.g:584:2: ( ( rule__NamedArgument__Group__0 ) )
{
//... | java | public final void ruleNamedArgument() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:583:2: ( ( ( rule__NamedArgument__Group__0 ) ) )
// InternalXtext.g:584:2: ( ( rule__NamedArgument__Group__0 ) )
{
//... | [
"public",
"final",
"void",
"ruleNamedArgument",
"(",
")",
"throws",
"RecognitionException",
"{",
"int",
"stackSize",
"=",
"keepStackSize",
"(",
")",
";",
"try",
"{",
"// InternalXtext.g:583:2: ( ( ( rule__NamedArgument__Group__0 ) ) )",
"// InternalXtext.g:584:2: ( ( rule__Name... | InternalXtext.g:579:1: ruleNamedArgument : ( ( rule__NamedArgument__Group__0 ) ) ; | [
"InternalXtext",
".",
"g",
":",
"579",
":",
"1",
":",
"ruleNamedArgument",
":",
"(",
"(",
"rule__NamedArgument__Group__0",
")",
")",
";"
] | bac941cb75cb24706519845ec174cfef874d7557 | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java#L1730-L1771 | train | Generates the code for a named argument | Of course, here is the Java code you requested:
```java
public final void ruleNamedArgument() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:583:2: ( ( ( rule__NamedArgument__Group__0 ) ) )
// InternalXtext.g:584:2: ( ( rule_... |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/o/TrafficEstimatorSelector.java | TrafficEstimatorSelector.setCampaignEstimateRequests | public void setCampaignEstimateRequests(com.google.api.ads.adwords.axis.v201809.o.CampaignEstimateRequest[] campaignEstimateRequests) {
this.campaignEstimateRequests = campaignEstimateRequests;
} | java | public void setCampaignEstimateRequests(com.google.api.ads.adwords.axis.v201809.o.CampaignEstimateRequest[] campaignEstimateRequests) {
this.campaignEstimateRequests = campaignEstimateRequests;
} | [
"public",
"void",
"setCampaignEstimateRequests",
"(",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"adwords",
".",
"axis",
".",
"v201809",
".",
"o",
".",
"CampaignEstimateRequest",
"[",
"]",
"campaignEstimateRequests",
")",
"{",
"this",
".",
"campaignEst... | Sets the campaignEstimateRequests value for this TrafficEstimatorSelector.
@param campaignEstimateRequests * A list of all campaigns to estimate.<p>
To create a Keyword estimates request, use {@code
null} campaign id.
<span class="constraint CollectionSize">The maximum
size of this collection is 5.</span>
<span cla... | [
"Sets",
"the",
"campaignEstimateRequests",
"value",
"for",
"this",
"TrafficEstimatorSelector",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/o/TrafficEstimatorSelector.java#L109-L111 | train | Sets the campaignEstimateRequests value for this CdnEstimateRequest. | Of course, here is the Java code you requested:
```java
public void setCampaignEstimateRequests(com.google.api.ads.adwords.axis.v201809.o.CampaignEstimateRequest[] campaignEstimateRequests) {
this.campaignEstimateRequests = campaignEstimateRequests;
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/relations/CmsExternalLinksValidator.java | CmsExternalLinksValidator.validateLinks | @SuppressWarnings("deprecation")
public void validateLinks(CmsObject cms) throws CmsException {
if (m_report == null) {
m_report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsExternalLinksValidator.class);
}
m_report.println(
Messages.get().container(Me... | java | @SuppressWarnings("deprecation")
public void validateLinks(CmsObject cms) throws CmsException {
if (m_report == null) {
m_report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsExternalLinksValidator.class);
}
m_report.println(
Messages.get().container(Me... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"validateLinks",
"(",
"CmsObject",
"cms",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"m_report",
"==",
"null",
")",
"{",
"m_report",
"=",
"new",
"CmsLogReport",
"(",
"cms",
".",
"get... | Validate all links.<p>
@param cms a OpenCms context object
@throws CmsException if something goes wrong | [
"Validate",
"all",
"links",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsExternalLinksValidator.java#L135-L198 | train | Validate links. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
public void validateLinks(CmsObject cms) throws CmsException {
if (m_report == null) {
m_report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsExternalLinksValidator.class);
}
... |
apache/spark | sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TUnionTypeEntry.java | TUnionTypeEntry.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME_TO_TYPE_PTR:
return isSetNameToTypePtr();
}
throw new IllegalStateException();
} | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME_TO_TYPE_PTR:
return isSetNameToTypePtr();
}
throw new IllegalStateException();
} | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"NAME_TO_TYPE_PTR",
":",
"return",
"isS... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"Returns",
"true",
"if",
"field",
"corresponding",
"to",
"fieldID",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TUnionTypeEntry.java#L214-L224 | train | Checks if the specified field is set to a value of a CRAsCTYPE object. | Of course, here is the Java code you requested:
```java
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NAME_TO_TYPE_PTR:
return isSetNameToTypePtr();
}
throw new IllegalStateException();
}
```
Hope this he... |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectExactCardinalityImpl_CustomFieldSerializer.java | OWLObjectExactCardinalityImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectExactCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectExactCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLObjectExactCardinalityImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | 7ab975fb6cef3c8947099983551672a3b5d4e2fd | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectExactCardinalityImpl_CustomFieldSerializer.java#L95-L98 | train | Deserialize an instance of the CRNCTYPE class. | Of course, here is the Java code you requested:
```java
@Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectExactCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
}
```
Hope this helps! |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java | DagManager.shutDown | @Override
protected void shutDown()
throws Exception {
this.scheduledExecutorPool.shutdown();
this.scheduledExecutorPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
this.jobStatusMonitor.shutDown();
} | java | @Override
protected void shutDown()
throws Exception {
this.scheduledExecutorPool.shutdown();
this.scheduledExecutorPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
this.jobStatusMonitor.shutDown();
} | [
"@",
"Override",
"protected",
"void",
"shutDown",
"(",
")",
"throws",
"Exception",
"{",
"this",
".",
"scheduledExecutorPool",
".",
"shutdown",
"(",
")",
";",
"this",
".",
"scheduledExecutorPool",
".",
"awaitTermination",
"(",
"TERMINATION_TIMEOUT",
",",
"TimeUnit"... | Stop the service. | [
"Stop",
"the",
"service",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java#L578-L584 | train | Shut down the task. | Of course, here is the Java code you requested:
```java
@Override
protected void shutDown()
throws Exception {
this.scheduledExecutorPool.shutdown();
this.scheduledExecutorPool.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
this.jobStatusMonitor.shutDown();
}
```
Hope this helps! |
haifengl/smile | math/src/main/java/smile/sort/IntHeapSelect.java | IntHeapSelect.get | public int get(int i) {
if (i > Math.min(k, n) - 1) {
throw new IllegalArgumentException("HeapSelect i is greater than the number of data received so far.");
}
if (i == k-1) {
return heap[0];
}
if (!sorted) {
sort(heap, Math.min(k,n))... | java | public int get(int i) {
if (i > Math.min(k, n) - 1) {
throw new IllegalArgumentException("HeapSelect i is greater than the number of data received so far.");
}
if (i == k-1) {
return heap[0];
}
if (!sorted) {
sort(heap, Math.min(k,n))... | [
"public",
"int",
"get",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"i",
">",
"Math",
".",
"min",
"(",
"k",
",",
"n",
")",
"-",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"HeapSelect i is greater than the number of data received so far.\"",
... | Returns the i-<i>th</i> smallest value seen so far. i = 0 returns the smallest
value seen, i = 1 the second largest, ..., i = k-1 the last position
tracked. Also, i must be less than the number of previous assimilated. | [
"Returns",
"the",
"i",
"-",
"<i",
">",
"th<",
"/",
"i",
">",
"smallest",
"value",
"seen",
"so",
"far",
".",
"i",
"=",
"0",
"returns",
"the",
"smallest",
"value",
"seen",
"i",
"=",
"1",
"the",
"second",
"largest",
"...",
"i",
"=",
"k",
"-",
"1",
... | e27e43e90fbaacce3f99d30120cf9dd6a764c33d | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/sort/IntHeapSelect.java#L97-L112 | train | Gets the value of the i th entry in the heap. | Of course, here is the Java code you requested:
```java
public int get(int i) {
if (i > Math.min(k, n) - 1) {
throw new IllegalArgumentException("HeapSelect i is greater than the number of data received so far.");
}
if (i == k-1) {
return heap[0];
}
... |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_filter_name_rule_id_GET | public OvhRule domain_account_accountName_filter_name_rule_id_GET(String domain, String accountName, String name, Long id) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}";
StringBuilder sb = path(qPath, domain, accountName, name, id);
String resp = exec(q... | java | public OvhRule domain_account_accountName_filter_name_rule_id_GET(String domain, String accountName, String name, Long id) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}";
StringBuilder sb = path(qPath, domain, accountName, name, id);
String resp = exec(q... | [
"public",
"OvhRule",
"domain_account_accountName_filter_name_rule_id_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"name",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/account/{accoun... | Get this object properties
REST: GET /email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param name [required] Filter name
@param id [required] | [
"Get",
"this",
"object",
"properties"
] | 6d531a40e56e09701943e334c25f90f640c55701 | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L723-L728 | train | Get rule details | Of course, here is the Java code you requested:
```java
public OvhRule domain_account_accountName_filter_name_rule_id_GET(String domain, String accountName, String name, Long id) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}";
StringBuilder sb = path(qPat... |
BlueBrain/bluima | modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/ObjectFactory.java | ObjectFactory.createCartesianproduct | @XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "cartesianproduct")
public JAXBElement<CartesianproductType> createCartesianproduct(CartesianproductType value) {
return new JAXBElement<CartesianproductType>(_Cartesianproduct_QNAME, CartesianproductType.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "cartesianproduct")
public JAXBElement<CartesianproductType> createCartesianproduct(CartesianproductType value) {
return new JAXBElement<CartesianproductType>(_Cartesianproduct_QNAME, CartesianproductType.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.w3.org/1998/Math/MathML\"",
",",
"name",
"=",
"\"cartesianproduct\"",
")",
"public",
"JAXBElement",
"<",
"CartesianproductType",
">",
"createCartesianproduct",
"(",
"CartesianproductType",
"value",
")",
"{",
"ret... | Create an instance of {@link JAXBElement }{@code <}{@link CartesianproductType }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"CartesianproductType",
"}",
"{",
"@code",
">",
"}}"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/ObjectFactory.java#L3015-L3018 | train | Create an instance of the Cartesianproduct property. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "cartesianproduct")
public JAXBElement<CartesianproductType> createCartesianproduct(CartesianproductType value) {
return new JAXBElement<CartesianproductType>(_Cartesianproduct_Q... |
oblac/jodd | jodd-petite/src/main/java/jodd/petite/BeanDefinition.java | BeanDefinition.addDestroyMethodPoints | protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) {
if (destroyMethods == null) {
destroyMethods = methods;
} else {
destroyMethods = ArraysUtil.join(destroyMethods, methods);
}
} | java | protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) {
if (destroyMethods == null) {
destroyMethods = methods;
} else {
destroyMethods = ArraysUtil.join(destroyMethods, methods);
}
} | [
"protected",
"void",
"addDestroyMethodPoints",
"(",
"final",
"DestroyMethodPoint",
"[",
"]",
"methods",
")",
"{",
"if",
"(",
"destroyMethods",
"==",
"null",
")",
"{",
"destroyMethods",
"=",
"methods",
";",
"}",
"else",
"{",
"destroyMethods",
"=",
"ArraysUtil",
... | Adds destroy methods. | [
"Adds",
"destroy",
"methods",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/BeanDefinition.java#L244-L250 | test | Add destroy method points. | Of course, here is the Java code you requested:
```java
protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) {
if (destroyMethods == null) {
destroyMethods = methods;
} else {
destroyMethods = ArraysUtil.join(destroyMethods, methods);
}
}
```
Hope this helps! |
ocelotds/ocelot | ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java | JsTopicInterceptor.getDynamicTopic | String getDynamicTopic(Method method, Object[] parameters) {
int idx = 0; // synchronise the two arrays, array of parameter and array of annotations
Annotation[][] parametersAnnotations = method.getParameterAnnotations();
for (Annotation[] parameterAnnotations : parametersAnnotations) { // for each parameter
... | java | String getDynamicTopic(Method method, Object[] parameters) {
int idx = 0; // synchronise the two arrays, array of parameter and array of annotations
Annotation[][] parametersAnnotations = method.getParameterAnnotations();
for (Annotation[] parameterAnnotations : parametersAnnotations) { // for each parameter
... | [
"String",
"getDynamicTopic",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"parameters",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"// synchronise the two arrays, array of parameter and array of annotations\r",
"Annotation",
"[",
"]",
"[",
"]",
"parametersAnnotations",... | Get dynamic topicname from parameter annotated @JsTopicName
@param method
@param parameters
@return | [
"Get",
"dynamic",
"topicname",
"from",
"parameter",
"annotated",
"@JsTopicName"
] | 5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7 | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java#L82-L93 | train | Gets the dynamic topic for a method. | Of course, here is the Java code you requested:
```java
String getDynamicTopic(Method method, Object[] parameters) {
int idx = 0; // synchronise the two arrays, array of parameter and array of annotations
Annotation[][] parametersAnnotations = method.getParameterAnnotations();
for (Annotation[] parameterAnnot... |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/GetResourceConfigHistoryResult.java | GetResourceConfigHistoryResult.getConfigurationItems | public java.util.List<ConfigurationItem> getConfigurationItems() {
if (configurationItems == null) {
configurationItems = new com.amazonaws.internal.SdkInternalList<ConfigurationItem>();
}
return configurationItems;
} | java | public java.util.List<ConfigurationItem> getConfigurationItems() {
if (configurationItems == null) {
configurationItems = new com.amazonaws.internal.SdkInternalList<ConfigurationItem>();
}
return configurationItems;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"ConfigurationItem",
">",
"getConfigurationItems",
"(",
")",
"{",
"if",
"(",
"configurationItems",
"==",
"null",
")",
"{",
"configurationItems",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkI... | <p>
A list that contains the configuration history of one or more resources.
</p>
@return A list that contains the configuration history of one or more resources. | [
"<p",
">",
"A",
"list",
"that",
"contains",
"the",
"configuration",
"history",
"of",
"one",
"or",
"more",
"resources",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/GetResourceConfigHistoryResult.java#L50-L55 | train | Gets the value of the configurationItems property. | Of course, here is the Java code you requested:
```java
public java.util.List<ConfigurationItem> getConfigurationItems() {
if (configurationItems == null) {
configurationItems = new com.amazonaws.internal.SdkInternalList<ConfigurationItem>();
}
return configurationItems;
}
```
... |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/QueryParsers.java | QueryParsers.addLanguage | public void addLanguage( QueryParser languageParser ) {
CheckArg.isNotNull(languageParser, "languageParser");
this.parsers.put(languageParser.getLanguage().trim().toLowerCase(), languageParser);
} | java | public void addLanguage( QueryParser languageParser ) {
CheckArg.isNotNull(languageParser, "languageParser");
this.parsers.put(languageParser.getLanguage().trim().toLowerCase(), languageParser);
} | [
"public",
"void",
"addLanguage",
"(",
"QueryParser",
"languageParser",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"languageParser",
",",
"\"languageParser\"",
")",
";",
"this",
".",
"parsers",
".",
"put",
"(",
"languageParser",
".",
"getLanguage",
"(",
")",
... | Add a language to this engine by supplying its parser.
@param languageParser the query parser for the language
@throws IllegalArgumentException if the language parser is null | [
"Add",
"a",
"language",
"to",
"this",
"engine",
"by",
"supplying",
"its",
"parser",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/QueryParsers.java#L67-L70 | train | Add a language parser to the language list. | Of course, here is the Java code you requested:
```java
public void addLanguage( QueryParser languageParser ) {
CheckArg.isNotNull(languageParser, "languageParser");
this.parsers.put(languageParser.getLanguage().trim().toLowerCase(), languageParser);
}
```
Hope this helps! |
sksamuel/scrimage | scrimage-core/src/main/java/com/sksamuel/scrimage/AwtImage.java | AwtImage.contains | public boolean contains(Color color) {
return exists(p -> p.toInt() == color.toPixel().toInt());
} | java | public boolean contains(Color color) {
return exists(p -> p.toInt() == color.toPixel().toInt());
} | [
"public",
"boolean",
"contains",
"(",
"Color",
"color",
")",
"{",
"return",
"exists",
"(",
"p",
"->",
"p",
".",
"toInt",
"(",
")",
"==",
"color",
".",
"toPixel",
"(",
")",
".",
"toInt",
"(",
")",
")",
";",
"}"
] | Returns true if a pixel with the given color exists
@param color the pixel colour to look for.
@return true if there exists at least one pixel that has the given pixels color | [
"Returns",
"true",
"if",
"a",
"pixel",
"with",
"the",
"given",
"color",
"exists"
] | 52dab448136e6657a71951b0e6b7d5e64dc979ac | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-core/src/main/java/com/sksamuel/scrimage/AwtImage.java#L205-L207 | train | Checks if a resource contains a resource with the specified color. | Of course, here is the Java code you requested:
```java
public boolean contains(Color color) {
return exists(p -> p.toInt() == color.toPixel().toInt());
}
```
Hope this helps! |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasPermute.java | KerasPermute.getInputPreprocessor | @Override
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws
InvalidKerasConfigurationException {
if (inputType.length > 1)
throw new InvalidKerasConfigurationException(
"Keras Permute layer accepts only one input (received " + inputType.... | java | @Override
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws
InvalidKerasConfigurationException {
if (inputType.length > 1)
throw new InvalidKerasConfigurationException(
"Keras Permute layer accepts only one input (received " + inputType.... | [
"@",
"Override",
"public",
"InputPreProcessor",
"getInputPreprocessor",
"(",
"InputType",
"...",
"inputType",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"if",
"(",
"inputType",
".",
"length",
">",
"1",
")",
"throw",
"new",
"InvalidKerasConfigurationExcept... | Gets appropriate DL4J InputPreProcessor for given InputTypes.
@param inputType Array of InputTypes
@return DL4J InputPreProcessor
@throws InvalidKerasConfigurationException Invalid Keras config
@see InputPreProcessor | [
"Gets",
"appropriate",
"DL4J",
"InputPreProcessor",
"for",
"given",
"InputTypes",
"."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/core/KerasPermute.java#L92-L122 | train | Get InputPreProcessor from Keras InputType array. | Of course, here is the Java code you requested:
```java
@Override
public InputPreProcessor getInputPreprocessor(InputType... inputType) throws
InvalidKerasConfigurationException {
if (inputType.length > 1)
throw new InvalidKerasConfigurationException(
"Keras Perm... |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerAS.java | ContainerAS.afterCompletion | public void afterCompletion(int status)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) // d144064
Tr.entry(tc, "afterCompletion (" + status + ") : " + this);
try
{
// inform the activator that the sessi... | java | public void afterCompletion(int status)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) // d144064
Tr.entry(tc, "afterCompletion (" + status + ") : " + this);
try
{
// inform the activator that the sessi... | [
"public",
"void",
"afterCompletion",
"(",
"int",
"status",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"// d144064",
"T... | This method is called after the ActivitySession associated with
this <code>ContainerAS</code> has completed. | [
"This",
"method",
"is",
"called",
"after",
"the",
"ActivitySession",
"associated",
"with",
"this",
"<code",
">",
"ContainerAS<",
"/",
"code",
">",
"has",
"completed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerAS.java#L161-L212 | train | d425046. 1 | Of course, here is the Java code you requested:
```java
public void afterCompletion(int status)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) // d144064
Tr.entry(tc, "afterCompletion (" + status + ") : " + this);
try
... |
streamsets/datacollector | omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmnitureSource.java | OmnitureSource.validateReportDescription | private void validateReportDescription(List<ConfigIssue> issues){
if(!jsonMapper.isValidJson(this.reportDescription)) {
issues.add(
getContext().createConfigIssue(
Groups.REPORT.name(),
"reportDescription",
Errors.OMNITURE_03
));
}
} | java | private void validateReportDescription(List<ConfigIssue> issues){
if(!jsonMapper.isValidJson(this.reportDescription)) {
issues.add(
getContext().createConfigIssue(
Groups.REPORT.name(),
"reportDescription",
Errors.OMNITURE_03
));
}
} | [
"private",
"void",
"validateReportDescription",
"(",
"List",
"<",
"ConfigIssue",
">",
"issues",
")",
"{",
"if",
"(",
"!",
"jsonMapper",
".",
"isValidJson",
"(",
"this",
".",
"reportDescription",
")",
")",
"{",
"issues",
".",
"add",
"(",
"getContext",
"(",
... | Validate Ominture Report Description. | [
"Validate",
"Ominture",
"Report",
"Description",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmnitureSource.java#L96-L105 | test | Validate the reportDescription | Of course, here is the Java code you requested:
```java
private void validateReportDescription(List<ConfigIssue> issues){
if(!jsonMapper.isValidJson(this.reportDescription)) {
issues.add(
getContext().createConfigIssue(
Groups.REPORT.name(),
"reportDescription",
... |
nielsbasjes/logparser | parser-core/src/main/java/nl/basjes/parse/core/Parser.java | Parser.findUsefulDissectorsFromField | private void findUsefulDissectorsFromField(
final Set<String> possibleTargets,
final Set<String> locatedTargets,
final String subRootType, final String subRootName,
final boolean thisIsTheRoot) {
String subRootId = subRootType + ':' + subRootName;
// Whe... | java | private void findUsefulDissectorsFromField(
final Set<String> possibleTargets,
final Set<String> locatedTargets,
final String subRootType, final String subRootName,
final boolean thisIsTheRoot) {
String subRootId = subRootType + ':' + subRootName;
// Whe... | [
"private",
"void",
"findUsefulDissectorsFromField",
"(",
"final",
"Set",
"<",
"String",
">",
"possibleTargets",
",",
"final",
"Set",
"<",
"String",
">",
"locatedTargets",
",",
"final",
"String",
"subRootType",
",",
"final",
"String",
"subRootName",
",",
"final",
... | -------------------------------------------- | [
"--------------------------------------------"
] | 236d5bf91926addab82b20387262bb35da8512cd | https://github.com/nielsbasjes/logparser/blob/236d5bf91926addab82b20387262bb35da8512cd/parser-core/src/main/java/nl/basjes/parse/core/Parser.java#L360-L458 | train | Find useful dissectors from field. | Of course, here is the Java code you requested:
```java
private void findUsefulDissectorsFromField(
final Set<String> possibleTargets,
final Set<String> locatedTargets,
final String subRootType, final String subRootName,
final boolean thisIsTheRoot) {
String sub... |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/JCEKSKeystoreCredentialStore.java | JCEKSKeystoreCredentialStore.generateAesKeys | public void generateAesKeys(int numKeys, int startOffset) throws IOException, KeyStoreException {
for (int i = 1; i <= numKeys; i++) {
SecretKey key = generateKey();
ks.setEntry(String.valueOf(i + startOffset), new KeyStore.SecretKeyEntry(key),
new KeyStore.PasswordProtection(password));
}... | java | public void generateAesKeys(int numKeys, int startOffset) throws IOException, KeyStoreException {
for (int i = 1; i <= numKeys; i++) {
SecretKey key = generateKey();
ks.setEntry(String.valueOf(i + startOffset), new KeyStore.SecretKeyEntry(key),
new KeyStore.PasswordProtection(password));
}... | [
"public",
"void",
"generateAesKeys",
"(",
"int",
"numKeys",
",",
"int",
"startOffset",
")",
"throws",
"IOException",
",",
"KeyStoreException",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"numKeys",
";",
"i",
"++",
")",
"{",
"SecretKey",
"key",... | Generate a set of AES keys for the store. The key ids will simple be (startOffset ... startOffset + numKeys).
@param numKeys Number of keys to generate
@param startOffset ID to start generating keys with
@throws IOException If there is an error serializing the keystore back to disk
@throws KeyStoreException If there is... | [
"Generate",
"a",
"set",
"of",
"AES",
"keys",
"for",
"the",
"store",
".",
"The",
"key",
"ids",
"will",
"simple",
"be",
"(",
"startOffset",
"...",
"startOffset",
"+",
"numKeys",
")",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/JCEKSKeystoreCredentialStore.java#L163-L171 | train | Generate a set of AesKeys from the input stream. | Of course, here is the Java code you requested:
```java
public void generateAesKeys(int numKeys, int startOffset) throws IOException, KeyStoreException {
for (int i = 1; i <= numKeys; i++) {
SecretKey key = generateKey();
ks.setEntry(String.valueOf(i + startOffset), new KeyStore.SecretKeyEntry(key),
... |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/AWSGlueClient.java | AWSGlueClient.createDatabase | @Override
public CreateDatabaseResult createDatabase(CreateDatabaseRequest request) {
request = beforeClientExecution(request);
return executeCreateDatabase(request);
} | java | @Override
public CreateDatabaseResult createDatabase(CreateDatabaseRequest request) {
request = beforeClientExecution(request);
return executeCreateDatabase(request);
} | [
"@",
"Override",
"public",
"CreateDatabaseResult",
"createDatabase",
"(",
"CreateDatabaseRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCreateDatabase",
"(",
"request",
")",
";",
"}"
] | <p>
Creates a new database in a Data Catalog.
</p>
@param createDatabaseRequest
@return Result of the CreateDatabase operation returned by the service.
@throws InvalidInputException
The input provided was not valid.
@throws AlreadyExistsException
A resource to be created or added already exists.
@throws ResourceNumber... | [
"<p",
">",
"Creates",
"a",
"new",
"database",
"in",
"a",
"Data",
"Catalog",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/AWSGlueClient.java#L1075-L1079 | train | Creates a CRUOUS database. | Of course, here is the Java code you requested:
```java
@Override
public CreateDatabaseResult createDatabase(CreateDatabaseRequest request) {
request = beforeClientExecution(request);
return executeCreateDatabase(request);
}
```
Hope this helps! |
square/sqlbrite | sqlbrite/src/main/java/com/squareup/sqlbrite3/BriteDatabase.java | BriteDatabase.createQuery | @CheckResult @NonNull
public QueryObservable createQuery(@NonNull final Iterable<String> tables,
@NonNull SupportSQLiteQuery query) {
return createQuery(new DatabaseQuery(tables, query));
} | java | @CheckResult @NonNull
public QueryObservable createQuery(@NonNull final Iterable<String> tables,
@NonNull SupportSQLiteQuery query) {
return createQuery(new DatabaseQuery(tables, query));
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"QueryObservable",
"createQuery",
"(",
"@",
"NonNull",
"final",
"Iterable",
"<",
"String",
">",
"tables",
",",
"@",
"NonNull",
"SupportSQLiteQuery",
"query",
")",
"{",
"return",
"createQuery",
"(",
"new",
"DatabaseQu... | See {@link #createQuery(String, SupportSQLiteQuery)} for usage. This overload allows for
monitoring multiple tables for changes.
@see SupportSQLiteDatabase#query(SupportSQLiteQuery) | [
"See",
"{",
"@link",
"#createQuery",
"(",
"String",
"SupportSQLiteQuery",
")",
"}",
"for",
"usage",
".",
"This",
"overload",
"allows",
"for",
"monitoring",
"multiple",
"tables",
"for",
"changes",
"."
] | 3fe18b615ebd3a3b4a0e0f71381acd8ba17e84ba | https://github.com/square/sqlbrite/blob/3fe18b615ebd3a3b4a0e0f71381acd8ba17e84ba/sqlbrite/src/main/java/com/squareup/sqlbrite3/BriteDatabase.java#L370-L374 | valid | Create a new query observable. | Of course, here is the Java code you requested:
```java
@CheckResult @NonNull
public QueryObservable createQuery(@NonNull final Iterable<String> tables,
@NonNull SupportSQLiteQuery query) {
return createQuery(new DatabaseQuery(tables, query));
}
```
Hope this helps! |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/DirectLogFetcher.java | DirectLogFetcher.putInt32 | protected final void putInt32(long i32) {
ensureCapacity(position + 4);
byte[] buf = buffer;
buf[position++] = (byte) (i32 & 0xff);
buf[position++] = (byte) (i32 >>> 8);
buf[position++] = (byte) (i32 >>> 16);
buf[position++] = (byte) (i32 >>> 24);
} | java | protected final void putInt32(long i32) {
ensureCapacity(position + 4);
byte[] buf = buffer;
buf[position++] = (byte) (i32 & 0xff);
buf[position++] = (byte) (i32 >>> 8);
buf[position++] = (byte) (i32 >>> 16);
buf[position++] = (byte) (i32 >>> 24);
} | [
"protected",
"final",
"void",
"putInt32",
"(",
"long",
"i32",
")",
"{",
"ensureCapacity",
"(",
"position",
"+",
"4",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"buffer",
";",
"buf",
"[",
"position",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"i32",
"&",
... | Put 32-bit integer in the buffer.
@param i32 the integer to put in the buffer | [
"Put",
"32",
"-",
"bit",
"integer",
"in",
"the",
"buffer",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/DirectLogFetcher.java#L229-L237 | train | Puts the 32 - bit integer into the buffer. | Of course, here is the Java code you requested:
```java
protected final void putInt32(long i32) {
ensureCapacity(position + 4);
byte[] buf = buffer;
buf[position++] = (byte) (i32 & 0xff);
buf[position++] = (byte) (i32 >>> 8);
buf[position++] = (byte) (i32 >>> 16);
... |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/MarketplaceListing.java | MarketplaceListing.jsonify | public JSONObject jsonify() {
JSONObject ret = new JSONObject();
ret.put("title", getTitle());
ret.put("category", getCategory());
ret.put("subcategory", getSubCategory());
ret.put("description", getDescription());
if (null != this._extraAttributes && !this._extraAttributes.isEmpty()) {
re... | java | public JSONObject jsonify() {
JSONObject ret = new JSONObject();
ret.put("title", getTitle());
ret.put("category", getCategory());
ret.put("subcategory", getSubCategory());
ret.put("description", getDescription());
if (null != this._extraAttributes && !this._extraAttributes.isEmpty()) {
re... | [
"public",
"JSONObject",
"jsonify",
"(",
")",
"{",
"JSONObject",
"ret",
"=",
"new",
"JSONObject",
"(",
")",
";",
"ret",
".",
"put",
"(",
"\"title\"",
",",
"getTitle",
"(",
")",
")",
";",
"ret",
".",
"put",
"(",
"\"category\"",
",",
"getCategory",
"(",
... | Return a JSON representation of this object
@return JSONObject | [
"Return",
"a",
"JSON",
"representation",
"of",
"this",
"object"
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/MarketplaceListing.java#L132-L142 | train | Returns a JSON representation of the object. | Of course, here is the Java code you requested:
```java
public JSONObject jsonify() {
JSONObject ret = new JSONObject();
ret.put("title", getTitle());
ret.put("category", getCategory());
ret.put("subcategory", getSubCategory());
ret.put("description", getDescription());
if (null != this._extraA... |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java | FingerprintManager.getRobustPointList | private List<Integer>[] getRobustPointList(double[][] spectrogramData) {
int numX = spectrogramData.length;
int numY = spectrogramData[0].length;
double[][] allBanksIntensities = new double[numX][numY];
int bandwidthPerBank = numY / numFilterBanks;
for (int b = 0; b < numFilte... | java | private List<Integer>[] getRobustPointList(double[][] spectrogramData) {
int numX = spectrogramData.length;
int numY = spectrogramData[0].length;
double[][] allBanksIntensities = new double[numX][numY];
int bandwidthPerBank = numY / numFilterBanks;
for (int b = 0; b < numFilte... | [
"private",
"List",
"<",
"Integer",
">",
"[",
"]",
"getRobustPointList",
"(",
"double",
"[",
"]",
"[",
"]",
"spectrogramData",
")",
"{",
"int",
"numX",
"=",
"spectrogramData",
".",
"length",
";",
"int",
"numY",
"=",
"spectrogramData",
"[",
"0",
"]",
".",
... | robustLists[x]=y1,y2,y3,... | [
"robustLists",
"[",
"x",
"]",
"=",
"y1",
"y2",
"y3",
"..."
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L198-L251 | train | Get the list of robust points in the spectrogramData | Of course, here is the Java code you requested:
```java
private List<Integer>[] getRobustPointList(double[][] spectrogramData) {
int numX = spectrogramData.length;
int numY = spectrogramData[0].length;
double[][] allBanksIntensities = new double[numX][numY];
int bandwidthPerBank = num... |
aragozin/jvm-tools | hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/TagBounds.java | TagBounds.union | TagBounds union(TagBounds otherTagBounds) {
if (otherTagBounds == null) {
return this;
}
long start = Math.min(startOffset, otherTagBounds.startOffset);
long end = Math.max(endOffset, otherTagBounds.endOffset);
return new TagBounds(-1, start, end);
} | java | TagBounds union(TagBounds otherTagBounds) {
if (otherTagBounds == null) {
return this;
}
long start = Math.min(startOffset, otherTagBounds.startOffset);
long end = Math.max(endOffset, otherTagBounds.endOffset);
return new TagBounds(-1, start, end);
} | [
"TagBounds",
"union",
"(",
"TagBounds",
"otherTagBounds",
")",
"{",
"if",
"(",
"otherTagBounds",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"long",
"start",
"=",
"Math",
".",
"min",
"(",
"startOffset",
",",
"otherTagBounds",
".",
"startOffset",
")... | ~ Methods ------------------------------------------------------------------------------------------------------------------ | [
"~",
"Methods",
"------------------------------------------------------------------------------------------------------------------"
] | d3a4d0c6a47fb9317f274988569655f30dcd2f76 | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/hprof-heap/src/main/java/org/netbeans/lib/profiler/heap/TagBounds.java#L68-L77 | train | Union this tag bounds with another. | Of course, here is the Java code you requested:
```java
TagBounds union(TagBounds otherTagBounds) {
if (otherTagBounds == null) {
return this;
}
long start = Math.min(startOffset, otherTagBounds.startOffset);
long end = Math.max(endOffset, otherTagBounds.endOffset);
... |
johnkil/Android-RobotoTextView | robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java | RobotoTypefaces.setUpTypeface | public static void setUpTypeface(@NonNull TextView textView, @RobotoFontFamily int fontFamily,
@RobotoTextWeight int textWeight, @RobotoTextStyle int textStyle) {
setUpTypeface(textView, obtainTypeface(textView.getContext(), fontFamily, textWeight, textStyle));
} | java | public static void setUpTypeface(@NonNull TextView textView, @RobotoFontFamily int fontFamily,
@RobotoTextWeight int textWeight, @RobotoTextStyle int textStyle) {
setUpTypeface(textView, obtainTypeface(textView.getContext(), fontFamily, textWeight, textStyle));
} | [
"public",
"static",
"void",
"setUpTypeface",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"RobotoFontFamily",
"int",
"fontFamily",
",",
"@",
"RobotoTextWeight",
"int",
"textWeight",
",",
"@",
"RobotoTextStyle",
"int",
"textStyle",
")",
"{",
"setUpTypefac... | Set up typeface for TextView.
@param textView The text view
@param fontFamily The value of "robotoFontFamily" attribute
@param textWeight The value of "robotoTextWeight" attribute
@param textStyle The value of "robotoTextStyle" attribute | [
"Set",
"up",
"typeface",
"for",
"TextView",
"."
] | 1341602f16c08057dddd193411e7dab96f963b77 | https://github.com/johnkil/Android-RobotoTextView/blob/1341602f16c08057dddd193411e7dab96f963b77/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java#L537-L540 | train | Set the typeface of the TextView. | Of course, here is the Java code you requested:
```java
public static void setUpTypeface(@NonNull TextView textView, @RobotoFontFamily int fontFamily,
@RobotoTextWeight int textWeight, @RobotoTextStyle int textStyle) {
setUpTypeface(textView, obtainTypeface(textView.getContext(), fontFamily, textWe... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.materialize | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<Notification<T>> materialize() {
return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this));
} | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<Notification<T>> materialize() {
return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this));
} | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"Notification",
"<",
"T",
">",
">",
"materialize",
"(",
")",
... | Returns a Flowable that represents all of the emissions <em>and</em> notifications from the source
Publisher into emissions marked with their original types within {@link Notification} objects.
<p>
<img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/materialize.png" alt="... | [
"Returns",
"a",
"Flowable",
"that",
"represents",
"all",
"of",
"the",
"emissions",
"<em",
">",
"and<",
"/",
"em",
">",
"notifications",
"from",
"the",
"source",
"Publisher",
"into",
"emissions",
"marked",
"with",
"their",
"original",
"types",
"within",
"{",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L11374-L11379 | test | Materialize the source notification. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<Notification<T>> materialize() {
return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this));
}
```
Hope th... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAApplInfo.java | JPAApplInfo.getPersistenceUnitInfo | JPAPUnitInfo getPersistenceUnitInfo(String modName, String puName) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getPersistenceUnitInfo", modName, puName, this);
JPAPUnitInfo rtnVal = null;
JPAScopeInfo scopeInfo = null;
if (puName == null ... | java | JPAPUnitInfo getPersistenceUnitInfo(String modName, String puName) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getPersistenceUnitInfo", modName, puName, this);
JPAPUnitInfo rtnVal = null;
JPAScopeInfo scopeInfo = null;
if (puName == null ... | [
"JPAPUnitInfo",
"getPersistenceUnitInfo",
"(",
"String",
"modName",
",",
"String",
"puName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
... | d408412 Begins | [
"d408412",
"Begins"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAApplInfo.java#L182-L237 | train | Gets the PersistenceUnitInfo object for the specified persistence unit. | Of course, here is the Java code you requested:
```java
JPAPUnitInfo getPersistenceUnitInfo(String modName, String puName) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getPersistenceUnitInfo", modName, puName, this);
JPAPUnitInfo rtnVal = null;
J... |
landawn/AbacusUtil | src/com/landawn/abacus/util/Seq.java | Seq.last | public List<T> last(final int n) {
N.checkArgument(n >= 0, "'n' can't be negative: " + n);
if (N.isNullOrEmpty(coll) || n == 0) {
return new ArrayList<>();
} else if (coll.size() <= n) {
return new ArrayList<>(coll);
} else if (coll instanceof List) {
... | java | public List<T> last(final int n) {
N.checkArgument(n >= 0, "'n' can't be negative: " + n);
if (N.isNullOrEmpty(coll) || n == 0) {
return new ArrayList<>();
} else if (coll.size() <= n) {
return new ArrayList<>(coll);
} else if (coll instanceof List) {
... | [
"public",
"List",
"<",
"T",
">",
"last",
"(",
"final",
"int",
"n",
")",
"{",
"N",
".",
"checkArgument",
"(",
"n",
">=",
"0",
",",
"\"'n' can't be negative: \"",
"+",
"n",
")",
";",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"coll",
")",
"||",
"n",
... | Return at most last <code>n</code> elements.
@param n
@return | [
"Return",
"at",
"most",
"last",
"<code",
">",
"n<",
"/",
"code",
">",
"elements",
"."
] | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Seq.java#L473-L497 | train | Returns the last n records from the collection. | Of course, here is the Java code you requested:
```java
public List<T> last(final int n) {
N.checkArgument(n >= 0, "'n' can't be negative: " + n);
if (N.isNullOrEmpty(coll) || n == 0) {
return new ArrayList<>();
} else if (coll.size() <= n) {
return new ArrayList<... |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpService.java | AnnotatedHttpService.convertResponse | private HttpResponse convertResponse(ServiceRequestContext ctx, HttpRequest req,
@Nullable HttpHeaders headers, @Nullable Object result,
HttpHeaders trailingHeaders) {
final HttpHeaders newHeaders;
final HttpHeaders newTra... | java | private HttpResponse convertResponse(ServiceRequestContext ctx, HttpRequest req,
@Nullable HttpHeaders headers, @Nullable Object result,
HttpHeaders trailingHeaders) {
final HttpHeaders newHeaders;
final HttpHeaders newTra... | [
"private",
"HttpResponse",
"convertResponse",
"(",
"ServiceRequestContext",
"ctx",
",",
"HttpRequest",
"req",
",",
"@",
"Nullable",
"HttpHeaders",
"headers",
",",
"@",
"Nullable",
"Object",
"result",
",",
"HttpHeaders",
"trailingHeaders",
")",
"{",
"final",
"HttpHea... | Converts the specified {@code result} to an {@link HttpResponse}. | [
"Converts",
"the",
"specified",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpService.java#L263-L306 | train | Convert response. | Of course, here is the Java code you requested:
```java
private HttpResponse convertResponse(ServiceRequestContext ctx, HttpRequest req,
@Nullable HttpHeaders headers, @Nullable Object result,
HttpHeaders trailingHeaders) {
final... |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.resources | List<JCTree> resources() {
ListBuffer<JCTree> defs = new ListBuffer<>();
defs.append(resource());
while (token.kind == SEMI) {
// All but last of multiple declarators must subsume a semicolon
storeEnd(defs.last(), token.endPos);
int semiColonPos = token.pos;
... | java | List<JCTree> resources() {
ListBuffer<JCTree> defs = new ListBuffer<>();
defs.append(resource());
while (token.kind == SEMI) {
// All but last of multiple declarators must subsume a semicolon
storeEnd(defs.last(), token.endPos);
int semiColonPos = token.pos;
... | [
"List",
"<",
"JCTree",
">",
"resources",
"(",
")",
"{",
"ListBuffer",
"<",
"JCTree",
">",
"defs",
"=",
"new",
"ListBuffer",
"<>",
"(",
")",
";",
"defs",
".",
"append",
"(",
"resource",
"(",
")",
")",
";",
"while",
"(",
"token",
".",
"kind",
"==",
... | Resources = Resource { ";" Resources } | [
"Resources",
"=",
"Resource",
"{",
";",
"Resources",
"}"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3073-L3088 | train | Get resources. | Of course, here is the Java code you requested:
```java
List<JCTree> resources() {
ListBuffer<JCTree> defs = new ListBuffer<>();
defs.append(resource());
while (token.kind == SEMI) {
// All but last of multiple declarators must subsume a semicolon
storeEnd(defs.last(), t... |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.neConst | public static <D> Predicate neConst(Expression<D> left, D constant) {
return ne(left, ConstantImpl.create(constant));
} | java | public static <D> Predicate neConst(Expression<D> left, D constant) {
return ne(left, ConstantImpl.create(constant));
} | [
"public",
"static",
"<",
"D",
">",
"Predicate",
"neConst",
"(",
"Expression",
"<",
"D",
">",
"left",
",",
"D",
"constant",
")",
"{",
"return",
"ne",
"(",
"left",
",",
"ConstantImpl",
".",
"create",
"(",
"constant",
")",
")",
";",
"}"
] | Create a {@code left != constant} expression
@param <D> type of expression
@param left lhs of expression
@param constant rhs of expression
@return left != constant | [
"Create",
"a",
"{",
"@code",
"left",
"!",
"=",
"constant",
"}",
"expression"
] | 2bf234caf78549813a1e0f44d9c30ecc5ef734e3 | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L707-L709 | train | Create a Predicate that returns true if the given expression is not equal to the given constant. | Of course, here is the Java code you requested:
```java
public static <D> Predicate neConst(Expression<D> left, D constant) {
return ne(left, ConstantImpl.create(constant));
}
```
Hope this helps! |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.getAt | public Object getAt(final int index) {
if (index < 0) {
// calculate whole list in this case
// recommend avoiding -ve's as this is obviously not as efficient
List list = list();
int adjustedIndex = index + list.size();
if (adjustedIndex >= 0 && adjust... | java | public Object getAt(final int index) {
if (index < 0) {
// calculate whole list in this case
// recommend avoiding -ve's as this is obviously not as efficient
List list = list();
int adjustedIndex = index + list.size();
if (adjustedIndex >= 0 && adjust... | [
"public",
"Object",
"getAt",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"// calculate whole list in this case",
"// recommend avoiding -ve's as this is obviously not as efficient",
"List",
"list",
"=",
"list",
"(",
")",
";",
"int... | Supports the subscript operator for a GPathResult.
<pre class="groovyTestCase">
import groovy.util.slurpersupport.*
def text = """
<characterList>
<character/>
<character>
<name>Gromit</name>
</character>
</characterList>"""
GPathResult characterList = new XmlSlurper().parseTe... | [
"Supports",
"the",
"subscript",
"operator",
"for",
"a",
"GPathResult",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"import",
"groovy",
".",
"util",
".",
"slurpersupport",
".",
"*",
"def",
"text",
"=",
"<",
";",
"characterList>",
";",
"<",
";",
... | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L426-L448 | train | Gets the value at the specified index. | Of course, here is the Java code you requested:
```java
public Object getAt(final int index) {
if (index < 0) {
// calculate whole list in this case
// recommend avoiding -ve's as this is obviously not as efficient
List list = list();
int adjustedIndex = index + ... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java | Types.POJO | public static <T> TypeInformation<T> POJO(Class<T> pojoClass, Map<String, TypeInformation<?>> fields) {
final List<PojoField> pojoFields = new ArrayList<>(fields.size());
for (Map.Entry<String, TypeInformation<?>> field : fields.entrySet()) {
final Field f = TypeExtractor.getDeclaredField(pojoClass, field.getKey... | java | public static <T> TypeInformation<T> POJO(Class<T> pojoClass, Map<String, TypeInformation<?>> fields) {
final List<PojoField> pojoFields = new ArrayList<>(fields.size());
for (Map.Entry<String, TypeInformation<?>> field : fields.entrySet()) {
final Field f = TypeExtractor.getDeclaredField(pojoClass, field.getKey... | [
"public",
"static",
"<",
"T",
">",
"TypeInformation",
"<",
"T",
">",
"POJO",
"(",
"Class",
"<",
"T",
">",
"pojoClass",
",",
"Map",
"<",
"String",
",",
"TypeInformation",
"<",
"?",
">",
">",
"fields",
")",
"{",
"final",
"List",
"<",
"PojoField",
">",
... | Returns type information for a POJO (Plain Old Java Object) and allows to specify all fields manually.
<p>A POJO class is public and standalone (no non-static inner class). It has a public no-argument
constructor. All non-static, non-transient fields in the class (and all superclasses) are either public
(and non-final... | [
"Returns",
"type",
"information",
"for",
"a",
"POJO",
"(",
"Plain",
"Old",
"Java",
"Object",
")",
"and",
"allows",
"to",
"specify",
"all",
"fields",
"manually",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java#L312-L323 | train | Creates a POJO type from a map of fields. | Of course, here is the Java code you requested:
```java
public static <T> TypeInformation<T> POJO(Class<T> pojoClass, Map<String, TypeInformation<?>> fields) {
final List<PojoField> pojoFields = new ArrayList<>(fields.size());
for (Map.Entry<String, TypeInformation<?>> field : fields.entrySet()) {
final Field f... |
iipc/webarchive-commons | src/main/java/org/archive/util/SurtPrefixSet.java | SurtPrefixSet.convertAllPrefixesToDomains | public void convertAllPrefixesToDomains() {
SurtPrefixSet iterCopy = (SurtPrefixSet) this.clone();
Iterator<String> iter = iterCopy.iterator();
while (iter.hasNext()) {
String prefix = (String) iter.next();
String convPrefix = convertPrefixToDomain(prefix);
if... | java | public void convertAllPrefixesToDomains() {
SurtPrefixSet iterCopy = (SurtPrefixSet) this.clone();
Iterator<String> iter = iterCopy.iterator();
while (iter.hasNext()) {
String prefix = (String) iter.next();
String convPrefix = convertPrefixToDomain(prefix);
if... | [
"public",
"void",
"convertAllPrefixesToDomains",
"(",
")",
"{",
"SurtPrefixSet",
"iterCopy",
"=",
"(",
"SurtPrefixSet",
")",
"this",
".",
"clone",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"iter",
"=",
"iterCopy",
".",
"iterator",
"(",
")",
";",
"whil... | Changes all prefixes so that they only enforce a general
domain (allowing subdomains).For prefixes that don't include
a ')', no change is necessary. For others, truncate everything
from the ')' onward. Additionally, truncate off "www," if it
appears. | [
"Changes",
"all",
"prefixes",
"so",
"that",
"they",
"only",
"enforce",
"a",
"general",
"domain",
"(",
"allowing",
"subdomains",
")",
".",
"For",
"prefixes",
"that",
"don",
"t",
"include",
"a",
")",
"no",
"change",
"is",
"necessary",
".",
"For",
"others",
... | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/SurtPrefixSet.java#L307-L319 | train | Convert all prefixes to domains. | Of course, here is the Java code you requested:
```java
public void convertAllPrefixesToDomains() {
SurtPrefixSet iterCopy = (SurtPrefixSet) this.clone();
Iterator<String> iter = iterCopy.iterator();
while (iter.hasNext()) {
String prefix = (String) iter.next();
String c... |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java | SeleniumGridListener.invokeInitializersBasedOnPriority | private void invokeInitializersBasedOnPriority(ITestContext context) {
ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
for (Initializer l : serviceLoader) {
loader.a... | java | private void invokeInitializersBasedOnPriority(ITestContext context) {
ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
for (Initializer l : serviceLoader) {
loader.a... | [
"private",
"void",
"invokeInitializersBasedOnPriority",
"(",
"ITestContext",
"context",
")",
"{",
"ServiceLoader",
"<",
"Initializer",
">",
"serviceLoader",
"=",
"ServiceLoader",
".",
"load",
"(",
"Initializer",
".",
"class",
")",
";",
"List",
"<",
"AbstractConfigIn... | This method facilitates initialization of all configurations from the current project as well as downstream
consumers.
@param context | [
"This",
"method",
"facilitates",
"initialization",
"of",
"all",
"configurations",
"from",
"the",
"current",
"project",
"as",
"well",
"as",
"downstream",
"consumers",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L540-L550 | train | Invoke initializers based on priority. | Of course, here is the Java code you requested:
```java
private void invokeInitializersBasedOnPriority(ITestContext context) {
ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
f... |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/UnsynchronizedSingletonFieldWrites.java | UnsynchronizedSingletonFieldWrites.isIgnorableMethod | private boolean isIgnorableMethod(Method m) {
if (m.isStatic() || m.isSynchronized()) {
return true;
}
String name = m.getName();
if (Values.CONSTRUCTOR.equals(name) || Values.STATIC_INITIALIZER.equals(name)) {
return true;
}
AnnotationEntry[] an... | java | private boolean isIgnorableMethod(Method m) {
if (m.isStatic() || m.isSynchronized()) {
return true;
}
String name = m.getName();
if (Values.CONSTRUCTOR.equals(name) || Values.STATIC_INITIALIZER.equals(name)) {
return true;
}
AnnotationEntry[] an... | [
"private",
"boolean",
"isIgnorableMethod",
"(",
"Method",
"m",
")",
"{",
"if",
"(",
"m",
".",
"isStatic",
"(",
")",
"||",
"m",
".",
"isSynchronized",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"String",
"name",
"=",
"m",
".",
"getName",
"(",
"... | looks for methods that should not be scanned for fields writes for a variety of reasons
<ul>
<li>Constructor</li>
<li>Static Initializer</li>
<li>static method</li>
<li>Has a synchronized attribute</li>
<li>Has a @PostConstruct annotation</li>
<li>Has an @Autowired annotation</li>
</ul>
@param m
the method to check
@r... | [
"looks",
"for",
"methods",
"that",
"should",
"not",
"be",
"scanned",
"for",
"fields",
"writes",
"for",
"a",
"variety",
"of",
"reasons",
"<ul",
">",
"<li",
">",
"Constructor<",
"/",
"li",
">",
"<li",
">",
"Static",
"Initializer<",
"/",
"li",
">",
"<li",
... | 3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8 | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UnsynchronizedSingletonFieldWrites.java#L216-L240 | train | Checks if the method is ignorable. | Of course, here is the Java code you requested:
```java
private boolean isIgnorableMethod(Method m) {
if (m.isStatic() || m.isSynchronized()) {
return true;
}
String name = m.getName();
if (Values.CONSTRUCTOR.equals(name) || Values.STATIC_INITIALIZER.equals(name)) {
... |
lennartj/nazgul_tools | visualization/visualization-spi-doclet/src/main/java/se/jguru/nazgul/tools/visualization/spi/doclet/VisualizationDoclet.java | VisualizationDoclet.optionLength | @Override
public int optionLength(final String option) {
// #1) Handle the -help option.
if (JavaDocOption.HELP.getOption().equals(option)) {
// First, provide the help text from the Standard Doclet.
final int toReturn = HtmlDoclet.optionLength(option);
// Prin... | java | @Override
public int optionLength(final String option) {
// #1) Handle the -help option.
if (JavaDocOption.HELP.getOption().equals(option)) {
// First, provide the help text from the Standard Doclet.
final int toReturn = HtmlDoclet.optionLength(option);
// Prin... | [
"@",
"Override",
"public",
"int",
"optionLength",
"(",
"final",
"String",
"option",
")",
"{",
"// #1) Handle the -help option.",
"if",
"(",
"JavaDocOption",
".",
"HELP",
".",
"getOption",
"(",
")",
".",
"equals",
"(",
"option",
")",
")",
"{",
"// First, provid... | {@inheritDoc} | [
"{"
] | 27425742629a49f7e0834127002083ff1e180564 | https://github.com/lennartj/nazgul_tools/blob/27425742629a49f7e0834127002083ff1e180564/visualization/visualization-spi-doclet/src/main/java/se/jguru/nazgul/tools/visualization/spi/doclet/VisualizationDoclet.java#L164-L195 | valid | Override the method to return the length of the option. | Of course, here is the Java code you requested:
```java
@Override
public int optionLength(final String option) {
// #1) Handle the -help option.
if (JavaDocOption.HELP.getOption().equals(option)) {
// First, provide the help text from the Standard Doclet.
final int toRetur... |
fabric8io/fabric8-forge | addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java | RouteXml.marshal | public void marshal(File file, final List<RouteDefinition> routeDefinitionList) throws Exception {
marshal(file, new Model2Model() {
@Override
public XmlModel transform(XmlModel model) {
copyRoutesToElement(routeDefinitionList, model.getContextElement());
... | java | public void marshal(File file, final List<RouteDefinition> routeDefinitionList) throws Exception {
marshal(file, new Model2Model() {
@Override
public XmlModel transform(XmlModel model) {
copyRoutesToElement(routeDefinitionList, model.getContextElement());
... | [
"public",
"void",
"marshal",
"(",
"File",
"file",
",",
"final",
"List",
"<",
"RouteDefinition",
">",
"routeDefinitionList",
")",
"throws",
"Exception",
"{",
"marshal",
"(",
"file",
",",
"new",
"Model2Model",
"(",
")",
"{",
"@",
"Override",
"public",
"XmlMode... | Loads the given file then updates the route definitions from the given list then stores the file again | [
"Loads",
"the",
"given",
"file",
"then",
"updates",
"the",
"route",
"definitions",
"from",
"the",
"given",
"list",
"then",
"stores",
"the",
"file",
"again"
] | a59871bae4d5c5d3ece10f1e8758e73663087f19 | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/RouteXml.java#L318-L326 | train | Marshals a file with a list of route definitions. | Of course, here is the Java code you requested:
```java
public void marshal(File file, final List<RouteDefinition> routeDefinitionList) throws Exception {
marshal(file, new Model2Model() {
@Override
public XmlModel transform(XmlModel model) {
copyRoutesToElement(routeDef... |
seanchenxi/gwt-storage | src/main/java/com/seanchenxi/gwt/storage/client/StorageExt.java | StorageExt.remove | public <T extends Serializable> void remove(StorageKey<T> key) {
String data = storage.getItem(key.name());
storage.removeItem(key.name());
T value = cache.remove(key);
fireEvent(StorageChangeEvent.ChangeType.REMOVE, key, null, value, null, data);
} | java | public <T extends Serializable> void remove(StorageKey<T> key) {
String data = storage.getItem(key.name());
storage.removeItem(key.name());
T value = cache.remove(key);
fireEvent(StorageChangeEvent.ChangeType.REMOVE, key, null, value, null, data);
} | [
"public",
"<",
"T",
"extends",
"Serializable",
">",
"void",
"remove",
"(",
"StorageKey",
"<",
"T",
">",
"key",
")",
"{",
"String",
"data",
"=",
"storage",
".",
"getItem",
"(",
"key",
".",
"name",
"(",
")",
")",
";",
"storage",
".",
"removeItem",
"(",... | Removes the record for the specified key from this storage if present.
<p>
{@link StorageKeyFactory} is preferred to get a {@link StorageKey} instance for primitive types
</p>
@param key key whose mapping is to be removed from the map
@param <T> the type of stored value | [
"Removes",
"the",
"record",
"for",
"the",
"specified",
"key",
"from",
"this",
"storage",
"if",
"present",
"."
] | fb2f97991af14d60a7693e0cf8f277fc34e90f7f | https://github.com/seanchenxi/gwt-storage/blob/fb2f97991af14d60a7693e0cf8f277fc34e90f7f/src/main/java/com/seanchenxi/gwt/storage/client/StorageExt.java#L266-L271 | valid | Removes the item from the cache. | Of course, here is the Java code you requested:
```java
public <T extends Serializable> void remove(StorageKey<T> key) {
String data = storage.getItem(key.name());
storage.removeItem(key.name());
T value = cache.remove(key);
fireEvent(StorageChangeEvent.ChangeType.REMOVE, key, null, value, null, data);... |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.addDataLakeStoreAccountAsync | public Observable<Void> addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) {
return addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).map(new Func1<... | java | public Observable<Void> addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) {
return addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).map(new Func1<... | [
"public",
"Observable",
"<",
"Void",
">",
"addDataLakeStoreAccountAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"dataLakeStoreAccountName",
",",
"AddDataLakeStoreParameters",
"parameters",
")",
"{",
"return",
"addDataLakeStoreAccou... | Updates the specified Data Lake Analytics account to include the additional Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account.
@... | [
"Updates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"to",
"include",
"the",
"additional",
"Data",
"Lake",
"Store",
"account",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L1161-L1168 | train | Adds a Data Lake Store account. | Of course, here is the Java code you requested:
```java
public Observable<Void> addDataLakeStoreAccountAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) {
return addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountN... |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java | AbstractEnvironment.getWServletPath | @Override
public String getWServletPath() {
final String configValue = ConfigurationProperties.getServletSupportPath();
return configValue == null ? getPostPath() : getServletPath(configValue);
} | java | @Override
public String getWServletPath() {
final String configValue = ConfigurationProperties.getServletSupportPath();
return configValue == null ? getPostPath() : getServletPath(configValue);
} | [
"@",
"Override",
"public",
"String",
"getWServletPath",
"(",
")",
"{",
"final",
"String",
"configValue",
"=",
"ConfigurationProperties",
".",
"getServletSupportPath",
"(",
")",
";",
"return",
"configValue",
"==",
"null",
"?",
"getPostPath",
"(",
")",
":",
"getSe... | Construct the path to the support servlet. Web components that need to construct a URL to target this servlet
will use this method.
@return the path to the AJAX servlet. | [
"Construct",
"the",
"path",
"to",
"the",
"support",
"servlet",
".",
"Web",
"components",
"that",
"need",
"to",
"construct",
"a",
"URL",
"to",
"target",
"this",
"servlet",
"will",
"use",
"this",
"method",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java#L81-L87 | train | Get the servlet path. | Of course, here is the Java code you requested:
```java
@Override
public String getWServletPath() {
final String configValue = ConfigurationProperties.getServletSupportPath();
return configValue == null ? getPostPath() : getServletPath(configValue);
}
```
Hope this helps! |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/users/UsersTableModel.java | UsersTableModel.addUser | public void addUser(User user){
this.users.add(user);
this.fireTableRowsInserted(this.users.size()-1, this.users.size()-1);
} | java | public void addUser(User user){
this.users.add(user);
this.fireTableRowsInserted(this.users.size()-1, this.users.size()-1);
} | [
"public",
"void",
"addUser",
"(",
"User",
"user",
")",
"{",
"this",
".",
"users",
".",
"add",
"(",
"user",
")",
";",
"this",
".",
"fireTableRowsInserted",
"(",
"this",
".",
"users",
".",
"size",
"(",
")",
"-",
"1",
",",
"this",
".",
"users",
".",
... | Adds a new user to this model
@param user the user | [
"Adds",
"a",
"new",
"user",
"to",
"this",
"model"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/users/UsersTableModel.java#L130-L133 | train | Add a user to the users table. | Of course, here is the Java code you requested:
```java
public void addUser(User user){
this.users.add(user);
this.fireTableRowsInserted(this.users.size()-1, this.users.size()-1);
}
```
Hope this helps! |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/bel/parser/BELScriptLexer.java | BELScriptLexer.mOPEN_PAREN | public final void mOPEN_PAREN() throws RecognitionException {
try {
int _type = OPEN_PAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// BELScript.g:285:11: ( '(' )
// BELScript.g:286:5: '('
{
match('(');
}
state.type... | java | public final void mOPEN_PAREN() throws RecognitionException {
try {
int _type = OPEN_PAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// BELScript.g:285:11: ( '(' )
// BELScript.g:286:5: '('
{
match('(');
}
state.type... | [
"public",
"final",
"void",
"mOPEN_PAREN",
"(",
")",
"throws",
"RecognitionException",
"{",
"try",
"{",
"int",
"_type",
"=",
"OPEN_PAREN",
";",
"int",
"_channel",
"=",
"DEFAULT_TOKEN_CHANNEL",
";",
"// BELScript.g:285:11: ( '(' )",
"// BELScript.g:286:5: '('",
"{",
"ma... | $ANTLR start "OPEN_PAREN" | [
"$ANTLR",
"start",
"OPEN_PAREN"
] | 149f80b1d6eabb15ab15815b6f745b0afa9fd2d3 | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/bel/parser/BELScriptLexer.java#L3071-L3087 | train | start XSD OPEN_PAREN | Of course, here is the Java code you requested:
```java
public final void mOPEN_PAREN() throws RecognitionException {
try {
int _type = OPEN_PAREN;
int _channel = DEFAULT_TOKEN_CHANNEL;
// BELScript.g:285:11: ( '(' )
// BELScript.g:286:5: '('
{
... |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/Manager.java | Manager.getUserAgent | public static String getUserAgent() {
if (USER_AGENT == null) {
USER_AGENT = String.format(Locale.ENGLISH, "%s/%s (%s/%s)",
PRODUCT_NAME,
Version.SYNC_PROTOCOL_VERSION,
Version.getVersionName(),
Version.getCommitHash());... | java | public static String getUserAgent() {
if (USER_AGENT == null) {
USER_AGENT = String.format(Locale.ENGLISH, "%s/%s (%s/%s)",
PRODUCT_NAME,
Version.SYNC_PROTOCOL_VERSION,
Version.getVersionName(),
Version.getCommitHash());... | [
"public",
"static",
"String",
"getUserAgent",
"(",
")",
"{",
"if",
"(",
"USER_AGENT",
"==",
"null",
")",
"{",
"USER_AGENT",
"=",
"String",
".",
"format",
"(",
"Locale",
".",
"ENGLISH",
",",
"\"%s/%s (%s/%s)\"",
",",
"PRODUCT_NAME",
",",
"Version",
".",
"SY... | Return User-Agent value
Format: ex: CouchbaseLite/1.2 (Java Linux/MIPS 1.2.1/3382EFA) | [
"Return",
"User",
"-",
"Agent",
"value",
"Format",
":",
"ex",
":",
"CouchbaseLite",
"/",
"1",
".",
"2",
"(",
"Java",
"Linux",
"/",
"MIPS",
"1",
".",
"2",
".",
"1",
"/",
"3382EFA",
")"
] | 3b275642e2d2f231fd155ad9def9c5e9eff3118e | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Manager.java#L1064-L1073 | train | Gets the user agent. | Of course, here is the Java code you requested:
```java
public static String getUserAgent() {
if (USER_AGENT == null) {
USER_AGENT = String.format(Locale.ENGLISH, "%s/%s (%s/%s)",
PRODUCT_NAME,
Version.SYNC_PROTOCOL_VERSION,
Version.getVer... |
robolectric/robolectric | shadows/framework/src/main/java/org/robolectric/shadows/NativeBitSet64.java | NativeBitSet64.getIndexOfBit | int getIndexOfBit(int n) {
// return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
int numMarkedBits = 0;
for (int i = 0; i < n; i++) {
if (hasBit(i)) {
numMarkedBits++;
}
}
return numMarkedBits;
} | java | int getIndexOfBit(int n) {
// return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
int numMarkedBits = 0;
for (int i = 0; i < n; i++) {
if (hasBit(i)) {
numMarkedBits++;
}
}
return numMarkedBits;
} | [
"int",
"getIndexOfBit",
"(",
"int",
"n",
")",
"{",
"// return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));",
"int",
"numMarkedBits",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"if",
"(",
"... | Gets the index of the specified bit in the set, which is the number of marked bits that appear
before the specified bit. | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"bit",
"in",
"the",
"set",
"which",
"is",
"the",
"number",
"of",
"marked",
"bits",
"that",
"appear",
"before",
"the",
"specified",
"bit",
"."
] | 4fa79a2c72f8abbf742ab920419653c207b41d62 | https://github.com/robolectric/robolectric/blob/4fa79a2c72f8abbf742ab920419653c207b41d62/shadows/framework/src/main/java/org/robolectric/shadows/NativeBitSet64.java#L92-L101 | valid | Gets the index of the n - th bit in the value. | Of course, here is the Java code you requested:
```java
int getIndexOfBit(int n) {
// return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
int numMarkedBits = 0;
for (int i = 0; i < n; i++) {
if (hasBit(i)) {
numMarkedBits++;
}
}
return numMarkedBits;
}
```
Hop... |
geomajas/geomajas-project-client-gwt2 | plugin/wfs/wfs/src/main/java/org/geomajas/gwt2/plugin/wfs/client/protocol/v_1_0_0/WfsFeatureTypeInfo100.java | WfsFeatureTypeInfo100.parse | protected void parse(Node node) {
parsed = true;
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
String nodeName = child.getNodeName();
if ("Name".equalsIgnoreCase(nodeName)) {
name = getValueRecursive(child);
} else i... | java | protected void parse(Node node) {
parsed = true;
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
String nodeName = child.getNodeName();
if ("Name".equalsIgnoreCase(nodeName)) {
name = getValueRecursive(child);
} else i... | [
"protected",
"void",
"parse",
"(",
"Node",
"node",
")",
"{",
"parsed",
"=",
"true",
";",
"NodeList",
"childNodes",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"childNodes",
".",
"getLength",
"(",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | bd8d7904e861fa80522eed7b83c4ea99844180c7 | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/wfs/wfs/src/main/java/org/geomajas/gwt2/plugin/wfs/client/protocol/v_1_0_0/WfsFeatureTypeInfo100.java#L98-L118 | train | Parse the XML node. | Of course, here is the Java code you requested:
```java
protected void parse(Node node) {
parsed = true;
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
String nodeName = child.getNodeName();
if ("Name".equalsIgnoreCase(node... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcCoveringTypeEnum | public EEnum getIfcCoveringTypeEnum() {
if (ifcCoveringTypeEnumEEnum == null) {
ifcCoveringTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(804);
}
return ifcCoveringTypeEnumEEnum;
} | java | public EEnum getIfcCoveringTypeEnum() {
if (ifcCoveringTypeEnumEEnum == null) {
ifcCoveringTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(804);
}
return ifcCoveringTypeEnumEEnum;
} | [
"public",
"EEnum",
"getIfcCoveringTypeEnum",
"(",
")",
"{",
"if",
"(",
"ifcCoveringTypeEnumEEnum",
"==",
"null",
")",
"{",
"ifcCoveringTypeEnumEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"Ifc2x3tc1Package"... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L36765-L36771 | train | Get the IfcCoveringTypeEnum for the Ifc2x3tc1Package. | Of course, here is the Java code you requested:
```java
public EEnum getIfcCoveringTypeEnum() {
if (ifcCoveringTypeEnumEEnum == null) {
ifcCoveringTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(804);
}
return ifcCoveringTypeEnumEEnum;
... |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.removeMailServer | public void removeMailServer(String hostName, String username) throws SecurityException {
checkWriteAccess();
Element mail = _getRootElement("mail");
Element[] children = XMLConfigWebFactory.getChildren(mail, "server");
String _hostName, _username;
if (children.length > 0) {
for (int i = 0; i < children.leng... | java | public void removeMailServer(String hostName, String username) throws SecurityException {
checkWriteAccess();
Element mail = _getRootElement("mail");
Element[] children = XMLConfigWebFactory.getChildren(mail, "server");
String _hostName, _username;
if (children.length > 0) {
for (int i = 0; i < children.leng... | [
"public",
"void",
"removeMailServer",
"(",
"String",
"hostName",
",",
"String",
"username",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"Element",
"mail",
"=",
"_getRootElement",
"(",
"\"mail\"",
")",
";",
"Element",
"[",
"]",
"... | removes a mailserver from system
@param hostName
@throws SecurityException | [
"removes",
"a",
"mailserver",
"from",
"system"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L527-L544 | train | Removes the mail server with the given host name and username. | Of course, here is the Java code you requested:
```java
public void removeMailServer(String hostName, String username) throws SecurityException {
checkWriteAccess();
Element mail = _getRootElement("mail");
Element[] children = XMLConfigWebFactory.getChildren(mail, "server");
String _hostName, _username;
if (chil... |
census-instrumentation/opencensus-java | benchmarks/src/jmh/java/io/opencensus/benchmarks/trace/StartEndSpanBenchmark.java | StartEndSpanBenchmark.startEndSampledRootSpan | @Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public Span startEndSampledRootSpan(Data data) {
Span span = data.tracer.spanBuilder(SPAN_NAME).setSampler(Samplers.alwaysSample()).startSpan();
span.end();
return span;
} | java | @Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public Span startEndSampledRootSpan(Data data) {
Span span = data.tracer.spanBuilder(SPAN_NAME).setSampler(Samplers.alwaysSample()).startSpan();
span.end();
return span;
} | [
"@",
"Benchmark",
"@",
"BenchmarkMode",
"(",
"Mode",
".",
"SampleTime",
")",
"@",
"OutputTimeUnit",
"(",
"TimeUnit",
".",
"NANOSECONDS",
")",
"public",
"Span",
"startEndSampledRootSpan",
"(",
"Data",
"data",
")",
"{",
"Span",
"span",
"=",
"data",
".",
"trace... | This benchmark attempts to measure performance of start/end for a sampled root {@code Span}. | [
"This",
"benchmark",
"attempts",
"to",
"measure",
"performance",
"of",
"start",
"/",
"end",
"for",
"a",
"sampled",
"root",
"{"
] | deefac9bed77e40a2297bff1ca5ec5aa48a5f755 | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/benchmarks/src/jmh/java/io/opencensus/benchmarks/trace/StartEndSpanBenchmark.java#L105-L112 | train | Benchmarks start and end of a node ID span. | Of course, here is the Java code you requested:
```java
@Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public Span startEndSampledRootSpan(Data data) {
Span span = data.tracer.spanBuilder(SPAN_NAME).setSampler(Samplers.alwaysSample()).startSpan();
span.end();
return ... |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/ListCommandInvocationsResult.java | ListCommandInvocationsResult.withCommandInvocations | public ListCommandInvocationsResult withCommandInvocations(CommandInvocation... commandInvocations) {
if (this.commandInvocations == null) {
setCommandInvocations(new com.amazonaws.internal.SdkInternalList<CommandInvocation>(commandInvocations.length));
}
for (CommandInvocation ele :... | java | public ListCommandInvocationsResult withCommandInvocations(CommandInvocation... commandInvocations) {
if (this.commandInvocations == null) {
setCommandInvocations(new com.amazonaws.internal.SdkInternalList<CommandInvocation>(commandInvocations.length));
}
for (CommandInvocation ele :... | [
"public",
"ListCommandInvocationsResult",
"withCommandInvocations",
"(",
"CommandInvocation",
"...",
"commandInvocations",
")",
"{",
"if",
"(",
"this",
".",
"commandInvocations",
"==",
"null",
")",
"{",
"setCommandInvocations",
"(",
"new",
"com",
".",
"amazonaws",
"."... | <p>
(Optional) A list of all invocations.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setCommandInvocations(java.util.Collection)} or {@link #withCommandInvocations(java.util.Collection)} if
you want to override the existing values.
</p>
@param commandInvocations
(Op... | [
"<p",
">",
"(",
"Optional",
")",
"A",
"list",
"of",
"all",
"invocations",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/ListCommandInvocationsResult.java#L87-L95 | train | Adds the command invocations to the result. | Of course, here is the Java code you requested:
```java
public ListCommandInvocationsResult withCommandInvocations(CommandInvocation... commandInvocations) {
if (this.commandInvocations == null) {
setCommandInvocations(new com.amazonaws.internal.SdkInternalList<CommandInvocation>(commandInvocations... |
Guichaguri/MinimalFTP | src/main/java/com/guichaguri/minimalftp/FTPConnection.java | FTPConnection.registerOption | public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
} | java | public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
} | [
"public",
"void",
"registerOption",
"(",
"String",
"option",
",",
"String",
"value",
")",
"{",
"options",
".",
"put",
"(",
"option",
".",
"toUpperCase",
"(",
")",
",",
"value",
")",
";",
"}"
] | Registers an option for the OPTS command
@param option The option name
@param value The default value | [
"Registers",
"an",
"option",
"for",
"the",
"OPTS",
"command"
] | ddd81e26ec88079ee4c37fe53d8efe420996e9b1 | https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L356-L358 | train | Registers an option with the application. | Of course, here is the Java code you requested:
```java
public void registerOption(String option, String value) {
options.put(option.toUpperCase(), value);
}
```
Hope this helps! |
jamesagnew/hapi-fhir | hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java | NpmPackage.list | public List<String> list(String folder) throws IOException {
List<String> res = new ArrayList<String>();
if (path != null) {
File f = new File(Utilities.path(path, folder));
if (f.exists() && f.isDirectory())
for (String s : f.list())
res.add(s);
} else {
... | java | public List<String> list(String folder) throws IOException {
List<String> res = new ArrayList<String>();
if (path != null) {
File f = new File(Utilities.path(path, folder));
if (f.exists() && f.isDirectory())
for (String s : f.list())
res.add(s);
} else {
... | [
"public",
"List",
"<",
"String",
">",
"list",
"(",
"String",
"folder",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"res",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"path",
"!=",
"null",
")",
"{",
"Fil... | Accessing the contents of the package - get a list of files in a subfolder of the package
@param folder
@return
@throws IOException | [
"Accessing",
"the",
"contents",
"of",
"the",
"package",
"-",
"get",
"a",
"list",
"of",
"files",
"in",
"a",
"subfolder",
"of",
"the",
"package"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java#L110-L124 | train | Gets a list of all the records in the specified folder. | Of course, here is the Java code you requested:
```java
public List<String> list(String folder) throws IOException {
List<String> res = new ArrayList<String>();
if (path != null) {
File f = new File(Utilities.path(path, folder));
if (f.exists() && f.isDirectory())
for (String... |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java | TreeUtil.findNodeByLabel | public static Treenode findNodeByLabel(Treeview tree, String label, boolean caseSensitive) {
for (Treenode item : tree.getChildren(Treenode.class)) {
if (caseSensitive ? label.equals(item.getLabel()) : label.equalsIgnoreCase(item.getLabel())) {
return item;
}
}
... | java | public static Treenode findNodeByLabel(Treeview tree, String label, boolean caseSensitive) {
for (Treenode item : tree.getChildren(Treenode.class)) {
if (caseSensitive ? label.equals(item.getLabel()) : label.equalsIgnoreCase(item.getLabel())) {
return item;
}
}
... | [
"public",
"static",
"Treenode",
"findNodeByLabel",
"(",
"Treeview",
"tree",
",",
"String",
"label",
",",
"boolean",
"caseSensitive",
")",
"{",
"for",
"(",
"Treenode",
"item",
":",
"tree",
".",
"getChildren",
"(",
"Treenode",
".",
"class",
")",
")",
"{",
"i... | Search the entire tree for a tree item matching the specified label.
@param tree Tree containing the item of interest.
@param label Label to match.
@param caseSensitive If true, match is case-sensitive.
@return The matching tree item, or null if not found. | [
"Search",
"the",
"entire",
"tree",
"for",
"a",
"tree",
"item",
"matching",
"the",
"specified",
"label",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/TreeUtil.java#L172-L180 | train | Find node by label. | Of course, here is the Java code you requested:
```java
public static Treenode findNodeByLabel(Treeview tree, String label, boolean caseSensitive) {
for (Treenode item : tree.getChildren(Treenode.class)) {
if (caseSensitive ? label.equals(item.getLabel()) : label.equalsIgnoreCase(item.getLabel())) ... |
apiman/apiman | gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/CachingPolicy.java | CachingPolicy.buildCacheID | private static String buildCacheID(ApiRequest request) {
StringBuilder req = new StringBuilder();
if (request.getContract() != null) {
req.append(request.getApiKey());
} else {
req.append(request.getApiOrgId()).append(KEY_SEPARATOR).append(request.getApiId())
... | java | private static String buildCacheID(ApiRequest request) {
StringBuilder req = new StringBuilder();
if (request.getContract() != null) {
req.append(request.getApiKey());
} else {
req.append(request.getApiOrgId()).append(KEY_SEPARATOR).append(request.getApiId())
... | [
"private",
"static",
"String",
"buildCacheID",
"(",
"ApiRequest",
"request",
")",
"{",
"StringBuilder",
"req",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"request",
".",
"getContract",
"(",
")",
"!=",
"null",
")",
"{",
"req",
".",
"append",
"... | Builds a cached request id composed by the API key followed by the HTTP
verb and the destination. In the case where there's no API key the ID
will contain ApiOrgId + ApiId + ApiVersion | [
"Builds",
"a",
"cached",
"request",
"id",
"composed",
"by",
"the",
"API",
"key",
"followed",
"by",
"the",
"HTTP",
"verb",
"and",
"the",
"destination",
".",
"In",
"the",
"case",
"where",
"there",
"s",
"no",
"API",
"key",
"the",
"ID",
"will",
"contain",
... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/CachingPolicy.java#L177-L188 | train | Build the cache ID from the API request | Of course, here is the Java code you requested:
```java
private static String buildCacheID(ApiRequest request) {
StringBuilder req = new StringBuilder();
if (request.getContract() != null) {
req.append(request.getApiKey());
} else {
req.append(request.getApiOrgId()).appe... |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java | TmdbPeople.getPersonMovieCredits | public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBas... | java | public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBas... | [
"public",
"PersonCreditList",
"<",
"CreditMovieBasic",
">",
"getPersonMovieCredits",
"(",
"int",
"personId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
... | Get the movie credits for a specific person id.
@param personId
@param language
@return
@throws MovieDbException | [
"Get",
"the",
"movie",
"credits",
"for",
"a",
"specific",
"person",
"id",
"."
] | bf132d7c7271734e13b58ba3bc92bba46f220118 | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L107-L122 | train | This method is used to retrieve the person movie credits. | Of course, here is the Java code you requested:
```java
public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, l... |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java | Xml.removeChild | public void removeChild(Xml child)
{
Check.notNull(child);
root.removeChild(child.getElement());
} | java | public void removeChild(Xml child)
{
Check.notNull(child);
root.removeChild(child.getElement());
} | [
"public",
"void",
"removeChild",
"(",
"Xml",
"child",
")",
"{",
"Check",
".",
"notNull",
"(",
"child",
")",
";",
"root",
".",
"removeChild",
"(",
"child",
".",
"getElement",
"(",
")",
")",
";",
"}"
] | Remove child.
@param child The child to remove (must not be <code>null</code>).
@throws LionEngineException If invalid argument. | [
"Remove",
"child",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java#L345-L350 | train | Remove a child from the base XML document. | Of course, here is the Java code you requested:
```java
public void removeChild(Xml child)
{
Check.notNull(child);
root.removeChild(child.getElement());
}
```
Hope this helps! |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/CollectionUtil.java | CollectionUtil.toList | public static <T> List<T> toList( T... objects )
{
List<T> list = new ArrayList<T>( objects.length );
for (T t : objects)
{
list.add( t );
}
return list;
} | java | public static <T> List<T> toList( T... objects )
{
List<T> list = new ArrayList<T>( objects.length );
for (T t : objects)
{
list.add( t );
}
return list;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"T",
"...",
"objects",
")",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"objects",
".",
"length",
")",
";",
"for",
"(",
"T",
"t",
":... | <p>toList.</p>
@param objects a T object.
@param <T> a T object.
@return a {@link java.util.List} object. | [
"<p",
">",
"toList",
".",
"<",
"/",
"p",
">"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/CollectionUtil.java#L83-L91 | train | Converts an array of objects to a list of objects. | Of course, here is the Java code you requested:
```java
public static <T> List<T> toList( T... objects )
{
List<T> list = new ArrayList<T>( objects.length );
for (T t : objects)
{
list.add( t );
}
return list;
}
```
Hope this helps! |
ocpsoft/rewrite | annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/AbstractClassFinder.java | AbstractClassFinder.getClassName | protected static String getClassName(String filename)
{
// end index is just before ".class"
int endIndex = filename.length() - ".class".length();
// extract relevant part of the path
String relativePath = filename.substring(0, endIndex);
// replace / by . to create FQCN
return... | java | protected static String getClassName(String filename)
{
// end index is just before ".class"
int endIndex = filename.length() - ".class".length();
// extract relevant part of the path
String relativePath = filename.substring(0, endIndex);
// replace / by . to create FQCN
return... | [
"protected",
"static",
"String",
"getClassName",
"(",
"String",
"filename",
")",
"{",
"// end index is just before \".class\"",
"int",
"endIndex",
"=",
"filename",
".",
"length",
"(",
")",
"-",
"\".class\"",
".",
"length",
"(",
")",
";",
"// extract relevant part of... | <p>
Creates a FQCN from an {@link URL} representing a <code>.class</code> file.
</p>
@param url The path of the class file
@return the FQCN of the class | [
"<p",
">",
"Creates",
"a",
"FQCN",
"from",
"an",
"{",
"@link",
"URL",
"}",
"representing",
"a",
"<code",
">",
".",
"class<",
"/",
"code",
">",
"file",
".",
"<",
"/",
"p",
">"
] | eded0bad0101d119a3a1e67ed3f97a3bc9a8222e | https://github.com/ocpsoft/rewrite/blob/eded0bad0101d119a3a1e67ed3f97a3bc9a8222e/annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/AbstractClassFinder.java#L102-L113 | valid | Get the FQCN from a file name. | Of course, here is the Java code you requested:
```java
protected static String getClassName(String filename)
{
// end index is just before ".class"
int endIndex = filename.length() - ".class".length();
// extract relevant part of the path
String relativePath = filename.substring(0, endInd... |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/component/AnimatedModelComponent.java | AnimatedModelComponent.link | public Timer link(BlockPos pos, String stop, String start)
{
Timer t = stop(pos, stop);
//no stop anim, start from the beginning
if (t == null)
return start(pos, start);
Animation<Shape> anim = Iterables.getFirst(model.getAnimation(stop), null);
//no stop anim, start from beginning
if (anim == null)
... | java | public Timer link(BlockPos pos, String stop, String start)
{
Timer t = stop(pos, stop);
//no stop anim, start from the beginning
if (t == null)
return start(pos, start);
Animation<Shape> anim = Iterables.getFirst(model.getAnimation(stop), null);
//no stop anim, start from beginning
if (anim == null)
... | [
"public",
"Timer",
"link",
"(",
"BlockPos",
"pos",
",",
"String",
"stop",
",",
"String",
"start",
")",
"{",
"Timer",
"t",
"=",
"stop",
"(",
"pos",
",",
"stop",
")",
";",
"//no stop anim, start from the beginning",
"if",
"(",
"t",
"==",
"null",
")",
"retu... | Links two animations together.<br>
The <i>start</i> animation will replace the <i>stop</i> one. The {@link Timer} for <i>start</i> will depend on the time spent by the
<i>stop</i> animation.<br>
The purpose is to have seamless transition between two reversed animations. (Ex: opening and closing of a door.)
@param pos ... | [
"Links",
"two",
"animations",
"together",
".",
"<br",
">",
"The",
"<i",
">",
"start<",
"/",
"i",
">",
"animation",
"will",
"replace",
"the",
"<i",
">",
"stop<",
"/",
"i",
">",
"one",
".",
"The",
"{",
"@link",
"Timer",
"}",
"for",
"<i",
">",
"start<... | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/component/AnimatedModelComponent.java#L222-L242 | train | Link a block to a stop animation. | Of course, here is the Java code you requested:
```java
public Timer link(BlockPos pos, String stop, String start)
{
Timer t = stop(pos, stop);
//no stop anim, start from the beginning
if (t == null)
return start(pos, start);
Animation<Shape> anim = Iterables.getFirst(model.getAnimation(stop), null);
//... |
demidenko05/beigesoft-accounting | src/main/java/org/beigesoft/accounting/factory/FctBnAccEntitiesProcessors.java | FctBnAccEntitiesProcessors.lazyGetPrcPurchaseInvoiceLineGfr | protected final PrcPurchaseInvoiceLineGfr lazyGetPrcPurchaseInvoiceLineGfr(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcPurchaseInvoiceLineGfr<RS> proc = (PrcPurchaseInvoiceLineGfr<RS>)
this.processorsMap.get(PrcPurchaseInvoiceLineGfr.class.getSimpleName()... | java | protected final PrcPurchaseInvoiceLineGfr lazyGetPrcPurchaseInvoiceLineGfr(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcPurchaseInvoiceLineGfr<RS> proc = (PrcPurchaseInvoiceLineGfr<RS>)
this.processorsMap.get(PrcPurchaseInvoiceLineGfr.class.getSimpleName()... | [
"protected",
"final",
"PrcPurchaseInvoiceLineGfr",
"lazyGetPrcPurchaseInvoiceLineGfr",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
")",
"throws",
"Exception",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"PrcPurchaseInvoiceLineGfr",
... | <p>Get PrcPurchaseInvoiceLineGfr (create and put into map).</p>
@param pAddParam additional param
@return requested PrcPurchaseInvoiceLineGfr
@throws Exception - an exception | [
"<p",
">",
"Get",
"PrcPurchaseInvoiceLineGfr",
"(",
"create",
"and",
"put",
"into",
"map",
")",
".",
"<",
"/",
"p",
">"
] | e6f423949008218ddd05953b078f1ea8805095c1 | https://github.com/demidenko05/beigesoft-accounting/blob/e6f423949008218ddd05953b078f1ea8805095c1/src/main/java/org/beigesoft/accounting/factory/FctBnAccEntitiesProcessors.java#L1513-L1531 | train | Get a PrcPurchaseInvoiceLineGfr object from the database. | Of course, here is the Java code you requested:
```java
protected final PrcPurchaseInvoiceLineGfr lazyGetPrcPurchaseInvoiceLineGfr(
final Map<String, Object> pAddParam) throws Exception {
@SuppressWarnings("unchecked")
PrcPurchaseInvoiceLineGfr<RS> proc = (PrcPurchaseInvoiceLineGfr<RS>)
this.processo... |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBQuery.java | CouchDBQuery.populateEntities | @Override
protected List populateEntities(EntityMetadata m, Client client)
{
ClientMetadata clientMetadata = ((ClientBase) client).getClientMetadata();
this.useLuceneOrES = !MetadataUtils.useSecondryIndex(clientMetadata);
if (useLuceneOrES)
{
return populateUsingLucen... | java | @Override
protected List populateEntities(EntityMetadata m, Client client)
{
ClientMetadata clientMetadata = ((ClientBase) client).getClientMetadata();
this.useLuceneOrES = !MetadataUtils.useSecondryIndex(clientMetadata);
if (useLuceneOrES)
{
return populateUsingLucen... | [
"@",
"Override",
"protected",
"List",
"populateEntities",
"(",
"EntityMetadata",
"m",
",",
"Client",
"client",
")",
"{",
"ClientMetadata",
"clientMetadata",
"=",
"(",
"(",
"ClientBase",
")",
"client",
")",
".",
"getClientMetadata",
"(",
")",
";",
"this",
".",
... | Populate results.
@param m
the m
@param client
the client
@return the list | [
"Populate",
"results",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBQuery.java#L102-L116 | train | Populate entities. | Of course, here is the Java code you requested:
```java
@Override
protected List populateEntities(EntityMetadata m, Client client)
{
ClientMetadata clientMetadata = ((ClientBase) client).getClientMetadata();
this.useLuceneOrES = !MetadataUtils.useSecondryIndex(clientMetadata);
if (useLu... |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/io/HtmlNotebookOutput.java | HtmlNotebookOutput.create | public static com.simiacryptus.util.io.HtmlNotebookOutput create(final File parentDirectory) throws FileNotFoundException {
@javax.annotation.Nonnull final FileOutputStream out = new FileOutputStream(new File(parentDirectory, "index.html"));
return new com.simiacryptus.util.io.HtmlNotebookOutput(parentDirectory... | java | public static com.simiacryptus.util.io.HtmlNotebookOutput create(final File parentDirectory) throws FileNotFoundException {
@javax.annotation.Nonnull final FileOutputStream out = new FileOutputStream(new File(parentDirectory, "index.html"));
return new com.simiacryptus.util.io.HtmlNotebookOutput(parentDirectory... | [
"public",
"static",
"com",
".",
"simiacryptus",
".",
"util",
".",
"io",
".",
"HtmlNotebookOutput",
"create",
"(",
"final",
"File",
"parentDirectory",
")",
"throws",
"FileNotFoundException",
"{",
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"final",
"FileOutp... | Create html notebook output.
@param parentDirectory the parent directory
@return the html notebook output
@throws FileNotFoundException the file not found exception | [
"Create",
"html",
"notebook",
"output",
"."
] | b5a5e73449aae57de7dbfca2ed7a074432c5b17e | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/io/HtmlNotebookOutput.java#L96-L104 | train | Create an instance of the HTMLNotebookOutput class. | Of course, here is the Java code you requested:
```java
public static com.simiacryptus.util.io.HtmlNotebookOutput create(final File parentDirectory) throws FileNotFoundException {
@javax.annotation.Nonnull final FileOutputStream out = new FileOutputStream(new File(parentDirectory, "index.html"));
return new co... |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java | EsStorage.generateGuid | private static synchronized Long generateGuid() {
StringBuilder builder = new StringBuilder();
builder.append(System.currentTimeMillis());
builder.append(guidCounter++);
// Reset the counter if it gets too high. It's always a number
// between 100 and 999 so that the # of digits... | java | private static synchronized Long generateGuid() {
StringBuilder builder = new StringBuilder();
builder.append(System.currentTimeMillis());
builder.append(guidCounter++);
// Reset the counter if it gets too high. It's always a number
// between 100 and 999 so that the # of digits... | [
"private",
"static",
"synchronized",
"Long",
"generateGuid",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"builder",
".",
"append... | Generates a (hopefully) unique ID. Mimics JPA's auto-generated long ID column. | [
"Generates",
"a",
"(",
"hopefully",
")",
"unique",
"ID",
".",
"Mimics",
"JPA",
"s",
"auto",
"-",
"generated",
"long",
"ID",
"column",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java#L2182-L2193 | train | Generate a GUID for a single exception. | Of course, here is the Java code you requested:
```java
private static synchronized Long generateGuid() {
StringBuilder builder = new StringBuilder();
builder.append(System.currentTimeMillis());
builder.append(guidCounter++);
// Reset the counter if it gets too high. It's always a numb... |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.toText | public static Text toText(Document doc, Object o) throws PageException {
if (o instanceof Text) return (Text) o;
else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
return doc.createTextNode(Caster.toString(o));
} | java | public static Text toText(Document doc, Object o) throws PageException {
if (o instanceof Text) return (Text) o;
else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
return doc.createTextNode(Caster.toString(o));
} | [
"public",
"static",
"Text",
"toText",
"(",
"Document",
"doc",
",",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Text",
")",
"return",
"(",
"Text",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"CharacterData",... | casts a value to a XML Text
@param doc XML Document
@param o Object to cast
@return XML Text Object
@throws PageException | [
"casts",
"a",
"value",
"to",
"a",
"XML",
"Text"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L86-L90 | train | casts a Object to a Text | Of course, here is the Java code you requested:
```java
public static Text toText(Document doc, Object o) throws PageException {
if (o instanceof Text) return (Text) o;
else if (o instanceof CharacterData) return doc.createTextNode(((CharacterData) o).getData());
return doc.createTextNode(Caster.toString(o));
}... |
walokra/markdown-page-generator-plugin | src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java | MdPageGeneratorMojo.processAttributes | private Map<String, Attributes> processAttributes(String[] attributeList) {
HashMap<String, Attributes> nodeAttributeMap = new HashMap<>();
for (String attribute : attributeList) {
String[] nodeAttributes = attribute.split("\\|");
Attributes attributes = new Attributes();
... | java | private Map<String, Attributes> processAttributes(String[] attributeList) {
HashMap<String, Attributes> nodeAttributeMap = new HashMap<>();
for (String attribute : attributeList) {
String[] nodeAttributes = attribute.split("\\|");
Attributes attributes = new Attributes();
... | [
"private",
"Map",
"<",
"String",
",",
"Attributes",
">",
"processAttributes",
"(",
"String",
"[",
"]",
"attributeList",
")",
"{",
"HashMap",
"<",
"String",
",",
"Attributes",
">",
"nodeAttributeMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
... | Parse attributes of the form NodeName:attributeName=attribute value:attributeName=attribute value...
@param attributeList list of attributes
@return map of Node class to attributable part and attributes | [
"Parse",
"attributes",
"of",
"the",
"form",
"NodeName",
":",
"attributeName",
"=",
"attribute",
"value",
":",
"attributeName",
"=",
"attribute",
"value",
"..."
] | 2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7 | https://github.com/walokra/markdown-page-generator-plugin/blob/2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7/src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java#L288-L313 | test | Process attributes. | Of course, here is the Java code you requested:
```java
private Map<String, Attributes> processAttributes(String[] attributeList) {
HashMap<String, Attributes> nodeAttributeMap = new HashMap<>();
for (String attribute : attributeList) {
String[] nodeAttributes = attribute.split("\\|");
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/inbound/security/SecurityInflowContextProviderImpl.java | SecurityInflowContextProviderImpl.captureThreadContext | @Override
public ThreadContext captureThreadContext(Map<String, String> execProps, Map<String, ?> threadContextConfig) {
throw new UnsupportedOperationException("captureThreadContext");
} | java | @Override
public ThreadContext captureThreadContext(Map<String, String> execProps, Map<String, ?> threadContextConfig) {
throw new UnsupportedOperationException("captureThreadContext");
} | [
"@",
"Override",
"public",
"ThreadContext",
"captureThreadContext",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"execProps",
",",
"Map",
"<",
"String",
",",
"?",
">",
"threadContextConfig",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"ca... | /*
(non-Javadoc)
@see com.ibm.wsspi.threadcontext.ThreadContextProvider#captureThreadContext(java.util.Map, java.util.Map) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/inbound/security/SecurityInflowContextProviderImpl.java#L101-L104 | train | Capture the thread context. | Of course, here is the Java code you requested:
```java
@Override
public ThreadContext captureThreadContext(Map<String, String> execProps, Map<String, ?> threadContextConfig) {
throw new UnsupportedOperationException("captureThreadContext");
}
```
Hope this helps! |
micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java | AbstractExecutor.startEnvironment | protected Environment startEnvironment(ApplicationContext applicationContext) {
if (!applicationContext.isRunning()) {
if (this instanceof PropertySource) {
applicationContext.getEnvironment().addPropertySource((PropertySource) this);
}
return applicationCont... | java | protected Environment startEnvironment(ApplicationContext applicationContext) {
if (!applicationContext.isRunning()) {
if (this instanceof PropertySource) {
applicationContext.getEnvironment().addPropertySource((PropertySource) this);
}
return applicationCont... | [
"protected",
"Environment",
"startEnvironment",
"(",
"ApplicationContext",
"applicationContext",
")",
"{",
"if",
"(",
"!",
"applicationContext",
".",
"isRunning",
"(",
")",
")",
"{",
"if",
"(",
"this",
"instanceof",
"PropertySource",
")",
"{",
"applicationContext",
... | Start the environment specified.
@param applicationContext the application context with the environment
@return The environment within the context | [
"Start",
"the",
"environment",
"specified",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java#L113-L125 | train | Start the application context environment. | Of course, here is the Java code you requested:
```java
protected Environment startEnvironment(ApplicationContext applicationContext) {
if (!applicationContext.isRunning()) {
if (this instanceof PropertySource) {
applicationContext.getEnvironment().addPropertySource((PropertySource)... |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelV2ServerState.java | PaymentChannelV2ServerState.signP2SHInput | private void signP2SHInput(Transaction tx, Transaction.SigHash hashType,
boolean anyoneCanPay, @Nullable KeyParameter userKey) {
TransactionSignature signature = tx.calculateSignature(0, serverKey, userKey, createP2SHRedeemScript(), hashType, anyoneCanPay);
byte[] mySig = ... | java | private void signP2SHInput(Transaction tx, Transaction.SigHash hashType,
boolean anyoneCanPay, @Nullable KeyParameter userKey) {
TransactionSignature signature = tx.calculateSignature(0, serverKey, userKey, createP2SHRedeemScript(), hashType, anyoneCanPay);
byte[] mySig = ... | [
"private",
"void",
"signP2SHInput",
"(",
"Transaction",
"tx",
",",
"Transaction",
".",
"SigHash",
"hashType",
",",
"boolean",
"anyoneCanPay",
",",
"@",
"Nullable",
"KeyParameter",
"userKey",
")",
"{",
"TransactionSignature",
"signature",
"=",
"tx",
".",
"calculate... | Signs the first input of the transaction which must spend the multisig contract. | [
"Signs",
"the",
"first",
"input",
"of",
"the",
"transaction",
"which",
"must",
"spend",
"the",
"multisig",
"contract",
"."
] | 9cf13d29315014ed59cf4fc5944e5f227e8df9a6 | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelV2ServerState.java#L138-L144 | train | Sign a P2SH input. | Of course, here is the Java code you requested:
```java
private void signP2SHInput(Transaction tx, Transaction.SigHash hashType,
boolean anyoneCanPay, @Nullable KeyParameter userKey) {
TransactionSignature signature = tx.calculateSignature(0, serverKey, userKey, createP2SHRedeemS... |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/utils/TagUtils.java | TagUtils.toSortedMap | public static Map<String, Tag> toSortedMap(List<Tag> tags, Comparator<String> comparator) {
Map<String, Tag> sortedMap;
if (comparator == null)
sortedMap = new LinkedHashMap<>();
else
sortedMap = new TreeMap<>(comparator);
tags.forEach(tag -> sortedMap.put(tag.get... | java | public static Map<String, Tag> toSortedMap(List<Tag> tags, Comparator<String> comparator) {
Map<String, Tag> sortedMap;
if (comparator == null)
sortedMap = new LinkedHashMap<>();
else
sortedMap = new TreeMap<>(comparator);
tags.forEach(tag -> sortedMap.put(tag.get... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Tag",
">",
"toSortedMap",
"(",
"List",
"<",
"Tag",
">",
"tags",
",",
"Comparator",
"<",
"String",
">",
"comparator",
")",
"{",
"Map",
"<",
"String",
",",
"Tag",
">",
"sortedMap",
";",
"if",
"(",
"compar... | Converts the global Tag list into a Map where the tag name is the key and the Tag the value.
Either ordered or as-is, if the comparator is null.
@param tags the List of tags
@param comparator the comparator to use.
@return the Map of tags. Either ordered or as-is, if the comparator is null. | [
"Converts",
"the",
"global",
"Tag",
"list",
"into",
"a",
"Map",
"where",
"the",
"tag",
"name",
"is",
"the",
"key",
"and",
"the",
"Tag",
"the",
"value",
".",
"Either",
"ordered",
"or",
"as",
"-",
"is",
"if",
"the",
"comparator",
"is",
"null",
"."
] | da83465f19a2f8a0f1fba873b5762bca8587896b | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/utils/TagUtils.java#L41-L49 | train | To sorted map map. | Of course, here is the Java code you requested:
```java
public static Map<String, Tag> toSortedMap(List<Tag> tags, Comparator<String> comparator) {
Map<String, Tag> sortedMap;
if (comparator == null)
sortedMap = new LinkedHashMap<>();
else
sortedMap = new TreeMap<>(compa... |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/AccountsApi.java | AccountsApi.getBrandResourcesByContentType | public void getBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, AccountsApi.GetBrandResourcesByContentTypeOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | java | public void getBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, AccountsApi.GetBrandResourcesByContentTypeOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"void",
"getBrandResourcesByContentType",
"(",
"String",
"accountId",
",",
"String",
"brandId",
",",
"String",
"resourceContentType",
",",
"AccountsApi",
".",
"GetBrandResourcesByContentTypeOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"loca... | Returns the specified branding resource file.
@param accountId The external account number (int) or account ID Guid. (required)
@param brandId The unique identifier of a brand. (required)
@param resourceContentType (required)
@param options for modifying the method behavior.
@throws ApiException if fails to make API ... | [
"Returns",
"the",
"specified",
"branding",
"resource",
"file",
"."
] | 17ae82ace0f023e98edf813be832950568212e34 | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/AccountsApi.java#L1311-L1360 | train | Get Brand Resources By ContentType Get Brand Resources by ContentType | Of course, here is the Java code you requested:
```java
public void getBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, AccountsApi.GetBrandResourcesByContentTypeOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required paramet... |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java | Modifiers.setPublic | public static int setPublic(int modifier, boolean b) {
if (b) {
return (modifier | PUBLIC) & (~PROTECTED & ~PRIVATE);
}
else {
return modifier & ~PUBLIC;
}
} | java | public static int setPublic(int modifier, boolean b) {
if (b) {
return (modifier | PUBLIC) & (~PROTECTED & ~PRIVATE);
}
else {
return modifier & ~PUBLIC;
}
} | [
"public",
"static",
"int",
"setPublic",
"(",
"int",
"modifier",
",",
"boolean",
"b",
")",
"{",
"if",
"(",
"b",
")",
"{",
"return",
"(",
"modifier",
"|",
"PUBLIC",
")",
"&",
"(",
"~",
"PROTECTED",
"&",
"~",
"PRIVATE",
")",
";",
"}",
"else",
"{",
"... | When set public, the modifier is cleared from being private or
protected. | [
"When",
"set",
"public",
"the",
"modifier",
"is",
"cleared",
"from",
"being",
"private",
"or",
"protected",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java#L34-L41 | train | Sets the public modifier for a Crazilian application. | Of course, here is the Java code you requested:
```java
public static int setPublic(int modifier, boolean b) {
if (b) {
return (modifier | PUBLIC) & (~PROTECTED & ~PRIVATE);
}
else {
return modifier & ~PUBLIC;
}
}
```
Hope this helps! |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java | PentaTreeNode.setChild1 | private boolean setChild1(N newChild) {
if (this.child1 == newChild) {
return false;
}
if (this.child1 != null) {
this.child1.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, this.child1);
}
if (newChild != null) {
final N oldParent = newChild.getParen... | java | private boolean setChild1(N newChild) {
if (this.child1 == newChild) {
return false;
}
if (this.child1 != null) {
this.child1.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, this.child1);
}
if (newChild != null) {
final N oldParent = newChild.getParen... | [
"private",
"boolean",
"setChild1",
"(",
"N",
"newChild",
")",
"{",
"if",
"(",
"this",
".",
"child1",
"==",
"newChild",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"child1",
"!=",
"null",
")",
"{",
"this",
".",
"child1",
".",
"set... | Set the child 1.
@param newChild is the new child
@return <code>true</code> on success, otherwise <code>false</code> | [
"Set",
"the",
"child",
"1",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/PentaTreeNode.java#L255-L282 | train | Sets the child 1. | Of course, here is the Java code you requested:
```java
private boolean setChild1(N newChild) {
if (this.child1 == newChild) {
return false;
}
if (this.child1 != null) {
this.child1.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, this.child1);
}
if (new... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.