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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/mains/BeagleMain.java | BeagleMain.addExtraOptions | public void addExtraOptions(ArgOptions options) {
options.addOption('n', "dimension",
"the length of each beagle vector",
true, "INT", "Options");
options.addOption('s', "semanticType",
"The type of semantic vectors to generat... | java | public void addExtraOptions(ArgOptions options) {
options.addOption('n', "dimension",
"the length of each beagle vector",
true, "INT", "Options");
options.addOption('s', "semanticType",
"The type of semantic vectors to generat... | [
"public",
"void",
"addExtraOptions",
"(",
"ArgOptions",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"'",
"'",
",",
"\"dimension\"",
",",
"\"the length of each beagle vector\"",
",",
"true",
",",
"\"INT\"",
",",
"\"Options\"",
")",
";",
"options",
".",... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/mains/BeagleMain.java#L107-L120 | train | Add extra options to the ArgOptions object. | Create a Java method that does the following: "Add extra options to the ArgOptions object.". | Of course, here is the Java code you requested:
```java
public void addExtraOptions(ArgOptions options) {
options.addOption('n', "dimension",
"the length of each beagle vector",
true, "INT", "Options");
options.addOption('s', "semanticType",
... | |
apache/parquet-mr | parquet-column/src/main/java/org/apache/parquet/column/values/ValuesReader.java | ValuesReader.initFromPage | public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException {
if (actualOffset != -1) {
throw new UnsupportedOperationException(
"Either initFromPage(int, ByteBuffer, int) or initFromPage(int, ByteBufferInputStream) must be implemented in "
+ getClass().getNam... | java | public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException {
if (actualOffset != -1) {
throw new UnsupportedOperationException(
"Either initFromPage(int, ByteBuffer, int) or initFromPage(int, ByteBufferInputStream) must be implemented in "
+ getClass().getNam... | [
"public",
"void",
"initFromPage",
"(",
"int",
"valueCount",
",",
"ByteBufferInputStream",
"in",
")",
"throws",
"IOException",
"{",
"if",
"(",
"actualOffset",
"!=",
"-",
"1",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Either initFromPage(int, ... | Called to initialize the column reader from a part of a page.
Implementations must consume all bytes from the input stream, leaving the
stream ready to read the next section of data. The underlying
implementation knows how much data to read, so a length is not provided.
Each page may contain several sections:
<ul>
<l... | [
"Called",
"to",
"initialize",
"the",
"column",
"reader",
"from",
"a",
"part",
"of",
"a",
"page",
"."
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/column/values/ValuesReader.java#L109-L116 | test | Initializes the sequence from a page of bytes. | Create a Java method that does the following: "Initializes the sequence from a page of bytes.". | Of course, here is the Java code you requested:
```java
public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException {
if (actualOffset != -1) {
throw new UnsupportedOperationException(
"Either initFromPage(int, ByteBuffer, int) or initFromPage(int, ByteBufferInputStream) m... | |
demidenko05/beigesoft-android-sqlite | src/main/java/org/beigesoft/android/sqlite/service/SrvDatabase.java | SrvDatabase.executeUpdate | @Override
public final int executeUpdate(final String pTable,
final ColumnsValues pColumnsVals,
final String pWhere) throws Exception {
try {
if (getLogger().getIsShowDebugMessagesFor(getClass())
&& getLogger().getDetailLevel() > 30000) {
getLogger().debug(null, SrvDatabase.class, "... | java | @Override
public final int executeUpdate(final String pTable,
final ColumnsValues pColumnsVals,
final String pWhere) throws Exception {
try {
if (getLogger().getIsShowDebugMessagesFor(getClass())
&& getLogger().getDetailLevel() > 30000) {
getLogger().debug(null, SrvDatabase.class, "... | [
"@",
"Override",
"public",
"final",
"int",
"executeUpdate",
"(",
"final",
"String",
"pTable",
",",
"final",
"ColumnsValues",
"pColumnsVals",
",",
"final",
"String",
"pWhere",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"getLogger",
"(",
")",
".",... | <p>Execute SQL UPDATE that returns affected rows.
It is to adapt Android insert/update/delete interface.
</p>
@param pTable table name
@param pColumnsVals type-safe map column name - column value
@param pWhere where conditions e.g. "itsId=2"
@return row count affected
@throws ExceptionWithCode - if an exception occured | [
"<p",
">",
"Execute",
"SQL",
"UPDATE",
"that",
"returns",
"affected",
"rows",
".",
"It",
"is",
"to",
"adapt",
"Android",
"insert",
"/",
"update",
"/",
"delete",
"interface",
".",
"<",
"/",
"p",
">"
] | 5d4a05e7248b3a764072562b6be808fa31376e57 | https://github.com/demidenko05/beigesoft-android-sqlite/blob/5d4a05e7248b3a764072562b6be808fa31376e57/src/main/java/org/beigesoft/android/sqlite/service/SrvDatabase.java#L243-L267 | train | Override the executeUpdate method. | Create a Java method that does the following: "Override the executeUpdate method.". | Of course, here is the Java code you requested:
```java
@Override
public final int executeUpdate(final String pTable,
final ColumnsValues pColumnsVals,
final String pWhere) throws Exception {
try {
if (getLogger().getIsShowDebugMessagesFor(getClass())
&& getLogger().getDetailLevel() > 3000... | |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BooleanField.java | BooleanField.write | public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Boolean boData = (Boolean)this.getData();
boolean bData;
if (boData == null)
bData = Boolean.FALSE.booleanValue(); // HACK
else
bData = boData.booleanV... | java | public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Boolean boData = (Boolean)this.getData();
boolean bData;
if (boData == null)
bData = Boolean.FALSE.booleanValue(); // HACK
else
bData = boData.booleanV... | [
"public",
"boolean",
"write",
"(",
"DataOutputStream",
"daOut",
",",
"boolean",
"bFixedLength",
")",
"{",
"try",
"{",
"Boolean",
"boData",
"=",
"(",
"Boolean",
")",
"this",
".",
"getData",
"(",
")",
";",
"boolean",
"bData",
";",
"if",
"(",
"boData",
"=="... | Write the physical data in this field to a stream file.
@param daOut Output stream to add this field to.
@param bFixedLength If false (default) be sure to get the length from the stream.
@return boolean Success? | [
"Write",
"the",
"physical",
"data",
"in",
"this",
"field",
"to",
"a",
"stream",
"file",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BooleanField.java#L343-L358 | train | Write the content of this object to the specified output stream. | Create a Java method that does the following: "Write the content of this object to the specified output stream.". | Of course, here is the Java code you requested:
```java
public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Boolean boData = (Boolean)this.getData();
boolean bData;
if (boData == null)
bData = Boolean.FALSE.booleanValue(); // HACK... | |
aws/aws-sdk-java | aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/BatchGetApplicationsResult.java | BatchGetApplicationsResult.getApplicationsInfo | public java.util.List<ApplicationInfo> getApplicationsInfo() {
if (applicationsInfo == null) {
applicationsInfo = new com.amazonaws.internal.SdkInternalList<ApplicationInfo>();
}
return applicationsInfo;
} | java | public java.util.List<ApplicationInfo> getApplicationsInfo() {
if (applicationsInfo == null) {
applicationsInfo = new com.amazonaws.internal.SdkInternalList<ApplicationInfo>();
}
return applicationsInfo;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"ApplicationInfo",
">",
"getApplicationsInfo",
"(",
")",
"{",
"if",
"(",
"applicationsInfo",
"==",
"null",
")",
"{",
"applicationsInfo",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalL... | <p>
Information about the applications.
</p>
@return Information about the applications. | [
"<p",
">",
"Information",
"about",
"the",
"applications",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/BatchGetApplicationsResult.java#L44-L49 | train | Gets the value of the applicationsInfo property. | Create a Java method that does the following: "Gets the value of the applicationsInfo property.". | Of course, here is the Java code you requested:
```java
public java.util.List<ApplicationInfo> getApplicationsInfo() {
if (applicationsInfo == null) {
applicationsInfo = new com.amazonaws.internal.SdkInternalList<ApplicationInfo>();
}
return applicationsInfo;
}
```
Hope this he... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/utils/FileLogHolder.java | FileLogHolder.getTc | private static TraceComponent getTc() {
if (tc == null) {
tc = Tr.register(FileLogHolder.class, null, "com.ibm.ws.logging.internal.resources.LoggingMessages");
}
return tc;
} | java | private static TraceComponent getTc() {
if (tc == null) {
tc = Tr.register(FileLogHolder.class, null, "com.ibm.ws.logging.internal.resources.LoggingMessages");
}
return tc;
} | [
"private",
"static",
"TraceComponent",
"getTc",
"(",
")",
"{",
"if",
"(",
"tc",
"==",
"null",
")",
"{",
"tc",
"=",
"Tr",
".",
"register",
"(",
"FileLogHolder",
".",
"class",
",",
"null",
",",
"\"com.ibm.ws.logging.internal.resources.LoggingMessages\"",
")",
";... | This method will get an instance of TraceComponent
@return | [
"This",
"method",
"will",
"get",
"an",
"instance",
"of",
"TraceComponent"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/utils/FileLogHolder.java#L107-L112 | train | Get the tc object. | Create a Java method that does the following: "Get the tc object.". | Of course, here is the Java code you requested:
```java
private static TraceComponent getTc() {
if (tc == null) {
tc = Tr.register(FileLogHolder.class, null, "com.ibm.ws.logging.internal.resources.LoggingMessages");
}
return tc;
}
```
Hope this helps! | |
pressgang-ccms/PressGangCCMSModel | src/main/java/org/jboss/pressgang/ccms/model/Topic.java | Topic.getTopicSearchText | @Transient
public String getTopicSearchText() {
if (topicXML == null) return "";
final Source source = new Source(topicXML);
source.fullSequentialParse();
return source.getTextExtractor().toString();
} | java | @Transient
public String getTopicSearchText() {
if (topicXML == null) return "";
final Source source = new Source(topicXML);
source.fullSequentialParse();
return source.getTextExtractor().toString();
} | [
"@",
"Transient",
"public",
"String",
"getTopicSearchText",
"(",
")",
"{",
"if",
"(",
"topicXML",
"==",
"null",
")",
"return",
"\"\"",
";",
"final",
"Source",
"source",
"=",
"new",
"Source",
"(",
"topicXML",
")",
";",
"source",
".",
"fullSequentialParse",
... | This function will take the XML in the topicXML String and use it to generate a text only view.
The text extraction uses Jericho - http://jericho.htmlparser.net/ | [
"This",
"function",
"will",
"take",
"the",
"XML",
"in",
"the",
"topicXML",
"String",
"and",
"use",
"it",
"to",
"generate",
"a",
"text",
"only",
"view",
".",
"The",
"text",
"extraction",
"uses",
"Jericho",
"-",
"http",
":",
"//",
"jericho",
".",
"htmlpars... | d70d6aab347a02a978f3c55c7314ab5eeea806c5 | https://github.com/pressgang-ccms/PressGangCCMSModel/blob/d70d6aab347a02a978f3c55c7314ab5eeea806c5/src/main/java/org/jboss/pressgang/ccms/model/Topic.java#L315-L322 | valid | Get the text of the topic search. | Create a Java method that does the following: "Get the text of the topic search.". | Of course, here is the Java code you requested:
```java
@Transient
public String getTopicSearchText() {
if (topicXML == null) return "";
final Source source = new Source(topicXML);
source.fullSequentialParse();
return source.getTextExtractor().toString();
}
```
Hope this helps... | |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/SheetBindingErrors.java | SheetBindingErrors.getFieldType | public Class<?> getFieldType(final String field) {
final String fieldPath = buildFieldPath(field);
Class<?> type = propertyTypeNavigator.getPropertyType(target.getClass(), fieldPath);
if(type != null) {
return type;
}
return getActualFieldTyp... | java | public Class<?> getFieldType(final String field) {
final String fieldPath = buildFieldPath(field);
Class<?> type = propertyTypeNavigator.getPropertyType(target.getClass(), fieldPath);
if(type != null) {
return type;
}
return getActualFieldTyp... | [
"public",
"Class",
"<",
"?",
">",
"getFieldType",
"(",
"final",
"String",
"field",
")",
"{",
"final",
"String",
"fieldPath",
"=",
"buildFieldPath",
"(",
"field",
")",
";",
"Class",
"<",
"?",
">",
"type",
"=",
"propertyTypeNavigator",
".",
"getPropertyType",
... | 指定したパスのフィールドのクラスタイプを取得する。
@since 2.0
@param field フィールド名
@return クラスタイプ。ただし、リストなどGenericsのタイプが指定されていない場合、クラスタイプもnullとなる。 | [
"指定したパスのフィールドのクラスタイプを取得する。"
] | a0c6b25c622e5f3a50b199ef685d2ee46ad5483c | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/SheetBindingErrors.java#L178-L187 | train | Gets the field type. | Create a Java method that does the following: "Gets the field type.". | Of course, here is the Java code you requested:
```java
public Class<?> getFieldType(final String field) {
final String fieldPath = buildFieldPath(field);
Class<?> type = propertyTypeNavigator.getPropertyType(target.getClass(), fieldPath);
if(type != null) {
return typ... | |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OServerConfigAuthenticator.java | OServerConfigAuthenticator.authenticate | public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServerConfig() != null) {
OServerUserConfiguration userCfg = null;
// This will throw an IllegalArgumentException if username is null or empty.
// However, a null or e... | java | public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServerConfig() != null) {
OServerUserConfiguration userCfg = null;
// This will throw an IllegalArgumentException if username is null or empty.
// However, a null or e... | [
"public",
"String",
"authenticate",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"String",
"principal",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"getServerConfig",
"(",
")",
"!=",
"null",
")",
"{",
"OServerUserConfigurati... | Returns the actual username if successful, null otherwise. | [
"Returns",
"the",
"actual",
"username",
"if",
"successful",
"null",
"otherwise",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OServerConfigAuthenticator.java#L44-L69 | test | Authenticate method. | Create a Java method that does the following: "Authenticate method.". | Of course, here is the Java code you requested:
```java
public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServerConfig() != null) {
OServerUserConfiguration userCfg = null;
// This will throw an IllegalArgumentException if u... | |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/util/MtasSolrBaseList.java | MtasSolrBaseList.createListOutput | public SimpleOrderedMap<Object> createListOutput(boolean shardRequests, int maxNumber) {
garbageCollect();
SimpleOrderedMap<Object> output = new SimpleOrderedMap<>();
output.add(NAME_ENABLED, enabled());
output.add(NAME_ENABLED, true);
int numberTotal = data.size();
ListData listData = new ListD... | java | public SimpleOrderedMap<Object> createListOutput(boolean shardRequests, int maxNumber) {
garbageCollect();
SimpleOrderedMap<Object> output = new SimpleOrderedMap<>();
output.add(NAME_ENABLED, enabled());
output.add(NAME_ENABLED, true);
int numberTotal = data.size();
ListData listData = new ListD... | [
"public",
"SimpleOrderedMap",
"<",
"Object",
">",
"createListOutput",
"(",
"boolean",
"shardRequests",
",",
"int",
"maxNumber",
")",
"{",
"garbageCollect",
"(",
")",
";",
"SimpleOrderedMap",
"<",
"Object",
">",
"output",
"=",
"new",
"SimpleOrderedMap",
"<>",
"("... | Creates the list output.
@param shardRequests the shard requests
@param maxNumber the max number
@return the simple ordered map | [
"Creates",
"the",
"list",
"output",
"."
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/util/MtasSolrBaseList.java#L170-L202 | train | Create list output. | Create a Java method that does the following: "Create list output.". | Of course, here is the Java code you requested:
```java
public SimpleOrderedMap<Object> createListOutput(boolean shardRequests, int maxNumber) {
garbageCollect();
SimpleOrderedMap<Object> output = new SimpleOrderedMap<>();
output.add(NAME_ENABLED, enabled());
output.add(NAME_ENABLED, true);
int num... | |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentService.java | CmsContentService.getChangeHandlerScopes | private Set<String> getChangeHandlerScopes(CmsXmlContentDefinition definition) {
List<I_CmsXmlContentEditorChangeHandler> changeHandlers = definition.getContentHandler().getEditorChangeHandlers();
Set<String> scopes = new HashSet<String>();
for (I_CmsXmlContentEditorChangeHandler handler : chan... | java | private Set<String> getChangeHandlerScopes(CmsXmlContentDefinition definition) {
List<I_CmsXmlContentEditorChangeHandler> changeHandlers = definition.getContentHandler().getEditorChangeHandlers();
Set<String> scopes = new HashSet<String>();
for (I_CmsXmlContentEditorChangeHandler handler : chan... | [
"private",
"Set",
"<",
"String",
">",
"getChangeHandlerScopes",
"(",
"CmsXmlContentDefinition",
"definition",
")",
"{",
"List",
"<",
"I_CmsXmlContentEditorChangeHandler",
">",
"changeHandlers",
"=",
"definition",
".",
"getContentHandler",
"(",
")",
".",
"getEditorChange... | Returns the change handler scopes.<p>
@param definition the content definition
@return the scopes | [
"Returns",
"the",
"change",
"handler",
"scopes",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentService.java#L1741-L1750 | train | Evaluate the scopes of all editor change handlers. | Create a Java method that does the following: "Evaluate the scopes of all editor change handlers.". | Of course, here is the Java code you requested:
```java
private Set<String> getChangeHandlerScopes(CmsXmlContentDefinition definition) {
List<I_CmsXmlContentEditorChangeHandler> changeHandlers = definition.getContentHandler().getEditorChangeHandlers();
Set<String> scopes = new HashSet<String>();
... | |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/GetMediaForFragmentListRequest.java | GetMediaForFragmentListRequest.withFragments | public GetMediaForFragmentListRequest withFragments(String... fragments) {
if (this.fragments == null) {
setFragments(new java.util.ArrayList<String>(fragments.length));
}
for (String ele : fragments) {
this.fragments.add(ele);
}
return this;
} | java | public GetMediaForFragmentListRequest withFragments(String... fragments) {
if (this.fragments == null) {
setFragments(new java.util.ArrayList<String>(fragments.length));
}
for (String ele : fragments) {
this.fragments.add(ele);
}
return this;
} | [
"public",
"GetMediaForFragmentListRequest",
"withFragments",
"(",
"String",
"...",
"fragments",
")",
"{",
"if",
"(",
"this",
".",
"fragments",
"==",
"null",
")",
"{",
"setFragments",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"String",
">",
"(",... | <p>
A list of the numbers of fragments for which to retrieve media. You retrieve these values with
<a>ListFragments</a>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setFragments(java.util.Collection)} or {@link #withFragments(java.util.Collection)} if you want to
over... | [
"<p",
">",
"A",
"list",
"of",
"the",
"numbers",
"of",
"fragments",
"for",
"which",
"to",
"retrieve",
"media",
".",
"You",
"retrieve",
"these",
"values",
"with",
"<a",
">",
"ListFragments<",
"/",
"a",
">",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/GetMediaForFragmentListRequest.java#L133-L141 | train | A list of the ID of the media that contains the media fragments. | Create a Java method that does the following: "A list of the ID of the media that contains the media fragments.". | Of course, here is the Java code you requested:
```java
public GetMediaForFragmentListRequest withFragments(String... fragments) {
if (this.fragments == null) {
setFragments(new java.util.ArrayList<String>(fragments.length));
}
for (String ele : fragments) {
this.fragmen... | |
tomgibara/bits | src/main/java/com/tomgibara/bits/BitVector.java | BitVector.range | @Override
public BitVector range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (to < from) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return new BitVector(from, to, bits, mutable);
} | java | @Override
public BitVector range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (to < from) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return new BitVector(from, to, bits, mutable);
} | [
"@",
"Override",
"public",
"BitVector",
"range",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"if",
"(",
"to",
"<",
"from",
")",
"throw",
"new",
"IllegalA... | bypasses duplicate for efficiency | [
"bypasses",
"duplicate",
"for",
"efficiency"
] | 56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97 | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/BitVector.java#L697-L705 | train | Returns a new range of bits. | Create a Java method that does the following: "Returns a new range of bits.". | Of course, here is the Java code you requested:
```java
@Override
public BitVector range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (to < from) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return ne... | |
RestComm/sip-servlets | containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContext.java | SipStandardContext.getNamingContextName | private String getNamingContextName() {
if (namingContextName == null) {
Container parent = getParent();
if (parent == null) {
namingContextName = getName();
} else {
Stack<String> stk = new Stack<String>();
StringBuffer buff = new StringBuffer();
while (parent != null) {
stk.pus... | java | private String getNamingContextName() {
if (namingContextName == null) {
Container parent = getParent();
if (parent == null) {
namingContextName = getName();
} else {
Stack<String> stk = new Stack<String>();
StringBuffer buff = new StringBuffer();
while (parent != null) {
stk.pus... | [
"private",
"String",
"getNamingContextName",
"(",
")",
"{",
"if",
"(",
"namingContextName",
"==",
"null",
")",
"{",
"Container",
"parent",
"=",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"namingContextName",
"=",
"getName",
"(... | Get naming context full name. | [
"Get",
"naming",
"context",
"full",
"name",
"."
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContext.java#L1028-L1048 | train | Gets the naming context name. | Create a Java method that does the following: "Gets the naming context name.". | Of course, here is the Java code you requested:
```java
private String getNamingContextName() {
if (namingContextName == null) {
Container parent = getParent();
if (parent == null) {
namingContextName = getName();
} else {
Stack<String> stk = new Stack<String>();
StringBuffer buff = new ... | |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/RelationGraph.java | RelationGraph.render | public void render(@NonNull Resource output) throws IOException {
render(output, GraphViz.Format.PNG);
} | java | public void render(@NonNull Resource output) throws IOException {
render(output, GraphViz.Format.PNG);
} | [
"public",
"void",
"render",
"(",
"@",
"NonNull",
"Resource",
"output",
")",
"throws",
"IOException",
"{",
"render",
"(",
"output",
",",
"GraphViz",
".",
"Format",
".",
"PNG",
")",
";",
"}"
] | Renders the graph using {@link GraphViz} in PNG format to specified output location.
@param output the PNG file to render the graph to
@throws IOException Something went wrong rendering the graph | [
"Renders",
"the",
"graph",
"using",
"{",
"@link",
"GraphViz",
"}",
"in",
"PNG",
"format",
"to",
"specified",
"output",
"location",
"."
] | 9ebefe7ad5dea1b731ae6931a30771eb75325ea3 | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/RelationGraph.java#L181-L183 | train | Renders the image to the specified output resource. | Create a Java method that does the following: "Renders the image to the specified output resource.". | Of course, here is the Java code you requested:
```java
public void render(@NonNull Resource output) throws IOException {
render(output, GraphViz.Format.PNG);
}
```
Hope this helps! | |
kiswanij/jk-util | src/main/java/com/jk/util/logging/JKLogger.java | JKLogger.trace | public void trace(Object format, Object... msg) {
if (logger.isTraceEnabled()) {
if (format.toString().contains("{")) {
logger.trace(format.toString(), msg);
} else {
logger.trace(format.toString().concat(" ").concat(JKStringUtil.concat(msg)));
}
}
} | java | public void trace(Object format, Object... msg) {
if (logger.isTraceEnabled()) {
if (format.toString().contains("{")) {
logger.trace(format.toString(), msg);
} else {
logger.trace(format.toString().concat(" ").concat(JKStringUtil.concat(msg)));
}
}
} | [
"public",
"void",
"trace",
"(",
"Object",
"format",
",",
"Object",
"...",
"msg",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"if",
"(",
"format",
".",
"toString",
"(",
")",
".",
"contains",
"(",
"\"{\"",
")",
")",
"{",... | Trace.
@param format the format
@param msg the msg | [
"Trace",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/logging/JKLogger.java#L105-L113 | train | Log a message at trace level. | Create a Java method that does the following: "Log a message at trace level.". | Of course, here is the Java code you requested:
```java
public void trace(Object format, Object... msg) {
if (logger.isTraceEnabled()) {
if (format.toString().contains("{")) {
logger.trace(format.toString(), msg);
} else {
logger.trace(format.toString().concat(" ").concat(JKStringUtil.concat(msg)));
... | |
FitLayout/classify | src/main/java/org/fit/layout/classify/StyleCounter.java | StyleCounter.getMaximalFrequency | public int getMaximalFrequency()
{
int maxfreq = 0;
for (Map.Entry<T, Integer> entry : styles.entrySet())
{
if (entry.getValue() > maxfreq)
maxfreq = entry.getValue();
}
return maxfreq;
} | java | public int getMaximalFrequency()
{
int maxfreq = 0;
for (Map.Entry<T, Integer> entry : styles.entrySet())
{
if (entry.getValue() > maxfreq)
maxfreq = entry.getValue();
}
return maxfreq;
} | [
"public",
"int",
"getMaximalFrequency",
"(",
")",
"{",
"int",
"maxfreq",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"T",
",",
"Integer",
">",
"entry",
":",
"styles",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"entry",
".",
"getValue"... | Gets the number of the most frequent entry.
@return the number of occurences of the most frequent entry | [
"Gets",
"the",
"number",
"of",
"the",
"most",
"frequent",
"entry",
"."
] | 0b43ceb2f0be4e6d26263491893884d811f0d605 | https://github.com/FitLayout/classify/blob/0b43ceb2f0be4e6d26263491893884d811f0d605/src/main/java/org/fit/layout/classify/StyleCounter.java#L64-L73 | train | Gets the maximal frequency of all the classes in the class. | Create a Java method that does the following: "Gets the maximal frequency of all the classes in the class.". | Of course, here is the Java code you requested:
```java
public int getMaximalFrequency()
{
int maxfreq = 0;
for (Map.Entry<T, Integer> entry : styles.entrySet())
{
if (entry.getValue() > maxfreq)
maxfreq = entry.getValue();
}
return maxfreq;
}... | |
filestack/filestack-android | filestack/src/main/java/com/filestack/android/internal/Util.java | Util.trimLastPathSection | public static String trimLastPathSection(String path) {
String[] sections = path.split("/");
StringBuilder newPath = new StringBuilder("/");
for (int i = 1; i < sections.length - 1; i++) {
newPath.append(sections[i]).append("/");
}
return newPath.toString();
} | java | public static String trimLastPathSection(String path) {
String[] sections = path.split("/");
StringBuilder newPath = new StringBuilder("/");
for (int i = 1; i < sections.length - 1; i++) {
newPath.append(sections[i]).append("/");
}
return newPath.toString();
} | [
"public",
"static",
"String",
"trimLastPathSection",
"(",
"String",
"path",
")",
"{",
"String",
"[",
"]",
"sections",
"=",
"path",
".",
"split",
"(",
"\"/\"",
")",
";",
"StringBuilder",
"newPath",
"=",
"new",
"StringBuilder",
"(",
"\"/\"",
")",
";",
"for",... | Removes the last part of a file path. | [
"Removes",
"the",
"last",
"part",
"of",
"a",
"file",
"path",
"."
] | 8dafa1cb5c77542c351d631be0742717b5a9d45d | https://github.com/filestack/filestack-android/blob/8dafa1cb5c77542c351d631be0742717b5a9d45d/filestack/src/main/java/com/filestack/android/internal/Util.java#L146-L153 | train | Trims the last path section of a path. | Create a Java method that does the following: "Trims the last path section of a path.". | Of course, here is the Java code you requested:
```java
public static String trimLastPathSection(String path) {
String[] sections = path.split("/");
StringBuilder newPath = new StringBuilder("/");
for (int i = 1; i < sections.length - 1; i++) {
newPath.append(sections[i]).append("/"... | |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/InstantiationUtils.java | InstantiationUtils.instantiate | public static <T> T instantiate(String type, Class<T> requiredType) {
try {
return ClassUtils.forName(type, requiredType.getClassLoader())
.flatMap((Function<Class, Optional<T>>) aClass -> {
if (requiredType == aClass || requiredType.isAssignableFrom(aClass)) {
... | java | public static <T> T instantiate(String type, Class<T> requiredType) {
try {
return ClassUtils.forName(type, requiredType.getClassLoader())
.flatMap((Function<Class, Optional<T>>) aClass -> {
if (requiredType == aClass || requiredType.isAssignableFrom(aClass)) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"instantiate",
"(",
"String",
"type",
",",
"Class",
"<",
"T",
">",
"requiredType",
")",
"{",
"try",
"{",
"return",
"ClassUtils",
".",
"forName",
"(",
"type",
",",
"requiredType",
".",
"getClassLoader",
"(",
")",
... | Instantiate the given class rethrowing any exceptions as {@link InstantiationException}.
@param type The type
@param requiredType The required type
@param <T> The type
@return The instantiated instance
@throws InstantiationException When an error occurs | [
"Instantiate",
"the",
"given",
"class",
"rethrowing",
"any",
"exceptions",
"as",
"{",
"@link",
"InstantiationException",
"}",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/InstantiationUtils.java#L179-L192 | train | Instantiate a class from a string type. | Create a Java method that does the following: "Instantiate a class from a string type.". | Of course, here is the Java code you requested:
```java
public static <T> T instantiate(String type, Class<T> requiredType) {
try {
return ClassUtils.forName(type, requiredType.getClassLoader())
.flatMap((Function<Class, Optional<T>>) aClass -> {
if (requiredType... | |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/metrics/HystrixMetricsPublisherFactory.java | HystrixMetricsPublisherFactory.createOrRetrievePublisherForCommand | public static HystrixMetricsPublisherCommand createOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {
return SINGLETON.getPublisherForCommand(commandKey, comm... | java | public static HystrixMetricsPublisherCommand createOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {
return SINGLETON.getPublisherForCommand(commandKey, comm... | [
"public",
"static",
"HystrixMetricsPublisherCommand",
"createOrRetrievePublisherForCommand",
"(",
"HystrixCommandKey",
"commandKey",
",",
"HystrixCommandGroupKey",
"commandOwner",
",",
"HystrixCommandMetrics",
"metrics",
",",
"HystrixCircuitBreaker",
"circuitBreaker",
",",
"Hystrix... | Get an instance of {@link HystrixMetricsPublisherCommand} with the given factory {@link HystrixMetricsPublisher} implementation for each {@link HystrixCommand} instance.
@param commandKey
Pass-thru to {@link HystrixMetricsPublisher#getMetricsPublisherForCommand} implementation
@param commandOwner
Pass-thru to {@link H... | [
"Get",
"an",
"instance",
"of",
"{",
"@link",
"HystrixMetricsPublisherCommand",
"}",
"with",
"the",
"given",
"factory",
"{",
"@link",
"HystrixMetricsPublisher",
"}",
"implementation",
"for",
"each",
"{",
"@link",
"HystrixCommand",
"}",
"instance",
"."
] | 3cb21589895e9f8f87cfcdbc9d96d9f63d48b848 | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/metrics/HystrixMetricsPublisherFactory.java#L82-L84 | train | Creates or retrieves a publisher for the given command. | Create a Java method that does the following: "Creates or retrieves a publisher for the given command.". | Of course, here is the Java code you requested:
```java
public static HystrixMetricsPublisherCommand createOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {
... | |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.lookupMessage | protected Message lookupMessage(String queueName) {
checkStarted();
try(Session session = consumerConnection.createSession()) {
Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
Enumeration messages = session.createBrowser(queue).getEnumeration();
... | java | protected Message lookupMessage(String queueName) {
checkStarted();
try(Session session = consumerConnection.createSession()) {
Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
Enumeration messages = session.createBrowser(queue).getEnumeration();
... | [
"protected",
"Message",
"lookupMessage",
"(",
"String",
"queueName",
")",
"{",
"checkStarted",
"(",
")",
";",
"try",
"(",
"Session",
"session",
"=",
"consumerConnection",
".",
"createSession",
"(",
")",
")",
"{",
"Queue",
"queue",
"=",
"(",
"Queue",
")",
"... | This method exists for testing | [
"This",
"method",
"exists",
"for",
"testing"
] | f25f589da94852b6f5625182360732e0861794a6 | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L594-L607 | train | Lookup a message from JMS server. | Create a Java method that does the following: "Lookup a message from JMS server.". | Of course, here is the Java code you requested:
```java
protected Message lookupMessage(String queueName) {
checkStarted();
try(Session session = consumerConnection.createSession()) {
Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
Enumeration messages = s... | |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.modifySearchResultLinkTitle | protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portlet definition in the
// evaluation context.
... | java | protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portlet definition in the
// evaluation context.
... | [
"protected",
"void",
"modifySearchResultLinkTitle",
"(",
"SearchResult",
"result",
",",
"final",
"HttpServletRequest",
"httpServletRequest",
",",
"final",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"// If the title contains a SpEL expression, parse it with the portlet definitio... | Since portlets don't have access to the portlet definition to create a useful search results
link using something like the portlet definition's title, post-process the link text and for
those portlets whose type is present in the substitution set, replace the title with the
portlet definition's title.
@param result Se... | [
"Since",
"portlets",
"don",
"t",
"have",
"access",
"to",
"the",
"portlet",
"definition",
"to",
"create",
"a",
"useful",
"search",
"results",
"link",
"using",
"something",
"like",
"the",
"portlet",
"definition",
"s",
"title",
"post",
"-",
"process",
"the",
"l... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L845-L868 | train | Modify the SearchResult link title. | Create a Java method that does the following: "Modify the SearchResult link title.". | Of course, here is the Java code you requested:
```java
protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portl... | |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.transform | @Override
public DigitalObject transform(DigitalObject in, String jsonConfig)
throws TransformerException {
if (!valid) {
error("Instantiation did not complete.");
}
log.debug("Received OID '{}'", in.getId());
return process(in, jsonConfig);
} | java | @Override
public DigitalObject transform(DigitalObject in, String jsonConfig)
throws TransformerException {
if (!valid) {
error("Instantiation did not complete.");
}
log.debug("Received OID '{}'", in.getId());
return process(in, jsonConfig);
} | [
"@",
"Override",
"public",
"DigitalObject",
"transform",
"(",
"DigitalObject",
"in",
",",
"String",
"jsonConfig",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"!",
"valid",
")",
"{",
"error",
"(",
"\"Instantiation did not complete.\"",
")",
";",
"}",
"... | Transform method
@param object DigitalObject to be transformed
@param jsonConfig String containing configuration for this item
@return DigitalObject The object after being transformed
@throws TransformerException | [
"Transform",
"method"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L503-L511 | train | This method is called to transform a single OID into a single object. | Create a Java method that does the following: "This method is called to transform a single OID into a single object.". | Of course, here is the Java code you requested:
```java
@Override
public DigitalObject transform(DigitalObject in, String jsonConfig)
throws TransformerException {
if (!valid) {
error("Instantiation did not complete.");
}
log.debug("Received OID '{}'", in.getId());
... | |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newEntity | public Entity newEntity(QualifiedName id, String label) {
Entity res = newEntity(id);
if (label != null)
res.getLabel().add(newInternationalizedString(label));
return res;
} | java | public Entity newEntity(QualifiedName id, String label) {
Entity res = newEntity(id);
if (label != null)
res.getLabel().add(newInternationalizedString(label));
return res;
} | [
"public",
"Entity",
"newEntity",
"(",
"QualifiedName",
"id",
",",
"String",
"label",
")",
"{",
"Entity",
"res",
"=",
"newEntity",
"(",
"id",
")",
";",
"if",
"(",
"label",
"!=",
"null",
")",
"res",
".",
"getLabel",
"(",
")",
".",
"add",
"(",
"newInter... | Creates a new {@link Entity} with provided identifier and label
@param id a {@link QualifiedName} for the entity
@param label a String for the label property (see {@link HasLabel#getLabel()}
@return an object of type {@link Entity} | [
"Creates",
"a",
"new",
"{"
] | f865952868ffb69432937b08728c86bebbe4678a | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L649-L654 | train | Create an entity with the specified id and label. | Create a Java method that does the following: "Create an entity with the specified id and label.". | Of course, here is the Java code you requested:
```java
public Entity newEntity(QualifiedName id, String label) {
Entity res = newEntity(id);
if (label != null)
res.getLabel().add(newInternationalizedString(label));
return res;
}
```
Hope this helps! | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java | Ifc2x3tc1FactoryImpl.createIfcControllerTypeEnumFromString | public IfcControllerTypeEnum createIfcControllerTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcControllerTypeEnum result = IfcControllerTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '"... | java | public IfcControllerTypeEnum createIfcControllerTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcControllerTypeEnum result = IfcControllerTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '"... | [
"public",
"IfcControllerTypeEnum",
"createIfcControllerTypeEnumFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"IfcControllerTypeEnum",
"result",
"=",
"IfcControllerTypeEnum",
".",
"get",
"(",
"initialValue",
")",
";",
"if",
"(",
"re... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java#L10725-L10731 | train | Returns the IfcControllerTypeEnum object that corresponds to the given initial value. | Create a Java method that does the following: "Returns the IfcControllerTypeEnum object that corresponds to the given initial value.". | Of course, here is the Java code you requested:
```java
public IfcControllerTypeEnum createIfcControllerTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcControllerTypeEnum result = IfcControllerTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The val... | |
m-m-m/util | pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/base/accessor/AbstractPojoPropertyAccessorBuilder.java | AbstractPojoPropertyAccessorBuilder.getPropertyName | protected String getPropertyName(String methodName, int prefixLength, int suffixLength) {
int len = methodName.length();
int end = len - suffixLength;
if (prefixLength < end) {
String methodSuffix = methodName.substring(prefixLength, end);
StringBuffer sb = new StringBuffer(methodSuffix);
... | java | protected String getPropertyName(String methodName, int prefixLength, int suffixLength) {
int len = methodName.length();
int end = len - suffixLength;
if (prefixLength < end) {
String methodSuffix = methodName.substring(prefixLength, end);
StringBuffer sb = new StringBuffer(methodSuffix);
... | [
"protected",
"String",
"getPropertyName",
"(",
"String",
"methodName",
",",
"int",
"prefixLength",
",",
"int",
"suffixLength",
")",
"{",
"int",
"len",
"=",
"methodName",
".",
"length",
"(",
")",
";",
"int",
"end",
"=",
"len",
"-",
"suffixLength",
";",
"if"... | This method gets the according {@link net.sf.mmm.util.pojo.descriptor.api.PojoPropertyDescriptor#getName()
property-name} for the given {@code methodName}. <br>
This is the un-capitalized substring of the {@code methodName} after the prefix (given via {@code prefixLength}).
@param methodName is the {@link java.lang.re... | [
"This",
"method",
"gets",
"the",
"according",
"{",
"@link",
"net",
".",
"sf",
".",
"mmm",
".",
"util",
".",
"pojo",
".",
"descriptor",
".",
"api",
".",
"PojoPropertyDescriptor#getName",
"()",
"property",
"-",
"name",
"}",
"for",
"the",
"given",
"{",
"@co... | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/base/accessor/AbstractPojoPropertyAccessorBuilder.java#L133-L144 | train | Get property name from method name prefix and suffix length | Create a Java method that does the following: "Get property name from method name prefix and suffix length". | Of course, here is the Java code you requested:
```java
protected String getPropertyName(String methodName, int prefixLength, int suffixLength) {
int len = methodName.length();
int end = len - suffixLength;
if (prefixLength < end) {
String methodSuffix = methodName.substring(prefixLength, end);
... | |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/datamodel/attributetype/RateType.java | RateType.readValue | @Override
public Object readValue(final Attribute _attribute,
final List<Object> _objectList)
throws EFapsException
{
final List<Object[]> ret = new ArrayList<>();
for (final Object object : _objectList) {
final Object[] temp = (Object[]) object;
... | java | @Override
public Object readValue(final Attribute _attribute,
final List<Object> _objectList)
throws EFapsException
{
final List<Object[]> ret = new ArrayList<>();
for (final Object object : _objectList) {
final Object[] temp = (Object[]) object;
... | [
"@",
"Override",
"public",
"Object",
"readValue",
"(",
"final",
"Attribute",
"_attribute",
",",
"final",
"List",
"<",
"Object",
">",
"_objectList",
")",
"throws",
"EFapsException",
"{",
"final",
"List",
"<",
"Object",
"[",
"]",
">",
"ret",
"=",
"new",
"Arr... | {@inheritDoc} | [
"{"
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/datamodel/attributetype/RateType.java#L116-L129 | train | Method to read the value of the ACS A ACS A ACS A ACS A B C A B C A B C C | Create a Java method that does the following: "Method to read the value of the ACS A ACS A ACS A ACS A B C A B C A B C C". | Of course, here is the Java code you requested:
```java
@Override
public Object readValue(final Attribute _attribute,
final List<Object> _objectList)
throws EFapsException
{
final List<Object[]> ret = new ArrayList<>();
for (final Object object : _objectList)... | |
aws/aws-sdk-java | aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/GetInsightsRequest.java | GetInsightsRequest.withInsightArns | public GetInsightsRequest withInsightArns(String... insightArns) {
if (this.insightArns == null) {
setInsightArns(new java.util.ArrayList<String>(insightArns.length));
}
for (String ele : insightArns) {
this.insightArns.add(ele);
}
return this;
} | java | public GetInsightsRequest withInsightArns(String... insightArns) {
if (this.insightArns == null) {
setInsightArns(new java.util.ArrayList<String>(insightArns.length));
}
for (String ele : insightArns) {
this.insightArns.add(ele);
}
return this;
} | [
"public",
"GetInsightsRequest",
"withInsightArns",
"(",
"String",
"...",
"insightArns",
")",
"{",
"if",
"(",
"this",
".",
"insightArns",
"==",
"null",
")",
"{",
"setInsightArns",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"String",
">",
"(",
"... | <p>
The ARNS of the insights that you want to describe.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setInsightArns(java.util.Collection)} or {@link #withInsightArns(java.util.Collection)} if you want to
override the existing values.
</p>
@param insightArns
The ARNS o... | [
"<p",
">",
"The",
"ARNS",
"of",
"the",
"insights",
"that",
"you",
"want",
"to",
"describe",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"li... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/GetInsightsRequest.java#L94-L102 | train | Gets the value of the insightArns property. | Create a Java method that does the following: "Gets the value of the insightArns property.". | Of course, here is the Java code you requested:
```java
public GetInsightsRequest withInsightArns(String... insightArns) {
if (this.insightArns == null) {
setInsightArns(new java.util.ArrayList<String>(insightArns.length));
}
for (String ele : insightArns) {
this.insight... | |
naver/nbase-arc | api/java/src/main/java/com/navercorp/redis/cluster/spring/RedisClusterConnection.java | RedisClusterConnection.rPop | @Override
public byte[] rPop(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.rpop(key)));
return null;
}
return client.rpop(key);
} catch (Exception ex) {
throw convertException(ex);
}... | java | @Override
public byte[] rPop(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.rpop(key)));
return null;
}
return client.rpop(key);
} catch (Exception ex) {
throw convertException(ex);
}... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"rPop",
"(",
"byte",
"[",
"]",
"key",
")",
"{",
"try",
"{",
"if",
"(",
"isPipelined",
"(",
")",
")",
"{",
"pipeline",
"(",
"new",
"JedisResult",
"(",
"pipeline",
".",
"rpop",
"(",
"key",
")",
")",
")",... | /*
@see org.springframework.data.redis.connection.RedisListCommands#rPop(byte[]) | [
"/",
"*"
] | d4ce8a258527160c09b55e34acc1542651a8bbb3 | https://github.com/naver/nbase-arc/blob/d4ce8a258527160c09b55e34acc1542651a8bbb3/api/java/src/main/java/com/navercorp/redis/cluster/spring/RedisClusterConnection.java#L1083-L1095 | valid | RPop from a set of keys. | Create a Java method that does the following: "RPop from a set of keys.". | Of course, here is the Java code you requested:
```java
@Override
public byte[] rPop(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.rpop(key)));
return null;
}
return client.rpop(key);
} catch (Exceptio... | |
nutzam/nutz | src/org/nutz/lang/Streams.java | Streams.read | public static StringBuilder read(Reader reader) throws IOException {
StringBuilder sb = new StringBuilder();
read(reader, sb);
return sb;
} | java | public static StringBuilder read(Reader reader) throws IOException {
StringBuilder sb = new StringBuilder();
read(reader, sb);
return sb;
} | [
"public",
"static",
"StringBuilder",
"read",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"read",
"(",
"reader",
",",
"sb",
")",
";",
"return",
"sb",
";",
"}"
] | 从一个文本流中读取全部内容并返回
<p>
<b style=color:red>注意</b>,它并不会关闭输出流
@param reader
文本输出流
@return 文本内容
@throws IOException | [
"从一个文本流中读取全部内容并返回",
"<p",
">",
"<b",
"style",
"=",
"color",
":",
"red",
">",
"注意<",
"/",
"b",
">",
",它并不会关闭输出流"
] | a38694d5cbda2692e7931ab093c168487a6a4bfe | https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/lang/Streams.java#L272-L276 | valid | Reads a
from the specified reader. | Create a Java method that does the following: "Reads a
from the specified reader.". | Of course, here is the Java code you requested:
```java
public static StringBuilder read(Reader reader) throws IOException {
StringBuilder sb = new StringBuilder();
read(reader, sb);
return sb;
}
```
Hope this helps! | |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderLabeled | public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) {
int colors[] = new int[numRegions];
Random rand = new Random(123);
for( int i = 0; i < colors.length; i++ ) {
colors[i] = rand.nextInt();
}
return renderLabeled(labelImage, colors, out);
} | java | public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) {
int colors[] = new int[numRegions];
Random rand = new Random(123);
for( int i = 0; i < colors.length; i++ ) {
colors[i] = rand.nextInt();
}
return renderLabeled(labelImage, colors, out);
} | [
"public",
"static",
"BufferedImage",
"renderLabeled",
"(",
"GrayS32",
"labelImage",
",",
"int",
"numRegions",
",",
"BufferedImage",
"out",
")",
"{",
"int",
"colors",
"[",
"]",
"=",
"new",
"int",
"[",
"numRegions",
"]",
";",
"Random",
"rand",
"=",
"new",
"R... | Renders a labeled where each region is assigned a random color.
@param labelImage Labeled image with labels from 0 to numRegions-1
@param numRegions Number of labeled in the image
@param out Output image. If null a new image is declared
@return Colorized labeled image | [
"Renders",
"a",
"labeled",
"where",
"each",
"region",
"is",
"assigned",
"a",
"random",
"color",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L332-L342 | train | Renders a image of the specified number of regions using the specified label image. | Create a Java method that does the following: "Renders a image of the specified number of regions using the specified label image.". | Of course, here is the Java code you requested:
```java
public static BufferedImage renderLabeled(GrayS32 labelImage, int numRegions, BufferedImage out) {
int colors[] = new int[numRegions];
Random rand = new Random(123);
for( int i = 0; i < colors.length; i++ ) {
colors[i] = rand.nextInt();
}
return r... | |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/NtlmPasswordAuthentication.java | NtlmPasswordAuthentication.getAnsiHash | public byte[] getAnsiHash( byte[] challenge ) {
if( hashesExternal ) {
return ansiHash;
}
switch (LM_COMPATIBILITY) {
case 0:
case 1:
return getPreNTLMResponse( password, challenge );
case 2:
return getNTLMResponse( password, challenge ... | java | public byte[] getAnsiHash( byte[] challenge ) {
if( hashesExternal ) {
return ansiHash;
}
switch (LM_COMPATIBILITY) {
case 0:
case 1:
return getPreNTLMResponse( password, challenge );
case 2:
return getNTLMResponse( password, challenge ... | [
"public",
"byte",
"[",
"]",
"getAnsiHash",
"(",
"byte",
"[",
"]",
"challenge",
")",
"{",
"if",
"(",
"hashesExternal",
")",
"{",
"return",
"ansiHash",
";",
"}",
"switch",
"(",
"LM_COMPATIBILITY",
")",
"{",
"case",
"0",
":",
"case",
"1",
":",
"return",
... | Computes the 24 byte ANSI password hash given the 8 byte server challenge. | [
"Computes",
"the",
"24",
"byte",
"ANSI",
"password",
"hash",
"given",
"the",
"8",
"byte",
"server",
"challenge",
"."
] | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/NtlmPasswordAuthentication.java#L414-L436 | train | Get the ansi hash for the challenge. | Create a Java method that does the following: "Get the ansi hash for the challenge.". | Of course, here is the Java code you requested:
```java
public byte[] getAnsiHash( byte[] challenge ) {
if( hashesExternal ) {
return ansiHash;
}
switch (LM_COMPATIBILITY) {
case 0:
case 1:
return getPreNTLMResponse( password, challenge );
case 2:... | |
ppi-ag/thymeleaf-bootstrap2 | src/main/java/de/ppi/fuwesta/thymeleaf/bootstrap2/AbstractBootstrap2AttrProcessor.java | AbstractBootstrap2AttrProcessor.processAttribute | @Override
public final ProcessorResult processAttribute(final Arguments arguments,
final Element element, final String attributeName) {
NestableNode parent = element.getParent();
final String fieldNameExpr = element.getAttributeValue(attributeName);
final String fieldName;
... | java | @Override
public final ProcessorResult processAttribute(final Arguments arguments,
final Element element, final String attributeName) {
NestableNode parent = element.getParent();
final String fieldNameExpr = element.getAttributeValue(attributeName);
final String fieldName;
... | [
"@",
"Override",
"public",
"final",
"ProcessorResult",
"processAttribute",
"(",
"final",
"Arguments",
"arguments",
",",
"final",
"Element",
"element",
",",
"final",
"String",
"attributeName",
")",
"{",
"NestableNode",
"parent",
"=",
"element",
".",
"getParent",
"(... | {@inheritDoc} | [
"{"
] | 5958358f2d5b057eb80376b6740f64f2f33e619a | https://github.com/ppi-ag/thymeleaf-bootstrap2/blob/5958358f2d5b057eb80376b6740f64f2f33e619a/src/main/java/de/ppi/fuwesta/thymeleaf/bootstrap2/AbstractBootstrap2AttrProcessor.java#L70-L109 | train | Process a single attribute of a Bootstrap field. | Create a Java method that does the following: "Process a single attribute of a Bootstrap field.". | Of course, here is the Java code you requested:
```java
@Override
public final ProcessorResult processAttribute(final Arguments arguments,
final Element element, final String attributeName) {
NestableNode parent = element.getParent();
final String fieldNameExpr = element.getAttributeVa... | |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/WktService.java | WktService.parseSrid | private static int parseSrid(String ewktPart) {
if (ewktPart != null && !"".equals(ewktPart)) {
String[] parts = ewktPart.split("=");
if (parts.length == 2) {
try {
return Integer.parseInt(parts[1]);
} catch (Exception e) {
}
}
}
return 0;
} | java | private static int parseSrid(String ewktPart) {
if (ewktPart != null && !"".equals(ewktPart)) {
String[] parts = ewktPart.split("=");
if (parts.length == 2) {
try {
return Integer.parseInt(parts[1]);
} catch (Exception e) {
}
}
}
return 0;
} | [
"private",
"static",
"int",
"parseSrid",
"(",
"String",
"ewktPart",
")",
"{",
"if",
"(",
"ewktPart",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"ewktPart",
")",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"ewktPart",
".",
"split",
"(",
"\"=... | Get the SRID from a string like "SRDI=4326". Used in parsing EWKT. | [
"Get",
"the",
"SRID",
"from",
"a",
"string",
"like",
"SRDI",
"=",
"4326",
".",
"Used",
"in",
"parsing",
"EWKT",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/WktService.java#L117-L128 | train | Parses the SRID part of an EWKT string. | Create a Java method that does the following: "Parses the SRID part of an EWKT string.". | Of course, here is the Java code you requested:
```java
private static int parseSrid(String ewktPart) {
if (ewktPart != null && !"".equals(ewktPart)) {
String[] parts = ewktPart.split("=");
if (parts.length == 2) {
try {
return Integer.parseInt(parts[1]);
} catch (Exception e) {
}
}
}
r... | |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.waitForAttributeNotEqualTo | public void waitForAttributeNotEqualTo(final String attributeName, final String attributeValue, long timeout) throws WidgetTimeoutException {
waitForCommand(new ITimerCallback() {
@Override
public boolean execute() throws WidgetException {
String val = getAttribute(attributeName);
if (val == null && a... | java | public void waitForAttributeNotEqualTo(final String attributeName, final String attributeValue, long timeout) throws WidgetTimeoutException {
waitForCommand(new ITimerCallback() {
@Override
public boolean execute() throws WidgetException {
String val = getAttribute(attributeName);
if (val == null && a... | [
"public",
"void",
"waitForAttributeNotEqualTo",
"(",
"final",
"String",
"attributeName",
",",
"final",
"String",
"attributeValue",
",",
"long",
"timeout",
")",
"throws",
"WidgetTimeoutException",
"{",
"waitForCommand",
"(",
"new",
"ITimerCallback",
"(",
")",
"{",
"@... | /*
(non-Javadoc)
@see
qc.automation.framework.widget.IElement#waitForAttributeNotEqualTo(java
.lang.String, java.lang.String, java.lang.Long) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 78d646def1bf0904f79b19a81df0241e07f2c73a | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L1069-L1094 | train | Waits until the element s attribute is not equal to the given value. | Create a Java method that does the following: "Waits until the element s attribute is not equal to the given value.". | Of course, here is the Java code you requested:
```java
public void waitForAttributeNotEqualTo(final String attributeName, final String attributeValue, long timeout) throws WidgetTimeoutException {
waitForCommand(new ITimerCallback() {
@Override
public boolean execute() throws WidgetException {
String val... | |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/inbox/InboxBase.java | InboxBase.addQuery | @Override
public QueryRefAmp addQuery(String address,
ResultChain<?> result,
ClassLoader loaderCaller)
{
return queryMap().addQuery(address, result, loaderCaller);
} | java | @Override
public QueryRefAmp addQuery(String address,
ResultChain<?> result,
ClassLoader loaderCaller)
{
return queryMap().addQuery(address, result, loaderCaller);
} | [
"@",
"Override",
"public",
"QueryRefAmp",
"addQuery",
"(",
"String",
"address",
",",
"ResultChain",
"<",
"?",
">",
"result",
",",
"ClassLoader",
"loaderCaller",
")",
"{",
"return",
"queryMap",
"(",
")",
".",
"addQuery",
"(",
"address",
",",
"result",
",",
... | Adds a query callback to handle a later message.
@param id the unique query identifier
@param result the application's callback for the result
@param loader the caller's class loader | [
"Adds",
"a",
"query",
"callback",
"to",
"handle",
"a",
"later",
"message",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/inbox/InboxBase.java#L128-L134 | train | Override the implementation of the addQuery method. | Create a Java method that does the following: "Override the implementation of the addQuery method.". | Of course, here is the Java code you requested:
```java
@Override
public QueryRefAmp addQuery(String address,
ResultChain<?> result,
ClassLoader loaderCaller)
{
return queryMap().addQuery(address, result, loaderCaller);
}
```
Hope this helps! | |
adessoAG/wicked-charts | wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java | JavaScriptExpressionSendingAjaxBehavior.addJavaScriptValues | public void addJavaScriptValues(Map<String, String> parameterMap) {
for (String parameterName : parameterMap.keySet()) {
this.javascriptExpressions.put(parameterName, parameterMap.get(parameterName));
}
} | java | public void addJavaScriptValues(Map<String, String> parameterMap) {
for (String parameterName : parameterMap.keySet()) {
this.javascriptExpressions.put(parameterName, parameterMap.get(parameterName));
}
} | [
"public",
"void",
"addJavaScriptValues",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameterMap",
")",
"{",
"for",
"(",
"String",
"parameterName",
":",
"parameterMap",
".",
"keySet",
"(",
")",
")",
"{",
"this",
".",
"javascriptExpressions",
".",
"put",... | Adds a set of javascript expressions to be passed from client to server.
@param parameterMap a map containing the name of a parameter as key and a javascript
expression as value
@see #addJavaScriptValue(String, String) | [
"Adds",
"a",
"set",
"of",
"javascript",
"expressions",
"to",
"be",
"passed",
"from",
"client",
"to",
"server",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java#L83-L87 | train | Add JavaScript values from a map of parameters to the javascript expressions. | Create a Java method that does the following: "Add JavaScript values from a map of parameters to the javascript expressions.". | Of course, here is the Java code you requested:
```java
public void addJavaScriptValues(Map<String, String> parameterMap) {
for (String parameterName : parameterMap.keySet()) {
this.javascriptExpressions.put(parameterName, parameterMap.get(parameterName));
}
}
```
Hope this helps! | |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.extract | public static void extract(ZMatrixRMaj src,
int srcY0, int srcY1,
int srcX0, int srcX1,
ZMatrixRMaj dst,
int dstY0, int dstX0 )
{
int numRows = srcY1 - srcY0;
int stride = (src... | java | public static void extract(ZMatrixRMaj src,
int srcY0, int srcY1,
int srcX0, int srcX1,
ZMatrixRMaj dst,
int dstY0, int dstX0 )
{
int numRows = srcY1 - srcY0;
int stride = (src... | [
"public",
"static",
"void",
"extract",
"(",
"ZMatrixRMaj",
"src",
",",
"int",
"srcY0",
",",
"int",
"srcY1",
",",
"int",
"srcX0",
",",
"int",
"srcX1",
",",
"ZMatrixRMaj",
"dst",
",",
"int",
"dstY0",
",",
"int",
"dstX0",
")",
"{",
"int",
"numRows",
"=",
... | <p>
Extracts a submatrix from 'src' and inserts it in a submatrix in 'dst'.
</p>
<p>
s<sub>i-y0 , j-x0</sub> = o<sub>ij</sub> for all y0 ≤ i < y1 and x0 ≤ j < x1 <br>
<br>
where 's<sub>ij</sub>' is an element in the submatrix and 'o<sub>ij</sub>' is an element in the
original matrix.
</p>
@param src The or... | [
"<p",
">",
"Extracts",
"a",
"submatrix",
"from",
"src",
"and",
"inserts",
"it",
"in",
"a",
"submatrix",
"in",
"dst",
".",
"<",
"/",
"p",
">",
"<p",
">",
"s<sub",
">",
"i",
"-",
"y0",
"j",
"-",
"x0<",
"/",
"sub",
">",
"=",
"o<sub",
">",
"ij<",
... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L1209-L1223 | train | Extract the source matrix into the destination matrix. | Create a Java method that does the following: "Extract the source matrix into the destination matrix.". | Of course, here is the Java code you requested:
```java
public static void extract(ZMatrixRMaj src,
int srcY0, int srcY1,
int srcX0, int srcX1,
ZMatrixRMaj dst,
int dstY0, int dstX0 )
{
... | |
apache/parquet-mr | parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java | ParquetFileWriter.mergeInto | static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema) {
return mergeInto(toMerge, mergedSchema, true);
} | java | static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema) {
return mergeInto(toMerge, mergedSchema, true);
} | [
"static",
"MessageType",
"mergeInto",
"(",
"MessageType",
"toMerge",
",",
"MessageType",
"mergedSchema",
")",
"{",
"return",
"mergeInto",
"(",
"toMerge",
",",
"mergedSchema",
",",
"true",
")",
";",
"}"
] | will return the result of merging toMerge into mergedSchema
@param toMerge the schema to merge into mergedSchema
@param mergedSchema the schema to append the fields to
@return the resulting schema | [
"will",
"return",
"the",
"result",
"of",
"merging",
"toMerge",
"into",
"mergedSchema"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java#L1095-L1097 | test | Merge the given schema into the given schema. | Create a Java method that does the following: "Merge the given schema into the given schema.". | Of course, here is the Java code you requested:
```java
static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema) {
return mergeInto(toMerge, mergedSchema, true);
}
```
Hope this helps! | |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java | IterableOfProtosSubject.ignoringExtraRepeatedFieldElementsOfFieldDescriptors | public IterableOfProtosFluentAssertion<M> ignoringExtraRepeatedFieldElementsOfFieldDescriptors(
Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(
config.ignoringExtraRepeatedFieldElementsOfFieldDescriptors(fieldDescriptors));
} | java | public IterableOfProtosFluentAssertion<M> ignoringExtraRepeatedFieldElementsOfFieldDescriptors(
Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(
config.ignoringExtraRepeatedFieldElementsOfFieldDescriptors(fieldDescriptors));
} | [
"public",
"IterableOfProtosFluentAssertion",
"<",
"M",
">",
"ignoringExtraRepeatedFieldElementsOfFieldDescriptors",
"(",
"Iterable",
"<",
"FieldDescriptor",
">",
"fieldDescriptors",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"ignoringExtraRepeatedFieldElementsOfFiel... | Specifies that extra repeated field elements for these explicitly specified field descriptors
should be ignored. Sub-fields must be specified explicitly if their extra elements are to be
ignored as well.
<p>Use {@link #ignoringExtraRepeatedFieldElements()} instead to ignore these for all fields.
@see #ignoringExtraRe... | [
"Specifies",
"that",
"extra",
"repeated",
"field",
"elements",
"for",
"these",
"explicitly",
"specified",
"field",
"descriptors",
"should",
"be",
"ignored",
".",
"Sub",
"-",
"fields",
"must",
"be",
"specified",
"explicitly",
"if",
"their",
"extra",
"elements",
"... | 60eceffd2e8c3297655d33ed87d965cf5af51108 | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java#L730-L734 | train | Ignores extra repeated elements of the given field descriptors. | Create a Java method that does the following: "Ignores extra repeated elements of the given field descriptors.". | Of course, here is the Java code you requested:
```java
public IterableOfProtosFluentAssertion<M> ignoringExtraRepeatedFieldElementsOfFieldDescriptors(
Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(
config.ignoringExtraRepeatedFieldElementsOfFieldDescriptors(fieldDescriptors));
}... | |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java | HostControllerEnvironment.getFileFromProperty | private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.ex... | java | private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
if (result != null && homeDir != null && !result.ex... | [
"private",
"File",
"getFileFromProperty",
"(",
"final",
"String",
"name",
")",
"{",
"String",
"value",
"=",
"hostSystemProperties",
".",
"get",
"(",
"name",
")",
";",
"File",
"result",
"=",
"(",
"value",
"!=",
"null",
")",
"?",
"new",
"File",
"(",
"value... | Get a File from configuration.
@param name the name of the property
@return the CanonicalFile form for the given name. | [
"Get",
"a",
"File",
"from",
"configuration",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/HostControllerEnvironment.java#L839-L850 | train | Gets the file from the property. | Create a Java method that does the following: "Gets the file from the property.". | Of course, here is the Java code you requested:
```java
private File getFileFromProperty(final String name) {
String value = hostSystemProperties.get(name);
File result = (value != null) ? new File(value) : null;
// AS7-1752 see if a non-existent relative path exists relative to the home dir
... | |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/connection/DataSourceConnectionSupplierImpl.java | DataSourceConnectionSupplierImpl.setAutoCommit | public void setAutoCommit(final String dataSourceName, final boolean autoCommit) {
Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
props.put(PROPS_AUTO_COMMIT, Boolean.toString(autoCommit));
} | java | public void setAutoCommit(final String dataSourceName, final boolean autoCommit) {
Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
props.put(PROPS_AUTO_COMMIT, Boolean.toString(autoCommit));
} | [
"public",
"void",
"setAutoCommit",
"(",
"final",
"String",
"dataSourceName",
",",
"final",
"boolean",
"autoCommit",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"props",
"=",
"getConnPropsByDataSourceName",
"(",
"dataSourceName",
")",
";",
"props",
".",
... | dataSourceNameで指定したデータソースに対するAutoCommitオプションの指定
@param dataSourceName データソース名
@param autoCommit AutoCommitを行う場合は<code>true</code> | [
"dataSourceNameで指定したデータソースに対するAutoCommitオプションの指定"
] | 4c26db51defdac3c6ed16866e33ab45e190e2e0c | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/connection/DataSourceConnectionSupplierImpl.java#L169-L172 | train | Sets the auto commit flag for the specified connection. | Create a Java method that does the following: "Sets the auto commit flag for the specified connection.". | Of course, here is the Java code you requested:
```java
public void setAutoCommit(final String dataSourceName, final boolean autoCommit) {
Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
props.put(PROPS_AUTO_COMMIT, Boolean.toString(autoCommit));
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/AmazonApiGatewayV2Client.java | AmazonApiGatewayV2Client.getRoutes | @Override
public GetRoutesResult getRoutes(GetRoutesRequest request) {
request = beforeClientExecution(request);
return executeGetRoutes(request);
} | java | @Override
public GetRoutesResult getRoutes(GetRoutesRequest request) {
request = beforeClientExecution(request);
return executeGetRoutes(request);
} | [
"@",
"Override",
"public",
"GetRoutesResult",
"getRoutes",
"(",
"GetRoutesRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGetRoutes",
"(",
"request",
")",
";",
"}"
] | <p>
Gets the Routes for an API.
</p>
@param getRoutesRequest
@return Result of the GetRoutes operation returned by the service.
@throws NotFoundException
The resource specified in the request was not found.
@throws TooManyRequestsException
The client is sending more than the allowed number of requests per unit of time... | [
"<p",
">",
"Gets",
"the",
"Routes",
"for",
"an",
"API",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/AmazonApiGatewayV2Client.java#L2496-L2500 | train | Returns a list of routes for a specific CA. | Create a Java method that does the following: "Returns a list of routes for a specific CA.". | Of course, here is the Java code you requested:
```java
@Override
public GetRoutesResult getRoutes(GetRoutesRequest request) {
request = beforeClientExecution(request);
return executeGetRoutes(request);
}
```
Hope this helps! | |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.isUpgradedFromBefore | public boolean isUpgradedFromBefore(VersionNumber v) {
try {
return new VersionNumber(version).isOlderThan(v);
} catch (IllegalArgumentException e) {
// fail to parse this version number
return false;
}
} | java | public boolean isUpgradedFromBefore(VersionNumber v) {
try {
return new VersionNumber(version).isOlderThan(v);
} catch (IllegalArgumentException e) {
// fail to parse this version number
return false;
}
} | [
"public",
"boolean",
"isUpgradedFromBefore",
"(",
"VersionNumber",
"v",
")",
"{",
"try",
"{",
"return",
"new",
"VersionNumber",
"(",
"version",
")",
".",
"isOlderThan",
"(",
"v",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"// fai... | Returns true if the current running Jenkins is upgraded from a version earlier than the specified version.
<p>
This method continues to return true until the system configuration is saved, at which point
{@link #version} will be overwritten and Jenkins forgets the upgrade history.
<p>
To handle SNAPSHOTS correctly, p... | [
"Returns",
"true",
"if",
"the",
"current",
"running",
"Jenkins",
"is",
"upgraded",
"from",
"a",
"version",
"earlier",
"than",
"the",
"specified",
"version",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1906-L1913 | train | Check if the version number is older than the version number passed in. | Create a Java method that does the following: "Check if the version number is older than the version number passed in.". | Of course, here is the Java code you requested:
```java
public boolean isUpgradedFromBefore(VersionNumber v) {
try {
return new VersionNumber(version).isOlderThan(v);
} catch (IllegalArgumentException e) {
// fail to parse this version number
return false;
}
... | |
antopen/alipay-sdk-java | src/main/java/com/alipay/api/internal/mapping/Converters.java | Converters.convert | public static <T> T convert(Class<T> clazz, Reader reader) throws AlipayApiException {
T rsp = null;
try {
rsp = clazz.newInstance();
BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
boole... | java | public static <T> T convert(Class<T> clazz, Reader reader) throws AlipayApiException {
T rsp = null;
try {
rsp = clazz.newInstance();
BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
boole... | [
"public",
"static",
"<",
"T",
">",
"T",
"convert",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Reader",
"reader",
")",
"throws",
"AlipayApiException",
"{",
"T",
"rsp",
"=",
"null",
";",
"try",
"{",
"rsp",
"=",
"clazz",
".",
"newInstance",
"(",
")",
... | 使用指定 的读取器去转换字符串为对象。
@param <T> 领域泛型
@param clazz 领域类型
@param reader 读取器
@return 领域对象
@throws ApiException | [
"使用指定",
"的读取器去转换字符串为对象。"
] | e82aeac7d0239330ee173c7e393596e51e41c1cd | https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/mapping/Converters.java#L75-L281 | train | Convert a class to an instance of the Alipay Response class. | Create a Java method that does the following: "Convert a class to an instance of the Alipay Response class.". | Of course, here is the Java code you requested:
```java
public static <T> T convert(Class<T> clazz, Reader reader) throws AlipayApiException {
T rsp = null;
try {
rsp = clazz.newInstance();
BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
PropertyDescriptor[] pd... | |
google/guava | guava/src/com/google/common/base/Throwables.java | Throwables.getCauseAs | @Beta
@GwtIncompatible // Class.cast(Object)
public static <X extends Throwable> X getCauseAs(
Throwable throwable, Class<X> expectedCauseType) {
try {
return expectedCauseType.cast(throwable.getCause());
} catch (ClassCastException e) {
e.initCause(throwable);
throw e;
}
} | java | @Beta
@GwtIncompatible // Class.cast(Object)
public static <X extends Throwable> X getCauseAs(
Throwable throwable, Class<X> expectedCauseType) {
try {
return expectedCauseType.cast(throwable.getCause());
} catch (ClassCastException e) {
e.initCause(throwable);
throw e;
}
} | [
"@",
"Beta",
"@",
"GwtIncompatible",
"// Class.cast(Object)",
"public",
"static",
"<",
"X",
"extends",
"Throwable",
">",
"X",
"getCauseAs",
"(",
"Throwable",
"throwable",
",",
"Class",
"<",
"X",
">",
"expectedCauseType",
")",
"{",
"try",
"{",
"return",
"expect... | Returns {@code throwable}'s cause, cast to {@code expectedCauseType}.
<p>Prefer this method instead of manually casting an exception's cause. For example, {@code
(IOException) e.getCause()} throws a {@link ClassCastException} that discards the original
exception {@code e} if the cause is not an {@link IOException}, bu... | [
"Returns",
"{",
"@code",
"throwable",
"}",
"s",
"cause",
"cast",
"to",
"{",
"@code",
"expectedCauseType",
"}",
"."
] | 7155d12b70a2406fa84d94d4b8b3bc108e89abfd | https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/base/Throwables.java#L331-L341 | valid | Get the cause of the given exception as an object of the given type. | Create a Java method that does the following: "Get the cause of the given exception as an object of the given type.". | Of course, here is the Java code you requested:
```java
@Beta
@GwtIncompatible // Class.cast(Object)
public static <X extends Throwable> X getCauseAs(
Throwable throwable, Class<X> expectedCauseType) {
try {
return expectedCauseType.cast(throwable.getCause());
} catch (ClassCastException e) {
... | |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/resourceindex/filters/WARCRevisitAnnotationFilter.java | WARCRevisitAnnotationFilter.filterObject | public int filterObject(CaptureSearchResult o) {
if(o.getFile().equals(EMPTY_VALUE)
|| o.getMimeType().equals(REVISIT_VALUE)) {
return annotate(o);
}
return remember(o);
} | java | public int filterObject(CaptureSearchResult o) {
if(o.getFile().equals(EMPTY_VALUE)
|| o.getMimeType().equals(REVISIT_VALUE)) {
return annotate(o);
}
return remember(o);
} | [
"public",
"int",
"filterObject",
"(",
"CaptureSearchResult",
"o",
")",
"{",
"if",
"(",
"o",
".",
"getFile",
"(",
")",
".",
"equals",
"(",
"EMPTY_VALUE",
")",
"||",
"o",
".",
"getMimeType",
"(",
")",
".",
"equals",
"(",
"REVISIT_VALUE",
")",
")",
"{",
... | } | [
"}"
] | da74c3a59a5b5a5c365bd4702dcb45d263535794 | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/resourceindex/filters/WARCRevisitAnnotationFilter.java#L92-L98 | train | Filter an object. | Create a Java method that does the following: "Filter an object.". | Of course, here is the Java code you requested:
```java
public int filterObject(CaptureSearchResult o) {
if(o.getFile().equals(EMPTY_VALUE)
|| o.getMimeType().equals(REVISIT_VALUE)) {
return annotate(o);
}
return remember(o);
}
```
Hope this helps! | |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.copy | public static ImmutableMatrix3 copy(Matrix3 source) {
if (source instanceof ImmutableMatrix3) return (ImmutableMatrix3)source;
return new ImmutableMatrix3(source);
} | java | public static ImmutableMatrix3 copy(Matrix3 source) {
if (source instanceof ImmutableMatrix3) return (ImmutableMatrix3)source;
return new ImmutableMatrix3(source);
} | [
"public",
"static",
"ImmutableMatrix3",
"copy",
"(",
"Matrix3",
"source",
")",
"{",
"if",
"(",
"source",
"instanceof",
"ImmutableMatrix3",
")",
"return",
"(",
"ImmutableMatrix3",
")",
"source",
";",
"return",
"new",
"ImmutableMatrix3",
"(",
"source",
")",
";",
... | Returns an immutable matrix with the same values as the argument.
@param source the matrix containing the data for the new immutable matrix
@return an immutable matrix containing the same elements as {@code source}
@throws NullPointerException if {@code source} is {@code null} | [
"Returns",
"an",
"immutable",
"matrix",
"with",
"the",
"same",
"values",
"as",
"the",
"argument",
"."
] | 018570db945fe616b25606fe605fa6e0c180ab5b | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L121-L124 | train | Creates a deep copy of the given matrix. | Create a Java method that does the following: "Creates a deep copy of the given matrix.". | Of course, here is the Java code you requested:
```java
public static ImmutableMatrix3 copy(Matrix3 source) {
if (source instanceof ImmutableMatrix3) return (ImmutableMatrix3)source;
return new ImmutableMatrix3(source);
}
```
Hope this helps! | |
Joe0/Feather | src/main/java/com/joepritzel/feather/Subscriber.java | Subscriber.receiveO | public void receiveO(Object o) {
try {
@SuppressWarnings("unchecked")
T o2 = (T) o;
receive(o2);
} catch (ClassCastException e) {
throw new SubscriberTypeMismatchException(e);
}
} | java | public void receiveO(Object o) {
try {
@SuppressWarnings("unchecked")
T o2 = (T) o;
receive(o2);
} catch (ClassCastException e) {
throw new SubscriberTypeMismatchException(e);
}
} | [
"public",
"void",
"receiveO",
"(",
"Object",
"o",
")",
"{",
"try",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"o2",
"=",
"(",
"T",
")",
"o",
";",
"receive",
"(",
"o2",
")",
";",
"}",
"catch",
"(",
"ClassCastException",
"e",
")",
... | A method that casts the message and calls the method that uses generics.<br>
Do not overide.
@param o
- The message that will be received by the subscriber.
@exception SubscriberTypeMismatchException
the type the subscriber was bound to is incompatible with
the type that is being received. | [
"A",
"method",
"that",
"casts",
"the",
"message",
"and",
"calls",
"the",
"method",
"that",
"uses",
"generics",
".",
"<br",
">",
"Do",
"not",
"overide",
"."
] | d17b1bc38326b8b86f1068898a59c8a34678d499 | https://github.com/Joe0/Feather/blob/d17b1bc38326b8b86f1068898a59c8a34678d499/src/main/java/com/joepritzel/feather/Subscriber.java#L33-L41 | train | Receives a message from the server. | Create a Java method that does the following: "Receives a message from the server.". | Of course, here is the Java code you requested:
```java
public void receiveO(Object o) {
try {
@SuppressWarnings("unchecked")
T o2 = (T) o;
receive(o2);
} catch (ClassCastException e) {
throw new SubscriberTypeMismatchException(e);
}
}
```
Hope this helps! | |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/commas/data/catalog/FunctionAttribute.java | FunctionAttribute.compareTo | public int compareTo(Object aOther)
{
FunctionAttribute other = (FunctionAttribute) aOther;
// compare names
return other.getName().compareTo(this.getName());
} | java | public int compareTo(Object aOther)
{
FunctionAttribute other = (FunctionAttribute) aOther;
// compare names
return other.getName().compareTo(this.getName());
} | [
"public",
"int",
"compareTo",
"(",
"Object",
"aOther",
")",
"{",
"FunctionAttribute",
"other",
"=",
"(",
"FunctionAttribute",
")",
"aOther",
";",
"// compare names",
"return",
"other",
".",
"getName",
"(",
")",
".",
"compareTo",
"(",
"this",
".",
"getName",
... | -------------------------------------------- | [
"--------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/commas/data/catalog/FunctionAttribute.java#L53-L59 | test | Compares this object to another object. | Create a Java method that does the following: "Compares this object to another object.". | Of course, here is the Java code you requested:
```java
public int compareTo(Object aOther)
{
FunctionAttribute other = (FunctionAttribute) aOther;
// compare names
return other.getName().compareTo(this.getName());
}
```
Hope this helps! | |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQueryUtils.java | KunderaQueryUtils.readSelectClause | public static List<Map<String, Object>> readSelectClause(Expression selectExpression, EntityMetadata m,
Boolean useLuceneOrES, KunderaMetadata kunderaMetadata)
{
List<Map<String, Object>> columnsToOutput = new ArrayList<Map<String, Object>>();
if (StateFieldPathExpression.class.isAssigna... | java | public static List<Map<String, Object>> readSelectClause(Expression selectExpression, EntityMetadata m,
Boolean useLuceneOrES, KunderaMetadata kunderaMetadata)
{
List<Map<String, Object>> columnsToOutput = new ArrayList<Map<String, Object>>();
if (StateFieldPathExpression.class.isAssigna... | [
"public",
"static",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"readSelectClause",
"(",
"Expression",
"selectExpression",
",",
"EntityMetadata",
"m",
",",
"Boolean",
"useLuceneOrES",
",",
"KunderaMetadata",
"kunderaMetadata",
")",
"{",
"List",
"... | Read select clause.
@param selectExpression
the select expression
@param m
the m
@param useLuceneOrES
the use lucene or es
@param kunderaMetadata
@return the list | [
"Read",
"select",
"clause",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQueryUtils.java#L369-L393 | train | Read select clause. | Create a Java method that does the following: "Read select clause.". | Of course, here is the Java code you requested:
```java
public static List<Map<String, Object>> readSelectClause(Expression selectExpression, EntityMetadata m,
Boolean useLuceneOrES, KunderaMetadata kunderaMetadata)
{
List<Map<String, Object>> columnsToOutput = new ArrayList<Map<String, Object>... | |
mscharhag/oleaster | oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/CollectionMatcher.java | CollectionMatcher.toContain | public void toContain(final Object item) {
expectNotNull(this.getValue(), "Expected null to contain '%s'", item);
expectTrue(this.getValue().contains(item), "Expected '%s' to contain '%s'", this.getValue(), item);
} | java | public void toContain(final Object item) {
expectNotNull(this.getValue(), "Expected null to contain '%s'", item);
expectTrue(this.getValue().contains(item), "Expected '%s' to contain '%s'", this.getValue(), item);
} | [
"public",
"void",
"toContain",
"(",
"final",
"Object",
"item",
")",
"{",
"expectNotNull",
"(",
"this",
".",
"getValue",
"(",
")",
",",
"\"Expected null to contain '%s'\"",
",",
"item",
")",
";",
"expectTrue",
"(",
"this",
".",
"getValue",
"(",
")",
".",
"c... | Checks if the stored {@code Collection} contains the provided item.
<p>This method throws an {@code AssertionError} if
<ul>
<li>the stored {@code Collection} does not contain the passed {@code item}</li>
<li>the given {@code Collection} is {@code null}</li>
</ul>
@param item the {@code Object} which the {@code Collecti... | [
"Checks",
"if",
"the",
"stored",
"{"
] | ce8c6fe2346cd0c0cf5f641417ff85019d1d09ac | https://github.com/mscharhag/oleaster/blob/ce8c6fe2346cd0c0cf5f641417ff85019d1d09ac/oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/CollectionMatcher.java#L28-L31 | train | Checks that the value contains the given item. | Create a Java method that does the following: "Checks that the value contains the given item.". | Of course, here is the Java code you requested:
```java
public void toContain(final Object item) {
expectNotNull(this.getValue(), "Expected null to contain '%s'", item);
expectTrue(this.getValue().contains(item), "Expected '%s' to contain '%s'", this.getValue(), item);
}
```
Hope this helps! | |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/BitmapUtil.java | BitmapUtil.writeInt | private static byte[] writeInt(int value) throws IOException {
byte[] b = new byte[4];
b[0] = (byte) (value & 0x000000FF);
b[1] = (byte) ((value & 0x0000FF00) >> 8);
b[2] = (byte) ((value & 0x00FF0000) >> 16);
b[3] = (byte) ((value & 0xFF000000) >> 24);
return b;
} | java | private static byte[] writeInt(int value) throws IOException {
byte[] b = new byte[4];
b[0] = (byte) (value & 0x000000FF);
b[1] = (byte) ((value & 0x0000FF00) >> 8);
b[2] = (byte) ((value & 0x00FF0000) >> 16);
b[3] = (byte) ((value & 0xFF000000) >> 24);
return b;
} | [
"private",
"static",
"byte",
"[",
"]",
"writeInt",
"(",
"int",
"value",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"b",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
"&",
"0x000000FF",
... | Write integer to little-endian
@param value
@return
@throws IOException | [
"Write",
"integer",
"to",
"little",
"-",
"endian"
] | 5123c1584757c6eeea0ed2a0e7e043629871a0c6 | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/BitmapUtil.java#L163-L172 | train | Write an int to a byte array. | Create a Java method that does the following: "Write an int to a byte array.". | Of course, here is the Java code you requested:
```java
private static byte[] writeInt(int value) throws IOException {
byte[] b = new byte[4];
b[0] = (byte) (value & 0x000000FF);
b[1] = (byte) ((value & 0x0000FF00) >> 8);
b[2] = (byte) ((value & 0x00FF0000) >> 16);
b[3] = (byte... | |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/util/FileAuthStore.java | FileAuthStore.clear | public void clear(String nsid) {
Auth a = this.auths.get(nsid);
if(a != null) {
this.authsByUser.remove(a.getUser().getUsername());
}
this.auths.remove(nsid);
this.authsByUser.remove(nsid); // in case username is passed.
File auth = new File(this.authStoreDir, nsi... | java | public void clear(String nsid) {
Auth a = this.auths.get(nsid);
if(a != null) {
this.authsByUser.remove(a.getUser().getUsername());
}
this.auths.remove(nsid);
this.authsByUser.remove(nsid); // in case username is passed.
File auth = new File(this.authStoreDir, nsi... | [
"public",
"void",
"clear",
"(",
"String",
"nsid",
")",
"{",
"Auth",
"a",
"=",
"this",
".",
"auths",
".",
"get",
"(",
"nsid",
")",
";",
"if",
"(",
"a",
"!=",
"null",
")",
"{",
"this",
".",
"authsByUser",
".",
"remove",
"(",
"a",
".",
"getUser",
... | /*
(non-Javadoc)
@see com.flickr4java.flickr.util.AuthStore#clear(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | f66987ba0e360e5fb7730efbbb8c51f3d978fc25 | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/util/FileAuthStore.java#L144-L155 | train | Removes all the records from the database. | Create a Java method that does the following: "Removes all the records from the database.". | Of course, here is the Java code you requested:
```java
public void clear(String nsid) {
Auth a = this.auths.get(nsid);
if(a != null) {
this.authsByUser.remove(a.getUser().getUsername());
}
this.auths.remove(nsid);
this.authsByUser.remove(nsid); // in case username is pas... | |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/RunJar.java | RunJar.main | public static void main(String[] args) throws Throwable {
String usage = "RunJar jarFile [mainClass] args...";
if (args.length < 1) {
System.err.println(usage);
System.exit(-1);
}
int firstArg = 0;
String fileName = args[firstArg++];
File file = new File(fileName);
String mainC... | java | public static void main(String[] args) throws Throwable {
String usage = "RunJar jarFile [mainClass] args...";
if (args.length < 1) {
System.err.println(usage);
System.exit(-1);
}
int firstArg = 0;
String fileName = args[firstArg++];
File file = new File(fileName);
String mainC... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"String",
"usage",
"=",
"\"RunJar jarFile [mainClass] args...\"",
";",
"if",
"(",
"args",
".",
"length",
"<",
"1",
")",
"{",
"System",
".",
"err",
".",
... | Run a Hadoop job jar. If the main class is not in the jar's manifest,
then it must be provided on the command line. | [
"Run",
"a",
"Hadoop",
"job",
"jar",
".",
"If",
"the",
"main",
"class",
"is",
"not",
"in",
"the",
"jar",
"s",
"manifest",
"then",
"it",
"must",
"be",
"provided",
"on",
"the",
"command",
"line",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/RunJar.java#L73-L160 | train | Main method for the Hadoop Unjar job. | Create a Java method that does the following: "Main method for the Hadoop Unjar job.". | Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws Throwable {
String usage = "RunJar jarFile [mainClass] args...";
if (args.length < 1) {
System.err.println(usage);
System.exit(-1);
}
int firstArg = 0;
String fileName = args[firstArg... | |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasUser.java | BaasUser.logout | public RequestToken logout(String registration, int flags, BaasHandler<Void> handler) {
BaasBox box = BaasBox.getDefaultChecked();
LogoutRequest request = new LogoutRequest(box, this, registration, flags, handler);
return box.submitAsync(request);
} | java | public RequestToken logout(String registration, int flags, BaasHandler<Void> handler) {
BaasBox box = BaasBox.getDefaultChecked();
LogoutRequest request = new LogoutRequest(box, this, registration, flags, handler);
return box.submitAsync(request);
} | [
"public",
"RequestToken",
"logout",
"(",
"String",
"registration",
",",
"int",
"flags",
",",
"BaasHandler",
"<",
"Void",
">",
"handler",
")",
"{",
"BaasBox",
"box",
"=",
"BaasBox",
".",
"getDefaultChecked",
"(",
")",
";",
"LogoutRequest",
"request",
"=",
"ne... | Logouts the user from the specific device. After this call completes no current user
is available. {@link BaasUser#current()} will return <code>null</code>.
And on this device the user will not receive any new message from google cloud messaging.
@param registration a registration id to remove
@param flags {@link Requ... | [
"Logouts",
"the",
"user",
"from",
"the",
"specific",
"device",
".",
"After",
"this",
"call",
"completes",
"no",
"current",
"user",
"is",
"available",
".",
"{",
"@link",
"BaasUser#current",
"()",
"}",
"will",
"return",
"<code",
">",
"null<",
"/",
"code",
">... | 6bb2203246b885b2ad63a7bfaf37c83caf15e0d8 | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasUser.java#L860-L864 | train | Asynchronously logouts the current user with the specified registration and flags. | Create a Java method that does the following: "Asynchronously logouts the current user with the specified registration and flags.". | Of course, here is the Java code you requested:
```java
public RequestToken logout(String registration, int flags, BaasHandler<Void> handler) {
BaasBox box = BaasBox.getDefaultChecked();
LogoutRequest request = new LogoutRequest(box, this, registration, flags, handler);
return box.submitAsync(r... | |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.doAfterTerminate | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doAfterTerminate(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return doOnEach(Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, onFinally);
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doAfterTerminate(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return doOnEach(Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, onFinally);
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"doAfterTerminate",
"(",
"Action",
"onFinally",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"onFinally",
",",
"... | Registers an {@link Action} to be called when this ObservableSource invokes either
{@link Observer#onComplete onComplete} or {@link Observer#onError onError}.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doAfterTerminate.png" alt="">
<dl>
<dt><b>Scheduler:</b><... | [
"Registers",
"an",
"{",
"@link",
"Action",
"}",
"to",
"be",
"called",
"when",
"this",
"ObservableSource",
"invokes",
"either",
"{",
"@link",
"Observer#onComplete",
"onComplete",
"}",
"or",
"{",
"@link",
"Observer#onError",
"onError",
"}",
".",
"<p",
">",
"<img... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L8038-L8043 | test | Performs a sequence of operations after the application terminate. | Create a Java method that does the following: "Performs a sequence of operations after the application terminate.". | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doAfterTerminate(Action onFinally) {
ObjectHelper.requireNonNull(onFinally, "onFinally is null");
return doOnEach(Functions.emptyConsumer(), Functions.em... | |
mikepenz/FastAdapter | library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.java | ExpandableExtension.deselect | public void deselect() {
SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class);
if (selectExtension == null) {
return;
}
for (Item item : AdapterUtil.getAllItems(mFastAdapter)) {
selectExtension.deselect(item);
}
... | java | public void deselect() {
SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class);
if (selectExtension == null) {
return;
}
for (Item item : AdapterUtil.getAllItems(mFastAdapter)) {
selectExtension.deselect(item);
}
... | [
"public",
"void",
"deselect",
"(",
")",
"{",
"SelectExtension",
"<",
"Item",
">",
"selectExtension",
"=",
"mFastAdapter",
".",
"getExtension",
"(",
"SelectExtension",
".",
"class",
")",
";",
"if",
"(",
"selectExtension",
"==",
"null",
")",
"{",
"return",
";"... | deselects all selections | [
"deselects",
"all",
"selections"
] | 3b2412abe001ba58422e0125846b704d4dba4ae9 | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.java#L485-L494 | train | Deselect all items in the adapter | Create a Java method that does the following: "Deselect all items in the adapter". | Of course, here is the Java code you requested:
```java
public void deselect() {
SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class);
if (selectExtension == null) {
return;
}
for (Item item : AdapterUtil.getAllItems(mFastAdapter)) {
... | |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreenToolbar.java | JScreenToolbar.addButtons | public void addButtons()
{
this.addButton(Constants.BACK);
this.addButton(Constants.GRID);
this.addButton(Constants.SUBMIT);
this.addButton(Constants.RESET);
this.addButton(Constants.DELETE);
this.addButton(Constants.HELP);
} | java | public void addButtons()
{
this.addButton(Constants.BACK);
this.addButton(Constants.GRID);
this.addButton(Constants.SUBMIT);
this.addButton(Constants.RESET);
this.addButton(Constants.DELETE);
this.addButton(Constants.HELP);
} | [
"public",
"void",
"addButtons",
"(",
")",
"{",
"this",
".",
"addButton",
"(",
"Constants",
".",
"BACK",
")",
";",
"this",
".",
"addButton",
"(",
"Constants",
".",
"GRID",
")",
";",
"this",
".",
"addButton",
"(",
"Constants",
".",
"SUBMIT",
")",
";",
... | Add the buttons to this window. | [
"Add",
"the",
"buttons",
"to",
"this",
"window",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreenToolbar.java#L50-L58 | train | Add the buttons that are used to create the page. | Create a Java method that does the following: "Add the buttons that are used to create the page.". | Of course, here is the Java code you requested:
```java
public void addButtons()
{
this.addButton(Constants.BACK);
this.addButton(Constants.GRID);
this.addButton(Constants.SUBMIT);
this.addButton(Constants.RESET);
this.addButton(Constants.DELETE);
this.addButton(Cons... | |
h2oai/h2o-3 | h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java | NonBlockingHashMapLong.print | public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
} | java | public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
} | [
"public",
"final",
"void",
"print",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"=========\"",
")",
";",
"print_impl",
"(",
"-",
"99",
",",
"NO_KEY",
",",
"_val_1",
")",
";",
"_chm",
".",
"print",
"(",
")",
";",
"System",
".",
"out"... | Verbose printout of table internals, useful for debugging. | [
"Verbose",
"printout",
"of",
"table",
"internals",
"useful",
"for",
"debugging",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java#L168-L173 | train | Print the content of this object. | Create a Java method that does the following: "Print the content of this object.". | Of course, here is the Java code you requested:
```java
public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
}
```
Hope this helps! | |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/mux/MuxServer.java | MuxServer.init | public void init(InputStream is, OutputStream os, boolean isClient)
{
this.is = is;
this.os = os;
this.isClient = isClient;
} | java | public void init(InputStream is, OutputStream os, boolean isClient)
{
this.is = is;
this.os = os;
this.isClient = isClient;
} | [
"public",
"void",
"init",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"boolean",
"isClient",
")",
"{",
"this",
".",
"is",
"=",
"is",
";",
"this",
".",
"os",
"=",
"os",
";",
"this",
".",
"isClient",
"=",
"isClient",
";",
"}"
] | Initialize the multiplexor with input and output streams.
@param is the underlying input stream
@param os the underlying output stream
@param isClient true if this is the connection client. | [
"Initialize",
"the",
"multiplexor",
"with",
"input",
"and",
"output",
"streams",
"."
] | 89e4f5af28602101dab7b498995018871616357b | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/mux/MuxServer.java#L102-L107 | train | Initialize the object. | Create a Java method that does the following: "Initialize the object.". | Of course, here is the Java code you requested:
```java
public void init(InputStream is, OutputStream os, boolean isClient)
{
this.is = is;
this.os = os;
this.isClient = isClient;
}
```
Hope this helps! | |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.setFilter | public void setFilter(Filter filter)
{
if (this.filter == null)
{
this.filter = new FilterList();
}
if (filter != null)
{
this.filter.addFilter(filter);
}
} | java | public void setFilter(Filter filter)
{
if (this.filter == null)
{
this.filter = new FilterList();
}
if (filter != null)
{
this.filter.addFilter(filter);
}
} | [
"public",
"void",
"setFilter",
"(",
"Filter",
"filter",
")",
"{",
"if",
"(",
"this",
".",
"filter",
"==",
"null",
")",
"{",
"this",
".",
"filter",
"=",
"new",
"FilterList",
"(",
")",
";",
"}",
"if",
"(",
"filter",
"!=",
"null",
")",
"{",
"this",
... | Sets the filter.
@param filter
the new filter | [
"Sets",
"the",
"filter",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L696-L706 | train | Sets the filter. | Create a Java method that does the following: "Sets the filter.". | Of course, here is the Java code you requested:
```java
public void setFilter(Filter filter)
{
if (this.filter == null)
{
this.filter = new FilterList();
}
if (filter != null)
{
this.filter.addFilter(filter);
}
}
```
Hope this helps! | |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/io/WritableFilesFilter.java | WritableFilesFilter.accept | @Override
@NullSafe
public boolean accept(File pathname) {
return (pathname != null && pathname.canWrite() == writable);
} | java | @Override
@NullSafe
public boolean accept(File pathname) {
return (pathname != null && pathname.canWrite() == writable);
} | [
"@",
"Override",
"@",
"NullSafe",
"public",
"boolean",
"accept",
"(",
"File",
"pathname",
")",
"{",
"return",
"(",
"pathname",
"!=",
"null",
"&&",
"pathname",
".",
"canWrite",
"(",
")",
"==",
"writable",
")",
";",
"}"
] | Determines whether the given {@link File} is accepted by this {@link FileFilter}, evaluating whether
the {@link File} is writable or not.
@param pathname {@link File} to evaluate.
@return a boolean value indicating whether writable {@link File}s are accepted or rejected.
@see org.cp.elements.lang.Filter#accept(Object)... | [
"Determines",
"whether",
"the",
"given",
"{",
"@link",
"File",
"}",
"is",
"accepted",
"by",
"this",
"{",
"@link",
"FileFilter",
"}",
"evaluating",
"whether",
"the",
"{",
"@link",
"File",
"}",
"is",
"writable",
"or",
"not",
"."
] | f2163c149fbbef05015e688132064ebcac7c49ab | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/io/WritableFilesFilter.java#L64-L68 | train | Override to accept a file. | Create a Java method that does the following: "Override to accept a file.". | Of course, here is the Java code you requested:
```java
@Override
@NullSafe
public boolean accept(File pathname) {
return (pathname != null && pathname.canWrite() == writable);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java | AmazonAutoScalingClient.describeNotificationConfigurations | @Override
public DescribeNotificationConfigurationsResult describeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeNotificationConfigurations(request);
} | java | @Override
public DescribeNotificationConfigurationsResult describeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeNotificationConfigurations(request);
} | [
"@",
"Override",
"public",
"DescribeNotificationConfigurationsResult",
"describeNotificationConfigurations",
"(",
"DescribeNotificationConfigurationsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeNotific... | <p>
Describes the notification actions associated with the specified Auto Scaling group.
</p>
@param describeNotificationConfigurationsRequest
@return Result of the DescribeNotificationConfigurations operation returned by the service.
@throws InvalidNextTokenException
The <code>NextToken</code> value is not valid.
@th... | [
"<p",
">",
"Describes",
"the",
"notification",
"actions",
"associated",
"with",
"the",
"specified",
"Auto",
"Scaling",
"group",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java#L2058-L2062 | train | Retrieves a list of notification configurations for a specific class. | Create a Java method that does the following: "Retrieves a list of notification configurations for a specific class.". | Of course, here is the Java code you requested:
```java
@Override
public DescribeNotificationConfigurationsResult describeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeNotificationConfigurations(reques... | |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/DefaultLocaleResolver.java | DefaultLocaleResolver.resolveLocaleCode | @Override
public String resolveLocaleCode(final HttpServletRequest request) {
String localCode = null;
if (request.getLocale() != Locale.getDefault()) {
localCode = request.getLocale().toString();
}
return localCode;
} | java | @Override
public String resolveLocaleCode(final HttpServletRequest request) {
String localCode = null;
if (request.getLocale() != Locale.getDefault()) {
localCode = request.getLocale().toString();
}
return localCode;
} | [
"@",
"Override",
"public",
"String",
"resolveLocaleCode",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"String",
"localCode",
"=",
"null",
";",
"if",
"(",
"request",
".",
"getLocale",
"(",
")",
"!=",
"Locale",
".",
"getDefault",
"(",
")",
")",
... | /*
(non-Javadoc)
@see
net.jawr.web.resource.bundle.locale.LocaleResolver#resolveLocaleCode(
javax.servlet.http.HttpServletRequest) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 5381f6acf461cd2502593c67a77bd6ef9eab848d | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/DefaultLocaleResolver.java#L40-L49 | train | Resolves the locale code for the request. | Create a Java method that does the following: "Resolves the locale code for the request.". | Of course, here is the Java code you requested:
```java
@Override
public String resolveLocaleCode(final HttpServletRequest request) {
String localCode = null;
if (request.getLocale() != Locale.getDefault()) {
localCode = request.getLocale().toString();
}
return localCode;
}
```
Hope this helps! | |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageutils/WebpUtil.java | WebpUtil.getSize | @Nullable public static Pair<Integer, Integer> getSize(InputStream is) {
// Here we have to parse the WebP data skipping all the information which are not
// the size
Pair<Integer, Integer> result = null;
byte[] headerBuffer = new byte[4];
try {
is.read(headerBuffer);
// These must be RI... | java | @Nullable public static Pair<Integer, Integer> getSize(InputStream is) {
// Here we have to parse the WebP data skipping all the information which are not
// the size
Pair<Integer, Integer> result = null;
byte[] headerBuffer = new byte[4];
try {
is.read(headerBuffer);
// These must be RI... | [
"@",
"Nullable",
"public",
"static",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
"getSize",
"(",
"InputStream",
"is",
")",
"{",
"// Here we have to parse the WebP data skipping all the information which are not",
"// the size",
"Pair",
"<",
"Integer",
",",
"Integer",
"... | This method checks for the dimension of the WebP image from the given InputStream. We don't
support mark/reset and the Stream is always closed.
@param is The InputStream used for read WebP data
@return The Size of the WebP image if any or null if the size is not available | [
"This",
"method",
"checks",
"for",
"the",
"dimension",
"of",
"the",
"WebP",
"image",
"from",
"the",
"given",
"InputStream",
".",
"We",
"don",
"t",
"support",
"mark",
"/",
"reset",
"and",
"the",
"Stream",
"is",
"always",
"closed",
"."
] | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageutils/WebpUtil.java#L44-L85 | train | Get the size of the image from the input stream. | Create a Java method that does the following: "Get the size of the image from the input stream.". | Of course, here is the Java code you requested:
```java
@Nullable public static Pair<Integer, Integer> getSize(InputStream is) {
// Here we have to parse the WebP data skipping all the information which are not
// the size
Pair<Integer, Integer> result = null;
byte[] headerBuffer = new byte[4];
try... | |
robolectric/robolectric | resources/src/main/java/org/robolectric/res/android/CppAssetManager2.java | CppAssetManager2.getAssetPaths | public List<AssetPath> getAssetPaths() {
ArrayList<AssetPath> assetPaths = new ArrayList<>(apk_assets_.size());
for (CppApkAssets apkAssets : apk_assets_) {
Path path = Fs.fromUrl(apkAssets.GetPath());
assetPaths.add(new AssetPath(path, apkAssets.GetLoadedArsc().IsSystem()));
}
return assetP... | java | public List<AssetPath> getAssetPaths() {
ArrayList<AssetPath> assetPaths = new ArrayList<>(apk_assets_.size());
for (CppApkAssets apkAssets : apk_assets_) {
Path path = Fs.fromUrl(apkAssets.GetPath());
assetPaths.add(new AssetPath(path, apkAssets.GetLoadedArsc().IsSystem()));
}
return assetP... | [
"public",
"List",
"<",
"AssetPath",
">",
"getAssetPaths",
"(",
")",
"{",
"ArrayList",
"<",
"AssetPath",
">",
"assetPaths",
"=",
"new",
"ArrayList",
"<>",
"(",
"apk_assets_",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"CppApkAssets",
"apkAssets",
":",
"... | namespace android | [
"namespace",
"android"
] | 4fa79a2c72f8abbf742ab920419653c207b41d62 | https://github.com/robolectric/robolectric/blob/4fa79a2c72f8abbf742ab920419653c207b41d62/resources/src/main/java/org/robolectric/res/android/CppAssetManager2.java#L1664-L1671 | valid | Get the asset paths | Create a Java method that does the following: "Get the asset paths". | Of course, here is the Java code you requested:
```java
public List<AssetPath> getAssetPaths() {
ArrayList<AssetPath> assetPaths = new ArrayList<>(apk_assets_.size());
for (CppApkAssets apkAssets : apk_assets_) {
Path path = Fs.fromUrl(apkAssets.GetPath());
assetPaths.add(new AssetPath(path, apkAss... | |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/EmailAttachment.java | EmailAttachment.writeToStream | public void writeToStream(final OutputStream out) {
InputStream input = null;
try {
input = getDataSource().getInputStream();
StreamUtil.copy(input, out);
}
catch (final IOException ioex) {
throw new MailException(ioex);
}
finally {
StreamUtil.close(input);
}
} | java | public void writeToStream(final OutputStream out) {
InputStream input = null;
try {
input = getDataSource().getInputStream();
StreamUtil.copy(input, out);
}
catch (final IOException ioex) {
throw new MailException(ioex);
}
finally {
StreamUtil.close(input);
}
} | [
"public",
"void",
"writeToStream",
"(",
"final",
"OutputStream",
"out",
")",
"{",
"InputStream",
"input",
"=",
"null",
";",
"try",
"{",
"input",
"=",
"getDataSource",
"(",
")",
".",
"getInputStream",
"(",
")",
";",
"StreamUtil",
".",
"copy",
"(",
"input",
... | Saves attachment to the output stream.
@param out OutputStream where attachment should be copied to. | [
"Saves",
"attachment",
"to",
"the",
"output",
"stream",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EmailAttachment.java#L295-L308 | test | Write the data to an output stream. | Create a Java method that does the following: "Write the data to an output stream.". | Of course, here is the Java code you requested:
```java
public void writeToStream(final OutputStream out) {
InputStream input = null;
try {
input = getDataSource().getInputStream();
StreamUtil.copy(input, out);
}
catch (final IOException ioex) {
throw new MailException(ioex);
}
finally {
Strea... | |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/SortedList.java | SortedList.removeItemAt | public T removeItemAt(int index) {
T item = get(index);
removeItemAtIndex(index, true);
return item;
} | java | public T removeItemAt(int index) {
T item = get(index);
removeItemAtIndex(index, true);
return item;
} | [
"public",
"T",
"removeItemAt",
"(",
"int",
"index",
")",
"{",
"T",
"item",
"=",
"get",
"(",
"index",
")",
";",
"removeItemAtIndex",
"(",
"index",
",",
"true",
")",
";",
"return",
"item",
";",
"}"
] | Removes the item at the given index and calls {@link Callback#onRemoved(int, int)}.
@param index The index of the item to be removed.
@return The removed item. | [
"Removes",
"the",
"item",
"at",
"the",
"given",
"index",
"and",
"calls",
"{",
"@link",
"Callback#onRemoved",
"(",
"int",
"int",
")",
"}",
"."
] | 8a5a51d9d2eeb91fed2ee331a4cf3496282452ce | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/SortedList.java#L224-L228 | train | Removes the item at the specified index. | Create a Java method that does the following: "Removes the item at the specified index.". | Of course, here is the Java code you requested:
```java
public T removeItemAt(int index) {
T item = get(index);
removeItemAtIndex(index, true);
return item;
}
```
Hope this helps! | |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.copy | public static ImmutableVector2 copy(Vector2 source) {
if (source instanceof ImmutableVector2) return (ImmutableVector2)source;
return createVector(source.getX(), source.getY());
} | java | public static ImmutableVector2 copy(Vector2 source) {
if (source instanceof ImmutableVector2) return (ImmutableVector2)source;
return createVector(source.getX(), source.getY());
} | [
"public",
"static",
"ImmutableVector2",
"copy",
"(",
"Vector2",
"source",
")",
"{",
"if",
"(",
"source",
"instanceof",
"ImmutableVector2",
")",
"return",
"(",
"ImmutableVector2",
")",
"source",
";",
"return",
"createVector",
"(",
"source",
".",
"getX",
"(",
")... | Returns an immutable vector with the same values as the argument.
@param source the vector containing the data for the new immutable vector
@return an immutable vector containing the same elements as {@code source}
@throws NullPointerException if {@code source} is {@code null} | [
"Returns",
"an",
"immutable",
"vector",
"with",
"the",
"same",
"values",
"as",
"the",
"argument",
"."
] | 018570db945fe616b25606fe605fa6e0c180ab5b | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L154-L157 | train | Creates a copy of the given vector. | Create a Java method that does the following: "Creates a copy of the given vector.". | Of course, here is the Java code you requested:
```java
public static ImmutableVector2 copy(Vector2 source) {
if (source instanceof ImmutableVector2) return (ImmutableVector2)source;
return createVector(source.getX(), source.getY());
}
```
Hope this helps! | |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/image/ConvertImage.java | ConvertImage.convert | public static GrayU8 convert(GrayF64 input , double min , double max , int numValues , GrayU8 output )
{
if (output == null) {
output = new GrayU8(input.width, input.height);
} else {
output.reshape(input.width,input.height);
}
if( numValues < 0 || numValues > 256 )
throw new IllegalArgumentException(... | java | public static GrayU8 convert(GrayF64 input , double min , double max , int numValues , GrayU8 output )
{
if (output == null) {
output = new GrayU8(input.width, input.height);
} else {
output.reshape(input.width,input.height);
}
if( numValues < 0 || numValues > 256 )
throw new IllegalArgumentException(... | [
"public",
"static",
"GrayU8",
"convert",
"(",
"GrayF64",
"input",
",",
"double",
"min",
",",
"double",
"max",
",",
"int",
"numValues",
",",
"GrayU8",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"GrayU8",
"(",
... | Converts pixel values in the input image into an integer values from 0 to numValues.
@param input Input image
@param min minimum input pixel value, inclusive
@param max maximum input pixel value, inclusive
@param numValues Number of possible pixel values in output image
@param output (Optional) Storage for the output i... | [
"Converts",
"pixel",
"values",
"in",
"the",
"input",
"image",
"into",
"an",
"integer",
"values",
"from",
"0",
"to",
"numValues",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/image/ConvertImage.java#L3503-L3526 | train | Converts an F64 image into a GrayU8 image. | Create a Java method that does the following: "Converts an F64 image into a GrayU8 image.". | Of course, here is the Java code you requested:
```java
public static GrayU8 convert(GrayF64 input , double min , double max , int numValues , GrayU8 output )
{
if (output == null) {
output = new GrayU8(input.width, input.height);
} else {
output.reshape(input.width,input.height);
}
if( numValues < 0 ||... | |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java | JsonUtils.getNode | public static Node getNode(Object root, String path) {
return getNode(root, Path.create(path));
} | java | public static Node getNode(Object root, String path) {
return getNode(root, Path.create(path));
} | [
"public",
"static",
"Node",
"getNode",
"(",
"Object",
"root",
",",
"String",
"path",
")",
"{",
"return",
"getNode",
"(",
"root",
",",
"Path",
".",
"create",
"(",
"path",
")",
")",
";",
"}"
] | Returns node with given path.
@param root
@param path
@return | [
"Returns",
"node",
"with",
"given",
"path",
"."
] | 2b12ed792e8dd787bddd6f3b8eb2325737435791 | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java#L81-L83 | train | Get a node from the root object and path. | Create a Java method that does the following: "Get a node from the root object and path.". | Of course, here is the Java code you requested:
```java
public static Node getNode(Object root, String path) {
return getNode(root, Path.create(path));
}
```
Hope this helps! | |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java | KDTree.distanceToHrect | protected double distanceToHrect(KDTreeNode node, Instance x) throws Exception {
double distance = 0.0;
Instance closestPoint = (Instance)x.copy();
boolean inside;
inside = clipToInsideHrect(node, closestPoint);
if (!inside)
distance = m_EuclideanDistance.distance(closestPoint, x);
return... | java | protected double distanceToHrect(KDTreeNode node, Instance x) throws Exception {
double distance = 0.0;
Instance closestPoint = (Instance)x.copy();
boolean inside;
inside = clipToInsideHrect(node, closestPoint);
if (!inside)
distance = m_EuclideanDistance.distance(closestPoint, x);
return... | [
"protected",
"double",
"distanceToHrect",
"(",
"KDTreeNode",
"node",
",",
"Instance",
"x",
")",
"throws",
"Exception",
"{",
"double",
"distance",
"=",
"0.0",
";",
"Instance",
"closestPoint",
"=",
"(",
"Instance",
")",
"x",
".",
"copy",
"(",
")",
";",
"bool... | Returns the distance between a point and an hyperrectangle.
@param node The current node from whose hyperrectangle
the distance is to be measured.
@param x the point
@return the distance
@throws Exception If some problem occurs in determining
the distance to the hyperrectangle. | [
"Returns",
"the",
"distance",
"between",
"a",
"point",
"and",
"an",
"hyperrectangle",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java#L819-L828 | train | Get the distance between the given instance and the closest point in the node. | Create a Java method that does the following: "Get the distance between the given instance and the closest point in the node.". | Of course, here is the Java code you requested:
```java
protected double distanceToHrect(KDTreeNode node, Instance x) throws Exception {
double distance = 0.0;
Instance closestPoint = (Instance)x.copy();
boolean inside;
inside = clipToInsideHrect(node, closestPoint);
if (!inside)
distance = ... | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.toBuffered | public static BufferedInputStream toBuffered(InputStream in) {
return (in instanceof BufferedInputStream) ? (BufferedInputStream) in : new BufferedInputStream(in);
} | java | public static BufferedInputStream toBuffered(InputStream in) {
return (in instanceof BufferedInputStream) ? (BufferedInputStream) in : new BufferedInputStream(in);
} | [
"public",
"static",
"BufferedInputStream",
"toBuffered",
"(",
"InputStream",
"in",
")",
"{",
"return",
"(",
"in",
"instanceof",
"BufferedInputStream",
")",
"?",
"(",
"BufferedInputStream",
")",
"in",
":",
"new",
"BufferedInputStream",
"(",
"in",
")",
";",
"}"
] | 转换为{@link BufferedInputStream}
@param in {@link InputStream}
@return {@link BufferedInputStream}
@since 4.0.10 | [
"转换为",
"{",
"@link",
"BufferedInputStream",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L803-L805 | train | Converts an input stream to a buffered input stream. | Create a Java method that does the following: "Converts an input stream to a buffered input stream.". | Of course, here is the Java code you requested:
```java
public static BufferedInputStream toBuffered(InputStream in) {
return (in instanceof BufferedInputStream) ? (BufferedInputStream) in : new BufferedInputStream(in);
}
```
Hope this helps! | |
randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/balancers/ExecutionTimeBalancer.java | ExecutionTimeBalancer.assign | @Override
public List<Assignment> assign(Collection<String> suiteNames, int slaves, long seed) {
// Read hints first.
final Map<String,List<Long>> hints = ExecutionTimesReport.mergeHints(resources, suiteNames);
// Preprocess and sort costs. Take the median for each suite's measurements as the
// wei... | java | @Override
public List<Assignment> assign(Collection<String> suiteNames, int slaves, long seed) {
// Read hints first.
final Map<String,List<Long>> hints = ExecutionTimesReport.mergeHints(resources, suiteNames);
// Preprocess and sort costs. Take the median for each suite's measurements as the
// wei... | [
"@",
"Override",
"public",
"List",
"<",
"Assignment",
">",
"assign",
"(",
"Collection",
"<",
"String",
">",
"suiteNames",
",",
"int",
"slaves",
",",
"long",
"seed",
")",
"{",
"// Read hints first.",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Long",
... | Assign based on execution time history. The algorithm is a greedy heuristic
assigning the longest remaining test to the slave with the
shortest-completion time so far. This is not optimal but fast and provides
a decent average assignment. | [
"Assign",
"based",
"on",
"execution",
"time",
"history",
".",
"The",
"algorithm",
"is",
"a",
"greedy",
"heuristic",
"assigning",
"the",
"longest",
"remaining",
"test",
"to",
"the",
"slave",
"with",
"the",
"shortest",
"-",
"completion",
"time",
"so",
"far",
"... | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/balancers/ExecutionTimeBalancer.java#L76-L132 | train | Override the assign method. | Create a Java method that does the following: "Override the assign method.". | Of course, here is the Java code you requested:
```java
@Override
public List<Assignment> assign(Collection<String> suiteNames, int slaves, long seed) {
// Read hints first.
final Map<String,List<Long>> hints = ExecutionTimesReport.mergeHints(resources, suiteNames);
// Preprocess and sort costs. Take th... | |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/StatisticalDocumentClassifier.java | StatisticalDocumentClassifier.classifySortedScoreMap | public SortedMap<Double, Set<String>> classifySortedScoreMap(final String[] document) {
return docClassifier.sortedScoreMap(document);
} | java | public SortedMap<Double, Set<String>> classifySortedScoreMap(final String[] document) {
return docClassifier.sortedScoreMap(document);
} | [
"public",
"SortedMap",
"<",
"Double",
",",
"Set",
"<",
"String",
">",
">",
"classifySortedScoreMap",
"(",
"final",
"String",
"[",
"]",
"document",
")",
"{",
"return",
"docClassifier",
".",
"sortedScoreMap",
"(",
"document",
")",
";",
"}"
] | Get a map of the scores sorted in ascending order together with their associated labels.
Many labels can have the same score, hence the Set as value.
@param document the input text to classify
@return a map with the score as a key. The value is a Set of labels with their score. | [
"Get",
"a",
"map",
"of",
"the",
"scores",
"sorted",
"in",
"ascending",
"order",
"together",
"with",
"their",
"associated",
"labels",
".",
"Many",
"labels",
"can",
"have",
"the",
"same",
"score",
"hence",
"the",
"Set",
"as",
"value",
"."
] | c817fa1e40e96ed15fc79d22c3a7c25f1a40d172 | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/StatisticalDocumentClassifier.java#L59-L61 | train | Classify sorted score map. | Create a Java method that does the following: "Classify sorted score map.". | Of course, here is the Java code you requested:
```java
public SortedMap<Double, Set<String>> classifySortedScoreMap(final String[] document) {
return docClassifier.sortedScoreMap(document);
}
```
Hope this helps! | |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatusMonitor.java | JobStatusMonitor.updateStatus | public void updateStatus(JobStatus newStatus) {
JobMonitor monitor = getJobMonitor(newStatus);
monitor.updateStatus(newStatus);
} | java | public void updateStatus(JobStatus newStatus) {
JobMonitor monitor = getJobMonitor(newStatus);
monitor.updateStatus(newStatus);
} | [
"public",
"void",
"updateStatus",
"(",
"JobStatus",
"newStatus",
")",
"{",
"JobMonitor",
"monitor",
"=",
"getJobMonitor",
"(",
"newStatus",
")",
";",
"monitor",
".",
"updateStatus",
"(",
"newStatus",
")",
";",
"}"
] | Updates the appropriate <code>ProgressMonitor</code> (creating one if
necessary) according to the new status of the job.
@param newStatus The <code>JobStatus</code> indicating the new status of
the job. | [
"Updates",
"the",
"appropriate",
"<code",
">",
"ProgressMonitor<",
"/",
"code",
">",
"(",
"creating",
"one",
"if",
"necessary",
")",
"according",
"to",
"the",
"new",
"status",
"of",
"the",
"job",
"."
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatusMonitor.java#L85-L88 | train | Update the status of a job. | Create a Java method that does the following: "Update the status of a job.". | Of course, here is the Java code you requested:
```java
public void updateStatus(JobStatus newStatus) {
JobMonitor monitor = getJobMonitor(newStatus);
monitor.updateStatus(newStatus);
}
```
Hope this helps! | |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/DogmaApi.java | DogmaApi.getDogmaDynamicItemsTypeIdItemIdAsync | public com.squareup.okhttp.Call getDogmaDynamicItemsTypeIdItemIdAsync(Long itemId, Integer typeId,
String datasource, String ifNoneMatch, final ApiCallback<DogmaDynamicItemsResponse> callback)
throws ApiException {
com.squareup.okhttp.Call call = getDogmaDynamicItemsTypeIdItemIdValidate... | java | public com.squareup.okhttp.Call getDogmaDynamicItemsTypeIdItemIdAsync(Long itemId, Integer typeId,
String datasource, String ifNoneMatch, final ApiCallback<DogmaDynamicItemsResponse> callback)
throws ApiException {
com.squareup.okhttp.Call call = getDogmaDynamicItemsTypeIdItemIdValidate... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getDogmaDynamicItemsTypeIdItemIdAsync",
"(",
"Long",
"itemId",
",",
"Integer",
"typeId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
",",
"final",
"ApiCallback",
"<",
"DogmaDynamicItemsRes... | Get dynamic item information (asynchronously) Returns info about a
dynamic item resulting from mutation with a mutaplasmid. --- This route
expires daily at 11:05
@param itemId
item_id integer (required)
@param typeId
type_id integer (required)
@param datasource
The server name you would like data from (optional, defau... | [
"Get",
"dynamic",
"item",
"information",
"(",
"asynchronously",
")",
"Returns",
"info",
"about",
"a",
"dynamic",
"item",
"resulting",
"from",
"mutation",
"with",
"a",
"mutaplasmid",
".",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | 24a941c592cfc15f23471ef849b282fbc582ca13 | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/DogmaApi.java#L491-L501 | train | Get a dynamic item type ID asynchronously | Create a Java method that does the following: "Get a dynamic item type ID asynchronously". | Of course, here is the Java code you requested:
```java
public com.squareup.okhttp.Call getDogmaDynamicItemsTypeIdItemIdAsync(Long itemId, Integer typeId,
String datasource, String ifNoneMatch, final ApiCallback<DogmaDynamicItemsResponse> callback)
throws ApiException {
com.squareup.ok... | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.unWrap | public static char[] unWrap(Character... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new char[0];
}
char[] array = new char[length];
for (int i = 0; i < length; i++) {
array[i] = values[i].charValue();
}
return array... | java | public static char[] unWrap(Character... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new char[0];
}
char[] array = new char[length];
for (int i = 0; i < length; i++) {
array[i] = values[i].charValue();
}
return array... | [
"public",
"static",
"char",
"[",
"]",
"unWrap",
"(",
"Character",
"...",
"values",
")",
"{",
"if",
"(",
"null",
"==",
"values",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"length",
"=",
"values",
".",
"length",
";",
"if",
"(",
"0",
"==",... | 包装类数组转为原始类型数组
@param values 包装类型数组
@return 原始类型数组 | [
"包装类数组转为原始类型数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1509-L1523 | train | Creates an array of characters that are not wrapped in a Character object. | Create a Java method that does the following: "Creates an array of characters that are not wrapped in a Character object.". | Of course, here is the Java code you requested:
```java
public static char[] unWrap(Character... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new char[0];
}
char[] array = new char[length];
for (int i = 0; i < length; i++) {
... | |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeClient.java | GeodeClient.getRegion | @SuppressWarnings("unchecked")
public <K,V> Region<K,V> getRegion(String regionName)
{
if(regionName == null || regionName.length() == 0)
return null;
Region<K,V> region = (Region<K,V>)clientCache.getRegion(regionName);
if(region != null )
return (Region<K,V>)region;
region = (Region<K,V>)this.... | java | @SuppressWarnings("unchecked")
public <K,V> Region<K,V> getRegion(String regionName)
{
if(regionName == null || regionName.length() == 0)
return null;
Region<K,V> region = (Region<K,V>)clientCache.getRegion(regionName);
if(region != null )
return (Region<K,V>)region;
region = (Region<K,V>)this.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"K",
",",
"V",
">",
"Region",
"<",
"K",
",",
"V",
">",
"getRegion",
"(",
"String",
"regionName",
")",
"{",
"if",
"(",
"regionName",
"==",
"null",
"||",
"regionName",
".",
"length",
"(",... | This is an example to get or create a region
@param regionName the name
@param <K> the key type
@param <V> the value type
@return the existing or created region (using the ClientbRegionFactory) | [
"This",
"is",
"an",
"example",
"to",
"get",
"or",
"create",
"a",
"region"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeClient.java#L382-L404 | test | Get the region with the specified name. | Create a Java method that does the following: "Get the region with the specified name.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <K,V> Region<K,V> getRegion(String regionName)
{
if(regionName == null || regionName.length() == 0)
return null;
Region<K,V> region = (Region<K,V>)clientCache.getRegion(regionName);
if(region != null )
ret... | |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/lang/gosuc/Gosuc.java | Gosuc.main | public static void main( String[] args ) throws FileNotFoundException {
String error = GosucArg.parseArgs( args );
if( error != null ) {
System.err.println( error );
return;
}
String strFile = GosucArg.PROJECT.getValue();
Gosuc gosuc = new Gosuc( strFile, maybeGetCustomParser() );
go... | java | public static void main( String[] args ) throws FileNotFoundException {
String error = GosucArg.parseArgs( args );
if( error != null ) {
System.err.println( error );
return;
}
String strFile = GosucArg.PROJECT.getValue();
Gosuc gosuc = new Gosuc( strFile, maybeGetCustomParser() );
go... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"FileNotFoundException",
"{",
"String",
"error",
"=",
"GosucArg",
".",
"parseArgs",
"(",
"args",
")",
";",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
"System",
".",
"e... | - Then run this from IJ using 'classpath of module' setting to match the proper module for pl/pc/cc etc. (this is so the global loaders will be in the classpath) | [
"-",
"Then",
"run",
"this",
"from",
"IJ",
"using",
"classpath",
"of",
"module",
"setting",
"to",
"match",
"the",
"proper",
"module",
"for",
"pl",
"/",
"pc",
"/",
"cc",
"etc",
".",
"(",
"this",
"is",
"so",
"the",
"global",
"loaders",
"will",
"be",
"in... | d6e9261b137ce66fef3726cabe7826d4a1f946b7 | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/lang/gosuc/Gosuc.java#L309-L319 | train | Main entry point for the Cosuc program. | Create a Java method that does the following: "Main entry point for the Cosuc program.". | Of course, here is the Java code you requested:
```java
public static void main( String[] args ) throws FileNotFoundException {
String error = GosucArg.parseArgs( args );
if( error != null ) {
System.err.println( error );
return;
}
String strFile = GosucArg.PROJECT.getValue();
Gosuc gos... | |
indeedeng/proctor | proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroupsPayload.java | AbstractGroupsPayload.convertObjectArrToLongArr | private Long[] convertObjectArrToLongArr(final Object[] list) {
final Long[] toReturn = new Long[list.length];
for(int i = 0; i < list.length; i++) {
toReturn[i] = ((Number)list[i]).longValue();
}
return toReturn;
} | java | private Long[] convertObjectArrToLongArr(final Object[] list) {
final Long[] toReturn = new Long[list.length];
for(int i = 0; i < list.length; i++) {
toReturn[i] = ((Number)list[i]).longValue();
}
return toReturn;
} | [
"private",
"Long",
"[",
"]",
"convertObjectArrToLongArr",
"(",
"final",
"Object",
"[",
"]",
"list",
")",
"{",
"final",
"Long",
"[",
"]",
"toReturn",
"=",
"new",
"Long",
"[",
"list",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i... | /*
Used because ObjectMapper does not always read in longs as longs (can be integer)
When it is a Map<String,Object> | [
"/",
"*",
"Used",
"because",
"ObjectMapper",
"does",
"not",
"always",
"read",
"in",
"longs",
"as",
"longs",
"(",
"can",
"be",
"integer",
")",
"When",
"it",
"is",
"a",
"Map<String",
"Object",
">"
] | b7795acfc26a30d013655d0e0fa1d3f8d0576571 | https://github.com/indeedeng/proctor/blob/b7795acfc26a30d013655d0e0fa1d3f8d0576571/proctor-consumer/src/main/java/com/indeed/proctor/consumer/AbstractGroupsPayload.java#L67-L73 | train | Convert object array to long array. | Create a Java method that does the following: "Convert object array to long array.". | Of course, here is the Java code you requested:
```java
private Long[] convertObjectArrToLongArr(final Object[] list) {
final Long[] toReturn = new Long[list.length];
for(int i = 0; i < list.length; i++) {
toReturn[i] = ((Number)list[i]).longValue();
}
return toReturn;
}... | |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/writer/Batch.java | Batch.onFailure | public void onFailure (Throwable throwable) {
for (Thunk thunk: this.thunks) {
thunk.callback.onFailure(throwable);
}
} | java | public void onFailure (Throwable throwable) {
for (Thunk thunk: this.thunks) {
thunk.callback.onFailure(throwable);
}
} | [
"public",
"void",
"onFailure",
"(",
"Throwable",
"throwable",
")",
"{",
"for",
"(",
"Thunk",
"thunk",
":",
"this",
".",
"thunks",
")",
"{",
"thunk",
".",
"callback",
".",
"onFailure",
"(",
"throwable",
")",
";",
"}",
"}"
] | When batch is sent with an error return, this method will be invoked | [
"When",
"batch",
"is",
"sent",
"with",
"an",
"error",
"return",
"this",
"method",
"will",
"be",
"invoked"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/writer/Batch.java#L111-L115 | train | Called when an exception occurs in the task. | Create a Java method that does the following: "Called when an exception occurs in the task.". | Of course, here is the Java code you requested:
```java
public void onFailure (Throwable throwable) {
for (Thunk thunk: this.thunks) {
thunk.callback.onFailure(throwable);
}
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/model/transform/DescribeStateMachineForExecutionRequestMarshaller.java | DescribeStateMachineForExecutionRequestMarshaller.marshall | public void marshall(DescribeStateMachineForExecutionRequest describeStateMachineForExecutionRequest, ProtocolMarshaller protocolMarshaller) {
if (describeStateMachineForExecutionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | java | public void marshall(DescribeStateMachineForExecutionRequest describeStateMachineForExecutionRequest, ProtocolMarshaller protocolMarshaller) {
if (describeStateMachineForExecutionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | [
"public",
"void",
"marshall",
"(",
"DescribeStateMachineForExecutionRequest",
"describeStateMachineForExecutionRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"describeStateMachineForExecutionRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"S... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/model/transform/DescribeStateMachineForExecutionRequestMarshaller.java#L42-L53 | train | marshalls the given request to the JSON - RPC method. | Create a Java method that does the following: "marshalls the given request to the JSON - RPC method.". | Of course, here is the Java code you requested:
```java
public void marshall(DescribeStateMachineForExecutionRequest describeStateMachineForExecutionRequest, ProtocolMarshaller protocolMarshaller) {
if (describeStateMachineForExecutionRequest == null) {
throw new SdkClientException("Invalid argume... | |
google/closure-templates | java/src/com/google/template/soy/types/SoyProtoType.java | SoyProtoType.getNameForBackend | public String getNameForBackend(SoyBackendKind backend) {
switch (backend) {
case JS_SRC:
// The 'proto' prefix is JSPB-specific. If we ever support some other
// JavaScript proto implementation, we'll need some way to determine which
// proto implementation the user wants to use at th... | java | public String getNameForBackend(SoyBackendKind backend) {
switch (backend) {
case JS_SRC:
// The 'proto' prefix is JSPB-specific. If we ever support some other
// JavaScript proto implementation, we'll need some way to determine which
// proto implementation the user wants to use at th... | [
"public",
"String",
"getNameForBackend",
"(",
"SoyBackendKind",
"backend",
")",
"{",
"switch",
"(",
"backend",
")",
"{",
"case",
"JS_SRC",
":",
"// The 'proto' prefix is JSPB-specific. If we ever support some other",
"// JavaScript proto implementation, we'll need some way to deter... | Returns this proto's type name for the given backend. | [
"Returns",
"this",
"proto",
"s",
"type",
"name",
"for",
"the",
"given",
"backend",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/types/SoyProtoType.java#L269-L283 | train | Returns the name of the type for the given backend. | Create a Java method that does the following: "Returns the name of the type for the given backend.". | Of course, here is the Java code you requested:
```java
public String getNameForBackend(SoyBackendKind backend) {
switch (backend) {
case JS_SRC:
// The 'proto' prefix is JSPB-specific. If we ever support some other
// JavaScript proto implementation, we'll need some way to determine which
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/container/jaxrs/RolesEndpoint.java | RolesEndpoint.checkIsUserInRole | @GET
@Path("/checkIsUserInRole")
@RolesAllowed("Tester")
public Response checkIsUserInRole(@Context SecurityContext sec) {
Principal user = sec.getUserPrincipal();
Response response;
if (!sec.isUserInRole("Echoer")) {
response = Response.status(new Response.StatusType() {... | java | @GET
@Path("/checkIsUserInRole")
@RolesAllowed("Tester")
public Response checkIsUserInRole(@Context SecurityContext sec) {
Principal user = sec.getUserPrincipal();
Response response;
if (!sec.isUserInRole("Echoer")) {
response = Response.status(new Response.StatusType() {... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/checkIsUserInRole\"",
")",
"@",
"RolesAllowed",
"(",
"\"Tester\"",
")",
"public",
"Response",
"checkIsUserInRole",
"(",
"@",
"Context",
"SecurityContext",
"sec",
")",
"{",
"Principal",
"user",
"=",
"sec",
".",
"getUserPrincipal"... | This endpoint requires a Tester role, and also validates that the caller has the role Echoer by calling
{@linkplain SecurityContext#isUserInRole(String)}.
@return principal name or FORBIDDEN error | [
"This",
"endpoint",
"requires",
"a",
"Tester",
"role",
"and",
"also",
"validates",
"that",
"the",
"caller",
"has",
"the",
"role",
"Echoer",
"by",
"calling",
"{",
"@linkplain",
"SecurityContext#isUserInRole",
"(",
"String",
")",
"}",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/container/jaxrs/RolesEndpoint.java#L120-L147 | train | Check if user is in role | Create a Java method that does the following: "Check if user is in role". | Of course, here is the Java code you requested:
```java
@GET
@Path("/checkIsUserInRole")
@RolesAllowed("Tester")
public Response checkIsUserInRole(@Context SecurityContext sec) {
Principal user = sec.getUserPrincipal();
Response response;
if (!sec.isUserInRole("Echoer")) {
... | |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/AbstractJdbcDAO.java | AbstractJdbcDAO.getPreparedStatement | protected PreparedStatement getPreparedStatement(String sql)
throws SQLException {
// Inject the schema name into the SQL
String replacedSQL = injectSchema(sql);
return getPreparedStatement(replacedSQL, replacedSQL);
} | java | protected PreparedStatement getPreparedStatement(String sql)
throws SQLException {
// Inject the schema name into the SQL
String replacedSQL = injectSchema(sql);
return getPreparedStatement(replacedSQL, replacedSQL);
} | [
"protected",
"PreparedStatement",
"getPreparedStatement",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"// Inject the schema name into the SQL",
"String",
"replacedSQL",
"=",
"injectSchema",
"(",
"sql",
")",
";",
"return",
"getPreparedStatement",
"(",
"replac... | Returns a {@link PreparedStatement} for the SQL statement in
<tt>sql</tt>.
@param sql {@link String}, the sql to prepare which can take certain
placeholders:<ul>
<il>? - paremeter substitution marker for the {@link PreparedStatement}</li>
<il>@ - schema name substitution marker defined</li></ul>
@return {@link Prepare... | [
"Returns",
"a",
"{",
"@link",
"PreparedStatement",
"}",
"for",
"the",
"SQL",
"statement",
"in",
"<tt",
">",
"sql<",
"/",
"tt",
">",
"."
] | 149f80b1d6eabb15ab15815b6f745b0afa9fd2d3 | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/AbstractJdbcDAO.java#L129-L134 | train | Get a PreparedStatement for the SQL sequence. | Create a Java method that does the following: "Get a PreparedStatement for the SQL sequence.". | Of course, here is the Java code you requested:
```java
protected PreparedStatement getPreparedStatement(String sql)
throws SQLException {
// Inject the schema name into the SQL
String replacedSQL = injectSchema(sql);
return getPreparedStatement(replacedSQL, replacedSQL);
}
```
... | |
akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/repo/CeylonRepoLayout.java | CeylonRepoLayout.toUri | private URI toUri(final String path) {
try {
return new URI(null, null, path, null);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
} | java | private URI toUri(final String path) {
try {
return new URI(null, null, path, null);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
} | [
"private",
"URI",
"toUri",
"(",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"null",
",",
"null",
",",
"path",
",",
"null",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"IllegalArg... | Converts from String to URI.
@param path The string to convert
@return URI if there was no exception | [
"Converts",
"from",
"String",
"to",
"URI",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/repo/CeylonRepoLayout.java#L84-L90 | train | Converts a path to a URI. | Create a Java method that does the following: "Converts a path to a URI.". | Of course, here is the Java code you requested:
```java
private URI toUri(final String path) {
try {
return new URI(null, null, path, null);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
}
```
Hope this helps! | |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/assistant/BeanReferenceInspector.java | BeanReferenceInspector.reserve | public void reserve(String beanId, Class<?> beanClass, BeanReferenceable referenceable, RuleAppender ruleAppender) {
RefererKey key = new RefererKey(beanClass, beanId);
Set<RefererInfo> refererInfoSet = refererInfoMap.get(key);
if (refererInfoSet == null) {
refererInfoSet = new Linke... | java | public void reserve(String beanId, Class<?> beanClass, BeanReferenceable referenceable, RuleAppender ruleAppender) {
RefererKey key = new RefererKey(beanClass, beanId);
Set<RefererInfo> refererInfoSet = refererInfoMap.get(key);
if (refererInfoSet == null) {
refererInfoSet = new Linke... | [
"public",
"void",
"reserve",
"(",
"String",
"beanId",
",",
"Class",
"<",
"?",
">",
"beanClass",
",",
"BeanReferenceable",
"referenceable",
",",
"RuleAppender",
"ruleAppender",
")",
"{",
"RefererKey",
"key",
"=",
"new",
"RefererKey",
"(",
"beanClass",
",",
"bea... | Reserves to bean reference inspection.
@param beanId the bean id
@param beanClass the bean class
@param referenceable the object to be inspected
@param ruleAppender the rule appender | [
"Reserves",
"to",
"bean",
"reference",
"inspection",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/assistant/BeanReferenceInspector.java#L59-L69 | train | Reserve a bean. | Create a Java method that does the following: "Reserve a bean.". | Of course, here is the Java code you requested:
```java
public void reserve(String beanId, Class<?> beanClass, BeanReferenceable referenceable, RuleAppender ruleAppender) {
RefererKey key = new RefererKey(beanClass, beanId);
Set<RefererInfo> refererInfoSet = refererInfoMap.get(key);
if (referer... | |
renepickhardt/metalcon | graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/user/CreateUserRequest.java | CreateUserRequest.checkDisplayName | private static String checkDisplayName(final FormItemList formItemList,
final CreateUserResponse createUserResponse) {
final String displayName = formItemList
.getField(ProtocolConstants.Parameters.Create.User.DISPLAY_NAME);
if (displayName != null) {
return displayName;
} else {
createUserResponse.d... | java | private static String checkDisplayName(final FormItemList formItemList,
final CreateUserResponse createUserResponse) {
final String displayName = formItemList
.getField(ProtocolConstants.Parameters.Create.User.DISPLAY_NAME);
if (displayName != null) {
return displayName;
} else {
createUserResponse.d... | [
"private",
"static",
"String",
"checkDisplayName",
"(",
"final",
"FormItemList",
"formItemList",
",",
"final",
"CreateUserResponse",
"createUserResponse",
")",
"{",
"final",
"String",
"displayName",
"=",
"formItemList",
".",
"getField",
"(",
"ProtocolConstants",
".",
... | check if the request contains a display name
@param formItemList
form item list extracted
@param createUserResponse
response object
@return display name<br>
<b>null</b> if there was no display name passed | [
"check",
"if",
"the",
"request",
"contains",
"a",
"display",
"name"
] | 26a7bd89d2225fe2172dc958d10f64a1bd9cf52f | https://github.com/renepickhardt/metalcon/blob/26a7bd89d2225fe2172dc958d10f64a1bd9cf52f/graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/user/CreateUserRequest.java#L147-L158 | train | Check displayName. | Create a Java method that does the following: "Check displayName.". | Of course, here is the Java code you requested:
```java
private static String checkDisplayName(final FormItemList formItemList,
final CreateUserResponse createUserResponse) {
final String displayName = formItemList
.getField(ProtocolConstants.Parameters.Create.User.DISPLAY_NAME);
if (displayName != null) {
... | |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/util/ResourceManager.java | ResourceManager.resolve | public static String resolve(String rbAndProperty, Object[] args) {
String value = common().resolve0(rbAndProperty);
return MessageFormat.format(value, args);
} | java | public static String resolve(String rbAndProperty, Object[] args) {
String value = common().resolve0(rbAndProperty);
return MessageFormat.format(value, args);
} | [
"public",
"static",
"String",
"resolve",
"(",
"String",
"rbAndProperty",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"String",
"value",
"=",
"common",
"(",
")",
".",
"resolve0",
"(",
"rbAndProperty",
")",
";",
"return",
"MessageFormat",
".",
"format",
"(",
... | Same as {@link #resolve(String)} but once the value as been resolved, a
MessageFormatter is applied with the given <code>args</code>.
@param rbAndProperty
@param args
@return the value for the resource parametrized by args | [
"Same",
"as",
"{",
"@link",
"#resolve",
"(",
"String",
")",
"}",
"but",
"once",
"the",
"value",
"as",
"been",
"resolved",
"a",
"MessageFormatter",
"is",
"applied",
"with",
"the",
"given",
"<code",
">",
"args<",
"/",
"code",
">",
"."
] | d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32 | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/util/ResourceManager.java#L119-L122 | train | Resolve a resource bundle and return the result as a string. | Create a Java method that does the following: "Resolve a resource bundle and return the result as a string.". | Of course, here is the Java code you requested:
```java
public static String resolve(String rbAndProperty, Object[] args) {
String value = common().resolve0(rbAndProperty);
return MessageFormat.format(value, args);
}
```
Hope this helps! | |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.removeByG_S_A | @Override
public void removeByG_S_A(long groupId, boolean shippingAllowed,
boolean active) {
for (CommerceCountry commerceCountry : findByG_S_A(groupId,
shippingAllowed, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null)) {
remove(commerceCountry);
}
} | java | @Override
public void removeByG_S_A(long groupId, boolean shippingAllowed,
boolean active) {
for (CommerceCountry commerceCountry : findByG_S_A(groupId,
shippingAllowed, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null)) {
remove(commerceCountry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_S_A",
"(",
"long",
"groupId",
",",
"boolean",
"shippingAllowed",
",",
"boolean",
"active",
")",
"{",
"for",
"(",
"CommerceCountry",
"commerceCountry",
":",
"findByG_S_A",
"(",
"groupId",
",",
"shippingAllowed",
",",
... | Removes all the commerce countries where groupId = ? and shippingAllowed = ? and active = ? from the database.
@param groupId the group ID
@param shippingAllowed the shipping allowed
@param active the active | [
"Removes",
"all",
"the",
"commerce",
"countries",
"where",
"groupId",
"=",
"?",
";",
"and",
"shippingAllowed",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L4114-L4122 | train | Removes all the commerce countries in the database where the commerce country is not in the database. Also notifies the appropriate model listeners. | Create a Java method that does the following: "Removes all the commerce countries in the database where the commerce country is not in the database. Also notifies the appropriate model listeners.". | Of course, here is the Java code you requested:
```java
@Override
public void removeByG_S_A(long groupId, boolean shippingAllowed,
boolean active) {
for (CommerceCountry commerceCountry : findByG_S_A(groupId,
shippingAllowed, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null)) {
remove(commerceCountry... | |
spring-projects/spring-social | spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java | ConnectController.addInterceptor | public void addInterceptor(ConnectInterceptor<?> interceptor) {
Class<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ConnectInterceptor.class);
connectInterceptors.add(serviceApiType, interceptor);
} | java | public void addInterceptor(ConnectInterceptor<?> interceptor) {
Class<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ConnectInterceptor.class);
connectInterceptors.add(serviceApiType, interceptor);
} | [
"public",
"void",
"addInterceptor",
"(",
"ConnectInterceptor",
"<",
"?",
">",
"interceptor",
")",
"{",
"Class",
"<",
"?",
">",
"serviceApiType",
"=",
"GenericTypeResolver",
".",
"resolveTypeArgument",
"(",
"interceptor",
".",
"getClass",
"(",
")",
",",
"ConnectI... | Adds a ConnectInterceptor to receive callbacks during the connection process.
Useful for programmatic configuration.
@param interceptor the connect interceptor to add | [
"Adds",
"a",
"ConnectInterceptor",
"to",
"receive",
"callbacks",
"during",
"the",
"connection",
"process",
".",
"Useful",
"for",
"programmatic",
"configuration",
"."
] | e41cfecb288022b83c79413b58f52511c3c9d4fc | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java#L184-L187 | train | Add a ConnectInterceptor to the interceptor list. | Create a Java method that does the following: "Add a ConnectInterceptor to the interceptor list.". | Of course, here is the Java code you requested:
```java
public void addInterceptor(ConnectInterceptor<?> interceptor) {
Class<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ConnectInterceptor.class);
connectInterceptors.add(serviceApiType, interceptor);
}
```
Hope this helps! | |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/RemoteEnvironment.java | RemoteEnvironment.dispose | protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();
}
}
catch (Exception e) {
throw new RuntimeExc... | java | protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();
}
}
catch (Exception e) {
throw new RuntimeExc... | [
"protected",
"void",
"dispose",
"(",
")",
"{",
"// Remove shutdown hook to prevent resource leaks",
"ShutdownHookUtil",
".",
"removeShutdownHook",
"(",
"shutdownHook",
",",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
",",
"LOG",
")",
";",
"try",
"{",
"Pl... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/RemoteEnvironment.java#L227-L240 | train | Dispose of the session. | Create a Java method that does the following: "Dispose of the session.". | Of course, here is the Java code you requested:
```java
protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();... | |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java | PreprocessorContext.isLocalVariable | public boolean isLocalVariable(@Nullable final String variableName) {
boolean result = false;
if (variableName != null) {
final String normalized = PreprocessorUtils.normalizeVariableName(variableName);
result = this.localVarTable.containsKey(normalized);
}
return result;
} | java | public boolean isLocalVariable(@Nullable final String variableName) {
boolean result = false;
if (variableName != null) {
final String normalized = PreprocessorUtils.normalizeVariableName(variableName);
result = this.localVarTable.containsKey(normalized);
}
return result;
} | [
"public",
"boolean",
"isLocalVariable",
"(",
"@",
"Nullable",
"final",
"String",
"variableName",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"variableName",
"!=",
"null",
")",
"{",
"final",
"String",
"normalized",
"=",
"PreprocessorUtils",
"."... | Check that there is a local variable with such name.
@param variableName a name to be checked, can be null
@return false if there is not such variable or it is null, true if such local variable exists | [
"Check",
"that",
"there",
"is",
"a",
"local",
"variable",
"with",
"such",
"name",
"."
] | 83ac87b575ac084914d77695a8c8673de3b8300c | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java#L695-L702 | train | Check if a variable is a local variable. | Create a Java method that does the following: "Check if a variable is a local variable.". | Of course, here is the Java code you requested:
```java
public boolean isLocalVariable(@Nullable final String variableName) {
boolean result = false;
if (variableName != null) {
final String normalized = PreprocessorUtils.normalizeVariableName(variableName);
result = this.localVarTable.containsKey(... | |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.setReadOnly | public void setReadOnly(boolean readonly) {
if (!readonly && database.databaseReadOnly) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
isReadOnly = readonly;
} | java | public void setReadOnly(boolean readonly) {
if (!readonly && database.databaseReadOnly) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
}
isReadOnly = readonly;
} | [
"public",
"void",
"setReadOnly",
"(",
"boolean",
"readonly",
")",
"{",
"if",
"(",
"!",
"readonly",
"&&",
"database",
".",
"databaseReadOnly",
")",
"{",
"throw",
"Error",
".",
"error",
"(",
"ErrorCode",
".",
"DATABASE_IS_READONLY",
")",
";",
"}",
"if",
"(",... | sets READ ONLY for next transaction only
@param readonly the new value | [
"sets",
"READ",
"ONLY",
"for",
"next",
"transaction",
"only"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L737-L748 | train | Sets the isReadOnly property. | Create a Java method that does the following: "Sets the isReadOnly property.". | Of course, here is the Java code you requested:
```java
public void setReadOnly(boolean readonly) {
if (!readonly && database.databaseReadOnly) {
throw Error.error(ErrorCode.DATABASE_IS_READONLY);
}
if (isInMidTransaction()) {
throw Error.error(ErrorCode.X_25001);
... | |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/filter/MapBranchFilterModule.java | MapBranchFilterModule.processMap | protected void processMap(final FileInfo fi) {
this.map = fi.uri;
currentFile = job.tempDirURI.resolve(map);
ditavalFile = Optional.of(new File(job.tempDir, FILE_NAME_MERGED_DITAVAL))
.filter(File::exists)
.map(File::toURI)
.orElse(null);
... | java | protected void processMap(final FileInfo fi) {
this.map = fi.uri;
currentFile = job.tempDirURI.resolve(map);
ditavalFile = Optional.of(new File(job.tempDir, FILE_NAME_MERGED_DITAVAL))
.filter(File::exists)
.map(File::toURI)
.orElse(null);
... | [
"protected",
"void",
"processMap",
"(",
"final",
"FileInfo",
"fi",
")",
"{",
"this",
".",
"map",
"=",
"fi",
".",
"uri",
";",
"currentFile",
"=",
"job",
".",
"tempDirURI",
".",
"resolve",
"(",
"map",
")",
";",
"ditavalFile",
"=",
"Optional",
".",
"of",
... | Process map for branch replication. | [
"Process",
"map",
"for",
"branch",
"replication",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/filter/MapBranchFilterModule.java#L92-L134 | train | Process the map file. | Create a Java method that does the following: "Process the map file.". | Of course, here is the Java code you requested:
```java
protected void processMap(final FileInfo fi) {
this.map = fi.uri;
currentFile = job.tempDirURI.resolve(map);
ditavalFile = Optional.of(new File(job.tempDir, FILE_NAME_MERGED_DITAVAL))
.filter(File::exists)
.... | |
m-m-m/util | scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java | CharSequenceScanner.getOriginalString | public String getOriginalString() {
if (this.string != null) {
this.string = new String(this.buffer, this.initialOffset, getLength());
}
return this.string;
} | java | public String getOriginalString() {
if (this.string != null) {
this.string = new String(this.buffer, this.initialOffset, getLength());
}
return this.string;
} | [
"public",
"String",
"getOriginalString",
"(",
")",
"{",
"if",
"(",
"this",
".",
"string",
"!=",
"null",
")",
"{",
"this",
".",
"string",
"=",
"new",
"String",
"(",
"this",
".",
"buffer",
",",
"this",
".",
"initialOffset",
",",
"getLength",
"(",
")",
... | This method gets the original string to parse.
@see CharSequenceScanner#CharSequenceScanner(String)
@return the original string. | [
"This",
"method",
"gets",
"the",
"original",
"string",
"to",
"parse",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java#L391-L397 | train | Gets the original string. | Create a Java method that does the following: "Gets the original string.". | Of course, here is the Java code you requested:
```java
public String getOriginalString() {
if (this.string != null) {
this.string = new String(this.buffer, this.initialOffset, getLength());
}
return this.string;
}
```
Hope this helps! | |
duracloud/snapshot | snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java | RestoreJobExecutionListener.changeRestoreStatus | private Date changeRestoreStatus(Restoration restoration,
RestoreStatus status,
String msg,
Date currentDate) {
log.info("Changing restore status to: " + status + " with message: " + msg);
rest... | java | private Date changeRestoreStatus(Restoration restoration,
RestoreStatus status,
String msg,
Date currentDate) {
log.info("Changing restore status to: " + status + " with message: " + msg);
rest... | [
"private",
"Date",
"changeRestoreStatus",
"(",
"Restoration",
"restoration",
",",
"RestoreStatus",
"status",
",",
"String",
"msg",
",",
"Date",
"currentDate",
")",
"{",
"log",
".",
"info",
"(",
"\"Changing restore status to: \"",
"+",
"status",
"+",
"\" with message... | Updates the restore details in the database
@param restoration the restoration being worked
@param status the new status of the restoration
@param msg status text | [
"Updates",
"the",
"restore",
"details",
"in",
"the",
"database"
] | 7cb387b22fd4a9425087f654276138727c2c0b73 | https://github.com/duracloud/snapshot/blob/7cb387b22fd4a9425087f654276138727c2c0b73/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobExecutionListener.java#L237-L253 | train | Change the restore status of a record. | Create a Java method that does the following: "Change the restore status of a record.". | Of course, here is the Java code you requested:
```java
private Date changeRestoreStatus(Restoration restoration,
RestoreStatus status,
String msg,
Date currentDate) {
log.info("Changing restore statu... | |
aws/aws-sdk-java | aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/Snapshot.java | Snapshot.withRestorableNodeTypes | public Snapshot withRestorableNodeTypes(String... restorableNodeTypes) {
if (this.restorableNodeTypes == null) {
setRestorableNodeTypes(new com.amazonaws.internal.SdkInternalList<String>(restorableNodeTypes.length));
}
for (String ele : restorableNodeTypes) {
this.restora... | java | public Snapshot withRestorableNodeTypes(String... restorableNodeTypes) {
if (this.restorableNodeTypes == null) {
setRestorableNodeTypes(new com.amazonaws.internal.SdkInternalList<String>(restorableNodeTypes.length));
}
for (String ele : restorableNodeTypes) {
this.restora... | [
"public",
"Snapshot",
"withRestorableNodeTypes",
"(",
"String",
"...",
"restorableNodeTypes",
")",
"{",
"if",
"(",
"this",
".",
"restorableNodeTypes",
"==",
"null",
")",
"{",
"setRestorableNodeTypes",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"S... | <p>
The list of node types that this cluster snapshot is able to restore into.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setRestorableNodeTypes(java.util.Collection)} or {@link #withRestorableNodeTypes(java.util.Collection)}
if you want to override the existing valu... | [
"<p",
">",
"The",
"list",
"of",
"node",
"types",
"that",
"this",
"cluster",
"snapshot",
"is",
"able",
"to",
"restore",
"into",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"va... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/Snapshot.java#L1652-L1660 | train | Sets the restorableNodeTypes value for this snapshot. | Create a Java method that does the following: "Sets the restorableNodeTypes value for this snapshot.". | Of course, here is the Java code you requested:
```java
public Snapshot withRestorableNodeTypes(String... restorableNodeTypes) {
if (this.restorableNodeTypes == null) {
setRestorableNodeTypes(new com.amazonaws.internal.SdkInternalList<String>(restorableNodeTypes.length));
}
for (Str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.