repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.doFinally | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new MaybeDoFinally<T>(this, onFinally));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new MaybeDoFinally<T>(this, onFinally));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"doFinally",
"(",
"Action",
"onFinally",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"onFinally",
",",
"\"onFinally ... | Calls the specified action after this Maybe signals onSuccess, onError or onComplete or gets disposed by
the downstream.
<p>In case of a race between a terminal event and a dispose call, the provided {@code onFinally} action
is executed once per subscription.
<p>Note that the {@code onFinally} action is shared between ... | [
"Calls",
"the",
"specified",
"action",
"after",
"this",
"Maybe",
"signals",
"onSuccess",
"onError",
"or",
"onComplete",
"or",
"gets",
"disposed",
"by",
"the",
"downstream",
".",
"<p",
">",
"In",
"case",
"of",
"a",
"race",
"between",
"a",
"terminal",
"event",... | 8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L2707-L2712 | train | Do a finally operation on the result of a Maybe. | Create a Java method that does the following: "Do a finally operation on the result of a Maybe.". | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doFinally(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return RxJavaPlugins.onAssembly(new MaybeDoFinally<T>(this, onFinal... | |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipDir | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
} | java | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
} | [
"public",
"static",
"void",
"zipDir",
"(",
"final",
"File",
"srcDir",
",",
"final",
"String",
"destPath",
",",
"final",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"zipDir",
"(",
"srcDir",
",",
"null",
",",
"destPath",
",",
"destFile",
")",
";",... | Creates a ZIP file and adds all files in a directory and all it's sub directories to the archive.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param destPath
Path to use for the ZIP archive - May be <code>null</code> or an empyt string.
@param destFile
Target ZIP file - ... | [
"Creates",
"a",
"ZIP",
"file",
"and",
"adds",
"all",
"files",
"in",
"a",
"directory",
"and",
"all",
"it",
"s",
"sub",
"directories",
"to",
"the",
"archive",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1404-L1408 | train | Zip a directory with a single file. | Create a Java method that does the following: "Zip a directory with a single file.". | Of course, here is the Java code you requested:
```java
public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
}
```
Hope this helps! | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java | IndexingConfigurationImpl.getPropertyBoost | public float getPropertyBoost(NodeData state, InternalQName propertyName)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.getBoost(propertyName);
}
return DEFAULT_BOOST;
} | java | public float getPropertyBoost(NodeData state, InternalQName propertyName)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.getBoost(propertyName);
}
return DEFAULT_BOOST;
} | [
"public",
"float",
"getPropertyBoost",
"(",
"NodeData",
"state",
",",
"InternalQName",
"propertyName",
")",
"{",
"IndexingRule",
"rule",
"=",
"getApplicableIndexingRule",
"(",
"state",
")",
";",
"if",
"(",
"rule",
"!=",
"null",
")",
"{",
"return",
"rule",
".",... | Returns the boost value for the given property name. If there is no
configuration entry for the property name the {@link #DEFAULT_BOOST} is
returned.
@param state
the node state.
@param propertyName
the name of a property.
@return the boost value for the property. | [
"Returns",
"the",
"boost",
"value",
"for",
"the",
"given",
"property",
"name",
".",
"If",
"there",
"is",
"no",
"configuration",
"entry",
"for",
"the",
"property",
"name",
"the",
"{",
"@link",
"#DEFAULT_BOOST",
"}",
"is",
"returned",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java#L271-L279 | train | Get the boost value for the given property name. | Create a Java method that does the following: "Get the boost value for the given property name.". | Of course, here is the Java code you requested:
```java
public float getPropertyBoost(NodeData state, InternalQName propertyName)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.getBoost(propertyName);
}
return DEFAULT_BOOST;
}
```
H... | |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/ModelCurator.java | ModelCurator.correct | public ModelDef[] correct(){
for(ModelDef m : modelList){
this.model = m;
correct1to1Detail();
}
for(ModelDef m : modelList){
this.model = m;
removeUnnecessaryHasOneToSelf();
}
for(ModelDef m : modelList){
this.model = m;
removeUnnecessaryHasManyToSelf();
}
for(ModelDef m : modelList){
... | java | public ModelDef[] correct(){
for(ModelDef m : modelList){
this.model = m;
correct1to1Detail();
}
for(ModelDef m : modelList){
this.model = m;
removeUnnecessaryHasOneToSelf();
}
for(ModelDef m : modelList){
this.model = m;
removeUnnecessaryHasManyToSelf();
}
for(ModelDef m : modelList){
... | [
"public",
"ModelDef",
"[",
"]",
"correct",
"(",
")",
"{",
"for",
"(",
"ModelDef",
"m",
":",
"modelList",
")",
"{",
"this",
".",
"model",
"=",
"m",
";",
"correct1to1Detail",
"(",
")",
";",
"}",
"for",
"(",
"ModelDef",
"m",
":",
"modelList",
")",
"{"... | Run each one at a time for all models in such a way that it won't disturb the other
@return | [
"Run",
"each",
"one",
"at",
"a",
"time",
"for",
"all",
"models",
"in",
"such",
"a",
"way",
"that",
"it",
"won",
"t",
"disturb",
"the",
"other"
] | e63213cb8abefd11df0e2d34b1c95477788e600e | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L25-L47 | train | Correct the models in the modelList. | Create a Java method that does the following: "Correct the models in the modelList.". | Of course, here is the Java code you requested:
```java
public ModelDef[] correct(){
for(ModelDef m : modelList){
this.model = m;
correct1to1Detail();
}
for(ModelDef m : modelList){
this.model = m;
removeUnnecessaryHasOneToSelf();
}
for(ModelDef m : modelList){
this.model = m;
removeUnneces... | |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PElement.java | PElement.addPathTo | protected final void addPathTo(final StringBuilder result) {
if (this.parent != null) {
this.parent.addPathTo(result);
if (!(this.parent instanceof PJsonArray)) {
result.append(".");
}
}
result.append(getPathElement(this.contextName));
} | java | protected final void addPathTo(final StringBuilder result) {
if (this.parent != null) {
this.parent.addPathTo(result);
if (!(this.parent instanceof PJsonArray)) {
result.append(".");
}
}
result.append(getPathElement(this.contextName));
} | [
"protected",
"final",
"void",
"addPathTo",
"(",
"final",
"StringBuilder",
"result",
")",
"{",
"if",
"(",
"this",
".",
"parent",
"!=",
"null",
")",
"{",
"this",
".",
"parent",
".",
"addPathTo",
"(",
"result",
")",
";",
"if",
"(",
"!",
"(",
"this",
"."... | Append the path to the StringBuilder.
@param result the string builder to add the path to. | [
"Append",
"the",
"path",
"to",
"the",
"StringBuilder",
"."
] | 25a452cb39f592bd8a53b20db1037703898e1e22 | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PElement.java#L65-L73 | train | Add the path to the result. | Create a Java method that does the following: "Add the path to the result.". | Of course, here is the Java code you requested:
```java
protected final void addPathTo(final StringBuilder result) {
if (this.parent != null) {
this.parent.addPathTo(result);
if (!(this.parent instanceof PJsonArray)) {
result.append(".");
}
}
... | |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/FileAppender.java | FileAppender.getAbsoluteFilePath | private String getAbsoluteFilePath(String filename) {
// In Android, relative paths created with File() are relative
// to root, so fix it by prefixing the path to the app's "files"
// directory.
// This transformation is rather expensive, since it involves loading the
// Android manifest from the A... | java | private String getAbsoluteFilePath(String filename) {
// In Android, relative paths created with File() are relative
// to root, so fix it by prefixing the path to the app's "files"
// directory.
// This transformation is rather expensive, since it involves loading the
// Android manifest from the A... | [
"private",
"String",
"getAbsoluteFilePath",
"(",
"String",
"filename",
")",
"{",
"// In Android, relative paths created with File() are relative",
"// to root, so fix it by prefixing the path to the app's \"files\"",
"// directory.",
"// This transformation is rather expensive, since it involv... | Gets the absolute path to the filename, starting from the app's
"files" directory, if it is not already an absolute path
@param filename filename to evaluate
@return absolute path to the filename | [
"Gets",
"the",
"absolute",
"path",
"to",
"the",
"filename",
"starting",
"from",
"the",
"app",
"s",
"files",
"directory",
"if",
"it",
"is",
"not",
"already",
"an",
"absolute",
"path"
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/FileAppender.java#L354-L367 | test | Get absolute path to the file | Create a Java method that does the following: "Get absolute path to the file". | Of course, here is the Java code you requested:
```java
private String getAbsoluteFilePath(String filename) {
// In Android, relative paths created with File() are relative
// to root, so fix it by prefixing the path to the app's "files"
// directory.
// This transformation is rather expensive, since i... | |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendBinarySync | public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting to send bin... | java | public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting to send bin... | [
"public",
"void",
"sendBinarySync",
"(",
"Session",
"session",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"throw"... | Sends binary data to a client synchronously.
@param session the client where the message will be sent
@param inputStream the binary data to send
@throws IOException if a problem occurred during delivery of the data to a session. | [
"Sends",
"binary",
"data",
"to",
"a",
"client",
"synchronously",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L143-L160 | train | Send binary data to the client synchronously. | Create a Java method that does the following: "Send binary data to the client synchronously.". | Of course, here is the Java code you requested:
```java
public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null... | |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/DescribeJobsResult.java | DescribeJobsResult.setJobs | public void setJobs(java.util.Collection<JobDetail> jobs) {
if (jobs == null) {
this.jobs = null;
return;
}
this.jobs = new java.util.ArrayList<JobDetail>(jobs);
} | java | public void setJobs(java.util.Collection<JobDetail> jobs) {
if (jobs == null) {
this.jobs = null;
return;
}
this.jobs = new java.util.ArrayList<JobDetail>(jobs);
} | [
"public",
"void",
"setJobs",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"JobDetail",
">",
"jobs",
")",
"{",
"if",
"(",
"jobs",
"==",
"null",
")",
"{",
"this",
".",
"jobs",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"jobs",
"=",
"ne... | <p>
The list of jobs.
</p>
@param jobs
The list of jobs. | [
"<p",
">",
"The",
"list",
"of",
"jobs",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/DescribeJobsResult.java#L54-L61 | train | Sets the value of the jobs property. | Create a Java method that does the following: "Sets the value of the jobs property.". | Of course, here is the Java code you requested:
```java
public void setJobs(java.util.Collection<JobDetail> jobs) {
if (jobs == null) {
this.jobs = null;
return;
}
this.jobs = new java.util.ArrayList<JobDetail>(jobs);
}
```
Hope this helps! | |
webfirmframework/wff | wffweb/src/main/java/com/webfirmframework/wffweb/util/TagStringUtil.java | TagStringUtil.toLowerCase | public static String toLowerCase(final String value) {
final char[] chars = value.toCharArray();
for (int i = 0; i < chars.length; i++) {
chars[i] = LOWER_CASE_CHARS[chars[i]];
}
return new String(chars);
} | java | public static String toLowerCase(final String value) {
final char[] chars = value.toCharArray();
for (int i = 0; i < chars.length; i++) {
chars[i] = LOWER_CASE_CHARS[chars[i]];
}
return new String(chars);
} | [
"public",
"static",
"String",
"toLowerCase",
"(",
"final",
"String",
"value",
")",
"{",
"final",
"char",
"[",
"]",
"chars",
"=",
"value",
".",
"toCharArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chars",
".",
"length",
";... | In html, the tag characters are supposed to use a limited number of
characters like 'a'-'z', 'A'-'Z', '0'-'9', '.', ',', '-' etc... only. *
This method gains performance than the native
{@code String.toLowerCase()} method.
@param value
The String to lower case
@return The lower case string
@author WFF | [
"In",
"html",
"the",
"tag",
"characters",
"are",
"supposed",
"to",
"use",
"a",
"limited",
"number",
"of",
"characters",
"like",
"a",
"-",
"z",
"A",
"-",
"Z",
"0",
"-",
"9",
".",
"-",
"etc",
"...",
"only",
".",
"*",
"This",
"method",
"gains",
"perfo... | e59def3a20d44f91e112b113448d951d7514af2e | https://github.com/webfirmframework/wff/blob/e59def3a20d44f91e112b113448d951d7514af2e/wffweb/src/main/java/com/webfirmframework/wffweb/util/TagStringUtil.java#L47-L55 | valid | Get the value lower case. | Create a Java method that does the following: "Get the value lower case.". | Of course, here is the Java code you requested:
```java
public static String toLowerCase(final String value) {
final char[] chars = value.toCharArray();
for (int i = 0; i < chars.length; i++) {
chars[i] = LOWER_CASE_CHARS[chars[i]];
}
return new String(chars);
}
```
H... | |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java | MemorizeTransactionProxy.attemptRecovery | private TransactionRecoveryResult attemptRecovery(List<ReplayLog> oldReplayLog) throws SQLException{
boolean tryAgain = false;
Throwable failedThrowable = null;
ConnectionHandle con = this.connectionHandle.get();
if (con == null){ // safety!
throw PoolUtil.generateSQLException("ConnectionHandle is gone!", ... | java | private TransactionRecoveryResult attemptRecovery(List<ReplayLog> oldReplayLog) throws SQLException{
boolean tryAgain = false;
Throwable failedThrowable = null;
ConnectionHandle con = this.connectionHandle.get();
if (con == null){ // safety!
throw PoolUtil.generateSQLException("ConnectionHandle is gone!", ... | [
"private",
"TransactionRecoveryResult",
"attemptRecovery",
"(",
"List",
"<",
"ReplayLog",
">",
"oldReplayLog",
")",
"throws",
"SQLException",
"{",
"boolean",
"tryAgain",
"=",
"false",
";",
"Throwable",
"failedThrowable",
"=",
"null",
";",
"ConnectionHandle",
"con",
... | Play back a transaction
@param oldReplayLog
@return map + result
@throws SQLException | [
"Play",
"back",
"a",
"transaction",
"@param",
"oldReplayLog",
"@return",
"map",
"+",
"result",
"@throws",
"SQLException"
] | 74bc3287025fc137ca28909f0f7693edae37a15d | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java#L269-L393 | train | Attempts to replay a transaction. | Create a Java method that does the following: "Attempts to replay a transaction.". | Of course, here is the Java code you requested:
```java
private TransactionRecoveryResult attemptRecovery(List<ReplayLog> oldReplayLog) throws SQLException{
boolean tryAgain = false;
Throwable failedThrowable = null;
ConnectionHandle con = this.connectionHandle.get();
if (con == null){ // safety!
throw Po... | |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/html/HtmlAbstractReport.java | HtmlAbstractReport.getFormattedString | static String getFormattedString(String key, Object... arguments) {
return I18N.getFormattedString(key, arguments);
} | java | static String getFormattedString(String key, Object... arguments) {
return I18N.getFormattedString(key, arguments);
} | [
"static",
"String",
"getFormattedString",
"(",
"String",
"key",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"I18N",
".",
"getFormattedString",
"(",
"key",
",",
"arguments",
")",
";",
"}"
] | Retourne une traduction dans la locale courante et insère les arguments aux positions {i}.
@param key clé d'un libellé dans les fichiers de traduction
@param arguments Valeur à inclure dans le résultat
@return String | [
"Retourne",
"une",
"traduction",
"dans",
"la",
"locale",
"courante",
"et",
"insère",
"les",
"arguments",
"aux",
"positions",
"{",
"i",
"}",
"."
] | 18ad583ddeb5dcadd797dfda295409c6983ffd71 | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/html/HtmlAbstractReport.java#L159-L161 | train | Returns a formatted string for the given key. | Create a Java method that does the following: "Returns a formatted string for the given key.". | Of course, here is the Java code you requested:
```java
static String getFormattedString(String key, Object... arguments) {
return I18N.getFormattedString(key, arguments);
}
```
Hope this helps! | |
eFaps/eFaps-Kernel | src/main/java/org/efaps/rest/Search.java | Search.search | @GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@SuppressWarnings("checkstyle:illegalcatch")
public Response search(@QueryParam("query") final String _query)
{
Response ret;
try {
final SearchResult result = org.efaps.admin.index.Searcher.search(_query);
... | java | @GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@SuppressWarnings("checkstyle:illegalcatch")
public Response search(@QueryParam("query") final String _query)
{
Response ret;
try {
final SearchResult result = org.efaps.admin.index.Searcher.search(_query);
... | [
"@",
"GET",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"APPLICATION_JSON",
",",
"MediaType",
".",
"TEXT_PLAIN",
"}",
")",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:illegalcatch\"",
")",
"public",
"Response",
"search",
"(",
"@",
"QueryParam",
"(",
"\"query\""... | Search.
@param _query the _query
@return the response | [
"Search",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/rest/Search.java#L54-L72 | train | Search for a single entity in a single language. | Create a Java method that does the following: "Search for a single entity in a single language.". | Of course, here is the Java code you requested:
```java
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
@SuppressWarnings("checkstyle:illegalcatch")
public Response search(@QueryParam("query") final String _query)
{
Response ret;
try {
final SearchResult... | |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journalv0/ufs/UfsCheckpointManager.java | UfsCheckpointManager.update | public void update(URI location) {
try {
if (mUfs.isFile(mCheckpoint.toString())) {
UnderFileSystemUtils.deleteFileIfExists(mUfs, mTempBackupCheckpoint.toString());
UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
// Rename in two steps so that we never have... | java | public void update(URI location) {
try {
if (mUfs.isFile(mCheckpoint.toString())) {
UnderFileSystemUtils.deleteFileIfExists(mUfs, mTempBackupCheckpoint.toString());
UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString());
// Rename in two steps so that we never have... | [
"public",
"void",
"update",
"(",
"URI",
"location",
")",
"{",
"try",
"{",
"if",
"(",
"mUfs",
".",
"isFile",
"(",
"mCheckpoint",
".",
"toString",
"(",
")",
")",
")",
"{",
"UnderFileSystemUtils",
".",
"deleteFileIfExists",
"(",
"mUfs",
",",
"mTempBackupCheck... | Updates the checkpoint to the specified URI.
@param location the location of the new checkpoint | [
"Updates",
"the",
"checkpoint",
"to",
"the",
"specified",
"URI",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journalv0/ufs/UfsCheckpointManager.java#L129-L150 | train | Update the checkpoint file. | Create a Java method that does the following: "Update the checkpoint file.". | Of course, here is the Java code you requested:
```java
public void update(URI location) {
try {
if (mUfs.isFile(mCheckpoint.toString())) {
UnderFileSystemUtils.deleteFileIfExists(mUfs, mTempBackupCheckpoint.toString());
UnderFileSystemUtils.deleteFileIfExists(mUfs, mBackupCheckpoint.toString... | |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java | LogoutConfigurer.getLogoutSuccessHandler | private LogoutSuccessHandler getLogoutSuccessHandler() {
LogoutSuccessHandler handler = this.logoutSuccessHandler;
if (handler == null) {
handler = createDefaultSuccessHandler();
}
return handler;
} | java | private LogoutSuccessHandler getLogoutSuccessHandler() {
LogoutSuccessHandler handler = this.logoutSuccessHandler;
if (handler == null) {
handler = createDefaultSuccessHandler();
}
return handler;
} | [
"private",
"LogoutSuccessHandler",
"getLogoutSuccessHandler",
"(",
")",
"{",
"LogoutSuccessHandler",
"handler",
"=",
"this",
".",
"logoutSuccessHandler",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"handler",
"=",
"createDefaultSuccessHandler",
"(",
")",
";",... | Gets the {@link LogoutSuccessHandler} if not null, otherwise creates a new
{@link SimpleUrlLogoutSuccessHandler} using the {@link #logoutSuccessUrl(String)}.
@return the {@link LogoutSuccessHandler} to use | [
"Gets",
"the",
"{",
"@link",
"LogoutSuccessHandler",
"}",
"if",
"not",
"null",
"otherwise",
"creates",
"a",
"new",
"{",
"@link",
"SimpleUrlLogoutSuccessHandler",
"}",
"using",
"the",
"{",
"@link",
"#logoutSuccessUrl",
"(",
"String",
")",
"}",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java#L253-L259 | test | Get the LogoutSuccessHandler. | Create a Java method that does the following: "Get the LogoutSuccessHandler.". | Of course, here is the Java code you requested:
```java
private LogoutSuccessHandler getLogoutSuccessHandler() {
LogoutSuccessHandler handler = this.logoutSuccessHandler;
if (handler == null) {
handler = createDefaultSuccessHandler();
}
return handler;
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/BillingMetersInner.java | BillingMetersInner.listAsync | public Observable<Page<BillingMeterInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<BillingMeterInner>>, Page<BillingMeterInner>>() {
@Override
public Page<BillingMeterInner> call(ServiceResponse<Page<BillingMeterInner>> ... | java | public Observable<Page<BillingMeterInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<BillingMeterInner>>, Page<BillingMeterInner>>() {
@Override
public Page<BillingMeterInner> call(ServiceResponse<Page<BillingMeterInner>> ... | [
"public",
"Observable",
"<",
"Page",
"<",
"BillingMeterInner",
">",
">",
"listAsync",
"(",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"BillingMeterInner",
">",
">",
... | Gets a list of meters for a given location.
Gets a list of meters for a given location.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<BillingMeterInner> object | [
"Gets",
"a",
"list",
"of",
"meters",
"for",
"a",
"given",
"location",
".",
"Gets",
"a",
"list",
"of",
"meters",
"for",
"a",
"given",
"location",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/BillingMetersInner.java#L115-L123 | train | List all the Crazend Sessions. | Create a Java method that does the following: "List all the Crazend Sessions.". | Of course, here is the Java code you requested:
```java
public Observable<Page<BillingMeterInner>> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1<ServiceResponse<Page<BillingMeterInner>>, Page<BillingMeterInner>>() {
@Override
public Page<BillingM... | |
stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/CacheManager.java | CacheManager.getAllCacheKeys | @Override
public <T> List<Object> getAllCacheKeys(final Class<T> clazz) {
try {
return getObjectPersister(clazz).getAllCacheKeys();
} catch (CacheCreationException e) {
Ln.e(e);
return Collections.emptyList();
}
} | java | @Override
public <T> List<Object> getAllCacheKeys(final Class<T> clazz) {
try {
return getObjectPersister(clazz).getAllCacheKeys();
} catch (CacheCreationException e) {
Ln.e(e);
return Collections.emptyList();
}
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"List",
"<",
"Object",
">",
"getAllCacheKeys",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"return",
"getObjectPersister",
"(",
"clazz",
")",
".",
"getAllCacheKeys",
"(",
")",
";",
"}",... | {@inheritDoc} | [
"{"
] | 8bffde88b3534a961a13cab72a8f07a755f0a0fe | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/CacheManager.java#L127-L135 | train | Gets all cache keys. | Create a Java method that does the following: "Gets all cache keys.". | Of course, here is the Java code you requested:
```java
@Override
public <T> List<Object> getAllCacheKeys(final Class<T> clazz) {
try {
return getObjectPersister(clazz).getAllCacheKeys();
} catch (CacheCreationException e) {
Ln.e(e);
return Collections.emptyList(... | |
getsentry/sentry-java | sentry/src/main/java/io/sentry/environment/SentryEnvironment.java | SentryEnvironment.stopManagingThread | public static void stopManagingThread() {
try {
if (!isManagingThread()) {
//Start managing the thread only to send the warning
startManagingThread();
logger.warn("Thread not yet managed by Sentry");
}
} finally {
if (SE... | java | public static void stopManagingThread() {
try {
if (!isManagingThread()) {
//Start managing the thread only to send the warning
startManagingThread();
logger.warn("Thread not yet managed by Sentry");
}
} finally {
if (SE... | [
"public",
"static",
"void",
"stopManagingThread",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isManagingThread",
"(",
")",
")",
"{",
"//Start managing the thread only to send the warning",
"startManagingThread",
"(",
")",
";",
"logger",
".",
"warn",
"(",
"\"Thread... | Sets the current thread as not managed by Sentry.
<p>
The logs generated by Threads not managed by Sentry will send logs to Sentry. | [
"Sets",
"the",
"current",
"thread",
"as",
"not",
"managed",
"by",
"Sentry",
".",
"<p",
">",
"The",
"logs",
"generated",
"by",
"Threads",
"not",
"managed",
"by",
"Sentry",
"will",
"send",
"logs",
"to",
"Sentry",
"."
] | 2e01461775cbd5951ff82b566069c349146d8aca | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/environment/SentryEnvironment.java#L67-L81 | train | Stop managing the Sentry thread. | Create a Java method that does the following: "Stop managing the Sentry thread.". | Of course, here is the Java code you requested:
```java
public static void stopManagingThread() {
try {
if (!isManagingThread()) {
//Start managing the thread only to send the warning
startManagingThread();
logger.warn("Thread not yet managed by Sentr... | |
nutzam/nutz | src/org/nutz/trans/Trans.java | Trans.getConnectionAuto | public static Connection getConnectionAuto(DataSource ds) throws SQLException {
if (get() == null)
return ds.getConnection();
else
return get().getConnection(ds);
} | java | public static Connection getConnectionAuto(DataSource ds) throws SQLException {
if (get() == null)
return ds.getConnection();
else
return get().getConnection(ds);
} | [
"public",
"static",
"Connection",
"getConnectionAuto",
"(",
"DataSource",
"ds",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"get",
"(",
")",
"==",
"null",
")",
"return",
"ds",
".",
"getConnection",
"(",
")",
";",
"else",
"return",
"get",
"(",
")",
"."... | 如果在事务中,则返回事务的连接,否则直接从数据源取一个新的连接 | [
"如果在事务中",
"则返回事务的连接",
"否则直接从数据源取一个新的连接"
] | a38694d5cbda2692e7931ab093c168487a6a4bfe | https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/trans/Trans.java#L261-L266 | valid | Get a Connection object from the DataSource. | Create a Java method that does the following: "Get a Connection object from the DataSource.". | Of course, here is the Java code you requested:
```java
public static Connection getConnectionAuto(DataSource ds) throws SQLException {
if (get() == null)
return ds.getConnection();
else
return get().getConnection(ds);
}
```
Hope this helps! | |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/svs/StructuredVectorSpace.java | StructuredVectorSpace.processDocument | public void processDocument(BufferedReader document) throws IOException {
// Local maps to record occurrence counts.
Map<Pair<String>,Double> localLemmaCounts =
new HashMap<Pair<String>,Double>();
Map<RelationTuple, SparseDoubleVector> localTuples =
new HashMap<RelationT... | java | public void processDocument(BufferedReader document) throws IOException {
// Local maps to record occurrence counts.
Map<Pair<String>,Double> localLemmaCounts =
new HashMap<Pair<String>,Double>();
Map<RelationTuple, SparseDoubleVector> localTuples =
new HashMap<RelationT... | [
"public",
"void",
"processDocument",
"(",
"BufferedReader",
"document",
")",
"throws",
"IOException",
"{",
"// Local maps to record occurrence counts.",
"Map",
"<",
"Pair",
"<",
"String",
">",
",",
"Double",
">",
"localLemmaCounts",
"=",
"new",
"HashMap",
"<",
"Pair... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/svs/StructuredVectorSpace.java#L243-L376 | train | Process the document. | Create a Java method that does the following: "Process the document.". | Of course, here is the Java code you requested:
```java
public void processDocument(BufferedReader document) throws IOException {
// Local maps to record occurrence counts.
Map<Pair<String>,Double> localLemmaCounts =
new HashMap<Pair<String>,Double>();
Map<RelationTuple, SparseDoub... | |
aws/aws-sdk-java | aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/AWSsignerClient.java | AWSsignerClient.listSigningPlatforms | @Override
public ListSigningPlatformsResult listSigningPlatforms(ListSigningPlatformsRequest request) {
request = beforeClientExecution(request);
return executeListSigningPlatforms(request);
} | java | @Override
public ListSigningPlatformsResult listSigningPlatforms(ListSigningPlatformsRequest request) {
request = beforeClientExecution(request);
return executeListSigningPlatforms(request);
} | [
"@",
"Override",
"public",
"ListSigningPlatformsResult",
"listSigningPlatforms",
"(",
"ListSigningPlatformsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListSigningPlatforms",
"(",
"request",
")",
";",
... | <p>
Lists all signing platforms available in AWS Signer that match the request parameters. If additional jobs remain
to be listed, AWS Signer returns a <code>nextToken</code> value. Use this value in subsequent calls to
<code>ListSigningJobs</code> to fetch the remaining values. You can continue calling <code>ListSigni... | [
"<p",
">",
"Lists",
"all",
"signing",
"platforms",
"available",
"in",
"AWS",
"Signer",
"that",
"match",
"the",
"request",
"parameters",
".",
"If",
"additional",
"jobs",
"remain",
"to",
"be",
"listed",
"AWS",
"Signer",
"returns",
"a",
"<code",
">",
"nextToken... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/AWSsignerClient.java#L479-L483 | train | Returns a list of signing platforms. | Create a Java method that does the following: "Returns a list of signing platforms.". | Of course, here is the Java code you requested:
```java
@Override
public ListSigningPlatformsResult listSigningPlatforms(ListSigningPlatformsRequest request) {
request = beforeClientExecution(request);
return executeListSigningPlatforms(request);
}
```
Hope this helps! | |
arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getRandomPod | private static Pod getRandomPod(KubernetesClient client, String name, String namespace) {
Endpoints endpoints = client.endpoints().inNamespace(namespace).withName(name).get();
List<String> pods = new ArrayList<>();
if (endpoints != null) {
for (EndpointSubset subset : endpoints.getSu... | java | private static Pod getRandomPod(KubernetesClient client, String name, String namespace) {
Endpoints endpoints = client.endpoints().inNamespace(namespace).withName(name).get();
List<String> pods = new ArrayList<>();
if (endpoints != null) {
for (EndpointSubset subset : endpoints.getSu... | [
"private",
"static",
"Pod",
"getRandomPod",
"(",
"KubernetesClient",
"client",
",",
"String",
"name",
",",
"String",
"namespace",
")",
"{",
"Endpoints",
"endpoints",
"=",
"client",
".",
"endpoints",
"(",
")",
".",
"inNamespace",
"(",
"namespace",
")",
".",
"... | Get a random pod that provides the specified service in the specified namespace.
@param client
The client instance to use.
@param name
The name of the service.
@param namespace
The namespace of the service.
@return The pod or null if no pod matches. | [
"Get",
"a",
"random",
"pod",
"that",
"provides",
"the",
"specified",
"service",
"in",
"the",
"specified",
"namespace",
"."
] | ce6b08062cc6ba2a68ecc29606bbae9acda5be13 | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L240-L261 | train | Get a random pod from the kubernetes client | Create a Java method that does the following: "Get a random pod from the kubernetes client". | Of course, here is the Java code you requested:
```java
private static Pod getRandomPod(KubernetesClient client, String name, String namespace) {
Endpoints endpoints = client.endpoints().inNamespace(namespace).withName(name).get();
List<String> pods = new ArrayList<>();
if (endpoints != null) {... | |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java | DropMenuRenderer.encodeDropMenuStart | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeAttribute("class", "dropdown-menu", "class");
if (null !... | java | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeAttribute("class", "dropdown-menu", "class");
if (null !... | [
"public",
"static",
"void",
"encodeDropMenuStart",
"(",
"DropMenu",
"c",
",",
"ResponseWriter",
"rw",
",",
"String",
"l",
")",
"throws",
"IOException",
"{",
"rw",
".",
"startElement",
"(",
"\"ul\"",
",",
"c",
")",
";",
"if",
"(",
"c",
".",
"getContentClass... | Renders the Drop Menu.
@param c
@param rw
@param l
@throws IOException | [
"Renders",
"the",
"Drop",
"Menu",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java#L210-L220 | train | Write the start of a DropMenu element. | Create a Java method that does the following: "Write the start of a DropMenu element.". | Of course, here is the Java code you requested:
```java
public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeA... | |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java | SVGHyperCube.drawFrame | public static Element drawFrame(SVGPlot svgp, Projection2D proj, double[] min, double[] max) {
SVGPath path = new SVGPath();
ArrayList<double[]> edges = getVisibleEdges(proj, min, max);
double[] rv_min = proj.fastProjectDataToRenderSpace(min);
recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zer... | java | public static Element drawFrame(SVGPlot svgp, Projection2D proj, double[] min, double[] max) {
SVGPath path = new SVGPath();
ArrayList<double[]> edges = getVisibleEdges(proj, min, max);
double[] rv_min = proj.fastProjectDataToRenderSpace(min);
recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zer... | [
"public",
"static",
"Element",
"drawFrame",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"double",
"[",
"]",
"min",
",",
"double",
"[",
"]",
"max",
")",
"{",
"SVGPath",
"path",
"=",
"new",
"SVGPath",
"(",
")",
";",
"ArrayList",
"<",
"doubl... | Wireframe hypercube.
@param svgp SVG Plot
@param proj Visualization projection
@param min First corner
@param max Opposite corner
@return path element | [
"Wireframe",
"hypercube",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java#L61-L67 | train | Draw a frame of the image. | Create a Java method that does the following: "Draw a frame of the image.". | Of course, here is the Java code you requested:
```java
public static Element drawFrame(SVGPlot svgp, Projection2D proj, double[] min, double[] max) {
SVGPath path = new SVGPath();
ArrayList<double[]> edges = getVisibleEdges(proj, min, max);
double[] rv_min = proj.fastProjectDataToRenderSpace(min);
rec... | |
mlhartme/mork | src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java | ObjectCompiler.run | private void run(Class<?> type, Object val, int limit) {
int initial;
initial = dest.getSize();
if (val == null) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("primitive null");
}
// null is not a string, but otherwise it is ... | java | private void run(Class<?> type, Object val, int limit) {
int initial;
initial = dest.getSize();
if (val == null) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("primitive null");
}
// null is not a string, but otherwise it is ... | [
"private",
"void",
"run",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"val",
",",
"int",
"limit",
")",
"{",
"int",
"initial",
";",
"initial",
"=",
"dest",
".",
"getSize",
"(",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"if",
"(... | type is the static type. If type is primitive, the primitive
object wrapped by val is compiled.
@param limit max number of instactions the value may be compiled to. >= 1. | [
"type",
"is",
"the",
"static",
"type",
".",
"If",
"type",
"is",
"primitive",
"the",
"primitive",
"object",
"wrapped",
"by",
"val",
"is",
"compiled",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java#L80-L105 | train | Run a single entry in the source. | Create a Java method that does the following: "Run a single entry in the source.". | Of course, here is the Java code you requested:
```java
private void run(Class<?> type, Object val, int limit) {
int initial;
initial = dest.getSize();
if (val == null) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("primitive null");
}
... | |
Azure/azure-sdk-for-java | devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java | ControllersInner.beginCreateAsync | public ServiceFuture<ControllerInner> beginCreateAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback<ControllerInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback);
} | java | public ServiceFuture<ControllerInner> beginCreateAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback<ControllerInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, name, controller), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"ControllerInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ControllerInner",
"controller",
",",
"final",
"ServiceCallback",
"<",
"ControllerInner",
">",
"serviceCallback",
")",
"{",
"ret... | Creates an Azure Dev Spaces Controller.
Creates an Azure Dev Spaces Controller with the specified create parameters.
@param resourceGroupName Resource group to which the resource belongs.
@param name Name of the resource.
@param controller Controller create parameters.
@param serviceCallback the async ServiceCallback ... | [
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
".",
"Creates",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
"with",
"the",
"specified",
"create",
"parameters",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java#L315-L317 | train | Creates a CDN controller. | Create a Java method that does the following: "Creates a CDN controller.". | Of course, here is the Java code you requested:
```java
public ServiceFuture<ControllerInner> beginCreateAsync(String resourceGroupName, String name, ControllerInner controller, final ServiceCallback<ControllerInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resou... | |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/security/KEYConverter.java | KEYConverter.parseRecord | public static PublicKey
parseRecord(KEYRecord r) {
int alg = r.getAlgorithm();
byte [] data = r.getKey();
return parseRecord(alg, data);
} | java | public static PublicKey
parseRecord(KEYRecord r) {
int alg = r.getAlgorithm();
byte [] data = r.getKey();
return parseRecord(alg, data);
} | [
"public",
"static",
"PublicKey",
"parseRecord",
"(",
"KEYRecord",
"r",
")",
"{",
"int",
"alg",
"=",
"r",
".",
"getAlgorithm",
"(",
")",
";",
"byte",
"[",
"]",
"data",
"=",
"r",
".",
"getKey",
"(",
")",
";",
"return",
"parseRecord",
"(",
"alg",
",",
... | Converts a KEY record into a PublicKey | [
"Converts",
"a",
"KEY",
"record",
"into",
"a",
"PublicKey"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/KEYConverter.java#L161-L166 | train | Parse a public key record. | Create a Java method that does the following: "Parse a public key record.". | Of course, here is the Java code you requested:
```java
public static PublicKey
parseRecord(KEYRecord r) {
int alg = r.getAlgorithm();
byte [] data = r.getKey();
return parseRecord(alg, data);
}
```
Hope this helps! | |
streamsets/datacollector | common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Matcher.java | Matcher.namedGroups | @Override
public Map<String, String> namedGroups() {
Map<String, String> result = new LinkedHashMap<String, String>();
if (matcher.find(0)) {
for (String groupName : parentPattern.groupNames()) {
String groupValue = matcher.group(groupIndex(groupName));
r... | java | @Override
public Map<String, String> namedGroups() {
Map<String, String> result = new LinkedHashMap<String, String>();
if (matcher.find(0)) {
for (String groupName : parentPattern.groupNames()) {
String groupValue = matcher.group(groupIndex(groupName));
r... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"namedGroups",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"if",
"(",
"matcher"... | Finds all named groups that exist in the input string. This resets the
matcher and attempts to match the input against the pre-specified
pattern.
@return a map of the group named and matched values
(empty if no match found) | [
"Finds",
"all",
"named",
"groups",
"that",
"exist",
"in",
"the",
"input",
"string",
".",
"This",
"resets",
"the",
"matcher",
"and",
"attempts",
"to",
"match",
"the",
"input",
"against",
"the",
"pre",
"-",
"specified",
"pattern",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Matcher.java#L279-L290 | test | Override the namedGroups method to return a map of all named groups. | Create a Java method that does the following: "Override the namedGroups method to return a map of all named groups.". | Of course, here is the Java code you requested:
```java
@Override
public Map<String, String> namedGroups() {
Map<String, String> result = new LinkedHashMap<String, String>();
if (matcher.find(0)) {
for (String groupName : parentPattern.groupNames()) {
String groupValue ... | |
mongodb/mongo-java-driver | bson/src/main/org/bson/BSON.java | BSON.regexFlag | public static int regexFlag(final char c) {
int flag = FLAG_LOOKUP[c];
if (flag == 0) {
throw new IllegalArgumentException(String.format("Unrecognized flag [%c]", c));
}
return flag;
} | java | public static int regexFlag(final char c) {
int flag = FLAG_LOOKUP[c];
if (flag == 0) {
throw new IllegalArgumentException(String.format("Unrecognized flag [%c]", c));
}
return flag;
} | [
"public",
"static",
"int",
"regexFlag",
"(",
"final",
"char",
"c",
")",
"{",
"int",
"flag",
"=",
"FLAG_LOOKUP",
"[",
"c",
"]",
";",
"if",
"(",
"flag",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
... | Converts a regular expression modifier from the database into Java regular expression flags.
@param c regular expression modifier
@return the Java flags
@throws IllegalArgumentException If sequence contains invalid flags. | [
"Converts",
"a",
"regular",
"expression",
"modifier",
"from",
"the",
"database",
"into",
"Java",
"regular",
"expression",
"flags",
"."
] | a92d47e2e9f2fca55d09229a0a2e2cdc714db085 | https://github.com/mongodb/mongo-java-driver/blob/a92d47e2e9f2fca55d09229a0a2e2cdc714db085/bson/src/main/org/bson/BSON.java#L318-L327 | valid | Returns the flag value for a given character. | Create a Java method that does the following: "Returns the flag value for a given character.". | Of course, here is the Java code you requested:
```java
public static int regexFlag(final char c) {
int flag = FLAG_LOOKUP[c];
if (flag == 0) {
throw new IllegalArgumentException(String.format("Unrecognized flag [%c]", c));
}
return flag;
}
```
Hope this helps! | |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java | AsyncLoggerSet.appendHtmlReport | void appendHtmlReport(StringBuilder sb) {
sb.append("<table class=\"storage\">");
sb.append("<thead><tr><td>JN</td><td>Status</td></tr></thead>\n");
for (AsyncLogger l : loggers) {
sb.append("<tr>");
sb.append("<td>" + JspUtil.escapeXml(l.toString()) + "</td>");
sb.append("<td>");
l.... | java | void appendHtmlReport(StringBuilder sb) {
sb.append("<table class=\"storage\">");
sb.append("<thead><tr><td>JN</td><td>Status</td></tr></thead>\n");
for (AsyncLogger l : loggers) {
sb.append("<tr>");
sb.append("<td>" + JspUtil.escapeXml(l.toString()) + "</td>");
sb.append("<td>");
l.... | [
"void",
"appendHtmlReport",
"(",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"<table class=\\\"storage\\\">\"",
")",
";",
"sb",
".",
"append",
"(",
"\"<thead><tr><td>JN</td><td>Status</td></tr></thead>\\n\"",
")",
";",
"for",
"(",
"AsyncLogger",
"l",
... | Append an HTML-formatted status readout on the current
state of the underlying loggers.
@param sb the StringBuilder to append to | [
"Append",
"an",
"HTML",
"-",
"formatted",
"status",
"readout",
"on",
"the",
"current",
"state",
"of",
"the",
"underlying",
"loggers",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java#L246-L257 | train | Append the HTML report for the async loggers | Create a Java method that does the following: "Append the HTML report for the async loggers". | Of course, here is the Java code you requested:
```java
void appendHtmlReport(StringBuilder sb) {
sb.append("<table class=\"storage\">");
sb.append("<thead><tr><td>JN</td><td>Status</td></tr></thead>\n");
for (AsyncLogger l : loggers) {
sb.append("<tr>");
sb.append("<td>" + JspUtil.escapeXml(l.... | |
advantageous/qbit | qbit/consul-client/src/main/java/io/advantageous/consul/endpoints/AgentEndpoint.java | AgentEndpoint.getMembers | public List<Member> getMembers() {
final URI uri = createURI("/members");
final HTTP.Response response = HTTP.getResponse(uri.toString());
if (response.code() == 200) {
return fromJsonArray(response.body(), Member.class);
}
die("Unable to read members", uri, response... | java | public List<Member> getMembers() {
final URI uri = createURI("/members");
final HTTP.Response response = HTTP.getResponse(uri.toString());
if (response.code() == 200) {
return fromJsonArray(response.body(), Member.class);
}
die("Unable to read members", uri, response... | [
"public",
"List",
"<",
"Member",
">",
"getMembers",
"(",
")",
"{",
"final",
"URI",
"uri",
"=",
"createURI",
"(",
"\"/members\"",
")",
";",
"final",
"HTTP",
".",
"Response",
"response",
"=",
"HTTP",
".",
"getResponse",
"(",
"uri",
".",
"toString",
"(",
... | Retrieves all members that the Agent can see in the gossip pool.
<p>
GET /v1/agent/members
@return List of Members. | [
"Retrieves",
"all",
"members",
"that",
"the",
"Agent",
"can",
"see",
"in",
"the",
"gossip",
"pool",
".",
"<p",
">",
"GET",
"/",
"v1",
"/",
"agent",
"/",
"members"
] | 533b3671785f238d576b02b5290c6525ed60f583 | https://github.com/advantageous/qbit/blob/533b3671785f238d576b02b5290c6525ed60f583/qbit/consul-client/src/main/java/io/advantageous/consul/endpoints/AgentEndpoint.java#L412-L422 | valid | Get the members of the user. | Create a Java method that does the following: "Get the members of the user.". | Of course, here is the Java code you requested:
```java
public List<Member> getMembers() {
final URI uri = createURI("/members");
final HTTP.Response response = HTTP.getResponse(uri.toString());
if (response.code() == 200) {
return fromJsonArray(response.body(), Member.class);
... | |
vdurmont/semver4j | src/main/java/com/vdurmont/semver4j/Requirement.java | Requirement.toReversePolishNotation | private static List<Tokenizer.Token> toReversePolishNotation(List<Tokenizer.Token> tokens) {
LinkedList<Tokenizer.Token> queue = new LinkedList<Tokenizer.Token>();
Stack<Tokenizer.Token> stack = new Stack<Tokenizer.Token>();
for (int i = 0; i < tokens.size(); i++) {
Tokenizer.Token ... | java | private static List<Tokenizer.Token> toReversePolishNotation(List<Tokenizer.Token> tokens) {
LinkedList<Tokenizer.Token> queue = new LinkedList<Tokenizer.Token>();
Stack<Tokenizer.Token> stack = new Stack<Tokenizer.Token>();
for (int i = 0; i < tokens.size(); i++) {
Tokenizer.Token ... | [
"private",
"static",
"List",
"<",
"Tokenizer",
".",
"Token",
">",
"toReversePolishNotation",
"(",
"List",
"<",
"Tokenizer",
".",
"Token",
">",
"tokens",
")",
"{",
"LinkedList",
"<",
"Tokenizer",
".",
"Token",
">",
"queue",
"=",
"new",
"LinkedList",
"<",
"T... | Adaptation of the shutting yard algorithm | [
"Adaptation",
"of",
"the",
"shutting",
"yard",
"algorithm"
] | 3f0266e4985ac29e9da482e04001ed15fad6c3e2 | https://github.com/vdurmont/semver4j/blob/3f0266e4985ac29e9da482e04001ed15fad6c3e2/src/main/java/com/vdurmont/semver4j/Requirement.java#L263-L300 | train | Converts a list of tokens to a list of tokens in polish notation. | Create a Java method that does the following: "Converts a list of tokens to a list of tokens in polish notation.". | Of course, here is the Java code you requested:
```java
private static List<Tokenizer.Token> toReversePolishNotation(List<Tokenizer.Token> tokens) {
LinkedList<Tokenizer.Token> queue = new LinkedList<Tokenizer.Token>();
Stack<Tokenizer.Token> stack = new Stack<Tokenizer.Token>();
for (int i = ... | |
prestodb/presto | presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java | Node.accept | protected <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitNode(this, context);
} | java | protected <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitNode(this, context);
} | [
"protected",
"<",
"R",
",",
"C",
">",
"R",
"accept",
"(",
"AstVisitor",
"<",
"R",
",",
"C",
">",
"visitor",
",",
"C",
"context",
")",
"{",
"return",
"visitor",
".",
"visitNode",
"(",
"this",
",",
"context",
")",
";",
"}"
] | Accessible for {@link AstVisitor}, use {@link AstVisitor#process(Node, Object)} instead. | [
"Accessible",
"for",
"{"
] | 89de5e379d8f85e139d292b0add8c537a2a01a88 | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java#L33-L36 | train | Visits this node then passes the given visitor to the appropriate method. | Create a Java method that does the following: "Visits this node then passes the given visitor to the appropriate method.". | Of course, here is the Java code you requested:
```java
protected <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitNode(this, context);
}
```
Hope this helps! | |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.canShowMessageCenter | public static void canShowMessageCenter(BooleanCallback callback) {
dispatchConversationTask(new ConversationDispatchTask(callback, DispatchQueue.mainQueue()) {
@Override
protected boolean execute(Conversation conversation) {
return ApptentiveInternal.canShowMessageCenterInternal(conversation);
}
}, "c... | java | public static void canShowMessageCenter(BooleanCallback callback) {
dispatchConversationTask(new ConversationDispatchTask(callback, DispatchQueue.mainQueue()) {
@Override
protected boolean execute(Conversation conversation) {
return ApptentiveInternal.canShowMessageCenterInternal(conversation);
}
}, "c... | [
"public",
"static",
"void",
"canShowMessageCenter",
"(",
"BooleanCallback",
"callback",
")",
"{",
"dispatchConversationTask",
"(",
"new",
"ConversationDispatchTask",
"(",
"callback",
",",
"DispatchQueue",
".",
"mainQueue",
"(",
")",
")",
"{",
"@",
"Override",
"prote... | Our SDK must connect to our server at least once to download initial configuration for Message
Center. Call this method to see whether or not Message Center can be displayed. This task is
performed asynchronously.
@param callback Called after we check to see if Message Center can be displayed, but before it
is display... | [
"Our",
"SDK",
"must",
"connect",
"to",
"our",
"server",
"at",
"least",
"once",
"to",
"download",
"initial",
"configuration",
"for",
"Message",
"Center",
".",
"Call",
"this",
"method",
"to",
"see",
"whether",
"or",
"not",
"Message",
"Center",
"can",
"be",
"... | 887c08d7bd5ae6488a90366dfb58f58938861a93 | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L970-L977 | train | Check if the message center is available. | Create a Java method that does the following: "Check if the message center is available.". | Of course, here is the Java code you requested:
```java
public static void canShowMessageCenter(BooleanCallback callback) {
dispatchConversationTask(new ConversationDispatchTask(callback, DispatchQueue.mainQueue()) {
@Override
protected boolean execute(Conversation conversation) {
return ApptentiveInternal... | |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onMapFor | public static <K,V> Level0BuildingMapOperator<Map<K,V>,K,V> onMapFor(final K key, final V value) {
final Map<K,V> newTarget = new LinkedHashMap<K, V>();
newTarget.put(key, value);
return new Level0BuildingMapOperator<Map<K,V>,K,V>(ExecutionTarget.forOp(newTarget, Normalisation.MAP));
} | java | public static <K,V> Level0BuildingMapOperator<Map<K,V>,K,V> onMapFor(final K key, final V value) {
final Map<K,V> newTarget = new LinkedHashMap<K, V>();
newTarget.put(key, value);
return new Level0BuildingMapOperator<Map<K,V>,K,V>(ExecutionTarget.forOp(newTarget, Normalisation.MAP));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Level0BuildingMapOperator",
"<",
"Map",
"<",
"K",
",",
"V",
">",
",",
"K",
",",
"V",
">",
"onMapFor",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"final",
"Map",
"<",
"K",
",",
"... | <p>
Creates a map containing one entry with the specified key and value, and an <i>operation
expression</i> on it. Also enables the addition of new entries to the map by means of the
<tt>and(...)</tt> action.
</p>
@param key the key for the map's first entry
@param value the value for the map's first entry
@return an ... | [
"<p",
">",
"Creates",
"a",
"map",
"containing",
"one",
"entry",
"with",
"the",
"specified",
"key",
"and",
"value",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"Also",
"enables",
"the",
"addition",
"of",
"new",
"e... | b577596dfe462089d3dd169666defc6de7ad289a | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L1163-L1167 | train | Creates an Level0 building map operator. | Create a Java method that does the following: "Creates an Level0 building map operator.". | Of course, here is the Java code you requested:
```java
public static <K,V> Level0BuildingMapOperator<Map<K,V>,K,V> onMapFor(final K key, final V value) {
final Map<K,V> newTarget = new LinkedHashMap<K, V>();
newTarget.put(key, value);
return new Level0BuildingMapOperator<Map<K,V>,K,V>(Execu... | |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/Renderer.java | Renderer.buildSimpleModel | private Map<String, Object> buildSimpleModel(String type) {
Map<String, Object> content = new HashMap<String, Object>();
content.put(Attributes.TYPE, type);
content.put(Attributes.ROOTPATH, "");
// add any more keys here that need to have a default value to prevent need to perform null c... | java | private Map<String, Object> buildSimpleModel(String type) {
Map<String, Object> content = new HashMap<String, Object>();
content.put(Attributes.TYPE, type);
content.put(Attributes.ROOTPATH, "");
// add any more keys here that need to have a default value to prevent need to perform null c... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"buildSimpleModel",
"(",
"String",
"type",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"content",
".",
"p... | Builds simple map of values, which are exposed when rendering index/archive/sitemap/feed/tags.
@param type
@return | [
"Builds",
"simple",
"map",
"of",
"values",
"which",
"are",
"exposed",
"when",
"rendering",
"index",
"/",
"archive",
"/",
"sitemap",
"/",
"feed",
"/",
"tags",
"."
] | beb9042a54bf0eb168821d524c88b9ea0bee88dc | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/Renderer.java#L325-L331 | train | Build a simple map of attributes for a single type | Create a Java method that does the following: "Build a simple map of attributes for a single type". | Of course, here is the Java code you requested:
```java
private Map<String, Object> buildSimpleModel(String type) {
Map<String, Object> content = new HashMap<String, Object>();
content.put(Attributes.TYPE, type);
content.put(Attributes.ROOTPATH, "");
// add any more keys here that need ... | |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java | QrUpdate_DDRM.declareInternalData | public void declareInternalData(int maxRows, int maxCols) {
this.maxRows = maxRows;
this.maxCols = maxCols;
U_tran = new DMatrixRMaj(maxRows,maxRows);
Qm = new DMatrixRMaj(maxRows,maxRows);
r_row = new double[ maxCols ];
} | java | public void declareInternalData(int maxRows, int maxCols) {
this.maxRows = maxRows;
this.maxCols = maxCols;
U_tran = new DMatrixRMaj(maxRows,maxRows);
Qm = new DMatrixRMaj(maxRows,maxRows);
r_row = new double[ maxCols ];
} | [
"public",
"void",
"declareInternalData",
"(",
"int",
"maxRows",
",",
"int",
"maxCols",
")",
"{",
"this",
".",
"maxRows",
"=",
"maxRows",
";",
"this",
".",
"maxCols",
"=",
"maxCols",
";",
"U_tran",
"=",
"new",
"DMatrixRMaj",
"(",
"maxRows",
",",
"maxRows",
... | Declares the internal data structures so that it can process matrices up to the specified size.
@param maxRows
@param maxCols | [
"Declares",
"the",
"internal",
"data",
"structures",
"so",
"that",
"it",
"can",
"process",
"matrices",
"up",
"to",
"the",
"specified",
"size",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java#L114-L122 | train | Declare internal data for this image. | Create a Java method that does the following: "Declare internal data for this image.". | Of course, here is the Java code you requested:
```java
public void declareInternalData(int maxRows, int maxCols) {
this.maxRows = maxRows;
this.maxCols = maxCols;
U_tran = new DMatrixRMaj(maxRows,maxRows);
Qm = new DMatrixRMaj(maxRows,maxRows);
r_row = new double[ maxCols ];
... | |
ef-labs/vertx-when | vertx-when/src/main/java/com/englishtown/vertx/promises/impl/DefaultWhenFileSystem.java | DefaultWhenFileSystem.copyRecursive | @Override
public Promise<Void> copyRecursive(String from, String to, boolean recursive) {
return adapter.toPromise(handler -> vertx.fileSystem().copyRecursive(from, to, recursive, handler));
} | java | @Override
public Promise<Void> copyRecursive(String from, String to, boolean recursive) {
return adapter.toPromise(handler -> vertx.fileSystem().copyRecursive(from, to, recursive, handler));
} | [
"@",
"Override",
"public",
"Promise",
"<",
"Void",
">",
"copyRecursive",
"(",
"String",
"from",
",",
"String",
"to",
",",
"boolean",
"recursive",
")",
"{",
"return",
"adapter",
".",
"toPromise",
"(",
"handler",
"->",
"vertx",
".",
"fileSystem",
"(",
")",
... | Copy a file from the path {@code from} to path {@code to}, asynchronously.
<p>
If {@code recursive} is {@code true} and {@code from} represents a directory, then the directory and its contents
will be copied recursively to the destination {@code to}.
<p>
The copy will fail if the destination if the destination already ... | [
"Copy",
"a",
"file",
"from",
"the",
"path",
"{",
"@code",
"from",
"}",
"to",
"path",
"{",
"@code",
"to",
"}",
"asynchronously",
".",
"<p",
">",
"If",
"{",
"@code",
"recursive",
"}",
"is",
"{",
"@code",
"true",
"}",
"and",
"{",
"@code",
"from",
"}",... | dc4fde973f58130f2eb2159206ee78b867048f4d | https://github.com/ef-labs/vertx-when/blob/dc4fde973f58130f2eb2159206ee78b867048f4d/vertx-when/src/main/java/com/englishtown/vertx/promises/impl/DefaultWhenFileSystem.java#L62-L65 | train | Copy a file or directory recursively. | Create a Java method that does the following: "Copy a file or directory recursively.". | Of course, here is the Java code you requested:
```java
@Override
public Promise<Void> copyRecursive(String from, String to, boolean recursive) {
return adapter.toPromise(handler -> vertx.fileSystem().copyRecursive(from, to, recursive, handler));
}
```
Hope this helps! | |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java | NodeTemplateClient.getNodeTemplate | @BetaApi
public final NodeTemplate getNodeTemplate(ProjectRegionNodeTemplateName nodeTemplate) {
GetNodeTemplateHttpRequest request =
GetNodeTemplateHttpRequest.newBuilder()
.setNodeTemplate(nodeTemplate == null ? null : nodeTemplate.toString())
.build();
return getNodeTemplat... | java | @BetaApi
public final NodeTemplate getNodeTemplate(ProjectRegionNodeTemplateName nodeTemplate) {
GetNodeTemplateHttpRequest request =
GetNodeTemplateHttpRequest.newBuilder()
.setNodeTemplate(nodeTemplate == null ? null : nodeTemplate.toString())
.build();
return getNodeTemplat... | [
"@",
"BetaApi",
"public",
"final",
"NodeTemplate",
"getNodeTemplate",
"(",
"ProjectRegionNodeTemplateName",
"nodeTemplate",
")",
"{",
"GetNodeTemplateHttpRequest",
"request",
"=",
"GetNodeTemplateHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setNodeTemplate",
"(",
"nod... | Returns the specified node template. Gets a list of available node templates by making a list()
request.
<p>Sample code:
<pre><code>
try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE... | [
"Returns",
"the",
"specified",
"node",
"template",
".",
"Gets",
"a",
"list",
"of",
"available",
"node",
"templates",
"by",
"making",
"a",
"list",
"()",
"request",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java#L411-L419 | train | Gets the NodeTemplate resource that contains the details of the specified node template. | Create a Java method that does the following: "Gets the NodeTemplate resource that contains the details of the specified node template.". | Of course, here is the Java code you requested:
```java
@BetaApi
public final NodeTemplate getNodeTemplate(ProjectRegionNodeTemplateName nodeTemplate) {
GetNodeTemplateHttpRequest request =
GetNodeTemplateHttpRequest.newBuilder()
.setNodeTemplate(nodeTemplate == null ? null : nodeTemplate.to... | |
aws/aws-sdk-java | aws-java-sdk-dax/src/main/java/com/amazonaws/services/dax/model/DescribeSubnetGroupsResult.java | DescribeSubnetGroupsResult.setSubnetGroups | public void setSubnetGroups(java.util.Collection<SubnetGroup> subnetGroups) {
if (subnetGroups == null) {
this.subnetGroups = null;
return;
}
this.subnetGroups = new java.util.ArrayList<SubnetGroup>(subnetGroups);
} | java | public void setSubnetGroups(java.util.Collection<SubnetGroup> subnetGroups) {
if (subnetGroups == null) {
this.subnetGroups = null;
return;
}
this.subnetGroups = new java.util.ArrayList<SubnetGroup>(subnetGroups);
} | [
"public",
"void",
"setSubnetGroups",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"SubnetGroup",
">",
"subnetGroups",
")",
"{",
"if",
"(",
"subnetGroups",
"==",
"null",
")",
"{",
"this",
".",
"subnetGroups",
"=",
"null",
";",
"return",
";",
"}",
"th... | <p>
An array of subnet groups. Each element in the array represents a single subnet group.
</p>
@param subnetGroups
An array of subnet groups. Each element in the array represents a single subnet group. | [
"<p",
">",
"An",
"array",
"of",
"subnet",
"groups",
".",
"Each",
"element",
"in",
"the",
"array",
"represents",
"a",
"single",
"subnet",
"group",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dax/src/main/java/com/amazonaws/services/dax/model/DescribeSubnetGroupsResult.java#L100-L107 | train | Sets the value of the subnetGroups property. | Create a Java method that does the following: "Sets the value of the subnetGroups property.". | Of course, here is the Java code you requested:
```java
public void setSubnetGroups(java.util.Collection<SubnetGroup> subnetGroups) {
if (subnetGroups == null) {
this.subnetGroups = null;
return;
}
this.subnetGroups = new java.util.ArrayList<SubnetGroup>(subnetGroups);
... | |
Jasig/NotificationPortlet | notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/ssp/SSPTaskNotificationService.java | SSPTaskNotificationService.getNotificationCategory | private NotificationCategory getNotificationCategory(PortletRequest request) {
PortletPreferences preferences = request.getPreferences();
String title = preferences.getValue(NOTIFICATION_CATEGORY_PREF, DEFAULT_CATEGORY);
NotificationCategory category = new NotificationCategory();
catego... | java | private NotificationCategory getNotificationCategory(PortletRequest request) {
PortletPreferences preferences = request.getPreferences();
String title = preferences.getValue(NOTIFICATION_CATEGORY_PREF, DEFAULT_CATEGORY);
NotificationCategory category = new NotificationCategory();
catego... | [
"private",
"NotificationCategory",
"getNotificationCategory",
"(",
"PortletRequest",
"request",
")",
"{",
"PortletPreferences",
"preferences",
"=",
"request",
".",
"getPreferences",
"(",
")",
";",
"String",
"title",
"=",
"preferences",
".",
"getValue",
"(",
"NOTIFICAT... | Get the category name to use for SSP notifications.
@param request the portlet request
@return The notification category to use | [
"Get",
"the",
"category",
"name",
"to",
"use",
"for",
"SSP",
"notifications",
"."
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/ssp/SSPTaskNotificationService.java#L326-L334 | test | Get the NotificationCategory from the PortletRequest. | Create a Java method that does the following: "Get the NotificationCategory from the PortletRequest.". | Of course, here is the Java code you requested:
```java
private NotificationCategory getNotificationCategory(PortletRequest request) {
PortletPreferences preferences = request.getPreferences();
String title = preferences.getValue(NOTIFICATION_CATEGORY_PREF, DEFAULT_CATEGORY);
NotificationCateg... | |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector10/ConnectorDescriptorImpl.java | ConnectorDescriptorImpl.getOrCreateResourceadapter | public Resourceadapter<ConnectorDescriptor> getOrCreateResourceadapter()
{
Node node = model.getOrCreate("resourceadapter");
Resourceadapter<ConnectorDescriptor> resourceadapter = new ResourceadapterImpl<ConnectorDescriptor>(this, "resourceadapter", model, node);
return resourceadapter;
} | java | public Resourceadapter<ConnectorDescriptor> getOrCreateResourceadapter()
{
Node node = model.getOrCreate("resourceadapter");
Resourceadapter<ConnectorDescriptor> resourceadapter = new ResourceadapterImpl<ConnectorDescriptor>(this, "resourceadapter", model, node);
return resourceadapter;
} | [
"public",
"Resourceadapter",
"<",
"ConnectorDescriptor",
">",
"getOrCreateResourceadapter",
"(",
")",
"{",
"Node",
"node",
"=",
"model",
".",
"getOrCreate",
"(",
"\"resourceadapter\"",
")",
";",
"Resourceadapter",
"<",
"ConnectorDescriptor",
">",
"resourceadapter",
"=... | If not already created, a new <code>resourceadapter</code> element with the given value will be created.
Otherwise, the existing <code>resourceadapter</code> element will be returned.
@return a new or existing instance of <code>Resourceadapter<ConnectorDescriptor></code> | [
"If",
"not",
"already",
"created",
"a",
"new",
"<code",
">",
"resourceadapter<",
"/",
"code",
">",
"element",
"with",
"the",
"given",
"value",
"will",
"be",
"created",
".",
"Otherwise",
"the",
"existing",
"<code",
">",
"resourceadapter<",
"/",
"code",
">",
... | cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/connector10/ConnectorDescriptorImpl.java#L371-L376 | train | Get or create a Resourceadapter object. | Create a Java method that does the following: "Get or create a Resourceadapter object.". | Of course, here is the Java code you requested:
```java
public Resourceadapter<ConnectorDescriptor> getOrCreateResourceadapter()
{
Node node = model.getOrCreate("resourceadapter");
Resourceadapter<ConnectorDescriptor> resourceadapter = new ResourceadapterImpl<ConnectorDescriptor>(this, "resourceadapter"... | |
structr/structr | structr-modules/structr-file-access-module/src/main/java/org/structr/files/ssh/filesystem/path/graph/StructrPropertyValueChannel.java | StructrPropertyValueChannel.handleFrameworkException | private static void handleFrameworkException(final FrameworkException fex, final String name) throws IOException {
switch (fex.getStatus()) {
case 401:
case 403:
throw new AccessDeniedException(name);
case 404:
throw new NoSuchFileException(name);
default:
throw new IllegalArgumentExceptio... | java | private static void handleFrameworkException(final FrameworkException fex, final String name) throws IOException {
switch (fex.getStatus()) {
case 401:
case 403:
throw new AccessDeniedException(name);
case 404:
throw new NoSuchFileException(name);
default:
throw new IllegalArgumentExceptio... | [
"private",
"static",
"void",
"handleFrameworkException",
"(",
"final",
"FrameworkException",
"fex",
",",
"final",
"String",
"name",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"fex",
".",
"getStatus",
"(",
")",
")",
"{",
"case",
"401",
":",
"case",
"40... | ----- private methods ----- | [
"-----",
"private",
"methods",
"-----"
] | c111a1d0c0201c7fea5574ed69aa5a5053185a97 | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-modules/structr-file-access-module/src/main/java/org/structr/files/ssh/filesystem/path/graph/StructrPropertyValueChannel.java#L279-L293 | train | Handle a FrameworkException. | Create a Java method that does the following: "Handle a FrameworkException.". | Of course, here is the Java code you requested:
```java
private static void handleFrameworkException(final FrameworkException fex, final String name) throws IOException {
switch (fex.getStatus()) {
case 401:
case 403:
throw new AccessDeniedException(name);
case 404:
throw new NoSuchFileException(... | |
google/closure-compiler | src/com/google/javascript/jscomp/gwt/client/GwtRunner.java | GwtRunner.toNativeErrorArray | private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
JavaScriptObject[] out = new JavaScriptObject[errors.size()];
for (int i = 0; i < errors.size(); ++i) {
JSError error = errors.get(i);
DiagnosticType type = error.getType();
out[i] = createError(error.sourceName, erro... | java | private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
JavaScriptObject[] out = new JavaScriptObject[errors.size()];
for (int i = 0; i < errors.size(); ++i) {
JSError error = errors.get(i);
DiagnosticType type = error.getType();
out[i] = createError(error.sourceName, erro... | [
"private",
"static",
"JavaScriptObject",
"[",
"]",
"toNativeErrorArray",
"(",
"List",
"<",
"JSError",
">",
"errors",
")",
"{",
"JavaScriptObject",
"[",
"]",
"out",
"=",
"new",
"JavaScriptObject",
"[",
"errors",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
... | Convert a list of {@link JSError} instances to a JS array containing plain objects. | [
"Convert",
"a",
"list",
"of",
"{"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/gwt/client/GwtRunner.java#L321-L330 | train | Convert a list of JSErrors to an array of JSErrors. | Create a Java method that does the following: "Convert a list of JSErrors to an array of JSErrors.". | Of course, here is the Java code you requested:
```java
private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
JavaScriptObject[] out = new JavaScriptObject[errors.size()];
for (int i = 0; i < errors.size(); ++i) {
JSError error = errors.get(i);
DiagnosticType type = error.get... | |
DDTH/ddth-cache-adapter | ddth-cache-adapter-core/src/main/java/com/github/ddth/cacheadapter/cacheimpl/redis/RedisCacheFactory.java | RedisCacheFactory.newJedisPool | public static JedisPool newJedisPool(String hostAndPort, String password, int db,
long timeoutMs) {
final int maxTotal = Runtime.getRuntime().availableProcessors();
final int maxIdle = maxTotal / 2;
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(m... | java | public static JedisPool newJedisPool(String hostAndPort, String password, int db,
long timeoutMs) {
final int maxTotal = Runtime.getRuntime().availableProcessors();
final int maxIdle = maxTotal / 2;
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(m... | [
"public",
"static",
"JedisPool",
"newJedisPool",
"(",
"String",
"hostAndPort",
",",
"String",
"password",
",",
"int",
"db",
",",
"long",
"timeoutMs",
")",
"{",
"final",
"int",
"maxTotal",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProcessors",... | Creates a new {@link JedisPool}.
@param hostAndPort
@param password
@param db
@param timeoutMs
@return | [
"Creates",
"a",
"new",
"{",
"@link",
"JedisPool",
"}",
"."
] | 7c897570cd2ce45f305601abbc4d3d61273da532 | https://github.com/DDTH/ddth-cache-adapter/blob/7c897570cd2ce45f305601abbc4d3d61273da532/ddth-cache-adapter-core/src/main/java/com/github/ddth/cacheadapter/cacheimpl/redis/RedisCacheFactory.java#L73-L91 | valid | Create a new JedisPool with the specified parameters. | Create a Java method that does the following: "Create a new JedisPool with the specified parameters.". | Of course, here is the Java code you requested:
```java
public static JedisPool newJedisPool(String hostAndPort, String password, int db,
long timeoutMs) {
final int maxTotal = Runtime.getRuntime().availableProcessors();
final int maxIdle = maxTotal / 2;
JedisPoolConfig poolConfig ... | |
juebanlin/util4j | util4j/src/main/java/net/jueb/util4j/hotSwap/classFactory/old/v0/AbstractScriptFactory.java | AbstractScriptFactory.loadAllClass | @SuppressWarnings("unchecked")
public final void loadAllClass(){
if(isLoading)
{
return;
}
isLoading=true;
classLoader = new ScriptClassLoader();
final ConcurrentHashMap<Integer, Class<? extends T>> codeMap=new ConcurrentHashMap<Integer, Class<? extends T>>();
for (Entry<String,ClassFile> entry : scri... | java | @SuppressWarnings("unchecked")
public final void loadAllClass(){
if(isLoading)
{
return;
}
isLoading=true;
classLoader = new ScriptClassLoader();
final ConcurrentHashMap<Integer, Class<? extends T>> codeMap=new ConcurrentHashMap<Integer, Class<? extends T>>();
for (Entry<String,ClassFile> entry : scri... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"void",
"loadAllClass",
"(",
")",
"{",
"if",
"(",
"isLoading",
")",
"{",
"return",
";",
"}",
"isLoading",
"=",
"true",
";",
"classLoader",
"=",
"new",
"ScriptClassLoader",
"(",
")",
";"... | 加载所有的类 | [
"加载所有的类"
] | c404b2dbdedf7a8890533b351257fa8af4f1439f | https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/hotSwap/classFactory/old/v0/AbstractScriptFactory.java#L226-L274 | train | Load all class. | Create a Java method that does the following: "Load all class.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public final void loadAllClass(){
if(isLoading)
{
return;
}
isLoading=true;
classLoader = new ScriptClassLoader();
final ConcurrentHashMap<Integer, Class<? extends T>> codeMap=new ConcurrentHashMap<Integer, Class<? e... | |
zaproxy/zaproxy | src/org/parosproxy/paros/model/SiteMap.java | SiteMap.findClosestParent | public synchronized SiteNode findClosestParent(HttpMessage msg) {
if (msg == null) {
return null;
}
return this.findClosestParent(msg.getRequestHeader().getURI());
} | java | public synchronized SiteNode findClosestParent(HttpMessage msg) {
if (msg == null) {
return null;
}
return this.findClosestParent(msg.getRequestHeader().getURI());
} | [
"public",
"synchronized",
"SiteNode",
"findClosestParent",
"(",
"HttpMessage",
"msg",
")",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"this",
".",
"findClosestParent",
"(",
"msg",
".",
"getRequestHeader",
"(",
")",
... | /*
Find the closest parent for the message - no new nodes will be created | [
"/",
"*",
"Find",
"the",
"closest",
"parent",
"for",
"the",
"message",
"-",
"no",
"new",
"nodes",
"will",
"be",
"created"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/SiteMap.java#L291-L296 | train | Find the closest parent of the given message. | Create a Java method that does the following: "Find the closest parent of the given message.". | Of course, here is the Java code you requested:
```java
public synchronized SiteNode findClosestParent(HttpMessage msg) {
if (msg == null) {
return null;
}
return this.findClosestParent(msg.getRequestHeader().getURI());
}
```
Hope this helps! | |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/cache/CacheEntry.java | CacheEntry.setValue | public void setValue(Object value, long timeout) {
_value = value;
_expiration = System.currentTimeMillis() + timeout;
} | java | public void setValue(Object value, long timeout) {
_value = value;
_expiration = System.currentTimeMillis() + timeout;
} | [
"public",
"void",
"setValue",
"(",
"Object",
"value",
",",
"long",
"timeout",
")",
"{",
"_value",
"=",
"value",
";",
"_expiration",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"timeout",
";",
"}"
] | Sets a new value and extends its expiration.
@param value a new cached value.
@param timeout a expiration timeout in milliseconds. | [
"Sets",
"a",
"new",
"value",
"and",
"extends",
"its",
"expiration",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/cache/CacheEntry.java#L48-L51 | train | Sets the value of the session. | Create a Java method that does the following: "Sets the value of the session.". | Of course, here is the Java code you requested:
```java
public void setValue(Object value, long timeout) {
_value = value;
_expiration = System.currentTimeMillis() + timeout;
}
```
Hope this helps! | |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java | WaveformPreview.segmentHeight | @SuppressWarnings("WeakerAccess")
public int segmentHeight(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int frontHeight = Util.unsign(bytes.get(base + 5));
if (front) {
... | java | @SuppressWarnings("WeakerAccess")
public int segmentHeight(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int frontHeight = Util.unsign(bytes.get(base + 5));
if (front) {
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"int",
"segmentHeight",
"(",
"final",
"int",
"segment",
",",
"final",
"boolean",
"front",
")",
"{",
"final",
"ByteBuffer",
"bytes",
"=",
"getData",
"(",
")",
";",
"if",
"(",
"isColor",
")",
"... | Determine the height of the preview given an index into it.
@param segment the index of the waveform preview segment to examine
@param front if {@code true} the height of the front (brighter) segment of a color waveform preview is returned,
otherwise the height of the back (dimmer) segment is returned. Has no effect f... | [
"Determine",
"the",
"height",
"of",
"the",
"preview",
"given",
"an",
"index",
"into",
"it",
"."
] | f958a2a70e8a87a31a75326d7b4db77c2f0b4212 | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreview.java#L218-L232 | train | Get the height of a segment. | Create a Java method that does the following: "Get the height of a segment.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("WeakerAccess")
public int segmentHeight(final int segment, final boolean front) {
final ByteBuffer bytes = getData();
if (isColor) {
final int base = segment * 6;
final int frontHeight = Util.unsign(b... | |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/builder/AbstractFFmpegStreamBuilder.java | AbstractFFmpegStreamBuilder.addMetaTag | public T addMetaTag(String key, String value) {
checkValidKey(key);
checkNotEmpty(value, "value must not be empty");
meta_tags.add("-metadata");
meta_tags.add(key + "=" + value);
return getThis();
} | java | public T addMetaTag(String key, String value) {
checkValidKey(key);
checkNotEmpty(value, "value must not be empty");
meta_tags.add("-metadata");
meta_tags.add(key + "=" + value);
return getThis();
} | [
"public",
"T",
"addMetaTag",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkValidKey",
"(",
"key",
")",
";",
"checkNotEmpty",
"(",
"value",
",",
"\"value must not be empty\"",
")",
";",
"meta_tags",
".",
"add",
"(",
"\"-metadata\"",
")",
";",
... | Add metadata on output streams. Which keys are possible depends on the used codec.
@param key Metadata key, e.g. "comment"
@param value Value to set for key
@return this | [
"Add",
"metadata",
"on",
"output",
"streams",
".",
"Which",
"keys",
"are",
"possible",
"depends",
"on",
"the",
"used",
"codec",
"."
] | 3819b155edf9132acc75bb6af66dcef1b98c64b2 | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/builder/AbstractFFmpegStreamBuilder.java#L329-L335 | train | Add a meta tag to the content. | Create a Java method that does the following: "Add a meta tag to the content.". | Of course, here is the Java code you requested:
```java
public T addMetaTag(String key, String value) {
checkValidKey(key);
checkNotEmpty(value, "value must not be empty");
meta_tags.add("-metadata");
meta_tags.add(key + "=" + value);
return getThis();
}
```
Hope this helps! | |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsSession.java | PresentsSession.safeEndSession | @AnyThread
protected void safeEndSession ()
{
if (!_omgr.isRunning()) {
log.info("Dropping end session request as we're shutting down " + this + ".");
} else {
_omgr.postRunnable(new Runnable() {
public void run () {
endSession();
... | java | @AnyThread
protected void safeEndSession ()
{
if (!_omgr.isRunning()) {
log.info("Dropping end session request as we're shutting down " + this + ".");
} else {
_omgr.postRunnable(new Runnable() {
public void run () {
endSession();
... | [
"@",
"AnyThread",
"protected",
"void",
"safeEndSession",
"(",
")",
"{",
"if",
"(",
"!",
"_omgr",
".",
"isRunning",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Dropping end session request as we're shutting down \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"... | Queues up a runnable on the object manager thread where we can safely end the session. | [
"Queues",
"up",
"a",
"runnable",
"on",
"the",
"object",
"manager",
"thread",
"where",
"we",
"can",
"safely",
"end",
"the",
"session",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L598-L610 | train | End the session. | Create a Java method that does the following: "End the session.". | Of course, here is the Java code you requested:
```java
@AnyThread
protected void safeEndSession ()
{
if (!_omgr.isRunning()) {
log.info("Dropping end session request as we're shutting down " + this + ".");
} else {
_omgr.postRunnable(new Runnable() {
pub... | |
protostuff/protostuff-compiler | protostuff-parser/src/main/java/io/protostuff/compiler/model/Proto.java | Proto.getPublicImports | public List<Import> getPublicImports() {
return getImports()
.stream()
.filter(Import::isPublic)
.collect(Collectors.toList());
} | java | public List<Import> getPublicImports() {
return getImports()
.stream()
.filter(Import::isPublic)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"Import",
">",
"getPublicImports",
"(",
")",
"{",
"return",
"getImports",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"Import",
"::",
"isPublic",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList",
"(",
")",
")",
... | Returns all public imports in this proto file. | [
"Returns",
"all",
"public",
"imports",
"in",
"this",
"proto",
"file",
"."
] | 665256c42cb41da849e8321ffcab088350ace171 | https://github.com/protostuff/protostuff-compiler/blob/665256c42cb41da849e8321ffcab088350ace171/protostuff-parser/src/main/java/io/protostuff/compiler/model/Proto.java#L80-L85 | train | Get the public imports. | Create a Java method that does the following: "Get the public imports.". | Of course, here is the Java code you requested:
```java
public List<Import> getPublicImports() {
return getImports()
.stream()
.filter(Import::isPublic)
.collect(Collectors.toList());
}
```
Hope this helps! | |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.withNodeKeys | public static NodeSequence withNodeKeys( final Iterator<NodeKey> keys,
final long keyCount,
final float score,
final String workspaceName,
f... | java | public static NodeSequence withNodeKeys( final Iterator<NodeKey> keys,
final long keyCount,
final float score,
final String workspaceName,
f... | [
"public",
"static",
"NodeSequence",
"withNodeKeys",
"(",
"final",
"Iterator",
"<",
"NodeKey",
">",
"keys",
",",
"final",
"long",
"keyCount",
",",
"final",
"float",
"score",
",",
"final",
"String",
"workspaceName",
",",
"final",
"NodeCache",
"cache",
")",
"{",
... | Create a sequence of nodes that iterates over the supplied node keys. Note that the supplied iterator is accessed lazily as
the resulting sequence's {@link #nextBatch() first batch} is {@link Batch#nextRow() used}.
@param keys the iterator over the keys of the node keys to be returned; if null, an {@link #emptySequenc... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"iterates",
"over",
"the",
"supplied",
"node",
"keys",
".",
"Note",
"that",
"the",
"supplied",
"iterator",
"is",
"accessed",
"lazily",
"as",
"the",
"resulting",
"sequence",
"s",
"{",
"@link",
"#nextBatch",
"(... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L601-L609 | train | Create a sequence of nodes from an iterator of node keys. | Create a Java method that does the following: "Create a sequence of nodes from an iterator of node keys.". | Of course, here is the Java code you requested:
```java
public static NodeSequence withNodeKeys( final Iterator<NodeKey> keys,
final long keyCount,
final float score,
final String work... | |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java | HdfsFileStatus.getFullName | final public String getFullName(final String parent) {
if (isEmptyLocalName()) {
return parent;
}
StringBuilder fullName = new StringBuilder(parent);
if (!parent.endsWith(Path.SEPARATOR)) {
fullName.append(Path.SEPARATOR);
}
fullName.append(getLocalName());
return fullName.t... | java | final public String getFullName(final String parent) {
if (isEmptyLocalName()) {
return parent;
}
StringBuilder fullName = new StringBuilder(parent);
if (!parent.endsWith(Path.SEPARATOR)) {
fullName.append(Path.SEPARATOR);
}
fullName.append(getLocalName());
return fullName.t... | [
"final",
"public",
"String",
"getFullName",
"(",
"final",
"String",
"parent",
")",
"{",
"if",
"(",
"isEmptyLocalName",
"(",
")",
")",
"{",
"return",
"parent",
";",
"}",
"StringBuilder",
"fullName",
"=",
"new",
"StringBuilder",
"(",
"parent",
")",
";",
"if"... | Get the string representation of the full path name
@param parent the parent path
@return the full path in string | [
"Get",
"the",
"string",
"representation",
"of",
"the",
"full",
"path",
"name"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java#L277-L288 | train | Get the full name of the node. | Create a Java method that does the following: "Get the full name of the node.". | Of course, here is the Java code you requested:
```java
final public String getFullName(final String parent) {
if (isEmptyLocalName()) {
return parent;
}
StringBuilder fullName = new StringBuilder(parent);
if (!parent.endsWith(Path.SEPARATOR)) {
fullName.append(Path.SEPARATOR);
}
... | |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/Activator.java | Activator.getImageDescriptor | public static ImageDescriptor getImageDescriptor(String id) {
ImageDescriptor retVal = getDefault().getImageRegistry().getDescriptor(id);
if (retVal == null) {
retVal = loadImageDescriptor(id);
getDefault().getImageRegistry().put(id, retVal);
}
return retVal;
... | java | public static ImageDescriptor getImageDescriptor(String id) {
ImageDescriptor retVal = getDefault().getImageRegistry().getDescriptor(id);
if (retVal == null) {
retVal = loadImageDescriptor(id);
getDefault().getImageRegistry().put(id, retVal);
}
return retVal;
... | [
"public",
"static",
"ImageDescriptor",
"getImageDescriptor",
"(",
"String",
"id",
")",
"{",
"ImageDescriptor",
"retVal",
"=",
"getDefault",
"(",
")",
".",
"getImageRegistry",
"(",
")",
".",
"getDescriptor",
"(",
"id",
")",
";",
"if",
"(",
"retVal",
"==",
"nu... | Returns an image descriptor for the image file at the given
plug-in relative path
@param path the path
@return the image descriptor | [
"Returns",
"an",
"image",
"descriptor",
"for",
"the",
"image",
"file",
"at",
"the",
"given",
"plug",
"-",
"in",
"relative",
"path"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/Activator.java#L163-L170 | test | Get the ImageDescriptor for the given ID. | Create a Java method that does the following: "Get the ImageDescriptor for the given ID.". | Of course, here is the Java code you requested:
```java
public static ImageDescriptor getImageDescriptor(String id) {
ImageDescriptor retVal = getDefault().getImageRegistry().getDescriptor(id);
if (retVal == null) {
retVal = loadImageDescriptor(id);
getDefault().getImageRegistry... | |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Arrow.java | Arrow.prepare | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = getPolygon();// is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
Point2D point = list.get(0);
conte... | java | @Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = getPolygon();// is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
Point2D point = list.get(0);
conte... | [
"@",
"Override",
"protected",
"boolean",
"prepare",
"(",
"final",
"Context2D",
"context",
",",
"final",
"Attributes",
"attr",
",",
"final",
"double",
"alpha",
")",
"{",
"final",
"Point2DArray",
"list",
"=",
"getPolygon",
"(",
")",
";",
"// is null for invalid ar... | Draws this arrow.
@param context the {@link Context2D} used to draw this arrow. | [
"Draws",
"this",
"arrow",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Arrow.java#L114-L140 | train | Override prepare to prepare the image. | Create a Java method that does the following: "Override prepare to prepare the image.". | Of course, here is the Java code you requested:
```java
@Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final Point2DArray list = getPolygon();// is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
... | |
nominanuda/zen-project | zen-core/src/main/java/com/nominanuda/zen/reactivestreams/TransformingProcessor.java | TransformingProcessor.in | protected void in(T t) throws Exception {
R r = getFunction().apply(t);
out(r);
} | java | protected void in(T t) throws Exception {
R r = getFunction().apply(t);
out(r);
} | [
"protected",
"void",
"in",
"(",
"T",
"t",
")",
"throws",
"Exception",
"{",
"R",
"r",
"=",
"getFunction",
"(",
")",
".",
"apply",
"(",
"t",
")",
";",
"out",
"(",
"r",
")",
";",
"}"
] | } | [
"}"
] | fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-core/src/main/java/com/nominanuda/zen/reactivestreams/TransformingProcessor.java#L55-L58 | train | In method. | Create a Java method that does the following: "In method.". | Of course, here is the Java code you requested:
```java
protected void in(T t) throws Exception {
R r = getFunction().apply(t);
out(r);
}
```
Hope this helps! | |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodeLbStatus.java | NodeLbStatus.update | synchronized boolean update() {
int elected = this.elected;
int oldelected = this.oldelected;
int lbfactor = this.lbfactor;
if (lbfactor > 0) {
this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
}
this.oldelected = elected;
return elected != o... | java | synchronized boolean update() {
int elected = this.elected;
int oldelected = this.oldelected;
int lbfactor = this.lbfactor;
if (lbfactor > 0) {
this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
}
this.oldelected = elected;
return elected != o... | [
"synchronized",
"boolean",
"update",
"(",
")",
"{",
"int",
"elected",
"=",
"this",
".",
"elected",
";",
"int",
"oldelected",
"=",
"this",
".",
"oldelected",
";",
"int",
"lbfactor",
"=",
"this",
".",
"lbfactor",
";",
"if",
"(",
"lbfactor",
">",
"0",
")"... | Update the load balancing status.
@return | [
"Update",
"the",
"load",
"balancing",
"status",
"."
] | 87de0b856a7a4ba8faf5b659537b9af07b763263 | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodeLbStatus.java#L51-L60 | train | Update the status of the record. | Create a Java method that does the following: "Update the status of the record.". | Of course, here is the Java code you requested:
```java
synchronized boolean update() {
int elected = this.elected;
int oldelected = this.oldelected;
int lbfactor = this.lbfactor;
if (lbfactor > 0) {
this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
}
... | |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/WindowManager.java | WindowManager.add | public void add(ApplicationWindow window) {
if (activeWindow == null) // first window will be set as activeWindow
setActiveWindow(window);
if (!windows.contains(window)) {
windows.add(window);
window.setWindowManager(this);
setChanged();
notif... | java | public void add(ApplicationWindow window) {
if (activeWindow == null) // first window will be set as activeWindow
setActiveWindow(window);
if (!windows.contains(window)) {
windows.add(window);
window.setWindowManager(this);
setChanged();
notif... | [
"public",
"void",
"add",
"(",
"ApplicationWindow",
"window",
")",
"{",
"if",
"(",
"activeWindow",
"==",
"null",
")",
"// first window will be set as activeWindow",
"setActiveWindow",
"(",
"window",
")",
";",
"if",
"(",
"!",
"windows",
".",
"contains",
"(",
"wind... | Adds the given window to the set of windows managed by this window
manager. Does nothing is this window is already managed by this window
manager.
@param window
the window | [
"Adds",
"the",
"given",
"window",
"to",
"the",
"set",
"of",
"windows",
"managed",
"by",
"this",
"window",
"manager",
".",
"Does",
"nothing",
"is",
"this",
"window",
"is",
"already",
"managed",
"by",
"this",
"window",
"manager",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/WindowManager.java#L80-L90 | train | Add a window to the application. | Create a Java method that does the following: "Add a window to the application.". | Of course, here is the Java code you requested:
```java
public void add(ApplicationWindow window) {
if (activeWindow == null) // first window will be set as activeWindow
setActiveWindow(window);
if (!windows.contains(window)) {
windows.add(window);
window.setWindowM... | |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/HorizontalRecordsProcessor.java | HorizontalRecordsProcessor.isOverMergedRegion | private boolean isOverMergedRegion(final Sheet sheet, final CellRangeAddress region) {
final int mergedCount = sheet.getNumMergedRegions();
for(int i=0; i < mergedCount; i++) {
final CellRangeAddress existsRegion = sheet.getMergedRegion(i);
if(POIUtils.intersectsRegion(ex... | java | private boolean isOverMergedRegion(final Sheet sheet, final CellRangeAddress region) {
final int mergedCount = sheet.getNumMergedRegions();
for(int i=0; i < mergedCount; i++) {
final CellRangeAddress existsRegion = sheet.getMergedRegion(i);
if(POIUtils.intersectsRegion(ex... | [
"private",
"boolean",
"isOverMergedRegion",
"(",
"final",
"Sheet",
"sheet",
",",
"final",
"CellRangeAddress",
"region",
")",
"{",
"final",
"int",
"mergedCount",
"=",
"sheet",
".",
"getNumMergedRegions",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | 結合する反映が既にシート情報に存在しているかどうか判定する。
@param sheet シート情報
@param region 結合領域の情報
@return trueの場合、結合情報が既に存在する。 | [
"結合する反映が既にシート情報に存在しているかどうか判定する。"
] | a0c6b25c622e5f3a50b199ef685d2ee46ad5483c | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/HorizontalRecordsProcessor.java#L2010-L2024 | train | Checks if the region is over the merged regions of the sheet. | Create a Java method that does the following: "Checks if the region is over the merged regions of the sheet.". | Of course, here is the Java code you requested:
```java
private boolean isOverMergedRegion(final Sheet sheet, final CellRangeAddress region) {
final int mergedCount = sheet.getNumMergedRegions();
for(int i=0; i < mergedCount; i++) {
final CellRangeAddress existsRegion = sheet.getMerged... | |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java | CalendarFormatterBase.formatISOYearWeekOfYear | void formatISOYearWeekOfYear(StringBuilder b, ZonedDateTime d, int width) {
int year = d.get(IsoFields.WEEK_BASED_YEAR);
_formatYearValue(b, year, width);
} | java | void formatISOYearWeekOfYear(StringBuilder b, ZonedDateTime d, int width) {
int year = d.get(IsoFields.WEEK_BASED_YEAR);
_formatYearValue(b, year, width);
} | [
"void",
"formatISOYearWeekOfYear",
"(",
"StringBuilder",
"b",
",",
"ZonedDateTime",
"d",
",",
"int",
"width",
")",
"{",
"int",
"year",
"=",
"d",
".",
"get",
"(",
"IsoFields",
".",
"WEEK_BASED_YEAR",
")",
";",
"_formatYearValue",
"(",
"b",
",",
"year",
",",... | Formats the year according to ISO week-year. | [
"Formats",
"the",
"year",
"according",
"to",
"ISO",
"week",
"-",
"year",
"."
] | 54b752d4ec2457df56e98461618f9c0eec41e1e1 | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java#L477-L480 | train | Format ISO year week - year. | Create a Java method that does the following: "Format ISO year week - year.". | Of course, here is the Java code you requested:
```java
void formatISOYearWeekOfYear(StringBuilder b, ZonedDateTime d, int width) {
int year = d.get(IsoFields.WEEK_BASED_YEAR);
_formatYearValue(b, year, width);
}
```
Hope this helps! | |
js-lib-com/tiny-container | src/main/java/js/container/ManagedClass.java | ManagedClass.scanAnnotations | private void scanAnnotations() {
// set remote type and request URI path from @Remote, @Controller or @Service
boolean remoteType = false;
Controller controllerAnnotation = getAnnotation(implementationClass, Controller.class);
if (controllerAnnotation != null) {
remoteType = true;
requestPath = cont... | java | private void scanAnnotations() {
// set remote type and request URI path from @Remote, @Controller or @Service
boolean remoteType = false;
Controller controllerAnnotation = getAnnotation(implementationClass, Controller.class);
if (controllerAnnotation != null) {
remoteType = true;
requestPath = cont... | [
"private",
"void",
"scanAnnotations",
"(",
")",
"{",
"// set remote type and request URI path from @Remote, @Controller or @Service\r",
"boolean",
"remoteType",
"=",
"false",
";",
"Controller",
"controllerAnnotation",
"=",
"getAnnotation",
"(",
"implementationClass",
",",
"Cont... | Scan annotations for managed classes that requires implementation. Annotations are processed only for managed classes
that have {@link #implementationClass} that is primary source scanned for annotation. If an annotation is not present
into implementation class try to find it on interface(s). See <a href="#annotations"... | [
"Scan",
"annotations",
"for",
"managed",
"classes",
"that",
"requires",
"implementation",
".",
"Annotations",
"are",
"processed",
"only",
"for",
"managed",
"classes",
"that",
"have",
"{",
"@link",
"#implementationClass",
"}",
"that",
"is",
"primary",
"source",
"sc... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ManagedClass.java#L397-L606 | test | Scans annotations on the implementation class for methods and methods that are annotated with the appropriate methods. | Create a Java method that does the following: "Scans annotations on the implementation class for methods and methods that are annotated with the appropriate methods.". | Of course, here is the Java code you requested:
```java
private void scanAnnotations() {
// set remote type and request URI path from @Remote, @Controller or @Service
boolean remoteType = false;
Controller controllerAnnotation = getAnnotation(implementationClass, Controller.class);
if (controllerAnnotation... | |
aws/aws-sdk-java | aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java | AmazonCloudWatchClient.putMetricAlarm | @Override
public PutMetricAlarmResult putMetricAlarm(PutMetricAlarmRequest request) {
request = beforeClientExecution(request);
return executePutMetricAlarm(request);
} | java | @Override
public PutMetricAlarmResult putMetricAlarm(PutMetricAlarmRequest request) {
request = beforeClientExecution(request);
return executePutMetricAlarm(request);
} | [
"@",
"Override",
"public",
"PutMetricAlarmResult",
"putMetricAlarm",
"(",
"PutMetricAlarmRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executePutMetricAlarm",
"(",
"request",
")",
";",
"}"
] | <p>
Creates or updates an alarm and associates it with the specified metric or metric math expression.
</p>
<p>
When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. The
alarm is then evaluated and its state is set appropriately. Any actions associated with the new ... | [
"<p",
">",
"Creates",
"or",
"updates",
"an",
"alarm",
"and",
"associates",
"it",
"with",
"the",
"specified",
"metric",
"or",
"metric",
"math",
"expression",
".",
"<",
"/",
"p",
">",
"<p",
">",
"When",
"this",
"operation",
"creates",
"an",
"alarm",
"the",... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java#L1401-L1405 | train | Updates an alarm for an app. | Create a Java method that does the following: "Updates an alarm for an app.". | Of course, here is the Java code you requested:
```java
@Override
public PutMetricAlarmResult putMetricAlarm(PutMetricAlarmRequest request) {
request = beforeClientExecution(request);
return executePutMetricAlarm(request);
}
```
Hope this helps! | |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java | BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntries(true);
final int countA = (thetaB == thetaA) ? ske... | java | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntries(true);
final int countA = (thetaB == thetaA) ? ske... | [
"public",
"static",
"double",
"getLowerBoundForBoverA",
"(",
"final",
"Sketch",
"sketchA",
",",
"final",
"Sketch",
"sketchB",
")",
"{",
"final",
"double",
"thetaA",
"=",
"sketchA",
".",
"getTheta",
"(",
")",
";",
"final",
"double",
"thetaB",
"=",
"sketchB",
... | Gets the approximate lower bound for B over A based on a 95% confidence interval
@param sketchA the sketch A
@param sketchB the sketch B
@return the approximate lower bound for B over A | [
"Gets",
"the",
"approximate",
"lower",
"bound",
"for",
"B",
"over",
"A",
"based",
"on",
"a",
"95%",
"confidence",
"interval"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java#L41-L53 | train | Gets the lower bound for B over A. | Create a Java method that does the following: "Gets the lower bound for B over A.". | Of course, here is the Java code you requested:
```java
public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntri... | |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/resource/ResourceResolver.java | ResourceResolver.readListResource | public static List<String> readListResource(Class<?> clazz, String path)
{
File targetFile = resolve(clazz, path);
if (targetFile == null)
{
return null;
}
List<String> result;
try
{
result = FileUtils.readLines(targetFile, "UTF-8");
... | java | public static List<String> readListResource(Class<?> clazz, String path)
{
File targetFile = resolve(clazz, path);
if (targetFile == null)
{
return null;
}
List<String> result;
try
{
result = FileUtils.readLines(targetFile, "UTF-8");
... | [
"public",
"static",
"List",
"<",
"String",
">",
"readListResource",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"path",
")",
"{",
"File",
"targetFile",
"=",
"resolve",
"(",
"clazz",
",",
"path",
")",
";",
"if",
"(",
"targetFile",
"==",
"null",... | Return target file's content by list from class and resource's path.<br>
@param clazz Target class
@param path resource's path
@return read result list | [
"Return",
"target",
"file",
"s",
"content",
"by",
"list",
"from",
"class",
"and",
"resource",
"s",
"path",
".",
"<br",
">"
] | 65b1f335d771d657c5640a2056ab5c8546eddec9 | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/resource/ResourceResolver.java#L166-L185 | train | Read a list of lines from a resource. | Create a Java method that does the following: "Read a list of lines from a resource.". | Of course, here is the Java code you requested:
```java
public static List<String> readListResource(Class<?> clazz, String path)
{
File targetFile = resolve(clazz, path);
if (targetFile == null)
{
return null;
}
List<String> result;
try
{
... | |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwconfidfield.java | appfwconfidfield.delete | public static base_response delete(nitro_service client, appfwconfidfield resource) throws Exception {
appfwconfidfield deleteresource = new appfwconfidfield();
deleteresource.fieldname = resource.fieldname;
deleteresource.url = resource.url;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, appfwconfidfield resource) throws Exception {
appfwconfidfield deleteresource = new appfwconfidfield();
deleteresource.fieldname = resource.fieldname;
deleteresource.url = resource.url;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"appfwconfidfield",
"resource",
")",
"throws",
"Exception",
"{",
"appfwconfidfield",
"deleteresource",
"=",
"new",
"appfwconfidfield",
"(",
")",
";",
"deleteresource",
".",
"fieldname"... | Use this API to delete appfwconfidfield. | [
"Use",
"this",
"API",
"to",
"delete",
"appfwconfidfield",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwconfidfield.java#L215-L220 | train | Use this API to delete appfwconfidfield. | Create a Java method that does the following: "Use this API to delete appfwconfidfield.". | Of course, here is the Java code you requested:
```java
public static base_response delete(nitro_service client, appfwconfidfield resource) throws Exception {
appfwconfidfield deleteresource = new appfwconfidfield();
deleteresource.fieldname = resource.fieldname;
deleteresource.url = resource.url;
return delet... | |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4Address.java | IPv4Address.toIPv6 | @Override
public IPv6Address toIPv6() {
IPAddressConverter conv = DEFAULT_ADDRESS_CONVERTER;
if(conv != null) {
return conv.toIPv6(this);
}
return null;
} | java | @Override
public IPv6Address toIPv6() {
IPAddressConverter conv = DEFAULT_ADDRESS_CONVERTER;
if(conv != null) {
return conv.toIPv6(this);
}
return null;
} | [
"@",
"Override",
"public",
"IPv6Address",
"toIPv6",
"(",
")",
"{",
"IPAddressConverter",
"conv",
"=",
"DEFAULT_ADDRESS_CONVERTER",
";",
"if",
"(",
"conv",
"!=",
"null",
")",
"{",
"return",
"conv",
".",
"toIPv6",
"(",
"this",
")",
";",
"}",
"return",
"null"... | Returns this address converted to IPv6.
<p>
This uses {@link #isIPv6Convertible()} to determine convertibility, and that uses an instance of {@link IPAddressConverter.DefaultAddressConverter} which uses IPv4-mapped address mappings from rfc 4038.
<p>
Override this method and {@link IPv6Address#isIPv4Convertible()} if y... | [
"Returns",
"this",
"address",
"converted",
"to",
"IPv6",
".",
"<p",
">",
"This",
"uses",
"{"
] | 90493d0673511d673100c36d020dd93dd870111a | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4Address.java#L375-L382 | train | Converts this address to an IPv6 address. | Create a Java method that does the following: "Converts this address to an IPv6 address.". | Of course, here is the Java code you requested:
```java
@Override
public IPv6Address toIPv6() {
IPAddressConverter conv = DEFAULT_ADDRESS_CONVERTER;
if(conv != null) {
return conv.toIPv6(this);
}
return null;
}
```
Hope this helps! | |
googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java | BigQuerySnippets.getJob | public Job getJob(String jobName) {
// [START ]
Job job = bigquery.getJob(jobName);
if (job == null) {
// job was not found
}
// [END ]
return job;
} | java | public Job getJob(String jobName) {
// [START ]
Job job = bigquery.getJob(jobName);
if (job == null) {
// job was not found
}
// [END ]
return job;
} | [
"public",
"Job",
"getJob",
"(",
"String",
"jobName",
")",
"{",
"// [START ]",
"Job",
"job",
"=",
"bigquery",
".",
"getJob",
"(",
"jobName",
")",
";",
"if",
"(",
"job",
"==",
"null",
")",
"{",
"// job was not found",
"}",
"// [END ]",
"return",
"job",
";"... | [VARIABLE "my_job_name"] | [
"[",
"VARIABLE",
"my_job_name",
"]"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigquery/snippets/BigQuerySnippets.java#L583-L591 | train | Get a Job object from the job table. | Create a Java method that does the following: "Get a Job object from the job table.". | Of course, here is the Java code you requested:
```java
public Job getJob(String jobName) {
// [START ]
Job job = bigquery.getJob(jobName);
if (job == null) {
// job was not found
}
// [END ]
return job;
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/TimingInfo.java | TimingInfo.newTimingInfoFullSupport | public static TimingInfo newTimingInfoFullSupport(
long startEpochTimeMilli, long startTimeNano, long endTimeNano) {
return new TimingInfoFullSupport(Long.valueOf(startEpochTimeMilli), startTimeNano, Long.valueOf(endTimeNano));
} | java | public static TimingInfo newTimingInfoFullSupport(
long startEpochTimeMilli, long startTimeNano, long endTimeNano) {
return new TimingInfoFullSupport(Long.valueOf(startEpochTimeMilli), startTimeNano, Long.valueOf(endTimeNano));
} | [
"public",
"static",
"TimingInfo",
"newTimingInfoFullSupport",
"(",
"long",
"startEpochTimeMilli",
",",
"long",
"startTimeNano",
",",
"long",
"endTimeNano",
")",
"{",
"return",
"new",
"TimingInfoFullSupport",
"(",
"Long",
".",
"valueOf",
"(",
"startEpochTimeMilli",
")"... | Returns a {@link TimingInfoFullSupport} based on the given
start time since epoch in millisecond,
and the given start and end time in nanosecond.
@param startEpochTimeMilli start time since epoch in millisecond
@param startTimeNano start time in nanosecond
@param endTimeNano end time in nanosecond | [
"Returns",
"a",
"{",
"@link",
"TimingInfoFullSupport",
"}",
"based",
"on",
"the",
"given",
"start",
"time",
"since",
"epoch",
"in",
"millisecond",
"and",
"the",
"given",
"start",
"and",
"end",
"time",
"in",
"nanosecond",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/TimingInfo.java#L129-L132 | train | Create a new TimingInfo object with the specified start and end times. | Create a Java method that does the following: "Create a new TimingInfo object with the specified start and end times.". | Of course, here is the Java code you requested:
```java
public static TimingInfo newTimingInfoFullSupport(
long startEpochTimeMilli, long startTimeNano, long endTimeNano) {
return new TimingInfoFullSupport(Long.valueOf(startEpochTimeMilli), startTimeNano, Long.valueOf(endTimeNano));
}
```
Hope thi... | |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java | BasePrefetcher.buildPrefetchCriteriaSingleKey | private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
{
Criteria crit = new Criteria();
ArrayList values = new ArrayList(ids.size());
Iterator iter = ids.iterator();
Identity id;
while (iter.hasNext())
{
id = (Ide... | java | private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
{
Criteria crit = new Criteria();
ArrayList values = new ArrayList(ids.size());
Iterator iter = ids.iterator();
Identity id;
while (iter.hasNext())
{
id = (Ide... | [
"private",
"Criteria",
"buildPrefetchCriteriaSingleKey",
"(",
"Collection",
"ids",
",",
"FieldDescriptor",
"field",
")",
"{",
"Criteria",
"crit",
"=",
"new",
"Criteria",
"(",
")",
";",
"ArrayList",
"values",
"=",
"new",
"ArrayList",
"(",
"ids",
".",
"size",
"(... | Build the Criteria using IN(...) for single keys
@param ids collection of identities
@param field
@return Criteria | [
"Build",
"the",
"Criteria",
"using",
"IN",
"(",
"...",
")",
"for",
"single",
"keys"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java#L168-L195 | train | Build a Criteria object from a Collection of Identity objects. | Create a Java method that does the following: "Build a Criteria object from a Collection of Identity objects.". | Of course, here is the Java code you requested:
```java
private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
{
Criteria crit = new Criteria();
ArrayList values = new ArrayList(ids.size());
Iterator iter = ids.iterator();
Identity id;
... | |
taimos/dvalin | interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java | InterconnectMapper.cloneObject | public static <T extends InterconnectObject> T cloneObject(T object) throws IOException {
return InterconnectMapper.fromJson(InterconnectMapper.toJson(object), (Class<T>) object.getClass());
} | java | public static <T extends InterconnectObject> T cloneObject(T object) throws IOException {
return InterconnectMapper.fromJson(InterconnectMapper.toJson(object), (Class<T>) object.getClass());
} | [
"public",
"static",
"<",
"T",
"extends",
"InterconnectObject",
">",
"T",
"cloneObject",
"(",
"T",
"object",
")",
"throws",
"IOException",
"{",
"return",
"InterconnectMapper",
".",
"fromJson",
"(",
"InterconnectMapper",
".",
"toJson",
"(",
"object",
")",
",",
"... | Returns a clone of the given object using JSON (de)serialization.
@param object the object to be cloned
@return a clone of this object.
@throws JsonGenerationException if the JSON data could not be generated
@throws JsonMappingException if the object could not be mapped to a JSON string
@throws IOException ... | [
"Returns",
"a",
"clone",
"of",
"the",
"given",
"object",
"using",
"JSON",
"(",
"de",
")",
"serialization",
"."
] | ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47 | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/InterconnectMapper.java#L103-L105 | train | Clone an InterconnectObject. | Create a Java method that does the following: "Clone an InterconnectObject.". | Of course, here is the Java code you requested:
```java
public static <T extends InterconnectObject> T cloneObject(T object) throws IOException {
return InterconnectMapper.fromJson(InterconnectMapper.toJson(object), (Class<T>) object.getClass());
}
```
Hope this helps! | |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashSSORealm.java | HashSSORealm.setSingleSignOn | public void setSingleSignOn(HttpRequest request,
HttpResponse response,
Principal principal,
Credential credential)
{
String ssoID=null;
synchronized(_ssoId2Principal)
{
... | java | public void setSingleSignOn(HttpRequest request,
HttpResponse response,
Principal principal,
Credential credential)
{
String ssoID=null;
synchronized(_ssoId2Principal)
{
... | [
"public",
"void",
"setSingleSignOn",
"(",
"HttpRequest",
"request",
",",
"HttpResponse",
"response",
",",
"Principal",
"principal",
",",
"Credential",
"credential",
")",
"{",
"String",
"ssoID",
"=",
"null",
";",
"synchronized",
"(",
"_ssoId2Principal",
")",
"{",
... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashSSORealm.java#L89-L117 | train | Sets the single sign on cookie. | Create a Java method that does the following: "Sets the single sign on cookie.". | Of course, here is the Java code you requested:
```java
public void setSingleSignOn(HttpRequest request,
HttpResponse response,
Principal principal,
Credential credential)
{
String ssoID=null;
... | |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlEntityResolver.java | CmsXmlEntityResolver.initialize | protected static void initialize(CmsObject adminCms, byte[] typeSchemaBytes) {
// create the resolver to register as event listener
CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(adminCms);
// register this object as event listener
OpenCms.addCmsEventListener(
res... | java | protected static void initialize(CmsObject adminCms, byte[] typeSchemaBytes) {
// create the resolver to register as event listener
CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(adminCms);
// register this object as event listener
OpenCms.addCmsEventListener(
res... | [
"protected",
"static",
"void",
"initialize",
"(",
"CmsObject",
"adminCms",
",",
"byte",
"[",
"]",
"typeSchemaBytes",
")",
"{",
"// create the resolver to register as event listener",
"CmsXmlEntityResolver",
"resolver",
"=",
"new",
"CmsXmlEntityResolver",
"(",
"adminCms",
... | Initialize the OpenCms XML entity resolver.<p>
@param adminCms an initialized OpenCms user context with "Administrator" role permissions
@param typeSchemaBytes the base widget type XML schema definitions
@see CmsXmlContentTypeManager#initialize(CmsObject) | [
"Initialize",
"the",
"OpenCms",
"XML",
"entity",
"resolver",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlEntityResolver.java#L189-L206 | train | Initialize the base widget type XML schema definitions. | Create a Java method that does the following: "Initialize the base widget type XML schema definitions.". | Of course, here is the Java code you requested:
```java
protected static void initialize(CmsObject adminCms, byte[] typeSchemaBytes) {
// create the resolver to register as event listener
CmsXmlEntityResolver resolver = new CmsXmlEntityResolver(adminCms);
// register this object as event list... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/helpers/FileTransferHelper.java | FileTransferHelper.setWsLocationAdminRef | @Reference(name = KEY_LOCATION_ADMIN, service = WsLocationAdmin.class)
protected void setWsLocationAdminRef(ServiceReference<WsLocationAdmin> ref) {
wsLocationAdminRef.setReference(ref);
} | java | @Reference(name = KEY_LOCATION_ADMIN, service = WsLocationAdmin.class)
protected void setWsLocationAdminRef(ServiceReference<WsLocationAdmin> ref) {
wsLocationAdminRef.setReference(ref);
} | [
"@",
"Reference",
"(",
"name",
"=",
"KEY_LOCATION_ADMIN",
",",
"service",
"=",
"WsLocationAdmin",
".",
"class",
")",
"protected",
"void",
"setWsLocationAdminRef",
"(",
"ServiceReference",
"<",
"WsLocationAdmin",
">",
"ref",
")",
"{",
"wsLocationAdminRef",
".",
"se... | Location Admin | [
"Location",
"Admin"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/helpers/FileTransferHelper.java#L110-L113 | train | Declarative Services method for setting the WsLocationAdmin service reference. | Create a Java method that does the following: "Declarative Services method for setting the WsLocationAdmin service reference.". | Of course, here is the Java code you requested:
```java
@Reference(name = KEY_LOCATION_ADMIN, service = WsLocationAdmin.class)
protected void setWsLocationAdminRef(ServiceReference<WsLocationAdmin> ref) {
wsLocationAdminRef.setReference(ref);
}
```
Hope this helps! | |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.appendClosingTag | public static StringBuffer appendClosingTag(StringBuffer buffer, String tag)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendClosingTag(_buffer, tag);
} | java | public static StringBuffer appendClosingTag(StringBuffer buffer, String tag)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendClosingTag(_buffer, tag);
} | [
"public",
"static",
"StringBuffer",
"appendClosingTag",
"(",
"StringBuffer",
"buffer",
",",
"String",
"tag",
")",
"{",
"StringBuffer",
"_buffer",
"=",
"initStringBufferIfNecessary",
"(",
"buffer",
")",
";",
"return",
"doAppendClosingTag",
"(",
"_buffer",
",",
"tag",... | Add a closing tag to a StringBuffer.
If the buffer is null, a new one is created.
@param buffer
StringBuffer to fill
@param tag
the tag to close
@return the buffer | [
"Add",
"a",
"closing",
"tag",
"to",
"a",
"StringBuffer",
"."
] | 3480ebd72a07422fcc09971be2607ee25efb2c26 | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L318-L322 | train | Append a closing tag to a StringBuffer. | Create a Java method that does the following: "Append a closing tag to a StringBuffer.". | Of course, here is the Java code you requested:
```java
public static StringBuffer appendClosingTag(StringBuffer buffer, String tag)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendClosingTag(_buffer, tag);
}
```
Hope this helps! | |
landawn/AbacusUtil | src/com/landawn/abacus/util/URLEncodedUtil.java | URLEncodedUtil.encPath | static void encPath(final StringBuilder sb, final String content, final Charset charset) {
urlEncode(sb, content, charset, PATHSAFE, false);
} | java | static void encPath(final StringBuilder sb, final String content, final Charset charset) {
urlEncode(sb, content, charset, PATHSAFE, false);
} | [
"static",
"void",
"encPath",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"urlEncode",
"(",
"sb",
",",
"content",
",",
"charset",
",",
"PATHSAFE",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #PATHSAFE} set of characters.
<p>
Used by URIBuilder to encode path segments.
@param content
the string to encode, does not convert space to '+'
@param charset
the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#PATHSAFE",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"path",
"segments",
".",
"@param",
"content",
"the",
"string",
"to",
"encode",
"does",
"not",
... | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/URLEncodedUtil.java#L544-L546 | train | Encode a path. | Create a Java method that does the following: "Encode a path.". | Of course, here is the Java code you requested:
```java
static void encPath(final StringBuilder sb, final String content, final Charset charset) {
urlEncode(sb, content, charset, PATHSAFE, false);
}
```
Hope this helps! | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java | AfplibPackageImpl.getMDR | public EClass getMDR() {
if (mdrEClass == null) {
mdrEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(294);
}
return mdrEClass;
} | java | public EClass getMDR() {
if (mdrEClass == null) {
mdrEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(294);
}
return mdrEClass;
} | [
"public",
"EClass",
"getMDR",
"(",
")",
"{",
"if",
"(",
"mdrEClass",
"==",
"null",
")",
"{",
"mdrEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"AfplibPackage",
".",
"eNS_URI",
")",
".",
"getEClas... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L7711-L7716 | train | Get the MDR. | Create a Java method that does the following: "Get the MDR.". | Of course, here is the Java code you requested:
```java
public EClass getMDR() {
if (mdrEClass == null) {
mdrEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(294);
}
return mdrEClass;
}
```
Hope this helps! | |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java | MultiPageWidget.selectItem | public boolean selectItem(int dataIndex, boolean select) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "selectItem [%d] select [%b]", dataIndex, select);
if (dataIndex < 0 || dataIndex >= mItemAdapter.getCount()) {
throw new IndexOutOfBoundsException("Selection index [" + dataIndex + "] is out of bound... | java | public boolean selectItem(int dataIndex, boolean select) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "selectItem [%d] select [%b]", dataIndex, select);
if (dataIndex < 0 || dataIndex >= mItemAdapter.getCount()) {
throw new IndexOutOfBoundsException("Selection index [" + dataIndex + "] is out of bound... | [
"public",
"boolean",
"selectItem",
"(",
"int",
"dataIndex",
",",
"boolean",
"select",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"selectItem [%d] select [%b]\"",
",",
"dataIndex",
",",
"select",
")",
";",
"if... | Select or deselect an item at position {@code pos}.
@param dataIndex
item position in the adapter
@param select
operation to perform select or deselect.
@return {@code true} if the requested operation is successful,
{@code false} otherwise. | [
"Select",
"or",
"deselect",
"an",
"item",
"at",
"position",
"{",
"@code",
"pos",
"}",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java#L272-L302 | train | Select a specific item in the list. | Create a Java method that does the following: "Select a specific item in the list.". | Of course, here is the Java code you requested:
```java
public boolean selectItem(int dataIndex, boolean select) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "selectItem [%d] select [%b]", dataIndex, select);
if (dataIndex < 0 || dataIndex >= mItemAdapter.getCount()) {
throw new IndexOutOfBoundsExcep... | |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpResponse.java | ServletHttpResponse.setContentType | public void setContentType(String contentType)
{
if (isCommitted() || contentType==null)
return;
int semi=contentType.indexOf(';');
if (semi>0)
{
int charset0=contentType.indexOf("charset=",semi);
if (charset0>0)
{
... | java | public void setContentType(String contentType)
{
if (isCommitted() || contentType==null)
return;
int semi=contentType.indexOf(';');
if (semi>0)
{
int charset0=contentType.indexOf("charset=",semi);
if (charset0>0)
{
... | [
"public",
"void",
"setContentType",
"(",
"String",
"contentType",
")",
"{",
"if",
"(",
"isCommitted",
"(",
")",
"||",
"contentType",
"==",
"null",
")",
"return",
";",
"int",
"semi",
"=",
"contentType",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"("... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpResponse.java#L605-L643 | train | Sets the content type of the response. | Create a Java method that does the following: "Sets the content type of the response.". | Of course, here is the Java code you requested:
```java
public void setContentType(String contentType)
{
if (isCommitted() || contentType==null)
return;
int semi=contentType.indexOf(';');
if (semi>0)
{
int charset0=contentType.indexOf("charset=",sem... | |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getGroupsOfUser | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
throws CmsException {
return getGroupsOfUser(username, directGroupsOnly, includeOtherOus, m_context.getRemoteAddress());
} | java | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
throws CmsException {
return getGroupsOfUser(username, directGroupsOnly, includeOtherOus, m_context.getRemoteAddress());
} | [
"public",
"List",
"<",
"CmsGroup",
">",
"getGroupsOfUser",
"(",
"String",
"username",
",",
"boolean",
"directGroupsOnly",
",",
"boolean",
"includeOtherOus",
")",
"throws",
"CmsException",
"{",
"return",
"getGroupsOfUser",
"(",
"username",
",",
"directGroupsOnly",
",... | Returns all the groups the given user belongs to.<p>
@param username the name of the user
@param directGroupsOnly if set only the direct assigned groups will be returned, if not also indirect roles
@param includeOtherOus if to include groups of other organizational units
@return a list of <code>{@link CmsGroup}</code... | [
"Returns",
"all",
"the",
"groups",
"the",
"given",
"user",
"belongs",
"to",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1471-L1475 | train | Returns a list of groups of the given username. | Create a Java method that does the following: "Returns a list of groups of the given username.". | Of course, here is the Java code you requested:
```java
public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
throws CmsException {
return getGroupsOfUser(username, directGroupsOnly, includeOtherOus, m_context.getRemoteAddress());
}
```
Hope this he... | |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java | QueryParametersLazyList.update | public QueryParameters update(int index, QueryParameters params) throws SQLException {
AssertUtils.assertNotNull(params, "Element cannot be null, but values inside of it - can");
if (this.type == Type.READ_ONLY_FORWARD || this.type == Type.READ_ONLY_SCROLL) {
throw new MjdbcSQLException("Th... | java | public QueryParameters update(int index, QueryParameters params) throws SQLException {
AssertUtils.assertNotNull(params, "Element cannot be null, but values inside of it - can");
if (this.type == Type.READ_ONLY_FORWARD || this.type == Type.READ_ONLY_SCROLL) {
throw new MjdbcSQLException("Th... | [
"public",
"QueryParameters",
"update",
"(",
"int",
"index",
",",
"QueryParameters",
"params",
")",
"throws",
"SQLException",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"params",
",",
"\"Element cannot be null, but values inside of it - can\"",
")",
";",
"if",
"(",
... | Updates specified row in ResultSet
@param index index of row which would be updated
@param params source of values with which row would be updated
@return value before update
@throws SQLException | [
"Updates",
"specified",
"row",
"in",
"ResultSet"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java#L482-L512 | train | Update the row of the result set at the specified index with the specified parameters. | Create a Java method that does the following: "Update the row of the result set at the specified index with the specified parameters.". | Of course, here is the Java code you requested:
```java
public QueryParameters update(int index, QueryParameters params) throws SQLException {
AssertUtils.assertNotNull(params, "Element cannot be null, but values inside of it - can");
if (this.type == Type.READ_ONLY_FORWARD || this.type == Type.READ_O... | |
junit-team/junit4 | src/main/java/org/junit/runner/JUnitCore.java | JUnitCore.run | public Result run(Runner runner) {
Result result = new Result();
RunListener listener = result.createListener();
notifier.addFirstListener(listener);
try {
notifier.fireTestRunStarted(runner.getDescription());
runner.run(notifier);
notifier.fireTestRun... | java | public Result run(Runner runner) {
Result result = new Result();
RunListener listener = result.createListener();
notifier.addFirstListener(listener);
try {
notifier.fireTestRunStarted(runner.getDescription());
runner.run(notifier);
notifier.fireTestRun... | [
"public",
"Result",
"run",
"(",
"Runner",
"runner",
")",
"{",
"Result",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"RunListener",
"listener",
"=",
"result",
".",
"createListener",
"(",
")",
";",
"notifier",
".",
"addFirstListener",
"(",
"listener",
")"... | Do not use. Testing purposes only. | [
"Do",
"not",
"use",
".",
"Testing",
"purposes",
"only",
"."
] | d9861ecdb6e487f6c352437ee823879aca3b81d4 | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/JUnitCore.java#L131-L143 | train | Run the test. | Create a Java method that does the following: "Run the test.". | Of course, here is the Java code you requested:
```java
public Result run(Runner runner) {
Result result = new Result();
RunListener listener = result.createListener();
notifier.addFirstListener(listener);
try {
notifier.fireTestRunStarted(runner.getDescription());
... | |
NessComputing/components-ness-server | server/src/main/java/com/nesscomputing/server/StandaloneServer.java | StandaloneServer.getPlumbingModules | public Module getPlumbingModules(final Config config)
{
return new Module() {
@Override
public void configure(final Binder binder) {
binder.install(new ConfigModule(config));
binder.install(getLifecycleModule());
binder.install(new Jmx... | java | public Module getPlumbingModules(final Config config)
{
return new Module() {
@Override
public void configure(final Binder binder) {
binder.install(new ConfigModule(config));
binder.install(getLifecycleModule());
binder.install(new Jmx... | [
"public",
"Module",
"getPlumbingModules",
"(",
"final",
"Config",
"config",
")",
"{",
"return",
"new",
"Module",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"configure",
"(",
"final",
"Binder",
"binder",
")",
"{",
"binder",
".",
"install",
"(",
"new"... | Can be overridden in tests. | [
"Can",
"be",
"overridden",
"in",
"tests",
"."
] | 44e4c2ed0ad5150ab5d66da5bb8d27a76e0dfa3e | https://github.com/NessComputing/components-ness-server/blob/44e4c2ed0ad5150ab5d66da5bb8d27a76e0dfa3e/server/src/main/java/com/nesscomputing/server/StandaloneServer.java#L180-L195 | train | Get the getPlumbingModules method. | Create a Java method that does the following: "Get the getPlumbingModules method.". | Of course, here is the Java code you requested:
```java
public Module getPlumbingModules(final Config config)
{
return new Module() {
@Override
public void configure(final Binder binder) {
binder.install(new ConfigModule(config));
binder.install(getLi... | |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsResourceUtil.java | CmsResourceUtil.getStateName | public String getStateName() {
CmsResourceState state = m_resource.getState();
String name;
if (m_request == null) {
name = org.opencms.workplace.explorer.Messages.get().getBundle().key(
org.opencms.workplace.explorer.Messages.getStateKey(state));
} else {
... | java | public String getStateName() {
CmsResourceState state = m_resource.getState();
String name;
if (m_request == null) {
name = org.opencms.workplace.explorer.Messages.get().getBundle().key(
org.opencms.workplace.explorer.Messages.getStateKey(state));
} else {
... | [
"public",
"String",
"getStateName",
"(",
")",
"{",
"CmsResourceState",
"state",
"=",
"m_resource",
".",
"getState",
"(",
")",
";",
"String",
"name",
";",
"if",
"(",
"m_request",
"==",
"null",
")",
"{",
"name",
"=",
"org",
".",
"opencms",
".",
"workplace"... | Returns the state name for a resource.<p>
Uses default locale if request context is <code>null</code>.<p>
@return the state name for that resource | [
"Returns",
"the",
"state",
"name",
"for",
"a",
"resource",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsResourceUtil.java#L1113-L1125 | train | Get the name of the state of the resource. | Create a Java method that does the following: "Get the name of the state of the resource.". | Of course, here is the Java code you requested:
```java
public String getStateName() {
CmsResourceState state = m_resource.getState();
String name;
if (m_request == null) {
name = org.opencms.workplace.explorer.Messages.get().getBundle().key(
org.opencms.workplace.e... | |
Netflix/ribbon | ribbon-core/src/main/java/com/netflix/client/ssl/AbstractSslContextFactory.java | AbstractSslContextFactory.createSSLContext | private SSLContext createSSLContext() throws ClientSslSocketFactoryException {
final KeyManager[] keyManagers = this.keyStore != null ? createKeyManagers() : null;
final TrustManager[] trustManagers = this.trustStore != null ? createTrustManagers() : null;
try {
final SSLContext ssl... | java | private SSLContext createSSLContext() throws ClientSslSocketFactoryException {
final KeyManager[] keyManagers = this.keyStore != null ? createKeyManagers() : null;
final TrustManager[] trustManagers = this.trustStore != null ? createTrustManagers() : null;
try {
final SSLContext ssl... | [
"private",
"SSLContext",
"createSSLContext",
"(",
")",
"throws",
"ClientSslSocketFactoryException",
"{",
"final",
"KeyManager",
"[",
"]",
"keyManagers",
"=",
"this",
".",
"keyStore",
"!=",
"null",
"?",
"createKeyManagers",
"(",
")",
":",
"null",
";",
"final",
"T... | Creates the SSL context needed to create the socket factory used by this factory. The key and
trust store parameters are optional. If they are null then the JRE defaults will be used.
@return the newly created SSL context
@throws ClientSslSocketFactoryException if an error is detected loading the specified key or
trus... | [
"Creates",
"the",
"SSL",
"context",
"needed",
"to",
"create",
"the",
"socket",
"factory",
"used",
"by",
"this",
"factory",
".",
"The",
"key",
"and",
"trust",
"store",
"parameters",
"are",
"optional",
".",
"If",
"they",
"are",
"null",
"then",
"the",
"JRE",
... | d15cd7715b0bf2f64ae6ca98c5e4d184f178e261 | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-core/src/main/java/com/netflix/client/ssl/AbstractSslContextFactory.java#L100-L115 | train | Create an SSL context. | Create a Java method that does the following: "Create an SSL context.". | Of course, here is the Java code you requested:
```java
private SSLContext createSSLContext() throws ClientSslSocketFactoryException {
final KeyManager[] keyManagers = this.keyStore != null ? createKeyManagers() : null;
final TrustManager[] trustManagers = this.trustStore != null ? createTrustManagers(... | |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/gradientcheck/GradientCheckUtil.java | GradientCheckUtil.checkGradientsPretrainLayer | public static boolean checkGradientsPretrainLayer(Layer layer, double epsilon, double maxRelError,
double minAbsoluteError, boolean print, boolean exitOnFirstError, INDArray input, int rngSeed) {
LayerWorkspaceMgr mgr = LayerWorkspaceMgr.noWorkspaces();
//Basic sanity checks on inp... | java | public static boolean checkGradientsPretrainLayer(Layer layer, double epsilon, double maxRelError,
double minAbsoluteError, boolean print, boolean exitOnFirstError, INDArray input, int rngSeed) {
LayerWorkspaceMgr mgr = LayerWorkspaceMgr.noWorkspaces();
//Basic sanity checks on inp... | [
"public",
"static",
"boolean",
"checkGradientsPretrainLayer",
"(",
"Layer",
"layer",
",",
"double",
"epsilon",
",",
"double",
"maxRelError",
",",
"double",
"minAbsoluteError",
",",
"boolean",
"print",
",",
"boolean",
"exitOnFirstError",
",",
"INDArray",
"input",
","... | Check backprop gradients for a pretrain layer
NOTE: gradient checking pretrain layers can be difficult... | [
"Check",
"backprop",
"gradients",
"for",
"a",
"pretrain",
"layer"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/gradientcheck/GradientCheckUtil.java#L663-L779 | train | Check gradients pretrain layer | Create a Java method that does the following: "Check gradients pretrain layer". | Of course, here is the Java code you requested:
```java
public static boolean checkGradientsPretrainLayer(Layer layer, double epsilon, double maxRelError,
double minAbsoluteError, boolean print, boolean exitOnFirstError, INDArray input, int rngSeed) {
LayerWorkspaceMgr mgr = LayerWorkspace... | |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getWebMercatorBoundingBox | public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (x * tileSize);
double maxLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ ((x + 1) * tileS... | java | public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (x * tileSize);
double maxLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ ((x + 1) * tileS... | [
"public",
"static",
"BoundingBox",
"getWebMercatorBoundingBox",
"(",
"long",
"x",
",",
"long",
"y",
",",
"int",
"zoom",
")",
"{",
"double",
"tileSize",
"=",
"tileSizeWithZoom",
"(",
"zoom",
")",
";",
"double",
"minLon",
"=",
"(",
"-",
"1",
"*",
"Projection... | Get the Web Mercator tile bounding box from the Google Maps API tile
coordinates and zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return bounding box | [
"Get",
"the",
"Web",
"Mercator",
"tile",
"bounding",
"box",
"from",
"the",
"Google",
"Maps",
"API",
"tile",
"coordinates",
"and",
"zoom",
"level"
] | 6431c3b041a45b7f3802904ea4156b4082a72daa | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L347-L363 | train | Get the Web Mercator bounding box from the x y and zoom level | Create a Java method that does the following: "Get the Web Mercator bounding box from the x y and zoom level". | Of course, here is the Java code you requested:
```java
public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (x * tileSize);
double maxLon = (-1 * ProjectionConsta... | |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java | ST_AsKml.toKml | public static String toKml(Geometry geometry) throws SQLException {
StringBuilder sb = new StringBuilder();
KMLGeometry.toKMLGeometry(geometry, sb);
return sb.toString();
} | java | public static String toKml(Geometry geometry) throws SQLException {
StringBuilder sb = new StringBuilder();
KMLGeometry.toKMLGeometry(geometry, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"toKml",
"(",
"Geometry",
"geometry",
")",
"throws",
"SQLException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"KMLGeometry",
".",
"toKMLGeometry",
"(",
"geometry",
",",
"sb",
")",
";",
"return",
"s... | Generate a KML geometry
@param geometry
@return
@throws SQLException | [
"Generate",
"a",
"KML",
"geometry"
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/ST_AsKml.java#L57-L61 | train | Convert a Geometry to a KML geometry. | Create a Java method that does the following: "Convert a Geometry to a KML geometry.". | Of course, here is the Java code you requested:
```java
public static String toKml(Geometry geometry) throws SQLException {
StringBuilder sb = new StringBuilder();
KMLGeometry.toKMLGeometry(geometry, sb);
return sb.toString();
}
```
Hope this helps! | |
i-net-software/jlessc | src/com/inet/lib/less/LessParser.java | LessParser.comment | private boolean comment( FormattableContainer container ) {
char ch = read();
switch( ch ) {
// case '/': // line comments will be skip
// reader.skipLine();
// return true;
case '*': // block comments
StringBuilder builder = new Strin... | java | private boolean comment( FormattableContainer container ) {
char ch = read();
switch( ch ) {
// case '/': // line comments will be skip
// reader.skipLine();
// return true;
case '*': // block comments
StringBuilder builder = new Strin... | [
"private",
"boolean",
"comment",
"(",
"FormattableContainer",
"container",
")",
"{",
"char",
"ch",
"=",
"read",
"(",
")",
";",
"switch",
"(",
"ch",
")",
"{",
"// case '/': // line comments will be skip",
"// reader.skipLine();",
"// ... | Parse comments
@param container optional container for the parsed comments
@return return true, if a comment was parsed, false if the slash must be parse anywhere else | [
"Parse",
"comments"
] | 15b13e1637f6cc2e4d72df021e23ee0ca8d5e629 | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/LessParser.java#L1176-L1209 | train | Reads a comment from the source. | Create a Java method that does the following: "Reads a comment from the source.". | Of course, here is the Java code you requested:
```java
private boolean comment( FormattableContainer container ) {
char ch = read();
switch( ch ) {
// case '/': // line comments will be skip
// reader.skipLine();
// return true;
case '*': // block c... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/BasicAuthAuthenticator.java | BasicAuthAuthenticator.getBasicAuthRealmName | protected String getBasicAuthRealmName(WebRequest webRequest) {
SecurityMetadata securityMetadata = webRequest.getSecurityMetadata();
if (securityMetadata != null) {
LoginConfiguration loginConfig = securityMetadata.getLoginConfiguration();
if (loginConfig != null && loginConfig.... | java | protected String getBasicAuthRealmName(WebRequest webRequest) {
SecurityMetadata securityMetadata = webRequest.getSecurityMetadata();
if (securityMetadata != null) {
LoginConfiguration loginConfig = securityMetadata.getLoginConfiguration();
if (loginConfig != null && loginConfig.... | [
"protected",
"String",
"getBasicAuthRealmName",
"(",
"WebRequest",
"webRequest",
")",
"{",
"SecurityMetadata",
"securityMetadata",
"=",
"webRequest",
".",
"getSecurityMetadata",
"(",
")",
";",
"if",
"(",
"securityMetadata",
"!=",
"null",
")",
"{",
"LoginConfiguration"... | Return a realm name if it's defined in the web.xml file. If it's not defined in the web.xml
and displayAuthenticationRealm is set to true, then return the userRegistry realm. Otherwise return
the realm as "Default Realm".
@param webRequest
@return realm | [
"Return",
"a",
"realm",
"name",
"if",
"it",
"s",
"defined",
"in",
"the",
"web",
".",
"xml",
"file",
".",
"If",
"it",
"s",
"not",
"defined",
"in",
"the",
"web",
".",
"xml",
"and",
"displayAuthenticationRealm",
"is",
"set",
"to",
"true",
"then",
"return"... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/BasicAuthAuthenticator.java#L162-L175 | train | Get the realm name for BASIC authentication. | Create a Java method that does the following: "Get the realm name for BASIC authentication.". | Of course, here is the Java code you requested:
```java
protected String getBasicAuthRealmName(WebRequest webRequest) {
SecurityMetadata securityMetadata = webRequest.getSecurityMetadata();
if (securityMetadata != null) {
LoginConfiguration loginConfig = securityMetadata.getLoginConfigurati... | |
HanSolo/tilesfx | src/main/java/eu/hansolo/tilesfx/TimeSection.java | TimeSection.setHighlightColor | public void setHighlightColor(final Color COLOR) {
if (null == highlightColor) {
_highlightColor = COLOR;
} else {
highlightColor.set(COLOR);
}
} | java | public void setHighlightColor(final Color COLOR) {
if (null == highlightColor) {
_highlightColor = COLOR;
} else {
highlightColor.set(COLOR);
}
} | [
"public",
"void",
"setHighlightColor",
"(",
"final",
"Color",
"COLOR",
")",
"{",
"if",
"(",
"null",
"==",
"highlightColor",
")",
"{",
"_highlightColor",
"=",
"COLOR",
";",
"}",
"else",
"{",
"highlightColor",
".",
"set",
"(",
"COLOR",
")",
";",
"}",
"}"
] | Defines the color that will be used to colorize a highlighted section
@param COLOR | [
"Defines",
"the",
"color",
"that",
"will",
"be",
"used",
"to",
"colorize",
"a",
"highlighted",
"section"
] | 36eb07b1119017beb851dad95256439224d1fcf4 | https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/TimeSection.java#L254-L260 | train | Sets the color that will be used to highlight the exception messages. | Create a Java method that does the following: "Sets the color that will be used to highlight the exception messages.". | Of course, here is the Java code you requested:
```java
public void setHighlightColor(final Color COLOR) {
if (null == highlightColor) {
_highlightColor = COLOR;
} else {
highlightColor.set(COLOR);
}
}
```
Hope this helps! | |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java | CommerceWarehouseItemPersistenceImpl.fetchByCWI_CPIU | @Override
public CommerceWarehouseItem fetchByCWI_CPIU(long commerceWarehouseId,
String CPInstanceUuid, boolean retrieveFromCache) {
Object[] finderArgs = new Object[] { commerceWarehouseId, CPInstanceUuid };
Object result = null;
if (retrieveFromCache) {
result = finderCache.getResult(FINDER_PATH_FETCH_B... | java | @Override
public CommerceWarehouseItem fetchByCWI_CPIU(long commerceWarehouseId,
String CPInstanceUuid, boolean retrieveFromCache) {
Object[] finderArgs = new Object[] { commerceWarehouseId, CPInstanceUuid };
Object result = null;
if (retrieveFromCache) {
result = finderCache.getResult(FINDER_PATH_FETCH_B... | [
"@",
"Override",
"public",
"CommerceWarehouseItem",
"fetchByCWI_CPIU",
"(",
"long",
"commerceWarehouseId",
",",
"String",
"CPInstanceUuid",
",",
"boolean",
"retrieveFromCache",
")",
"{",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"comme... | Returns the commerce warehouse item where commerceWarehouseId = ? and CPInstanceUuid = ? or returns <code>null</code> if it could not be found, optionally using the finder cache.
@param commerceWarehouseId the commerce warehouse ID
@param CPInstanceUuid the cp instance uuid
@param retrieveFromCache whether to ... | [
"Returns",
"the",
"commerce",
"warehouse",
"item",
"where",
"commerceWarehouseId",
"=",
"?",
";",
"and",
"CPInstanceUuid",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
"optionally",... | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java#L691-L782 | train | Returns the commerce warehouse item with the matching CPIU and CPInstance. | Create a Java method that does the following: "Returns the commerce warehouse item with the matching CPIU and CPInstance.". | Of course, here is the Java code you requested:
```java
@Override
public CommerceWarehouseItem fetchByCWI_CPIU(long commerceWarehouseId,
String CPInstanceUuid, boolean retrieveFromCache) {
Object[] finderArgs = new Object[] { commerceWarehouseId, CPInstanceUuid };
Object result = null;
if (retrieveFromCache... | |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/vector/SparseHashIntegerVector.java | SparseHashIntegerVector.add | public int add(int index, int delta) {
int val = map.get(index);
int newVal = val + delta;
if (newVal == 0)
map.remove(index);
else
map.put(index, newVal);
magnitude = -1;
return newVal;
} | java | public int add(int index, int delta) {
int val = map.get(index);
int newVal = val + delta;
if (newVal == 0)
map.remove(index);
else
map.put(index, newVal);
magnitude = -1;
return newVal;
} | [
"public",
"int",
"add",
"(",
"int",
"index",
",",
"int",
"delta",
")",
"{",
"int",
"val",
"=",
"map",
".",
"get",
"(",
"index",
")",
";",
"int",
"newVal",
"=",
"val",
"+",
"delta",
";",
"if",
"(",
"newVal",
"==",
"0",
")",
"map",
".",
"remove",... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/vector/SparseHashIntegerVector.java#L116-L125 | train | Add to a single attribute of the class. | Create a Java method that does the following: "Add to a single attribute of the class.". | Of course, here is the Java code you requested:
```java
public int add(int index, int delta) {
int val = map.get(index);
int newVal = val + delta;
if (newVal == 0)
map.remove(index);
else
map.put(index, newVal);
magnitude = -1;
return newVal;
... | |
hawkular/hawkular-apm | server/api/src/main/java/org/hawkular/apm/server/api/utils/zipkin/SpanHttpDeriverUtil.java | SpanHttpDeriverUtil.getHttpStatusCodes | public static List<HttpCode> getHttpStatusCodes(List<BinaryAnnotation> binaryAnnotations) {
if (binaryAnnotations == null) {
return Collections.emptyList();
}
List<HttpCode> httpCodes = new ArrayList<>();
for (BinaryAnnotation binaryAnnotation: binaryAnnotations) {
... | java | public static List<HttpCode> getHttpStatusCodes(List<BinaryAnnotation> binaryAnnotations) {
if (binaryAnnotations == null) {
return Collections.emptyList();
}
List<HttpCode> httpCodes = new ArrayList<>();
for (BinaryAnnotation binaryAnnotation: binaryAnnotations) {
... | [
"public",
"static",
"List",
"<",
"HttpCode",
">",
"getHttpStatusCodes",
"(",
"List",
"<",
"BinaryAnnotation",
">",
"binaryAnnotations",
")",
"{",
"if",
"(",
"binaryAnnotations",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
... | Method returns list of http status codes.
@param binaryAnnotations zipkin binary annotations
@return http status codes | [
"Method",
"returns",
"list",
"of",
"http",
"status",
"codes",
"."
] | 57a4df0611b359597626563ea5f9ac64d4bb2533 | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/server/api/src/main/java/org/hawkular/apm/server/api/utils/zipkin/SpanHttpDeriverUtil.java#L53-L75 | train | Get the Http status codes from the list of binary annotations. | Create a Java method that does the following: "Get the Http status codes from the list of binary annotations.". | Of course, here is the Java code you requested:
```java
public static List<HttpCode> getHttpStatusCodes(List<BinaryAnnotation> binaryAnnotations) {
if (binaryAnnotations == null) {
return Collections.emptyList();
}
List<HttpCode> httpCodes = new ArrayList<>();
for (BinaryA... | |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java | CmsCreateSiteThread.setFolderTitle | private void setFolderTitle(CmsResource res) {
try {
CmsProperty titleProperty = m_cms.readPropertyObject(res, CmsPropertyDefinition.PROPERTY_TITLE, false);
if (!titleProperty.isNullProperty()) {
titleProperty.setValue(m_site.getTitle(), CmsProperty.TYPE_INDIVIDUAL);
... | java | private void setFolderTitle(CmsResource res) {
try {
CmsProperty titleProperty = m_cms.readPropertyObject(res, CmsPropertyDefinition.PROPERTY_TITLE, false);
if (!titleProperty.isNullProperty()) {
titleProperty.setValue(m_site.getTitle(), CmsProperty.TYPE_INDIVIDUAL);
... | [
"private",
"void",
"setFolderTitle",
"(",
"CmsResource",
"res",
")",
"{",
"try",
"{",
"CmsProperty",
"titleProperty",
"=",
"m_cms",
".",
"readPropertyObject",
"(",
"res",
",",
"CmsPropertyDefinition",
".",
"PROPERTY_TITLE",
",",
"false",
")",
";",
"if",
"(",
"... | Updates title property of site root resource in case of copy from template.<p>
@param res root resource to set titel for | [
"Updates",
"title",
"property",
"of",
"site",
"root",
"resource",
"in",
"case",
"of",
"copy",
"from",
"template",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java#L586-L605 | train | Sets the title of the folder. | Create a Java method that does the following: "Sets the title of the folder.". | Of course, here is the Java code you requested:
```java
private void setFolderTitle(CmsResource res) {
try {
CmsProperty titleProperty = m_cms.readPropertyObject(res, CmsPropertyDefinition.PROPERTY_TITLE, false);
if (!titleProperty.isNullProperty()) {
titleProperty.setV... | |
conveyal/gtfs-lib | src/main/java/com/conveyal/gtfs/model/CalendarDate.java | CalendarDate.setStatementParameters | @Override
public void setStatementParameters(PreparedStatement statement, boolean setDefaultId) throws SQLException {
int oneBasedIndex = 1;
if (!setDefaultId) statement.setInt(oneBasedIndex++, id);
DateField dateField = (DateField) Table.CALENDAR_DATES.getFieldForName("date");
state... | java | @Override
public void setStatementParameters(PreparedStatement statement, boolean setDefaultId) throws SQLException {
int oneBasedIndex = 1;
if (!setDefaultId) statement.setInt(oneBasedIndex++, id);
DateField dateField = (DateField) Table.CALENDAR_DATES.getFieldForName("date");
state... | [
"@",
"Override",
"public",
"void",
"setStatementParameters",
"(",
"PreparedStatement",
"statement",
",",
"boolean",
"setDefaultId",
")",
"throws",
"SQLException",
"{",
"int",
"oneBasedIndex",
"=",
"1",
";",
"if",
"(",
"!",
"setDefaultId",
")",
"statement",
".",
... | Sets the parameters for a prepared statement following the parameter order defined in
{@link com.conveyal.gtfs.loader.Table#CALENDAR_DATES}. JDBC prepared statement parameters use a one-based index. | [
"Sets",
"the",
"parameters",
"for",
"a",
"prepared",
"statement",
"following",
"the",
"parameter",
"order",
"defined",
"in",
"{"
] | ba9e19563af9f52d4eb0eac60327d9f39ebd19f7 | https://github.com/conveyal/gtfs-lib/blob/ba9e19563af9f52d4eb0eac60327d9f39ebd19f7/src/main/java/com/conveyal/gtfs/model/CalendarDate.java#L35-L43 | valid | Set the parameters of the calendar_context to the statement. | Create a Java method that does the following: "Set the parameters of the calendar_context to the statement.". | Of course, here is the Java code you requested:
```java
@Override
public void setStatementParameters(PreparedStatement statement, boolean setDefaultId) throws SQLException {
int oneBasedIndex = 1;
if (!setDefaultId) statement.setInt(oneBasedIndex++, id);
DateField dateField = (DateField) Ta... | |
dnsjava/dnsjava | org/xbill/DNS/Tokenizer.java | Tokenizer.get | public Token
get(boolean wantWhitespace, boolean wantComment) throws IOException {
int type;
int c;
if (ungottenToken) {
ungottenToken = false;
if (current.type == WHITESPACE) {
if (wantWhitespace)
return current;
} else if (current.type == COMMENT) {
if (wantComment)
return current;
} else {
... | java | public Token
get(boolean wantWhitespace, boolean wantComment) throws IOException {
int type;
int c;
if (ungottenToken) {
ungottenToken = false;
if (current.type == WHITESPACE) {
if (wantWhitespace)
return current;
} else if (current.type == COMMENT) {
if (wantComment)
return current;
} else {
... | [
"public",
"Token",
"get",
"(",
"boolean",
"wantWhitespace",
",",
"boolean",
"wantComment",
")",
"throws",
"IOException",
"{",
"int",
"type",
";",
"int",
"c",
";",
"if",
"(",
"ungottenToken",
")",
"{",
"ungottenToken",
"=",
"false",
";",
"if",
"(",
"current... | Gets the next token from a tokenizer.
@param wantWhitespace If true, leading whitespace will be returned as a
token.
@param wantComment If true, comments are returned as tokens.
@return The next token in the stream.
@throws TextParseException The input was invalid.
@throws IOException An I/O error occurred. | [
"Gets",
"the",
"next",
"token",
"from",
"a",
"tokenizer",
"."
] | d97b6a0685d59143372bb392ab591dd8dd840b61 | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Tokenizer.java#L233-L336 | train | Get the next token from the stream. | Create a Java method that does the following: "Get the next token from the stream.". | Of course, here is the Java code you requested:
```java
public Token
get(boolean wantWhitespace, boolean wantComment) throws IOException {
int type;
int c;
if (ungottenToken) {
ungottenToken = false;
if (current.type == WHITESPACE) {
if (wantWhitespace)
return current;
} else if (current.type == COMME... | |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion10.java | CmsImportVersion10.parseLinks | public static void parseLinks(CmsObject cms, List<CmsResource> parseables, I_CmsReport report) {
int i = 0;
sortParseableResources(parseables);
for (CmsResource parsableRes : parseables) {
String resName = cms.getSitePath(parsableRes);
report.print(
org... | java | public static void parseLinks(CmsObject cms, List<CmsResource> parseables, I_CmsReport report) {
int i = 0;
sortParseableResources(parseables);
for (CmsResource parsableRes : parseables) {
String resName = cms.getSitePath(parsableRes);
report.print(
org... | [
"public",
"static",
"void",
"parseLinks",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"parseables",
",",
"I_CmsReport",
"report",
")",
"{",
"int",
"i",
"=",
"0",
";",
"sortParseableResources",
"(",
"parseables",
")",
";",
"for",
"(",
"Cm... | Parses the links.<p>
@param cms the CMS context to use
@param parseables the list of resources for which to parse the links
@param report the report | [
"Parses",
"the",
"links",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion10.java#L582-L634 | train | Parses the links for the resources in the list of parseables. | Create a Java method that does the following: "Parses the links for the resources in the list of parseables.". | Of course, here is the Java code you requested:
```java
public static void parseLinks(CmsObject cms, List<CmsResource> parseables, I_CmsReport report) {
int i = 0;
sortParseableResources(parseables);
for (CmsResource parsableRes : parseables) {
String resName = cms.getSitePath(par... | |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ClassLoader.java | ClassLoader.defineClass | protected final Class<?> defineClass(String name, byte[] b, int off, int len,
ProtectionDomain protectionDomain)
throws ClassFormatError
{
throw new UnsupportedOperationException("can't load this type of class file");
} | java | protected final Class<?> defineClass(String name, byte[] b, int off, int len,
ProtectionDomain protectionDomain)
throws ClassFormatError
{
throw new UnsupportedOperationException("can't load this type of class file");
} | [
"protected",
"final",
"Class",
"<",
"?",
">",
"defineClass",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
",",
"ProtectionDomain",
"protectionDomain",
")",
"throws",
"ClassFormatError",
"{",
"throw",
"new",
"Unsu... | Android-changed: Remove <tt> from link for NoClassDefFoundError | [
"Android",
"-",
"changed",
":",
"Remove",
"<tt",
">",
"from",
"link",
"for",
"NoClassDefFoundError"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ClassLoader.java#L535-L540 | train | Defines a class from a byte array of bytes. | Create a Java method that does the following: "Defines a class from a byte array of bytes.". | Of course, here is the Java code you requested:
```java
protected final Class<?> defineClass(String name, byte[] b, int off, int len,
ProtectionDomain protectionDomain)
throws ClassFormatError
{
throw new UnsupportedOperationException("can't load this type o... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java | EJBMDOrchestrator.finishBMDInitWithReferenceContext | public void finishBMDInitWithReferenceContext(BeanMetaData bmd) throws ContainerException, EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) //367834.5
Tr.entry(tc, "finishBMDInitWithReferenceContext", bmd.j2eeN... | java | public void finishBMDInitWithReferenceContext(BeanMetaData bmd) throws ContainerException, EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) //367834.5
Tr.entry(tc, "finishBMDInitWithReferenceContext", bmd.j2eeN... | [
"public",
"void",
"finishBMDInitWithReferenceContext",
"(",
"BeanMetaData",
"bmd",
")",
"throws",
"ContainerException",
",",
"EJBConfigurationException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
... | F743-17630 refactored method F743-17630CodRv | [
"F743",
"-",
"17630",
"refactored",
"method",
"F743",
"-",
"17630CodRv"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java#L598-L761 | train | Finish the initialization of a BeanMetaData object with a reference context. | Create a Java method that does the following: "Finish the initialization of a BeanMetaData object with a reference context.". | Of course, here is the Java code you requested:
```java
public void finishBMDInitWithReferenceContext(BeanMetaData bmd) throws ContainerException, EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) //367834.5
Tr... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/IELImpl.java | IELImpl.eIsSet | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IEL__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(featureID);
} | java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IEL__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(featureID);
} | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"IEL__TRIPLETS",
":",
"return",
"triplets",
"!=",
"null",
"&&",
"!",
"triplets",
".",
"isEmpty",
"(",
")"... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/IELImpl.java#L144-L151 | train | Replies if the feature is set to a value. | Create a Java method that does the following: "Replies if the feature is set to a value.". | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IEL__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(featureID);
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.