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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
denisneuling/apitrary.jar | apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/ApitraryDaoSupport.java | ApitraryDaoSupport.resolveApitraryEntity | protected <T> String resolveApitraryEntity(T entity) {
String entityName = ClassUtil.getClassAnnotationValue(entity.getClass(), Entity.class, "value", String.class);
if (entityName == null || entityName.isEmpty()) {
entityName = StringUtil.toVerb(entity.getClass().getSimpleName());
}
return entityName;
} | java | protected <T> String resolveApitraryEntity(T entity) {
String entityName = ClassUtil.getClassAnnotationValue(entity.getClass(), Entity.class, "value", String.class);
if (entityName == null || entityName.isEmpty()) {
entityName = StringUtil.toVerb(entity.getClass().getSimpleName());
}
return entityName;
} | [
"protected",
"<",
"T",
">",
"String",
"resolveApitraryEntity",
"(",
"T",
"entity",
")",
"{",
"String",
"entityName",
"=",
"ClassUtil",
".",
"getClassAnnotationValue",
"(",
"entity",
".",
"getClass",
"(",
")",
",",
"Entity",
".",
"class",
",",
"\"value\"",
",... | <p>
resolveApitraryEntity.
</p>
@param entity
a T object.
@param <T>
a T object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"resolveApitraryEntity",
".",
"<",
"/",
"p",
">"
] | b7f639a1e735c60ba2b1b62851926757f5de8628 | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/ApitraryDaoSupport.java#L417-L423 | train | Resolves the name of the entity that is an apitrary. | Create a Java method that does the following: "Resolves the name of the entity that is an apitrary.". | Of course, here is the Java code you requested:
```java
protected <T> String resolveApitraryEntity(T entity) {
String entityName = ClassUtil.getClassAnnotationValue(entity.getClass(), Entity.class, "value", String.class);
if (entityName == null || entityName.isEmpty()) {
entityName = StringUtil.toVerb(entity.ge... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/IIDImpl.java | IIDImpl.eIsSet | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IID__CON_DATA1:
return CON_DATA1_EDEFAULT == null ? conData1 != null : !CON_DATA1_EDEFAULT.equals(conData1);
case AfplibPackage.IID__XBASE:
return XBASE_EDEFAULT == null ? xBase != null : !XBASE_EDEFAULT.equals(xBa... | java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IID__CON_DATA1:
return CON_DATA1_EDEFAULT == null ? conData1 != null : !CON_DATA1_EDEFAULT.equals(conData1);
case AfplibPackage.IID__XBASE:
return XBASE_EDEFAULT == null ? xBase != null : !XBASE_EDEFAULT.equals(xBa... | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"IID__CON_DATA1",
":",
"return",
"CON_DATA1_EDEFAULT",
"==",
"null",
"?",
"conData1",
"!=",
"null",
":",
"!... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/IIDImpl.java#L689-L718 | train | Replies if the feature ID is contained in this sequence. | Create a Java method that does the following: "Replies if the feature ID is contained in this sequence.". | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.IID__CON_DATA1:
return CON_DATA1_EDEFAULT == null ? conData1 != null : !CON_DATA1_EDEFAULT.equals(conData1);
case AfplibPackage.IID__XBASE:
return XBASE_EDEF... | |
stratosphere/stratosphere | stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java | JDBCInputFormat.reachedEnd | @Override
public boolean reachedEnd() throws IOException {
try {
if (resultSet.isLast()) {
close();
return true;
}
return false;
} catch (SQLException se) {
throw new IOException("Couldn't evaluate reachedEnd() - " + se.getMessage(), se);
}
} | java | @Override
public boolean reachedEnd() throws IOException {
try {
if (resultSet.isLast()) {
close();
return true;
}
return false;
} catch (SQLException se) {
throw new IOException("Couldn't evaluate reachedEnd() - " + se.getMessage(), se);
}
} | [
"@",
"Override",
"public",
"boolean",
"reachedEnd",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"resultSet",
".",
"isLast",
"(",
")",
")",
"{",
"close",
"(",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}",
"catch... | Checks whether all data has been read.
@return boolean value indication whether all data has been read.
@throws IOException | [
"Checks",
"whether",
"all",
"data",
"has",
"been",
"read",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/jdbc/src/main/java/eu/stratosphere/api/java/io/jdbc/JDBCInputFormat.java#L131-L142 | train | Returns true if the cursor reached the end of the file. | Create a Java method that does the following: "Returns true if the cursor reached the end of the file.". | Of course, here is the Java code you requested:
```java
@Override
public boolean reachedEnd() throws IOException {
try {
if (resultSet.isLast()) {
close();
return true;
}
return false;
} catch (SQLException se) {
throw new IOException("Couldn't evaluate reachedEnd() - " + se.getMessage(), se);... | |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/service/persistence/CommerceNotificationTemplateUserSegmentRelUtil.java | CommerceNotificationTemplateUserSegmentRelUtil.findByCommerceUserSegmentEntryId_First | public static CommerceNotificationTemplateUserSegmentRel findByCommerceUserSegmentEntryId_First(
long commerceUserSegmentEntryId,
OrderByComparator<CommerceNotificationTemplateUserSegmentRel> orderByComparator)
throws com.liferay.commerce.notification.exception.NoSuchNotificationTemplateUserSegmentRelException {
... | java | public static CommerceNotificationTemplateUserSegmentRel findByCommerceUserSegmentEntryId_First(
long commerceUserSegmentEntryId,
OrderByComparator<CommerceNotificationTemplateUserSegmentRel> orderByComparator)
throws com.liferay.commerce.notification.exception.NoSuchNotificationTemplateUserSegmentRelException {
... | [
"public",
"static",
"CommerceNotificationTemplateUserSegmentRel",
"findByCommerceUserSegmentEntryId_First",
"(",
"long",
"commerceUserSegmentEntryId",
",",
"OrderByComparator",
"<",
"CommerceNotificationTemplateUserSegmentRel",
">",
"orderByComparator",
")",
"throws",
"com",
".",
"... | Returns the first commerce notification template user segment rel in the ordered set where commerceUserSegmentEntryId = ?.
@param commerceUserSegmentEntryId the commerce user segment entry ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching comme... | [
"Returns",
"the",
"first",
"commerce",
"notification",
"template",
"user",
"segment",
"rel",
"in",
"the",
"ordered",
"set",
"where",
"commerceUserSegmentEntryId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/service/persistence/CommerceNotificationTemplateUserSegmentRelUtil.java#L204-L211 | train | Returns the first commerce notification template user segment rel in the ordered set. | Create a Java method that does the following: "Returns the first commerce notification template user segment rel in the ordered set.". | Of course, here is the Java code you requested:
```java
public static CommerceNotificationTemplateUserSegmentRel findByCommerceUserSegmentEntryId_First(
long commerceUserSegmentEntryId,
OrderByComparator<CommerceNotificationTemplateUserSegmentRel> orderByComparator)
throws com.liferay.commerce.notification.excep... | |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/views/RepositoryContentProvider.java | RepositoryContentProvider.inputChanged | public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if (v instanceof AbstractTreeViewer) {
viewer = (AbstractTreeViewer)v;
manager = new DeferredTreeContentManager(this, viewer);
}
} | java | public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if (v instanceof AbstractTreeViewer) {
viewer = (AbstractTreeViewer)v;
manager = new DeferredTreeContentManager(this, viewer);
}
} | [
"public",
"void",
"inputChanged",
"(",
"Viewer",
"v",
",",
"Object",
"oldInput",
",",
"Object",
"newInput",
")",
"{",
"if",
"(",
"v",
"instanceof",
"AbstractTreeViewer",
")",
"{",
"viewer",
"=",
"(",
"AbstractTreeViewer",
")",
"v",
";",
"manager",
"=",
"ne... | /*
(non-Javadoc)
@see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/views/RepositoryContentProvider.java#L47-L52 | test | Input Changed event. | Create a Java method that does the following: "Input Changed event.". | Of course, here is the Java code you requested:
```java
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if (v instanceof AbstractTreeViewer) {
viewer = (AbstractTreeViewer)v;
manager = new DeferredTreeContentManager(this, viewer);
}
}
```
Hope this he... | |
yunify/qingstor-sdk-java | src/main/java/com/qingstor/sdk/utils/QSStringUtil.java | QSStringUtil.asciiCharactersEncoding | public static String asciiCharactersEncoding(String str) throws QSException {
if (QSStringUtil.isEmpty(str)) {
return "";
}
try {
String encoded = URLEncoder.encode(str, QSConstant.ENCODING_UTF8);
encoded = encoded.replace("%2F", "/");
encoded = en... | java | public static String asciiCharactersEncoding(String str) throws QSException {
if (QSStringUtil.isEmpty(str)) {
return "";
}
try {
String encoded = URLEncoder.encode(str, QSConstant.ENCODING_UTF8);
encoded = encoded.replace("%2F", "/");
encoded = en... | [
"public",
"static",
"String",
"asciiCharactersEncoding",
"(",
"String",
"str",
")",
"throws",
"QSException",
"{",
"if",
"(",
"QSStringUtil",
".",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"String",
"encoded",
"=",
"URLEn... | Chinese characters transform
@param str unEncoded chars
@return encoded chars
@throws QSException UnsupportedEncodingException | [
"Chinese",
"characters",
"transform"
] | b44a228a99e60e4d6e5a450b7c05972552ab9962 | https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/utils/QSStringUtil.java#L171-L185 | test | Encode a string to ascii characters. | Create a Java method that does the following: "Encode a string to ascii characters.". | Of course, here is the Java code you requested:
```java
public static String asciiCharactersEncoding(String str) throws QSException {
if (QSStringUtil.isEmpty(str)) {
return "";
}
try {
String encoded = URLEncoder.encode(str, QSConstant.ENCODING_UTF8);
encode... | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/WriteValue.java | WriteValue.rollback | public void rollback() throws IOException
{
if (fileLock != null)
{
try
{
if (file.exists() && !file.delete())
{
cleaner.addFile(file);
}
}
finally
{
fileLock.unlock();
}
... | java | public void rollback() throws IOException
{
if (fileLock != null)
{
try
{
if (file.exists() && !file.delete())
{
cleaner.addFile(file);
}
}
finally
{
fileLock.unlock();
}
... | [
"public",
"void",
"rollback",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fileLock",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"file",
".",
"exists",
"(",
")",
"&&",
"!",
"file",
".",
"delete",
"(",
")",
")",
"{",
"cleaner",
".",
"ad... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/WriteValue.java#L107-L123 | train | Rollback the read operation. | Create a Java method that does the following: "Rollback the read operation.". | Of course, here is the Java code you requested:
```java
public void rollback() throws IOException
{
if (fileLock != null)
{
try
{
if (file.exists() && !file.delete())
{
cleaner.addFile(file);
}
}
finally
... | |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java | TypeAnalysis.getEdgeExceptionSet | public ExceptionSet getEdgeExceptionSet(Edge edge) {
CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(edge.getSource());
return cachedExceptionSet.getEdgeExceptionSet(edge);
} | java | public ExceptionSet getEdgeExceptionSet(Edge edge) {
CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(edge.getSource());
return cachedExceptionSet.getEdgeExceptionSet(edge);
} | [
"public",
"ExceptionSet",
"getEdgeExceptionSet",
"(",
"Edge",
"edge",
")",
"{",
"CachedExceptionSet",
"cachedExceptionSet",
"=",
"thrownExceptionSetMap",
".",
"get",
"(",
"edge",
".",
"getSource",
"(",
")",
")",
";",
"return",
"cachedExceptionSet",
".",
"getEdgeExce... | Get the set of exceptions that can be thrown on given edge. This should
only be called after the analysis completes.
@param edge
the Edge
@return the ExceptionSet | [
"Get",
"the",
"set",
"of",
"exceptions",
"that",
"can",
"be",
"thrown",
"on",
"given",
"edge",
".",
"This",
"should",
"only",
"be",
"called",
"after",
"the",
"analysis",
"completes",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeAnalysis.java#L313-L316 | train | Get the exception set for the edge. | Create a Java method that does the following: "Get the exception set for the edge.". | Of course, here is the Java code you requested:
```java
public ExceptionSet getEdgeExceptionSet(Edge edge) {
CachedExceptionSet cachedExceptionSet = thrownExceptionSetMap.get(edge.getSource());
return cachedExceptionSet.getEdgeExceptionSet(edge);
}
```
Hope this helps! | |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/state/ScrollBarButtonsTogetherState.java | ScrollBarButtonsTogetherState.isInState | public boolean isInState(JComponent c) {
while (c != null && !(c instanceof JScrollBar)) {
c = (JComponent) c.getParent();
}
if (c != null) {
Object clientProperty = c.getClientProperty("SeaGlass.Override.ScrollBarButtonsTogether");
if (clientProperty != nul... | java | public boolean isInState(JComponent c) {
while (c != null && !(c instanceof JScrollBar)) {
c = (JComponent) c.getParent();
}
if (c != null) {
Object clientProperty = c.getClientProperty("SeaGlass.Override.ScrollBarButtonsTogether");
if (clientProperty != nul... | [
"public",
"boolean",
"isInState",
"(",
"JComponent",
"c",
")",
"{",
"while",
"(",
"c",
"!=",
"null",
"&&",
"!",
"(",
"c",
"instanceof",
"JScrollBar",
")",
")",
"{",
"c",
"=",
"(",
"JComponent",
")",
"c",
".",
"getParent",
"(",
")",
";",
"}",
"if",
... | {@inheritDoc} | [
"{"
] | f25ecba622923d7b29b64cb7d6068dd8005989b3 | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/state/ScrollBarButtonsTogetherState.java#L41-L55 | train | Is this component in the state of the scroll bar? | Create a Java method that does the following: "Is this component in the state of the scroll bar?". | Of course, here is the Java code you requested:
```java
public boolean isInState(JComponent c) {
while (c != null && !(c instanceof JScrollBar)) {
c = (JComponent) c.getParent();
}
if (c != null) {
Object clientProperty = c.getClientProperty("SeaGlass.Override.ScrollBar... | |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.findAll | @Override
public List<CommerceDiscountRule> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceDiscountRule> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRule",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce discount rules.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <co... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discount",
"rules",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L1158-L1161 | train | Returns a range of all the commerce discount rules. | Create a Java method that does the following: "Returns a range of all the commerce discount rules.". | Of course, here is the Java code you requested:
```java
@Override
public List<CommerceDiscountRule> findAll(int start, int end) {
return findAll(start, end, null);
}
```
Hope this helps! | |
networknt/light-4j | client/src/main/java/com/networknt/client/http/Light4jHttpClientProvider.java | Light4jHttpClientProvider.createHttpClientConnection | private ClientConnection createHttpClientConnection(final StreamConnection connection, final OptionMap options, final ByteBufferPool bufferPool) {
try {
Class<?> cls = Class.forName("io.undertow.client.http.HttpClientConnection");
Constructor<?> o = cls.getDeclaredConstructor(StreamConnection.class, OptionM... | java | private ClientConnection createHttpClientConnection(final StreamConnection connection, final OptionMap options, final ByteBufferPool bufferPool) {
try {
Class<?> cls = Class.forName("io.undertow.client.http.HttpClientConnection");
Constructor<?> o = cls.getDeclaredConstructor(StreamConnection.class, OptionM... | [
"private",
"ClientConnection",
"createHttpClientConnection",
"(",
"final",
"StreamConnection",
"connection",
",",
"final",
"OptionMap",
"options",
",",
"final",
"ByteBufferPool",
"bufferPool",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"Class",
".",... | /*
Create instances of "io.undertow.client.http.HttpClientConnection" using reflections | [
"/",
"*",
"Create",
"instances",
"of",
"io",
".",
"undertow",
".",
"client",
".",
"http",
".",
"HttpClientConnection",
"using",
"reflections"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/http/Light4jHttpClientProvider.java#L175-L189 | train | Creates a new HTTP client connection. | Create a Java method that does the following: "Creates a new HTTP client connection.". | Of course, here is the Java code you requested:
```java
private ClientConnection createHttpClientConnection(final StreamConnection connection, final OptionMap options, final ByteBufferPool bufferPool) {
try {
Class<?> cls = Class.forName("io.undertow.client.http.HttpClientConnection");
Constructor<?> o = c... | |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java | MDLV2000Writer.formatMDLInt | protected static String formatMDLInt(int x, int n) {
char[] buf = new char[n];
Arrays.fill(buf, ' ');
String val = Integer.toString(x);
if (val.length() > n)
val = "0";
int off = n - val.length();
for (int i = 0; i < val.length(); i++)
buf[off+i] =... | java | protected static String formatMDLInt(int x, int n) {
char[] buf = new char[n];
Arrays.fill(buf, ' ');
String val = Integer.toString(x);
if (val.length() > n)
val = "0";
int off = n - val.length();
for (int i = 0; i < val.length(); i++)
buf[off+i] =... | [
"protected",
"static",
"String",
"formatMDLInt",
"(",
"int",
"x",
",",
"int",
"n",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"n",
"]",
";",
"Arrays",
".",
"fill",
"(",
"buf",
",",
"'",
"'",
")",
";",
"String",
"val",
"=",
"Int... | Formats an integer to fit into the connection table and changes it
to a String.
@param x The int to be formated
@param n Length of the String
@return The String to be written into the connectiontable | [
"Formats",
"an",
"integer",
"to",
"fit",
"into",
"the",
"connection",
"table",
"and",
"changes",
"it",
"to",
"a",
"String",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java#L1112-L1122 | train | Format a single integer into a string. | Create a Java method that does the following: "Format a single integer into a string.". | Of course, here is the Java code you requested:
```java
protected static String formatMDLInt(int x, int n) {
char[] buf = new char[n];
Arrays.fill(buf, ' ');
String val = Integer.toString(x);
if (val.length() > n)
val = "0";
int off = n - val.length();
for (i... | |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/MultiException.java | MultiException.printStackTrace | public void printStackTrace()
{
super.printStackTrace();
for (int i=0;i<LazyList.size(nested);i++)
((Throwable)LazyList.get(nested,i)).printStackTrace();
} | java | public void printStackTrace()
{
super.printStackTrace();
for (int i=0;i<LazyList.size(nested);i++)
((Throwable)LazyList.get(nested,i)).printStackTrace();
} | [
"public",
"void",
"printStackTrace",
"(",
")",
"{",
"super",
".",
"printStackTrace",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"LazyList",
".",
"size",
"(",
"nested",
")",
";",
"i",
"++",
")",
"",
"(",
"(",
"Throwable",
")",... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiException.java#L115-L120 | train | printStackTrace This is a convenience method for debugging. | Create a Java method that does the following: "printStackTrace This is a convenience method for debugging.". | Of course, here is the Java code you requested:
```java
public void printStackTrace()
{
super.printStackTrace();
for (int i=0;i<LazyList.size(nested);i++)
((Throwable)LazyList.get(nested,i)).printStackTrace();
}
```
Hope this helps! | |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderList.java | ProviderList.getProvider | public Provider getProvider(String name) {
ProviderConfig config = getProviderConfig(name);
return (config == null) ? null : config.getProvider();
} | java | public Provider getProvider(String name) {
ProviderConfig config = getProviderConfig(name);
return (config == null) ? null : config.getProvider();
} | [
"public",
"Provider",
"getProvider",
"(",
"String",
"name",
")",
"{",
"ProviderConfig",
"config",
"=",
"getProviderConfig",
"(",
"name",
")",
";",
"return",
"(",
"config",
"==",
"null",
")",
"?",
"null",
":",
"config",
".",
"getProvider",
"(",
")",
";",
... | return the Provider with the specified name or null | [
"return",
"the",
"Provider",
"with",
"the",
"specified",
"name",
"or",
"null"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/ProviderList.java#L258-L261 | train | Get the provider with the specified name. | Create a Java method that does the following: "Get the provider with the specified name.". | Of course, here is the Java code you requested:
```java
public Provider getProvider(String name) {
ProviderConfig config = getProviderConfig(name);
return (config == null) ? null : config.getProvider();
}
```
Hope this helps! | |
mwilliamson/java-mammoth | src/main/java/org/zwobble/mammoth/DocumentConverter.java | DocumentConverter.extractRawText | public Result<String> extractRawText(InputStream stream) throws IOException {
return new InternalDocumentConverter(options).extractRawText(stream).toResult();
} | java | public Result<String> extractRawText(InputStream stream) throws IOException {
return new InternalDocumentConverter(options).extractRawText(stream).toResult();
} | [
"public",
"Result",
"<",
"String",
">",
"extractRawText",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"InternalDocumentConverter",
"(",
"options",
")",
".",
"extractRawText",
"(",
"stream",
")",
".",
"toResult",
"(",
")",
... | Extract the raw text of the document.
This will ignore all formatting in the document.
Each paragraph is followed by two newlines. | [
"Extract",
"the",
"raw",
"text",
"of",
"the",
"document",
".",
"This",
"will",
"ignore",
"all",
"formatting",
"in",
"the",
"document",
".",
"Each",
"paragraph",
"is",
"followed",
"by",
"two",
"newlines",
"."
] | f2fd5ec08b2b87278f2929d7c15c9ed71fbac8d8 | https://github.com/mwilliamson/java-mammoth/blob/f2fd5ec08b2b87278f2929d7c15c9ed71fbac8d8/src/main/java/org/zwobble/mammoth/DocumentConverter.java#L92-L94 | train | Extract raw text from an input stream. | Create a Java method that does the following: "Extract raw text from an input stream.". | Of course, here is the Java code you requested:
```java
public Result<String> extractRawText(InputStream stream) throws IOException {
return new InternalDocumentConverter(options).extractRawText(stream).toResult();
}
```
Hope this helps! | |
oblac/jodd | jodd-db/src/main/java/jodd/db/DbCallResult.java | DbCallResult.getBoolean | public boolean getBoolean(final int index) {
try {
return statement.getBoolean(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | java | public boolean getBoolean(final int index) {
try {
return statement.getBoolean(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"final",
"int",
"index",
")",
"{",
"try",
"{",
"return",
"statement",
".",
"getBoolean",
"(",
"index",
")",
";",
"}",
"catch",
"(",
"SQLException",
"sex",
")",
"{",
"throw",
"newGetParamError",
"(",
"index",
",",
"... | ---------------------------------------------------------------- boolean | [
"----------------------------------------------------------------",
"boolean"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbCallResult.java#L79-L85 | test | Get a boolean value from the database at the given index. | Create a Java method that does the following: "Get a boolean value from the database at the given index.". | Of course, here is the Java code you requested:
```java
public boolean getBoolean(final int index) {
try {
return statement.getBoolean(index);
} catch (SQLException sex) {
throw newGetParamError(index, sex);
}
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/TriggerConfig.java | TriggerConfig.withTriggerEvents | public TriggerConfig withTriggerEvents(TriggerEventType... triggerEvents) {
com.amazonaws.internal.SdkInternalList<String> triggerEventsCopy = new com.amazonaws.internal.SdkInternalList<String>(triggerEvents.length);
for (TriggerEventType value : triggerEvents) {
triggerEventsCopy.add(value.... | java | public TriggerConfig withTriggerEvents(TriggerEventType... triggerEvents) {
com.amazonaws.internal.SdkInternalList<String> triggerEventsCopy = new com.amazonaws.internal.SdkInternalList<String>(triggerEvents.length);
for (TriggerEventType value : triggerEvents) {
triggerEventsCopy.add(value.... | [
"public",
"TriggerConfig",
"withTriggerEvents",
"(",
"TriggerEventType",
"...",
"triggerEvents",
")",
"{",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",
"String",
">",
"triggerEventsCopy",
"=",
"new",
"com",
".",
"amazonaws",
".",
"interna... | <p>
The event type or types for which notifications are triggered.
</p>
@param triggerEvents
The event type or types for which notifications are triggered.
@return Returns a reference to this object so that method calls can be chained together.
@see TriggerEventType | [
"<p",
">",
"The",
"event",
"type",
"or",
"types",
"for",
"which",
"notifications",
"are",
"triggered",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/TriggerConfig.java#L225-L236 | train | Sets the trigger events. | Create a Java method that does the following: "Sets the trigger events.". | Of course, here is the Java code you requested:
```java
public TriggerConfig withTriggerEvents(TriggerEventType... triggerEvents) {
com.amazonaws.internal.SdkInternalList<String> triggerEventsCopy = new com.amazonaws.internal.SdkInternalList<String>(triggerEvents.length);
for (TriggerEventType value : ... | |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.findByC_CSO | @Override
public List<CPDefinitionSpecificationOptionValue> findByC_CSO(
long CPDefinitionId, long CPSpecificationOptionId) {
return findByC_CSO(CPDefinitionId, CPSpecificationOptionId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionSpecificationOptionValue> findByC_CSO(
long CPDefinitionId, long CPSpecificationOptionId) {
return findByC_CSO(CPDefinitionId, CPSpecificationOptionId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionSpecificationOptionValue",
">",
"findByC_CSO",
"(",
"long",
"CPDefinitionId",
",",
"long",
"CPSpecificationOptionId",
")",
"{",
"return",
"findByC_CSO",
"(",
"CPDefinitionId",
",",
"CPSpecificationOptionId",
",",
"Que... | Returns all the cp definition specification option values where CPDefinitionId = ? and CPSpecificationOptionId = ?.
@param CPDefinitionId the cp definition ID
@param CPSpecificationOptionId the cp specification option ID
@return the matching cp definition specification option values | [
"Returns",
"all",
"the",
"cp",
"definition",
"specification",
"option",
"values",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"CPSpecificationOptionId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L4232-L4237 | train | Returns all the cp definition specification option values matching the requested cp specification option id. | Create a Java method that does the following: "Returns all the cp definition specification option values matching the requested cp specification option id.". | Of course, here is the Java code you requested:
```java
@Override
public List<CPDefinitionSpecificationOptionValue> findByC_CSO(
long CPDefinitionId, long CPSpecificationOptionId) {
return findByC_CSO(CPDefinitionId, CPSpecificationOptionId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
}
```
Hope this helps! | |
robolectric/robolectric | shadows/framework/src/main/java/org/robolectric/shadows/ShadowWifiRttManager.java | ShadowWifiRttManager.startRanging | @Implementation(minSdk = P)
protected void startRanging(
RangingRequest request, Executor executor, RangingResultCallback callback) {
if (!rangingResults.isEmpty()) {
executor.execute(() -> callback.onRangingResults(this.rangingResults));
} else {
executor.execute(() -> callback.onRangingFai... | java | @Implementation(minSdk = P)
protected void startRanging(
RangingRequest request, Executor executor, RangingResultCallback callback) {
if (!rangingResults.isEmpty()) {
executor.execute(() -> callback.onRangingResults(this.rangingResults));
} else {
executor.execute(() -> callback.onRangingFai... | [
"@",
"Implementation",
"(",
"minSdk",
"=",
"P",
")",
"protected",
"void",
"startRanging",
"(",
"RangingRequest",
"request",
",",
"Executor",
"executor",
",",
"RangingResultCallback",
"callback",
")",
"{",
"if",
"(",
"!",
"rangingResults",
".",
"isEmpty",
"(",
... | If there are RangingResults set by the setRangeResults method of this shadow class, this method
will call the onRangingResults method of the callback on the executor thread and pass the list
of RangingResults. If there are no ranging results set, it will pass
RangingResultCallback.STATUS_CODE_FAIL to the onRangingFailu... | [
"If",
"there",
"are",
"RangingResults",
"set",
"by",
"the",
"setRangeResults",
"method",
"of",
"this",
"shadow",
"class",
"this",
"method",
"will",
"call",
"the",
"onRangingResults",
"method",
"of",
"the",
"callback",
"on",
"the",
"executor",
"thread",
"and",
... | 4fa79a2c72f8abbf742ab920419653c207b41d62 | https://github.com/robolectric/robolectric/blob/4fa79a2c72f8abbf742ab920419653c207b41d62/shadows/framework/src/main/java/org/robolectric/shadows/ShadowWifiRttManager.java#L28-L36 | valid | Start the ranging process. | Create a Java method that does the following: "Start the ranging process.". | Of course, here is the Java code you requested:
```java
@Implementation(minSdk = P)
protected void startRanging(
RangingRequest request, Executor executor, RangingResultCallback callback) {
if (!rangingResults.isEmpty()) {
executor.execute(() -> callback.onRangingResults(this.rangingResults));
} ... | |
jeremiehuchet/acrachilisync | acrachilisync-core/src/main/java/fr/dudie/acrachilisync/AcraToChiliprojectSyncer.java | AcraToChiliprojectSyncer.getIssueForStack | private Issue getIssueForStack(final String pStacktraceMD5) throws IOException,
AuthenticationException, NotFoundException, RedmineException {
final Map<String, String> parameters = new HashMap<String, String>();
parameters.put("project_id", String.valueOf(config.CHILIPROJECT_PROJECT_ID));
... | java | private Issue getIssueForStack(final String pStacktraceMD5) throws IOException,
AuthenticationException, NotFoundException, RedmineException {
final Map<String, String> parameters = new HashMap<String, String>();
parameters.put("project_id", String.valueOf(config.CHILIPROJECT_PROJECT_ID));
... | [
"private",
"Issue",
"getIssueForStack",
"(",
"final",
"String",
"pStacktraceMD5",
")",
"throws",
"IOException",
",",
"AuthenticationException",
",",
"NotFoundException",
",",
"RedmineException",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"... | Search for the issue related to the given MD5 stacktrace hash.
@param pStacktraceMD5
an MD5 stacktrace hash
@return the Chiliproject issue related to the given stacktrace or null if no issue found
@throws IOException
@throws AuthenticationException
@throws NotFoundException
@throws RedmineException | [
"Search",
"for",
"the",
"issue",
"related",
"to",
"the",
"given",
"MD5",
"stacktrace",
"hash",
"."
] | 4eadb0218623e77e0d92b5a08515eea2db51e988 | https://github.com/jeremiehuchet/acrachilisync/blob/4eadb0218623e77e0d92b5a08515eea2db51e988/acrachilisync-core/src/main/java/fr/dudie/acrachilisync/AcraToChiliprojectSyncer.java#L255-L270 | train | Get an issue for a given stacktrace MD5. | Create a Java method that does the following: "Get an issue for a given stacktrace MD5.". | Of course, here is the Java code you requested:
```java
private Issue getIssueForStack(final String pStacktraceMD5) throws IOException,
AuthenticationException, NotFoundException, RedmineException {
final Map<String, String> parameters = new HashMap<String, String>();
parameters.put("proje... | |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java | ABaseClientWS.getJson | public JSONObject getJson(
String postfixUrlParam,
List<HeaderNameValue> headerNameValuesParam) {
return this.getJson(
false,
postfixUrlParam,
headerNameValuesParam);
} | java | public JSONObject getJson(
String postfixUrlParam,
List<HeaderNameValue> headerNameValuesParam) {
return this.getJson(
false,
postfixUrlParam,
headerNameValuesParam);
} | [
"public",
"JSONObject",
"getJson",
"(",
"String",
"postfixUrlParam",
",",
"List",
"<",
"HeaderNameValue",
">",
"headerNameValuesParam",
")",
"{",
"return",
"this",
".",
"getJson",
"(",
"false",
",",
"postfixUrlParam",
",",
"headerNameValuesParam",
")",
";",
"}"
] | Performs an HTTP-GET request with {@code postfixUrlParam}.
Does not perform a connection test.
@param postfixUrlParam URL mapping after the Base endpoint.
@param headerNameValuesParam The HTTP Headers to include.
@return Return body as JSON.
@see JSONObject | [
"Performs",
"an",
"HTTP",
"-",
"GET",
"request",
"with",
"{",
"@code",
"postfixUrlParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java#L285-L293 | test | Get the JSON object for the specified post - form URL parameters and header - name - values parameters. | Create a Java method that does the following: "Get the JSON object for the specified post - form URL parameters and header - name - values parameters.". | Of course, here is the Java code you requested:
```java
public JSONObject getJson(
String postfixUrlParam,
List<HeaderNameValue> headerNameValuesParam) {
return this.getJson(
false,
postfixUrlParam,
headerNameValuesParam);
}
```
Hope this helps! | |
google/safe-html-types | types/src/main/java/com/google/common/html/types/SafeHtmls.java | SafeHtmls.fromScriptUrlWithCspNonce | public static SafeHtml fromScriptUrlWithCspNonce(TrustedResourceUrl trustedResourceUrl,
String cspNonce) {
String escapedUrl = htmlEscapeInternal(trustedResourceUrl.getTrustedResourceUrlString());
return create("<script type=\"text/javascript\" nonce=\"" + htmlEscapeInternal(cspNonce)
+ "\" src=\"... | java | public static SafeHtml fromScriptUrlWithCspNonce(TrustedResourceUrl trustedResourceUrl,
String cspNonce) {
String escapedUrl = htmlEscapeInternal(trustedResourceUrl.getTrustedResourceUrlString());
return create("<script type=\"text/javascript\" nonce=\"" + htmlEscapeInternal(cspNonce)
+ "\" src=\"... | [
"public",
"static",
"SafeHtml",
"fromScriptUrlWithCspNonce",
"(",
"TrustedResourceUrl",
"trustedResourceUrl",
",",
"String",
"cspNonce",
")",
"{",
"String",
"escapedUrl",
"=",
"htmlEscapeInternal",
"(",
"trustedResourceUrl",
".",
"getTrustedResourceUrlString",
"(",
")",
"... | Creates a <script type="text/javascript" src="<i>url</i>"><script> where the
{@code src} attribute points to the given {@code trustedResourceUrl}.
The tag has a nonce attribute populated from the provided CSP nonce value. | [
"Creates",
"a",
"<",
";",
"script",
"type",
"=",
"text",
"/",
"javascript",
"src",
"=",
"<i",
">",
"url<",
"/",
"i",
">",
">",
";",
"<",
";",
"script>",
";",
"where",
"the",
"{"
] | 8507735457ea41a37dfa027fb176d49d5783c4ba | https://github.com/google/safe-html-types/blob/8507735457ea41a37dfa027fb176d49d5783c4ba/types/src/main/java/com/google/common/html/types/SafeHtmls.java#L93-L98 | valid | Create a SafeHtml from a JavaScript url with a CSP nonce | Create a Java method that does the following: "Create a SafeHtml from a JavaScript url with a CSP nonce". | Of course, here is the Java code you requested:
```java
public static SafeHtml fromScriptUrlWithCspNonce(TrustedResourceUrl trustedResourceUrl,
String cspNonce) {
String escapedUrl = htmlEscapeInternal(trustedResourceUrl.getTrustedResourceUrlString());
return create("<script type=\"text/javascript\" nonc... | |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft2/coverage/remote/CdmrfWriter.java | CdmrfWriter.encodeCoordTransform | CdmrFeatureProto.CoordTransform.Builder encodeCoordTransform(CoverageTransform gct) {
CdmrFeatureProto.CoordTransform.Builder builder = CdmrFeatureProto.CoordTransform.newBuilder();
builder.setIsHoriz(gct.isHoriz());
builder.setName(gct.getName());
for (Attribute att : gct.getAttributes())
builder... | java | CdmrFeatureProto.CoordTransform.Builder encodeCoordTransform(CoverageTransform gct) {
CdmrFeatureProto.CoordTransform.Builder builder = CdmrFeatureProto.CoordTransform.newBuilder();
builder.setIsHoriz(gct.isHoriz());
builder.setName(gct.getName());
for (Attribute att : gct.getAttributes())
builder... | [
"CdmrFeatureProto",
".",
"CoordTransform",
".",
"Builder",
"encodeCoordTransform",
"(",
"CoverageTransform",
"gct",
")",
"{",
"CdmrFeatureProto",
".",
"CoordTransform",
".",
"Builder",
"builder",
"=",
"CdmrFeatureProto",
".",
"CoordTransform",
".",
"newBuilder",
"(",
... | /* message CoordTransform {
required bool isHoriz = 1;
required string name = 2;
repeated Attribute params = 3;
} | [
"/",
"*",
"message",
"CoordTransform",
"{",
"required",
"bool",
"isHoriz",
"=",
"1",
";",
"required",
"string",
"name",
"=",
"2",
";",
"repeated",
"Attribute",
"params",
"=",
"3",
";",
"}"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/remote/CdmrfWriter.java#L199-L206 | test | Encode a CoverageTransform object to a coord transform builder. | Create a Java method that does the following: "Encode a CoverageTransform object to a coord transform builder.". | Of course, here is the Java code you requested:
```java
CdmrFeatureProto.CoordTransform.Builder encodeCoordTransform(CoverageTransform gct) {
CdmrFeatureProto.CoordTransform.Builder builder = CdmrFeatureProto.CoordTransform.newBuilder();
builder.setIsHoriz(gct.isHoriz());
builder.setName(gct.getName());
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/javaee/util/DDUtil.java | DDUtil.methodParamsMatch | public static boolean methodParamsMatch(List<String> typeNames, Class<?>[] types)
{
if (typeNames.size() != types.length)
{
return false;
}
for (int i = 0; i < types.length; i++)
{
String typeName = typeNames.get(i);
int typeNameEnd = type... | java | public static boolean methodParamsMatch(List<String> typeNames, Class<?>[] types)
{
if (typeNames.size() != types.length)
{
return false;
}
for (int i = 0; i < types.length; i++)
{
String typeName = typeNames.get(i);
int typeNameEnd = type... | [
"public",
"static",
"boolean",
"methodParamsMatch",
"(",
"List",
"<",
"String",
">",
"typeNames",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"{",
"if",
"(",
"typeNames",
".",
"size",
"(",
")",
"!=",
"types",
".",
"length",
")",
"{",
"return... | Checks if the specified method parameters object matches the specified
method parameter types.
@param parms the method parameters object
@param types the method parameter types
@return true if the object matches the types | [
"Checks",
"if",
"the",
"specified",
"method",
"parameters",
"object",
"matches",
"the",
"specified",
"method",
"parameter",
"types",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/javaee/util/DDUtil.java#L36-L66 | train | Method params match. | Create a Java method that does the following: "Method params match.". | Of course, here is the Java code you requested:
```java
public static boolean methodParamsMatch(List<String> typeNames, Class<?>[] types)
{
if (typeNames.size() != types.length)
{
return false;
}
for (int i = 0; i < types.length; i++)
{
String typeNa... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/EsaParser.java | EsaParser.setJavaRequirements | private static void setJavaRequirements(File esa, EsaResourceWritable resource) throws RepositoryException {
Map<String, String> bundleRequirements = new HashMap<String, String>();
Path zipfile = esa.toPath();
Map<String, VersionRange> matchingEnvs = new LinkedHashMap<String, VersionRange>();
... | java | private static void setJavaRequirements(File esa, EsaResourceWritable resource) throws RepositoryException {
Map<String, String> bundleRequirements = new HashMap<String, String>();
Path zipfile = esa.toPath();
Map<String, VersionRange> matchingEnvs = new LinkedHashMap<String, VersionRange>();
... | [
"private",
"static",
"void",
"setJavaRequirements",
"(",
"File",
"esa",
",",
"EsaResourceWritable",
"resource",
")",
"throws",
"RepositoryException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"bundleRequirements",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Look in the esa for bundles with particular java version requirements. Create an aggregate
requirement of the esa as a whole, and write the data into the supplied resource
@param esa
@param resource
@throws RepositoryException If there are any IOExceptions reading the esa, or if the
the bundles have conflicting Java v... | [
"Look",
"in",
"the",
"esa",
"for",
"bundles",
"with",
"particular",
"java",
"version",
"requirements",
".",
"Create",
"an",
"aggregate",
"requirement",
"of",
"the",
"esa",
"as",
"a",
"whole",
"and",
"write",
"the",
"data",
"into",
"the",
"supplied",
"resourc... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/EsaParser.java#L404-L526 | train | Sets the java requirements for the specified ESA file. | Create a Java method that does the following: "Sets the java requirements for the specified ESA file.". | Of course, here is the Java code you requested:
```java
private static void setJavaRequirements(File esa, EsaResourceWritable resource) throws RepositoryException {
Map<String, String> bundleRequirements = new HashMap<String, String>();
Path zipfile = esa.toPath();
Map<String, VersionRange> ma... | |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/types/TypeRegistry.java | TypeRegistry.decode | public Object decode(String alias, U value) {
requireNonNull(alias, "Not allowed to have a null alias");
requireNonNull(value, "Value for decoding can not be null");
TypeEncoder<?, U> encoder = aliasMapping.get(alias);
if (encoder != null)
return encoder.decode(value);
... | java | public Object decode(String alias, U value) {
requireNonNull(alias, "Not allowed to have a null alias");
requireNonNull(value, "Value for decoding can not be null");
TypeEncoder<?, U> encoder = aliasMapping.get(alias);
if (encoder != null)
return encoder.decode(value);
... | [
"public",
"Object",
"decode",
"(",
"String",
"alias",
",",
"U",
"value",
")",
"{",
"requireNonNull",
"(",
"alias",
",",
"\"Not allowed to have a null alias\"",
")",
";",
"requireNonNull",
"(",
"value",
",",
"\"Value for decoding can not be null\"",
")",
";",
"TypeEn... | Decodes the given {@code value} using one of the registered {@link TypeEncoder}s. The {@code alias} is used
to determine which {@link TypeEncoder} will be used and shall correlate to the result of the {@code getAlias()}
method for the original object. | [
"Decodes",
"the",
"given",
"{"
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/types/TypeRegistry.java#L112-L121 | train | Decodes the value of a single type from the given value. | Create a Java method that does the following: "Decodes the value of a single type from the given value.". | Of course, here is the Java code you requested:
```java
public Object decode(String alias, U value) {
requireNonNull(alias, "Not allowed to have a null alias");
requireNonNull(value, "Value for decoding can not be null");
TypeEncoder<?, U> encoder = aliasMapping.get(alias);
if (encoder... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/jfapchannel/server/impl/ServerConnectionManagerImpl.java | ServerConnectionManagerImpl.getActiveOutboundMEtoMEConversations | @Override
public List getActiveOutboundMEtoMEConversations() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getActiveOutboundMEtoMEConversations");
List convs = null;
if (connectionTracker != null) {
convs = connectionTracke... | java | @Override
public List getActiveOutboundMEtoMEConversations() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getActiveOutboundMEtoMEConversations");
List convs = null;
if (connectionTracker != null) {
convs = connectionTracke... | [
"@",
"Override",
"public",
"List",
"getActiveOutboundMEtoMEConversations",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",... | Obtains a list of active outbound ME to ME conversations in this JVM.
@return a list of Conversations | [
"Obtains",
"a",
"list",
"of",
"active",
"outbound",
"ME",
"to",
"ME",
"conversations",
"in",
"this",
"JVM",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/jfapchannel/server/impl/ServerConnectionManagerImpl.java#L247-L260 | train | Returns a list of all active outbound ME to ME conversations. | Create a Java method that does the following: "Returns a list of all active outbound ME to ME conversations.". | Of course, here is the Java code you requested:
```java
@Override
public List getActiveOutboundMEtoMEConversations() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getActiveOutboundMEtoMEConversations");
List convs = null;
if (connecti... | |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java | SparseVector.inner_product | static double inner_product(SparseVector vec1, SparseVector vec2)
{
Iterator<Map.Entry<Integer, Double>> it;
SparseVector other;
if (vec1.size() < vec2.size())
{
it = vec1.entrySet().iterator();
other = vec2;
}
else
{
it = v... | java | static double inner_product(SparseVector vec1, SparseVector vec2)
{
Iterator<Map.Entry<Integer, Double>> it;
SparseVector other;
if (vec1.size() < vec2.size())
{
it = vec1.entrySet().iterator();
other = vec2;
}
else
{
it = v... | [
"static",
"double",
"inner_product",
"(",
"SparseVector",
"vec1",
",",
"SparseVector",
"vec2",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Double",
">",
">",
"it",
";",
"SparseVector",
"other",
";",
"if",
"(",
"vec1",
".",
"size... | Calculate the inner product value between vectors. | [
"Calculate",
"the",
"inner",
"product",
"value",
"between",
"vectors",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L141-L162 | train | Get the inner product of two vectors. | Create a Java method that does the following: "Get the inner product of two vectors.". | Of course, here is the Java code you requested:
```java
static double inner_product(SparseVector vec1, SparseVector vec2)
{
Iterator<Map.Entry<Integer, Double>> it;
SparseVector other;
if (vec1.size() < vec2.size())
{
it = vec1.entrySet().iterator();
other = ... | |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FilterProcessor.java | FilterProcessor.isExcluded | public boolean isExcluded(String endpoint) {
for (int i = 0; i < exclusions.size(); i++) {
if (exclusions.get(i).test(endpoint)) {
return true;
}
}
return false;
} | java | public boolean isExcluded(String endpoint) {
for (int i = 0; i < exclusions.size(); i++) {
if (exclusions.get(i).test(endpoint)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isExcluded",
"(",
"String",
"endpoint",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"exclusions",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"exclusions",
".",
"get",
"(",
"i",
")",
".",
"te... | This method determines whether the supplied endpoint should be
excluded.
@param endpoint The endpoint to check
@return Whether the supplied endpoint should be excluded | [
"This",
"method",
"determines",
"whether",
"the",
"supplied",
"endpoint",
"should",
"be",
"excluded",
"."
] | 57a4df0611b359597626563ea5f9ac64d4bb2533 | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FilterProcessor.java#L131-L138 | train | Is the specified endpoint excluded from the source. | Create a Java method that does the following: "Is the specified endpoint excluded from the source.". | Of course, here is the Java code you requested:
```java
public boolean isExcluded(String endpoint) {
for (int i = 0; i < exclusions.size(); i++) {
if (exclusions.get(i).test(endpoint)) {
return true;
}
}
return false;
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java | EventHubConnectionsInner.createOrUpdateAsync | public ServiceFuture<EventHubConnectionInner> createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters, final ServiceCallback<EventHubConnectionInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpda... | java | public ServiceFuture<EventHubConnectionInner> createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters, final ServiceCallback<EventHubConnectionInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpda... | [
"public",
"ServiceFuture",
"<",
"EventHubConnectionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"String",
"eventHubConnectionName",
",",
"EventHubConnectionInner",
"parameters",
","... | Creates or updates a Event Hub connection.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param eventHubConnectionName The name of the event hub connection.
@para... | [
"Creates",
"or",
"updates",
"a",
"Event",
"Hub",
"connection",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L429-L431 | train | Creates or updates an Event Hub Connection. | Create a Java method that does the following: "Creates or updates an Event Hub Connection.". | Of course, here is the Java code you requested:
```java
public ServiceFuture<EventHubConnectionInner> createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters, final ServiceCallback<EventHubConnectionInner> serviceCallback)... | |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java | AuthorizationUtils.authorizeResourceAction | public static Access authorizeResourceAction(
final HttpServletRequest request,
final ResourceAction resourceAction,
final AuthorizerMapper authorizerMapper
)
{
return authorizeAllResourceActions(
request,
Collections.singletonList(resourceAction),
authorizerMapper
... | java | public static Access authorizeResourceAction(
final HttpServletRequest request,
final ResourceAction resourceAction,
final AuthorizerMapper authorizerMapper
)
{
return authorizeAllResourceActions(
request,
Collections.singletonList(resourceAction),
authorizerMapper
... | [
"public",
"static",
"Access",
"authorizeResourceAction",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"ResourceAction",
"resourceAction",
",",
"final",
"AuthorizerMapper",
"authorizerMapper",
")",
"{",
"return",
"authorizeAllResourceActions",
"(",
"request",... | Check a resource-action using the authorization fields from the request.
Otherwise, if the resource-actions is authorized, return ACCESS_OK.
This function will set the DRUID_AUTHORIZATION_CHECKED attribute in the request.
If this attribute is already set when this function is called, an exception is thrown.
@param ... | [
"Check",
"a",
"resource",
"-",
"action",
"using",
"the",
"authorization",
"fields",
"from",
"the",
"request",
"."
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java#L55-L66 | train | Check if the user has access to the specified resource action. | Create a Java method that does the following: "Check if the user has access to the specified resource action.". | Of course, here is the Java code you requested:
```java
public static Access authorizeResourceAction(
final HttpServletRequest request,
final ResourceAction resourceAction,
final AuthorizerMapper authorizerMapper
)
{
return authorizeAllResourceActions(
request,
Collections.sin... | |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.minusRetainScale | public BigMoney minusRetainScale(double amountToSubtract, RoundingMode roundingMode) {
if (amountToSubtract == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(BigDecimal.valueOf(amountToSubtract));
newAmount = newAmount.setScale(getScale(), roundingMode);
... | java | public BigMoney minusRetainScale(double amountToSubtract, RoundingMode roundingMode) {
if (amountToSubtract == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(BigDecimal.valueOf(amountToSubtract));
newAmount = newAmount.setScale(getScale(), roundingMode);
... | [
"public",
"BigMoney",
"minusRetainScale",
"(",
"double",
"amountToSubtract",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"if",
"(",
"amountToSubtract",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"BigDecimal",
"newAmount",
"=",
"amount",
".",
"subtract",... | Returns a copy of this monetary value with the amount subtracted retaining
the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For example,'USD 25.95' minus '3.029d' gives 'USD 22.92' with most rounding modes.
<p>
The amount is converted via {@link BigDecimal#va... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"amount",
"subtracted",
"retaining",
"the",
"scale",
"by",
"rounding",
"the",
"result",
".",
"<p",
">",
"The",
"scale",
"of",
"the",
"result",
"will",
"be",
"the",
"same",
"as",
"t... | e1f2de75aa36610a695358696c8a88a18ca66cde | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1226-L1233 | train | Returns a new instance with the specified amount subtracted by this money. | Create a Java method that does the following: "Returns a new instance with the specified amount subtracted by this money.". | Of course, here is the Java code you requested:
```java
public BigMoney minusRetainScale(double amountToSubtract, RoundingMode roundingMode) {
if (amountToSubtract == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(BigDecimal.valueOf(amountToSubtract));
newAm... | |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java | ManagedDatabasesInner.beginCreateOrUpdateAsync | public ServiceFuture<ManagedDatabaseInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters, final ServiceCallback<ManagedDatabaseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseA... | java | public ServiceFuture<ManagedDatabaseInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters, final ServiceCallback<ManagedDatabaseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseA... | [
"public",
"ServiceFuture",
"<",
"ManagedDatabaseInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
",",
"ManagedDatabaseInner",
"parameters",
",",
"final",
"ServiceCallback",
"<",... | Creates a new database or updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param databaseName The name of the datab... | [
"Creates",
"a",
"new",
"database",
"or",
"updates",
"an",
"existing",
"database",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedDatabasesInner.java#L614-L616 | train | Creates or updates a managed database. | Create a Java method that does the following: "Creates or updates a managed database.". | Of course, here is the Java code you requested:
```java
public ServiceFuture<ManagedDatabaseInner> beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters, final ServiceCallback<ManagedDatabaseInner> serviceCallback) {
return ServiceFu... | |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.collect | public static String[] collect(String[] storage, int offset, String prefix, Object object, char separator, String... names) {
if (storage == null) {
storage = new String[names.length];
offset = 0;
}
Class<?> type = object.getClass();
for (int i = 0; i < names.leng... | java | public static String[] collect(String[] storage, int offset, String prefix, Object object, char separator, String... names) {
if (storage == null) {
storage = new String[names.length];
offset = 0;
}
Class<?> type = object.getClass();
for (int i = 0; i < names.leng... | [
"public",
"static",
"String",
"[",
"]",
"collect",
"(",
"String",
"[",
"]",
"storage",
",",
"int",
"offset",
",",
"String",
"prefix",
",",
"Object",
"object",
",",
"char",
"separator",
",",
"String",
"...",
"names",
")",
"{",
"if",
"(",
"storage",
"=="... | Collects object member values into an array of Strings, each prefixed by the field name.
@param storage - an array of strings to store the return values
@param offset - a offset into the storage from which to start storing return values
@param prefix - a string to prepend to each member name in the output
@param objec... | [
"Collects",
"object",
"member",
"values",
"into",
"an",
"array",
"of",
"Strings",
"each",
"prefixed",
"by",
"the",
"field",
"name",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L269-L283 | train | Collect a set of strings from an object to a string array. | Create a Java method that does the following: "Collect a set of strings from an object to a string array.". | Of course, here is the Java code you requested:
```java
public static String[] collect(String[] storage, int offset, String prefix, Object object, char separator, String... names) {
if (storage == null) {
storage = new String[names.length];
offset = 0;
}
Class<?> type = ... | |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.find | public <T> T find(Entity where, RsHandler<T> rsh, String... fields) throws SQLException {
return find(CollectionUtil.newArrayList(fields), where, rsh);
} | java | public <T> T find(Entity where, RsHandler<T> rsh, String... fields) throws SQLException {
return find(CollectionUtil.newArrayList(fields), where, rsh);
} | [
"public",
"<",
"T",
">",
"T",
"find",
"(",
"Entity",
"where",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"String",
"...",
"fields",
")",
"throws",
"SQLException",
"{",
"return",
"find",
"(",
"CollectionUtil",
".",
"newArrayList",
"(",
"fields",
")",
... | 查询,返回所有字段<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param <T> 需要处理成的结果对象类型
@param where 条件实体类(包含表名)
@param rsh 结果集处理对象
@param fields 字段列表,可变长参数如果无值表示查询全部字段
@return 结果对象
@throws SQLException SQL执行异常 | [
"查询,返回所有字段<br",
">",
"查询条件为多个key",
"value对表示,默认key",
"=",
"value,如果使用其它条件可以使用:where",
".",
"put",
"(",
"key",
">",
";",
"1",
")",
",value也可以传Condition对象,key被忽略"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L478-L480 | train | Find records in the database that match the criteria specified in the where clause. | Create a Java method that does the following: "Find records in the database that match the criteria specified in the where clause.". | Of course, here is the Java code you requested:
```java
public <T> T find(Entity where, RsHandler<T> rsh, String... fields) throws SQLException {
return find(CollectionUtil.newArrayList(fields), where, rsh);
}
```
Hope this helps! | |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateSequenceDimensionFilter.java | CoordinateSequenceDimensionFilter.apply | public static CoordinateSequenceDimensionFilter apply(Geometry geometry) {
CoordinateSequenceDimensionFilter cd = new CoordinateSequenceDimensionFilter();
geometry.apply(cd);
return cd;
} | java | public static CoordinateSequenceDimensionFilter apply(Geometry geometry) {
CoordinateSequenceDimensionFilter cd = new CoordinateSequenceDimensionFilter();
geometry.apply(cd);
return cd;
} | [
"public",
"static",
"CoordinateSequenceDimensionFilter",
"apply",
"(",
"Geometry",
"geometry",
")",
"{",
"CoordinateSequenceDimensionFilter",
"cd",
"=",
"new",
"CoordinateSequenceDimensionFilter",
"(",
")",
";",
"geometry",
".",
"apply",
"(",
"cd",
")",
";",
"return",... | Init CoordinateSequenceDimensionFilter object.
@param geometry Geometry instance
@return CoordinateSequenceDimensionFilter instance | [
"Init",
"CoordinateSequenceDimensionFilter",
"object",
"."
] | 9cd70b447e6469cecbc2fc64b16774b59491df3b | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateSequenceDimensionFilter.java#L76-L80 | train | Create a CoordinateSequenceDimensionFilter from a Geometry | Create a Java method that does the following: "Create a CoordinateSequenceDimensionFilter from a Geometry". | Of course, here is the Java code you requested:
```java
public static CoordinateSequenceDimensionFilter apply(Geometry geometry) {
CoordinateSequenceDimensionFilter cd = new CoordinateSequenceDimensionFilter();
geometry.apply(cd);
return cd;
}
```
Hope this helps! | |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.addEntries | public static void addEntries(File zip, ZipEntrySource[] entries, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and adding " + Arrays.asList(entries) + ".");
}
OutputStream destOut = null;
try {
destOut = new BufferedOutputStream(new FileO... | java | public static void addEntries(File zip, ZipEntrySource[] entries, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and adding " + Arrays.asList(entries) + ".");
}
OutputStream destOut = null;
try {
destOut = new BufferedOutputStream(new FileO... | [
"public",
"static",
"void",
"addEntries",
"(",
"File",
"zip",
",",
"ZipEntrySource",
"[",
"]",
"entries",
",",
"File",
"destZip",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Copying '\"",
"+",
"zi... | Copies an existing ZIP file and appends it with new entries.
@param zip
an existing ZIP file (only read).
@param entries
new ZIP entries appended.
@param destZip
new ZIP file created. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"appends",
"it",
"with",
"new",
"entries",
"."
] | abb4dc43583e4d19339c0c021035019798970a13 | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2164-L2180 | train | Add the entries from the given zip file to the given destination zip file. | Create a Java method that does the following: "Add the entries from the given zip file to the given destination zip file.". | Of course, here is the Java code you requested:
```java
public static void addEntries(File zip, ZipEntrySource[] entries, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and adding " + Arrays.asList(entries) + ".");
}
OutputStream destOut = null;
... | |
casmi/casmi | src/main/java/casmi/graphics/element/Curve.java | Curve.setNode | public void setNode(int number, double x, double y) {
if (number <= 0) number = 0;
if (number >= 3) number = 3;
this.points[number * 3] = (float)x;
this.points[number * 3 + 1] = (float)y;
this.points[number * 3 + 2] = 0;
set();
} | java | public void setNode(int number, double x, double y) {
if (number <= 0) number = 0;
if (number >= 3) number = 3;
this.points[number * 3] = (float)x;
this.points[number * 3 + 1] = (float)y;
this.points[number * 3 + 2] = 0;
set();
} | [
"public",
"void",
"setNode",
"(",
"int",
"number",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"number",
"<=",
"0",
")",
"number",
"=",
"0",
";",
"if",
"(",
"number",
">=",
"3",
")",
"number",
"=",
"3",
";",
"this",
".",
"point... | Sets x,y,z-coordinate of nodes of this Curve.
@param number The number of a node. The node whose number is 0 or 3 is a anchor point, and
the node whose number is 1 or 2 is a control point.
@param x The x-coordinate of this node.
@param y The y-coordinate of this node. | [
"Sets",
"x",
"y",
"z",
"-",
"coordinate",
"of",
"nodes",
"of",
"this",
"Curve",
"."
] | 90f6514a9cbce0685186e7a92beb69e22a3b11c4 | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Curve.java#L348-L355 | train | Sets the node of the image. | Create a Java method that does the following: "Sets the node of the image.". | Of course, here is the Java code you requested:
```java
public void setNode(int number, double x, double y) {
if (number <= 0) number = 0;
if (number >= 3) number = 3;
this.points[number * 3] = (float)x;
this.points[number * 3 + 1] = (float)y;
this.points[number * 3 + 2] = 0;
... | |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/RQ.java | RQ.factorize | public static RQ factorize(Matrix A) {
return new RQ(A.numRows(), A.numColumns()).factor(new DenseMatrix(A));
} | java | public static RQ factorize(Matrix A) {
return new RQ(A.numRows(), A.numColumns()).factor(new DenseMatrix(A));
} | [
"public",
"static",
"RQ",
"factorize",
"(",
"Matrix",
"A",
")",
"{",
"return",
"new",
"RQ",
"(",
"A",
".",
"numRows",
"(",
")",
",",
"A",
".",
"numColumns",
"(",
")",
")",
".",
"factor",
"(",
"new",
"DenseMatrix",
"(",
"A",
")",
")",
";",
"}"
] | Convenience method to compute an RQ decomposition
@param A
Matrix to decompose. Not modified
@return Newly allocated decomposition | [
"Convenience",
"method",
"to",
"compute",
"an",
"RQ",
"decomposition"
] | 6157618bc86bcda3749af2a60bf869d8f3292960 | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/RQ.java#L87-L89 | train | Creates a new RQ factor from a matrix. | Create a Java method that does the following: "Creates a new RQ factor from a matrix.". | Of course, here is the Java code you requested:
```java
public static RQ factorize(Matrix A) {
return new RQ(A.numRows(), A.numColumns()).factor(new DenseMatrix(A));
}
```
Hope this helps! | |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java | Infer.reportBoundError | void reportBoundError(UndetVar uv, InferenceBound ib) {
reportInferenceError(
String.format("incompatible.%s.bounds", StringUtils.toLowerCase(ib.name())),
uv.qtype,
uv.getBounds(ib));
} | java | void reportBoundError(UndetVar uv, InferenceBound ib) {
reportInferenceError(
String.format("incompatible.%s.bounds", StringUtils.toLowerCase(ib.name())),
uv.qtype,
uv.getBounds(ib));
} | [
"void",
"reportBoundError",
"(",
"UndetVar",
"uv",
",",
"InferenceBound",
"ib",
")",
"{",
"reportInferenceError",
"(",
"String",
".",
"format",
"(",
"\"incompatible.%s.bounds\"",
",",
"StringUtils",
".",
"toLowerCase",
"(",
"ib",
".",
"name",
"(",
")",
")",
")... | Incorporation error: mismatch between two (or more) bounds of same kind. | [
"Incorporation",
"error",
":",
"mismatch",
"between",
"two",
"(",
"or",
"more",
")",
"bounds",
"of",
"same",
"kind",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java#L1280-L1285 | train | Report an error for a CIDE inference bound. | Create a Java method that does the following: "Report an error for a CIDE inference bound.". | Of course, here is the Java code you requested:
```java
void reportBoundError(UndetVar uv, InferenceBound ib) {
reportInferenceError(
String.format("incompatible.%s.bounds", StringUtils.toLowerCase(ib.name())),
uv.qtype,
uv.getBounds(ib));
}
```
Hope this he... | |
hansenji/pocketknife | pocketknife/src/main/java/pocketknife/PocketKnife.java | PocketKnife.bindArguments | public static <T> void bindArguments(T target, Bundle bundle) {
@SuppressWarnings("unchecked")
BundleBinding<T> binding = (BundleBinding<T>) getBundleBinding(target.getClass().getClassLoader(), target.getClass());
if (binding != null) {
binding.bindArguments(target, bundle);
... | java | public static <T> void bindArguments(T target, Bundle bundle) {
@SuppressWarnings("unchecked")
BundleBinding<T> binding = (BundleBinding<T>) getBundleBinding(target.getClass().getClassLoader(), target.getClass());
if (binding != null) {
binding.bindArguments(target, bundle);
... | [
"public",
"static",
"<",
"T",
">",
"void",
"bindArguments",
"(",
"T",
"target",
",",
"Bundle",
"bundle",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"BundleBinding",
"<",
"T",
">",
"binding",
"=",
"(",
"BundleBinding",
"<",
"T",
">",
")... | Bind annotated fields in the specified {@code target} from the {@link android.os.Bundle}.
@param target Target object for bind arguments
@param bundle Bundle containing arguments; | [
"Bind",
"annotated",
"fields",
"in",
"the",
"specified",
"{",
"@code",
"target",
"}",
"from",
"the",
"{",
"@link",
"android",
".",
"os",
".",
"Bundle",
"}",
"."
] | f225dd66bcafdd702f472a5c99be1fb48202e6ca | https://github.com/hansenji/pocketknife/blob/f225dd66bcafdd702f472a5c99be1fb48202e6ca/pocketknife/src/main/java/pocketknife/PocketKnife.java#L91-L97 | train | Binds the bundle arguments to the target object. | Create a Java method that does the following: "Binds the bundle arguments to the target object.". | Of course, here is the Java code you requested:
```java
public static <T> void bindArguments(T target, Bundle bundle) {
@SuppressWarnings("unchecked")
BundleBinding<T> binding = (BundleBinding<T>) getBundleBinding(target.getClass().getClassLoader(), target.getClass());
if (binding != null) {
... | |
hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.findApkSignBlock | protected ByteBuffer findApkSignBlock() throws IOException {
ByteBuffer buffer = fileData().order(ByteOrder.LITTLE_ENDIAN);
int len = buffer.limit();
// first find zip end of central directory entry
if (len < 22) {
// should not happen
throw new RuntimeException(... | java | protected ByteBuffer findApkSignBlock() throws IOException {
ByteBuffer buffer = fileData().order(ByteOrder.LITTLE_ENDIAN);
int len = buffer.limit();
// first find zip end of central directory entry
if (len < 22) {
// should not happen
throw new RuntimeException(... | [
"protected",
"ByteBuffer",
"findApkSignBlock",
"(",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"buffer",
"=",
"fileData",
"(",
")",
".",
"order",
"(",
"ByteOrder",
".",
"LITTLE_ENDIAN",
")",
";",
"int",
"len",
"=",
"buffer",
".",
"limit",
"(",
")",
"... | Create ApkSignBlockParser for this apk file.
@return null if do not have sign block | [
"Create",
"ApkSignBlockParser",
"for",
"this",
"apk",
"file",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L437-L484 | train | Find the apk sign block in the file. | Create a Java method that does the following: "Find the apk sign block in the file.". | Of course, here is the Java code you requested:
```java
protected ByteBuffer findApkSignBlock() throws IOException {
ByteBuffer buffer = fileData().order(ByteOrder.LITTLE_ENDIAN);
int len = buffer.limit();
// first find zip end of central directory entry
if (len < 22) {
// ... | |
gkopff/gson-jodatime-serialisers | src/main/java/com/fatboyindustrial/gsonjodatime/DateMidnightConverter.java | DateMidnightConverter.deserialize | @Override
public DateMidnight deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException
{
// Do not try to deserialize null or empty values
if (json.getAsString() == null || json.getAsString().isEmpty())
{
return null;
}
final DateTime... | java | @Override
public DateMidnight deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException
{
// Do not try to deserialize null or empty values
if (json.getAsString() == null || json.getAsString().isEmpty())
{
return null;
}
final DateTime... | [
"@",
"Override",
"public",
"DateMidnight",
"deserialize",
"(",
"JsonElement",
"json",
",",
"Type",
"typeOfT",
",",
"JsonDeserializationContext",
"context",
")",
"throws",
"JsonParseException",
"{",
"// Do not try to deserialize null or empty values",
"if",
"(",
"json",
".... | Gson invokes this call-back method during deserialization when it encounters a field of the
specified type. <p>
In the implementation of this call-back method, you should consider invoking
{@link com.google.gson.JsonDeserializationContext#deserialize(com.google.gson.JsonElement, java.lang.reflect.Type)} method to crea... | [
"Gson",
"invokes",
"this",
"call",
"-",
"back",
"method",
"during",
"deserialization",
"when",
"it",
"encounters",
"a",
"field",
"of",
"the",
"specified",
"type",
".",
"<p",
">"
] | a48f05ded1cb262ad1c6e3f25fd2498765589dc2 | https://github.com/gkopff/gson-jodatime-serialisers/blob/a48f05ded1cb262ad1c6e3f25fd2498765589dc2/src/main/java/com/fatboyindustrial/gsonjodatime/DateMidnightConverter.java#L80-L92 | train | Deserialize a DateMidnight object from a JSON Element. | Create a Java method that does the following: "Deserialize a DateMidnight object from a JSON Element.". | Of course, here is the Java code you requested:
```java
@Override
public DateMidnight deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException
{
// Do not try to deserialize null or empty values
if (json.getAsString() == null || json.getAsString().isEm... | |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft2/coverage/CoordAxisHelper.java | CoordAxisHelper.findCoordElementDiscontiguousInterval | private int findCoordElementDiscontiguousInterval(double target, boolean bounded) {
int idx = findSingleHit(target);
if (idx >= 0) return idx;
if (idx == -1) return -1; // no hits
// multiple hits = choose closest to the midpoint
return findClosest(target);
} | java | private int findCoordElementDiscontiguousInterval(double target, boolean bounded) {
int idx = findSingleHit(target);
if (idx >= 0) return idx;
if (idx == -1) return -1; // no hits
// multiple hits = choose closest to the midpoint
return findClosest(target);
} | [
"private",
"int",
"findCoordElementDiscontiguousInterval",
"(",
"double",
"target",
",",
"boolean",
"bounded",
")",
"{",
"int",
"idx",
"=",
"findSingleHit",
"(",
"target",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"return",
"idx",
";",
"if",
"(",
"idx",
... | LOOK not using bounded | [
"LOOK",
"not",
"using",
"bounded"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/CoordAxisHelper.java#L179-L186 | test | Find the discontiguous interval of the target. | Create a Java method that does the following: "Find the discontiguous interval of the target.". | Of course, here is the Java code you requested:
```java
private int findCoordElementDiscontiguousInterval(double target, boolean bounded) {
int idx = findSingleHit(target);
if (idx >= 0) return idx;
if (idx == -1) return -1; // no hits
// multiple hits = choose closest to the midpoint
return findC... | |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java | I18N.getBugTypeDescription | public @Nonnull
String getBugTypeDescription(String shortBugType) {
BugCode bugCode = DetectorFactoryCollection.instance().lookupBugCode(shortBugType);
if (bugCode == null) {
return L10N.getLocalString("err.missing_code", "Error: missing bug code for key") + " " + shortBugType;
}... | java | public @Nonnull
String getBugTypeDescription(String shortBugType) {
BugCode bugCode = DetectorFactoryCollection.instance().lookupBugCode(shortBugType);
if (bugCode == null) {
return L10N.getLocalString("err.missing_code", "Error: missing bug code for key") + " " + shortBugType;
}... | [
"public",
"@",
"Nonnull",
"String",
"getBugTypeDescription",
"(",
"String",
"shortBugType",
")",
"{",
"BugCode",
"bugCode",
"=",
"DetectorFactoryCollection",
".",
"instance",
"(",
")",
".",
"lookupBugCode",
"(",
"shortBugType",
")",
";",
"if",
"(",
"bugCode",
"=... | Get a description for given "bug type". FIXME: this is referred to
elsewhere as the "bug code" or "bug abbrev". Should make the terminology
consistent everywhere. In this case, the bug type refers to the short
prefix code prepended to the long and short bug messages.
@param shortBugType
the short bug type code
@return... | [
"Get",
"a",
"description",
"for",
"given",
"bug",
"type",
".",
"FIXME",
":",
"this",
"is",
"referred",
"to",
"elsewhere",
"as",
"the",
"bug",
"code",
"or",
"bug",
"abbrev",
".",
"Should",
"make",
"the",
"terminology",
"consistent",
"everywhere",
".",
"In",... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/I18N.java#L156-L163 | train | Get the description of a bug type. | Create a Java method that does the following: "Get the description of a bug type.". | Of course, here is the Java code you requested:
```java
public @Nonnull
String getBugTypeDescription(String shortBugType) {
BugCode bugCode = DetectorFactoryCollection.instance().lookupBugCode(shortBugType);
if (bugCode == null) {
return L10N.getLocalString("err.missing_code", "Error: m... | |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java | CliFrontend.getProgramSpecificOptions | static Options getProgramSpecificOptions(Options options) {
options.addOption(JAR_OPTION);
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
options.addOption(ARGS_OPTION);
return options;
} | java | static Options getProgramSpecificOptions(Options options) {
options.addOption(JAR_OPTION);
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
options.addOption(ARGS_OPTION);
return options;
} | [
"static",
"Options",
"getProgramSpecificOptions",
"(",
"Options",
"options",
")",
"{",
"options",
".",
"addOption",
"(",
"JAR_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"CLASS_OPTION",
")",
";",
"options",
".",
"addOption",
"(",
"PARALLELISM_OPTION",
"... | gets the program options with the old flags for jar file and arguments | [
"gets",
"the",
"program",
"options",
"with",
"the",
"old",
"flags",
"for",
"jar",
"file",
"and",
"arguments"
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L167-L173 | train | Get the program specific options. | Create a Java method that does the following: "Get the program specific options.". | Of course, here is the Java code you requested:
```java
static Options getProgramSpecificOptions(Options options) {
options.addOption(JAR_OPTION);
options.addOption(CLASS_OPTION);
options.addOption(PARALLELISM_OPTION);
options.addOption(ARGS_OPTION);
return options;
}
```
Hope this helps! | |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/UnionImpl.java | UnionImpl.initNewHeapInstance | static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p,
final ResizeFactor rf) {
final UpdateSketch gadget = new HeapQuickSelectSketch(
lgNomLongs, seed, p, rf, true); //create with UNION family
final UnionImpl unionImpl = new UnionImpl(gadget, seed);
unionIm... | java | static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p,
final ResizeFactor rf) {
final UpdateSketch gadget = new HeapQuickSelectSketch(
lgNomLongs, seed, p, rf, true); //create with UNION family
final UnionImpl unionImpl = new UnionImpl(gadget, seed);
unionIm... | [
"static",
"UnionImpl",
"initNewHeapInstance",
"(",
"final",
"int",
"lgNomLongs",
",",
"final",
"long",
"seed",
",",
"final",
"float",
"p",
",",
"final",
"ResizeFactor",
"rf",
")",
"{",
"final",
"UpdateSketch",
"gadget",
"=",
"new",
"HeapQuickSelectSketch",
"(",
... | Construct a new Union SetOperation on the java heap.
Called by SetOperationBuilder.
@param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLogs">See lgNomLongs</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@param p <a href="{@docRoot}/resources/dictionary.html#p">See Sa... | [
"Construct",
"a",
"new",
"Union",
"SetOperation",
"on",
"the",
"java",
"heap",
".",
"Called",
"by",
"SetOperationBuilder",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L74-L82 | train | Creates a new instance of the Union class with the given parameters. | Create a Java method that does the following: "Creates a new instance of the Union class with the given parameters.". | Of course, here is the Java code you requested:
```java
static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p,
final ResizeFactor rf) {
final UpdateSketch gadget = new HeapQuickSelectSketch(
lgNomLongs, seed, p, rf, true); //create with UNION family
final Union... | |
ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/datalog/impl/CQContainmentCheckUnderLIDs.java | CQContainmentCheckUnderLIDs.computeSomeHomomorphism | private static Substitution computeSomeHomomorphism(SubstitutionBuilder sb, List<Function> from, Map<Predicate, List<Function>> to) {
int fromSize = from.size();
if (fromSize == 0)
return sb.getSubstituition();
// stack of partial homomorphisms
Stack<SubstitutionBuilder> sbStack = new Stack<>();
sbStack.... | java | private static Substitution computeSomeHomomorphism(SubstitutionBuilder sb, List<Function> from, Map<Predicate, List<Function>> to) {
int fromSize = from.size();
if (fromSize == 0)
return sb.getSubstituition();
// stack of partial homomorphisms
Stack<SubstitutionBuilder> sbStack = new Stack<>();
sbStack.... | [
"private",
"static",
"Substitution",
"computeSomeHomomorphism",
"(",
"SubstitutionBuilder",
"sb",
",",
"List",
"<",
"Function",
">",
"from",
",",
"Map",
"<",
"Predicate",
",",
"List",
"<",
"Function",
">",
">",
"to",
")",
"{",
"int",
"fromSize",
"=",
"from",... | Extends a given substitution that maps each atom in {@code from} to match at least one atom in {@code to}
@param sb
@param from
@param to
@return | [
"Extends",
"a",
"given",
"substitution",
"that",
"maps",
"each",
"atom",
"in",
"{",
"@code",
"from",
"}",
"to",
"match",
"at",
"least",
"one",
"atom",
"in",
"{",
"@code",
"to",
"}"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/datalog/impl/CQContainmentCheckUnderLIDs.java#L287-L342 | train | Compute some homomorphism. | Create a Java method that does the following: "Compute some homomorphism.". | Of course, here is the Java code you requested:
```java
private static Substitution computeSomeHomomorphism(SubstitutionBuilder sb, List<Function> from, Map<Predicate, List<Function>> to) {
int fromSize = from.size();
if (fromSize == 0)
return sb.getSubstituition();
// stack of partial homomorphisms
Stack... | |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.toNativeKeys | static Key[] toNativeKeys(List<DatastoreKey> keys) {
Key[] nativeKeys = new Key[keys.size()];
for (int i = 0; i < keys.size(); i++) {
nativeKeys[i] = keys.get(i).nativeKey();
}
return nativeKeys;
} | java | static Key[] toNativeKeys(List<DatastoreKey> keys) {
Key[] nativeKeys = new Key[keys.size()];
for (int i = 0; i < keys.size(); i++) {
nativeKeys[i] = keys.get(i).nativeKey();
}
return nativeKeys;
} | [
"static",
"Key",
"[",
"]",
"toNativeKeys",
"(",
"List",
"<",
"DatastoreKey",
">",
"keys",
")",
"{",
"Key",
"[",
"]",
"nativeKeys",
"=",
"new",
"Key",
"[",
"keys",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",... | Converts/Unwraps the given list of {@link DatastoreKey} objects into an array of native
{@link Key}s.
@param keys
the list of {@link DatastoreKey} objects
@return the native keys | [
"Converts",
"/",
"Unwraps",
"the",
"given",
"list",
"of",
"{",
"@link",
"DatastoreKey",
"}",
"objects",
"into",
"an",
"array",
"of",
"native",
"{",
"@link",
"Key",
"}",
"s",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L199-L205 | train | Converts a list of datastore keys to native keys. | Create a Java method that does the following: "Converts a list of datastore keys to native keys.". | Of course, here is the Java code you requested:
```java
static Key[] toNativeKeys(List<DatastoreKey> keys) {
Key[] nativeKeys = new Key[keys.size()];
for (int i = 0; i < keys.size(); i++) {
nativeKeys[i] = keys.get(i).nativeKey();
}
return nativeKeys;
}
```
Hope this helps! | |
Pi4J/pi4j | pi4j-example/src/main/java/bananapro/GpioListenAllExample.java | GpioListenAllExample.main | public static void main(String args[]) throws InterruptedException, PlatformAlreadyAssignedException {
// ####################################################################
//
// since we are not using the default Raspberry Pi platform, we should
// explicitly assign the platform as t... | java | public static void main(String args[]) throws InterruptedException, PlatformAlreadyAssignedException {
// ####################################################################
//
// since we are not using the default Raspberry Pi platform, we should
// explicitly assign the platform as t... | [
"public",
"static",
"void",
"main",
"(",
"String",
"args",
"[",
"]",
")",
"throws",
"InterruptedException",
",",
"PlatformAlreadyAssignedException",
"{",
"// ####################################################################",
"//",
"// since we are not using the default Raspberr... | [ARGUMENT/OPTION "--pull (up|down|off)" | "-l (up|down|off)" | "--up" | "--down" ]
This example program accepts an optional argument for specifying pin pull resistance.
Supported values: "up|down" (or simply "1|0"). If no value is specified in the command
argument, then the pin pull resistance will be set to PULL_UP ... | [
"[",
"ARGUMENT",
"/",
"OPTION",
"--",
"pull",
"(",
"up|down|off",
")",
"|",
"-",
"l",
"(",
"up|down|off",
")",
"|",
"--",
"up",
"|",
"--",
"down",
"]",
"This",
"example",
"program",
"accepts",
"an",
"optional",
"argument",
"for",
"specifying",
"pin",
"... | 03cacc62223cc59b3118bfcefadabab979fd84c7 | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-example/src/main/java/bananapro/GpioListenAllExample.java#L60-L198 | train | Main entry point for the C
command. | Create a Java method that does the following: "Main entry point for the C
command.". | Of course, here is the Java code you requested:
```java
public static void main(String args[]) throws InterruptedException, PlatformAlreadyAssignedException {
// ####################################################################
//
// since we are not using the default Raspberry Pi platform,... | |
zaproxy/zaproxy | src/org/parosproxy/paros/db/paros/ParosTableTag.java | ParosTableTag.insert | @Override
public synchronized RecordTag insert(long historyId, String tag) throws DatabaseException {
try {
psInsertTag.setLong(1, historyId);
psInsertTag.setString(2, tag);
psInsertTag.executeUpdate();
try (ResultSet rs = psGetIdLastInsert.executeQuery()) {
rs.next();
long id ... | java | @Override
public synchronized RecordTag insert(long historyId, String tag) throws DatabaseException {
try {
psInsertTag.setLong(1, historyId);
psInsertTag.setString(2, tag);
psInsertTag.executeUpdate();
try (ResultSet rs = psGetIdLastInsert.executeQuery()) {
rs.next();
long id ... | [
"@",
"Override",
"public",
"synchronized",
"RecordTag",
"insert",
"(",
"long",
"historyId",
",",
"String",
"tag",
")",
"throws",
"DatabaseException",
"{",
"try",
"{",
"psInsertTag",
".",
"setLong",
"(",
"1",
",",
"historyId",
")",
";",
"psInsertTag",
".",
"s... | /* (non-Javadoc)
@see org.parosproxy.paros.db.paros.TableTag#insert(long, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/paros/ParosTableTag.java#L100-L115 | train | Creates a new record tag in the database. | Create a Java method that does the following: "Creates a new record tag in the database.". | Of course, here is the Java code you requested:
```java
@Override
public synchronized RecordTag insert(long historyId, String tag) throws DatabaseException {
try {
psInsertTag.setLong(1, historyId);
psInsertTag.setString(2, tag);
psInsertTag.executeUpdate();
try (ResultSet rs = psGetIdL... | |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.rotationX | public Matrix3f rotationX(float ang) {
float sin, cos;
sin = (float) Math.sin(ang);
cos = (float) Math.cosFromSin(sin, ang);
m00 = 1.0f;
m01 = 0.0f;
m02 = 0.0f;
m10 = 0.0f;
m11 = cos;
m12 = sin;
m20 = 0.0f;
m21 = -sin;
m22 =... | java | public Matrix3f rotationX(float ang) {
float sin, cos;
sin = (float) Math.sin(ang);
cos = (float) Math.cosFromSin(sin, ang);
m00 = 1.0f;
m01 = 0.0f;
m02 = 0.0f;
m10 = 0.0f;
m11 = cos;
m12 = sin;
m20 = 0.0f;
m21 = -sin;
m22 =... | [
"public",
"Matrix3f",
"rotationX",
"(",
"float",
"ang",
")",
"{",
"float",
"sin",
",",
"cos",
";",
"sin",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"cos",
"=",
"(",
"float",
")",
"Math",
".",
"cosFromSin",
"(",
"sin",
",",... | Set this matrix to a rotation transformation about the X axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin.
When used with a left-handed coordinate system, th... | [
"Set",
"this",
"matrix",
"to",
"a",
"rotation",
"transformation",
"about",
"the",
"X",
"axis",
".",
"<p",
">",
"When",
"used",
"with",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"the",
"produced",
"rotation",
"will",
"rotate",
"a",
"vector",
"cou... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L1463-L1477 | train | Sets this matrix to be a rotation matrix. | Create a Java method that does the following: "Sets this matrix to be a rotation matrix.". | Of course, here is the Java code you requested:
```java
public Matrix3f rotationX(float ang) {
float sin, cos;
sin = (float) Math.sin(ang);
cos = (float) Math.cosFromSin(sin, ang);
m00 = 1.0f;
m01 = 0.0f;
m02 = 0.0f;
m10 = 0.0f;
m11 = cos;
m12 = s... | |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLUtil.java | XMLUtil.hasChildElement | public static boolean hasChildElement(NodeList list) {
Node n;
for(int i = 0; i < list.getLength(); i++) {
n = list.item(i);
if(n.getNodeType() == Node.ELEMENT_NODE) {
return true;
}
}
return false;
} | java | public static boolean hasChildElement(NodeList list) {
Node n;
for(int i = 0; i < list.getLength(); i++) {
n = list.item(i);
if(n.getNodeType() == Node.ELEMENT_NODE) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"hasChildElement",
"(",
"NodeList",
"list",
")",
"{",
"Node",
"n",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"getLength",
"(",
")",
";",
"i",
"++",
")",
"{",
"n",
"=",
"list",
".",
"item",
... | Checks if the given {@link NodeList} contains a child element.
@param list The {@link NodeList} to check.
@return Whether the {@link NodeList} contains children. | [
"Checks",
"if",
"the",
"given",
"{",
"@link",
"NodeList",
"}",
"contains",
"a",
"child",
"element",
"."
] | 8ca6f95f7eb3a28efaef3569d53adddeb32b6bda | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLUtil.java#L97-L111 | train | Checks if the NodeList contains any child Element nodes. | Create a Java method that does the following: "Checks if the NodeList contains any child Element nodes.". | Of course, here is the Java code you requested:
```java
public static boolean hasChildElement(NodeList list) {
Node n;
for(int i = 0; i < list.getLength(); i++) {
n = list.item(i);
if(n.getNodeType() == Node.ELEMENT_NODE) {
return true;
}
}
return false;
}
```
Hope this helps! | |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/index/IndexDefinition.java | IndexDefinition.loadDefinition | private static void loadDefinition(final UUID _typeUUID)
throws EFapsException
{
final Type type = Type.get(_typeUUID);
final QueryBuilder queryBldr = new QueryBuilder(CIAdminIndex.IndexDefinition);
queryBldr.addWhereAttrEqValue(CIAdminIndex.IndexDefinition.Active, true);
que... | java | private static void loadDefinition(final UUID _typeUUID)
throws EFapsException
{
final Type type = Type.get(_typeUUID);
final QueryBuilder queryBldr = new QueryBuilder(CIAdminIndex.IndexDefinition);
queryBldr.addWhereAttrEqValue(CIAdminIndex.IndexDefinition.Active, true);
que... | [
"private",
"static",
"void",
"loadDefinition",
"(",
"final",
"UUID",
"_typeUUID",
")",
"throws",
"EFapsException",
"{",
"final",
"Type",
"type",
"=",
"Type",
".",
"get",
"(",
"_typeUUID",
")",
";",
"final",
"QueryBuilder",
"queryBldr",
"=",
"new",
"QueryBuilde... | Load definition.
@param _typeUUID the type uuid
@throws EFapsException on error | [
"Load",
"definition",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/index/IndexDefinition.java#L179-L253 | train | Load the index definition. | Create a Java method that does the following: "Load the index definition.". | Of course, here is the Java code you requested:
```java
private static void loadDefinition(final UUID _typeUUID)
throws EFapsException
{
final Type type = Type.get(_typeUUID);
final QueryBuilder queryBldr = new QueryBuilder(CIAdminIndex.IndexDefinition);
queryBldr.addWhereAttrEqValu... | |
karlnicholas/votesmart | src/main/java/org/votesmart/classes/RatingClass.java | RatingClass.getRating | public Rating getRating(String ratingId) throws VoteSmartException, VoteSmartErrorException {
return api.query("Rating.getRating", new ArgMap("ratingId", ratingId), Rating.class );
} | java | public Rating getRating(String ratingId) throws VoteSmartException, VoteSmartErrorException {
return api.query("Rating.getRating", new ArgMap("ratingId", ratingId), Rating.class );
} | [
"public",
"Rating",
"getRating",
"(",
"String",
"ratingId",
")",
"throws",
"VoteSmartException",
",",
"VoteSmartErrorException",
"{",
"return",
"api",
".",
"query",
"(",
"\"Rating.getRating\"",
",",
"new",
"ArgMap",
"(",
"\"ratingId\"",
",",
"ratingId",
")",
",",
... | This method dumps all candidate ratings from a scorecard by an SIG.
@param ratingId
@return {@link Rating}
@throws VoteSmartException, VoteSmartErrorException | [
"This",
"method",
"dumps",
"all",
"candidate",
"ratings",
"from",
"a",
"scorecard",
"by",
"an",
"SIG",
"."
] | b7e0cb58e48071ae904bc0924691e99f2c4e314e | https://github.com/karlnicholas/votesmart/blob/b7e0cb58e48071ae904bc0924691e99f2c4e314e/src/main/java/org/votesmart/classes/RatingClass.java#L180-L182 | valid | Get a rating. | Create a Java method that does the following: "Get a rating.". | Of course, here is the Java code you requested:
```java
public Rating getRating(String ratingId) throws VoteSmartException, VoteSmartErrorException {
return api.query("Rating.getRating", new ArgMap("ratingId", ratingId), Rating.class );
}
```
Hope this helps! | |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/modelplugins/AbstractLIBORCovarianceModel.java | AbstractLIBORCovarianceModel.getCovariance | public RandomVariableInterface getCovariance(int timeIndex, int component1, int component2, RandomVariableInterface[] realizationAtTimeIndex) {
RandomVariableInterface[] factorLoadingOfComponent1 = getFactorLoading(timeIndex, component1, realizationAtTimeIndex);
RandomVariableInterface[] factorLoadingOfComponent2 ... | java | public RandomVariableInterface getCovariance(int timeIndex, int component1, int component2, RandomVariableInterface[] realizationAtTimeIndex) {
RandomVariableInterface[] factorLoadingOfComponent1 = getFactorLoading(timeIndex, component1, realizationAtTimeIndex);
RandomVariableInterface[] factorLoadingOfComponent2 ... | [
"public",
"RandomVariableInterface",
"getCovariance",
"(",
"int",
"timeIndex",
",",
"int",
"component1",
",",
"int",
"component2",
",",
"RandomVariableInterface",
"[",
"]",
"realizationAtTimeIndex",
")",
"{",
"RandomVariableInterface",
"[",
"]",
"factorLoadingOfComponent1... | Returns the instantaneous covariance calculated from factor loadings.
@param timeIndex The time index at which covariance is requested.
@param component1 Index of component <i>i</i>.
@param component2 Index of component <i>j</i>.
@param realizationAtTimeIndex The realization of the stochastic process.
@return The ins... | [
"Returns",
"the",
"instantaneous",
"covariance",
"calculated",
"from",
"factor",
"loadings",
"."
] | a3c067d52dd33feb97d851df6cab130e4116759f | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/modelplugins/AbstractLIBORCovarianceModel.java#L145-L159 | train | Returns the covariance of the product of the two random variables at the given time index. | Create a Java method that does the following: "Returns the covariance of the product of the two random variables at the given time index.". | Of course, here is the Java code you requested:
```java
public RandomVariableInterface getCovariance(int timeIndex, int component1, int component2, RandomVariableInterface[] realizationAtTimeIndex) {
RandomVariableInterface[] factorLoadingOfComponent1 = getFactorLoading(timeIndex, component1, realizationAtTimeIndex... | |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java | AbstractCommandBuilder.addServerArguments | public T addServerArguments(final String... args) {
if (args != null) {
for (String arg : args) {
addServerArgument(arg);
}
}
return getThis();
} | java | public T addServerArguments(final String... args) {
if (args != null) {
for (String arg : args) {
addServerArgument(arg);
}
}
return getThis();
} | [
"public",
"T",
"addServerArguments",
"(",
"final",
"String",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"arg",
":",
"args",
")",
"{",
"addServerArgument",
"(",
"arg",
")",
";",
"}",
"}",
"return",
"getTh... | Adds the arguments to the collection of arguments that will be passed to the server ignoring any {@code null}
arguments.
@param args the arguments to add
@return the builder | [
"Adds",
"the",
"arguments",
"to",
"the",
"collection",
"of",
"arguments",
"that",
"will",
"be",
"passed",
"to",
"the",
"server",
"ignoring",
"any",
"{",
"@code",
"null",
"}",
"arguments",
"."
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java#L313-L320 | train | Add server arguments. | Create a Java method that does the following: "Add server arguments.". | Of course, here is the Java code you requested:
```java
public T addServerArguments(final String... args) {
if (args != null) {
for (String arg : args) {
addServerArgument(arg);
}
}
return getThis();
}
```
Hope this helps! | |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/component/decoration/UIImage.java | UIImage.setSize | @Override
public void setSize(ISize size)
{
//UIImage for itemStack have a fixed 16*16 size
if (itemStack != null)
size = ITEMSTACK_SIZE;
super.setSize(size);
} | java | @Override
public void setSize(ISize size)
{
//UIImage for itemStack have a fixed 16*16 size
if (itemStack != null)
size = ITEMSTACK_SIZE;
super.setSize(size);
} | [
"@",
"Override",
"public",
"void",
"setSize",
"(",
"ISize",
"size",
")",
"{",
"//UIImage for itemStack have a fixed 16*16 size",
"if",
"(",
"itemStack",
"!=",
"null",
")",
"size",
"=",
"ITEMSTACK_SIZE",
";",
"super",
".",
"setSize",
"(",
"size",
")",
";",
"}"
... | Sets the size for this {@link UIImage}.<br>
Has no effect if rendering an {@link ItemStack}.
@param size the new size | [
"Sets",
"the",
"size",
"for",
"this",
"{",
"@link",
"UIImage",
"}",
".",
"<br",
">",
"Has",
"no",
"effect",
"if",
"rendering",
"an",
"{",
"@link",
"ItemStack",
"}",
"."
] | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/decoration/UIImage.java#L131-L138 | train | Set the size of the UIImage. | Create a Java method that does the following: "Set the size of the UIImage.". | Of course, here is the Java code you requested:
```java
@Override
public void setSize(ISize size)
{
//UIImage for itemStack have a fixed 16*16 size
if (itemStack != null)
size = ITEMSTACK_SIZE;
super.setSize(size);
}
```
Hope this helps! | |
orientechnologies/orientdb | client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java | OServerAdmin.existsDatabase | public synchronized boolean existsDatabase(final String iDatabaseName, final String storageType) throws IOException {
OExistsDatabaseRequest request = new OExistsDatabaseRequest(iDatabaseName, storageType);
OExistsDatabaseResponse response = networkAdminOperation(request,
"Error on checking existence... | java | public synchronized boolean existsDatabase(final String iDatabaseName, final String storageType) throws IOException {
OExistsDatabaseRequest request = new OExistsDatabaseRequest(iDatabaseName, storageType);
OExistsDatabaseResponse response = networkAdminOperation(request,
"Error on checking existence... | [
"public",
"synchronized",
"boolean",
"existsDatabase",
"(",
"final",
"String",
"iDatabaseName",
",",
"final",
"String",
"storageType",
")",
"throws",
"IOException",
"{",
"OExistsDatabaseRequest",
"request",
"=",
"new",
"OExistsDatabaseRequest",
"(",
"iDatabaseName",
","... | Checks if a database exists in the remote server.
@param iDatabaseName The database name
@param storageType Storage type between "plocal" or "memory".
@return true if exists, otherwise false
@throws IOException | [
"Checks",
"if",
"a",
"database",
"exists",
"in",
"the",
"remote",
"server",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java#L262-L268 | test | Checks if a database exists in the remote server. | Create a Java method that does the following: "Checks if a database exists in the remote server.". | Of course, here is the Java code you requested:
```java
public synchronized boolean existsDatabase(final String iDatabaseName, final String storageType) throws IOException {
OExistsDatabaseRequest request = new OExistsDatabaseRequest(iDatabaseName, storageType);
OExistsDatabaseResponse response = networkAdmi... | |
overturetool/overture | core/interpreter/src/main/java/org/overture/interpreter/values/ObjectValue.java | ObjectValue.readObject | private void readObject(ObjectInputStream in)
throws ClassNotFoundException, IOException
{
in.defaultReadObject();
CPU = CPUValue.vCPU;
guardLock = new Lock();
} | java | private void readObject(ObjectInputStream in)
throws ClassNotFoundException, IOException
{
in.defaultReadObject();
CPU = CPUValue.vCPU;
guardLock = new Lock();
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"CPU",
"=",
"CPUValue",
".",
"vCPU",
";",
"guardLock",
"=",
"new",
"Lock",
"(",
... | } | [
"}"
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/org/overture/interpreter/values/ObjectValue.java#L530-L536 | train | readObject is called to restore the state of the object from a stream. | Create a Java method that does the following: "readObject is called to restore the state of the object from a stream.". | Of course, here is the Java code you requested:
```java
private void readObject(ObjectInputStream in)
throws ClassNotFoundException, IOException
{
in.defaultReadObject();
CPU = CPUValue.vCPU;
guardLock = new Lock();
}
```
Hope this helps! | |
Netflix/denominator | model/src/main/java/denominator/model/ResourceRecordSets.java | ResourceRecordSets.txt | public static ResourceRecordSet<TXTData> txt(String name, Collection<String> txtdata) {
return new TXTBuilder().name(name).addAll(txtdata).build();
} | java | public static ResourceRecordSet<TXTData> txt(String name, Collection<String> txtdata) {
return new TXTBuilder().name(name).addAll(txtdata).build();
} | [
"public",
"static",
"ResourceRecordSet",
"<",
"TXTData",
">",
"txt",
"(",
"String",
"name",
",",
"Collection",
"<",
"String",
">",
"txtdata",
")",
"{",
"return",
"new",
"TXTBuilder",
"(",
")",
".",
"name",
"(",
"name",
")",
".",
"addAll",
"(",
"txtdata",... | creates txt set of {@link denominator.model.rdata.TXTData TXT} records for the specified name.
@param name ex. {@code denominator.io.}
@param txtdata txtdata values ex. {@code ["made in sweden", "made in norway"]} | [
"creates",
"txt",
"set",
"of",
"{",
"@link",
"denominator",
".",
"model",
".",
"rdata",
".",
"TXTData",
"TXT",
"}",
"records",
"for",
"the",
"specified",
"name",
"."
] | c565e3b8c6043051252e0947029511f9ac5d306f | https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/model/src/main/java/denominator/model/ResourceRecordSets.java#L467-L469 | train | Create a TXT record set with the specified name and a collection of text data. | Create a Java method that does the following: "Create a TXT record set with the specified name and a collection of text data.". | Of course, here is the Java code you requested:
```java
public static ResourceRecordSet<TXTData> txt(String name, Collection<String> txtdata) {
return new TXTBuilder().name(name).addAll(txtdata).build();
}
```
Hope this helps! | |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201811/ExcludeContentFromContentBundle.java | ExcludeContentFromContentBundle.getContentStatement | public com.google.api.ads.admanager.axis.v201811.Statement getContentStatement() {
return contentStatement;
} | java | public com.google.api.ads.admanager.axis.v201811.Statement getContentStatement() {
return contentStatement;
} | [
"public",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201811",
".",
"Statement",
"getContentStatement",
"(",
")",
"{",
"return",
"contentStatement",
";",
"}"
] | Gets the contentStatement value for this ExcludeContentFromContentBundle.
@return contentStatement * The Publisher Query Language statement specifying which {@link
Content} to exclude from the
{@link ContentBundle}. The statement is expressed
in terms of {@code Content} fields such as
name and status.
<p>
All fields... | [
"Gets",
"the",
"contentStatement",
"value",
"for",
"this",
"ExcludeContentFromContentBundle",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201811/ExcludeContentFromContentBundle.java#L70-L72 | train | Gets the contentStatement value for this CIDCTYPE. | Create a Java method that does the following: "Gets the contentStatement value for this CIDCTYPE.". | Of course, here is the Java code you requested:
```java
public com.google.api.ads.admanager.axis.v201811.Statement getContentStatement() {
return contentStatement;
}
```
Hope this helps! | |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java | JsonArray.add | public boolean add(Boolean value) {
if (value == null) {
stateList.add(Type.NULL);
} else {
stateList.add(Type.BOOLEAN);
}
return super.add(value);
} | java | public boolean add(Boolean value) {
if (value == null) {
stateList.add(Type.NULL);
} else {
stateList.add(Type.BOOLEAN);
}
return super.add(value);
} | [
"public",
"boolean",
"add",
"(",
"Boolean",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"stateList",
".",
"add",
"(",
"Type",
".",
"NULL",
")",
";",
"}",
"else",
"{",
"stateList",
".",
"add",
"(",
"Type",
".",
"BOOLEAN",
")",
"... | see {@link List#add(Object)}.
this method is alternative of {@link #add(Object, Type)} call with {@link Type#BOOLEAN}.
@param value
@return see {@link List#add(Object)}
@since 1.4.12
@author vvakame | [
"see",
"{"
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonArray.java#L641-L649 | train | Add a Boolean value to the list. | Create a Java method that does the following: "Add a Boolean value to the list.". | Of course, here is the Java code you requested:
```java
public boolean add(Boolean value) {
if (value == null) {
stateList.add(Type.NULL);
} else {
stateList.add(Type.BOOLEAN);
}
return super.add(value);
}
```
Hope this helps! | |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/jcp/expression/ExpressionParser.java | ExpressionParser.nextItem | @Nullable
ExpressionItem nextItem(@Nonnull final PushbackReader reader, @Nonnull final PreprocessorContext context) throws IOException {
assertNotNull("Reader is null", reader);
ParserState state = ParserState.WAIT;
final StringBuilder builder = new StringBuilder(12);
boolean found = false;
char... | java | @Nullable
ExpressionItem nextItem(@Nonnull final PushbackReader reader, @Nonnull final PreprocessorContext context) throws IOException {
assertNotNull("Reader is null", reader);
ParserState state = ParserState.WAIT;
final StringBuilder builder = new StringBuilder(12);
boolean found = false;
char... | [
"@",
"Nullable",
"ExpressionItem",
"nextItem",
"(",
"@",
"Nonnull",
"final",
"PushbackReader",
"reader",
",",
"@",
"Nonnull",
"final",
"PreprocessorContext",
"context",
")",
"throws",
"IOException",
"{",
"assertNotNull",
"(",
"\"Reader is null\"",
",",
"reader",
")"... | Read the next item from the reader
@param reader a reader to be used as the char source, must not be null
@param context a preprocessor context
@return a read expression item, it can be null if the end is reached
@throws IOException it will be thrown if there is any error during a char reading | [
"Read",
"the",
"next",
"item",
"from",
"the",
"reader"
] | 83ac87b575ac084914d77695a8c8673de3b8300c | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/expression/ExpressionParser.java#L322-L601 | train | Gets the next token. | Create a Java method that does the following: "Gets the next token.". | Of course, here is the Java code you requested:
```java
@Nullable
ExpressionItem nextItem(@Nonnull final PushbackReader reader, @Nonnull final PreprocessorContext context) throws IOException {
assertNotNull("Reader is null", reader);
ParserState state = ParserState.WAIT;
final StringBuilder builder = ne... | |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java | AmazonRDSClient.describeOptionGroupOptions | @Override
public DescribeOptionGroupOptionsResult describeOptionGroupOptions(DescribeOptionGroupOptionsRequest request) {
request = beforeClientExecution(request);
return executeDescribeOptionGroupOptions(request);
} | java | @Override
public DescribeOptionGroupOptionsResult describeOptionGroupOptions(DescribeOptionGroupOptionsRequest request) {
request = beforeClientExecution(request);
return executeDescribeOptionGroupOptions(request);
} | [
"@",
"Override",
"public",
"DescribeOptionGroupOptionsResult",
"describeOptionGroupOptions",
"(",
"DescribeOptionGroupOptionsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeOptionGroupOptions",
"(",
"... | <p>
Describes all available options.
</p>
@param describeOptionGroupOptionsRequest
@return Result of the DescribeOptionGroupOptions operation returned by the service.
@sample AmazonRDS.DescribeOptionGroupOptions
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeOptionGroupOptions" target="_to... | [
"<p",
">",
"Describes",
"all",
"available",
"options",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java#L4690-L4694 | train | Retrieves the options for a specific language. | Create a Java method that does the following: "Retrieves the options for a specific language.". | Of course, here is the Java code you requested:
```java
@Override
public DescribeOptionGroupOptionsResult describeOptionGroupOptions(DescribeOptionGroupOptionsRequest request) {
request = beforeClientExecution(request);
return executeDescribeOptionGroupOptions(request);
}
```
Hope this helps! | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4FactoryImpl.java | Ifc4FactoryImpl.createIfcSystemFurnitureElementTypeEnumFromString | public IfcSystemFurnitureElementTypeEnum createIfcSystemFurnitureElementTypeEnumFromString(EDataType eDataType,
String initialValue) {
IfcSystemFurnitureElementTypeEnum result = IfcSystemFurnitureElementTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '"... | java | public IfcSystemFurnitureElementTypeEnum createIfcSystemFurnitureElementTypeEnumFromString(EDataType eDataType,
String initialValue) {
IfcSystemFurnitureElementTypeEnum result = IfcSystemFurnitureElementTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '"... | [
"public",
"IfcSystemFurnitureElementTypeEnum",
"createIfcSystemFurnitureElementTypeEnumFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"IfcSystemFurnitureElementTypeEnum",
"result",
"=",
"IfcSystemFurnitureElementTypeEnum",
".",
"get",
"(",
"i... | <!-- 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/ifc4/impl/Ifc4FactoryImpl.java#L16804-L16811 | train | Create a IfcSystemFurnitureElementTypeEnum from a String value. | Create a Java method that does the following: "Create a IfcSystemFurnitureElementTypeEnum from a String value.". | Of course, here is the Java code you requested:
```java
public IfcSystemFurnitureElementTypeEnum createIfcSystemFurnitureElementTypeEnumFromString(EDataType eDataType,
String initialValue) {
IfcSystemFurnitureElementTypeEnum result = IfcSystemFurnitureElementTypeEnum.get(initialValue);
if (result == null)
... | |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagContainer.java | CmsJspTagContainer.doStartTag | @Override
public int doStartTag() {
if (CmsFlexController.isCmsRequest(pageContext.getRequest())) {
m_paramState = new ParamState(
CmsFlexController.getController(pageContext.getRequest()).getCurrentRequest());
m_paramState.init();
}
return EVAL_BODY_... | java | @Override
public int doStartTag() {
if (CmsFlexController.isCmsRequest(pageContext.getRequest())) {
m_paramState = new ParamState(
CmsFlexController.getController(pageContext.getRequest()).getCurrentRequest());
m_paramState.init();
}
return EVAL_BODY_... | [
"@",
"Override",
"public",
"int",
"doStartTag",
"(",
")",
"{",
"if",
"(",
"CmsFlexController",
".",
"isCmsRequest",
"(",
"pageContext",
".",
"getRequest",
"(",
")",
")",
")",
"{",
"m_paramState",
"=",
"new",
"ParamState",
"(",
"CmsFlexController",
".",
"getC... | Internal action method.<p>
@return EVAL_BODY_BUFFERED
@see javax.servlet.jsp.tagext.Tag#doStartTag() | [
"Internal",
"action",
"method",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagContainer.java#L645-L654 | train | Override to initialize the param state. | Create a Java method that does the following: "Override to initialize the param state.". | Of course, here is the Java code you requested:
```java
@Override
public int doStartTag() {
if (CmsFlexController.isCmsRequest(pageContext.getRequest())) {
m_paramState = new ParamState(
CmsFlexController.getController(pageContext.getRequest()).getCurrentRequest());
... | |
atbashEE/atbash-config | impl/src/main/java/be/atbash/config/spi/AbstractConfigSource.java | AbstractConfigSource.getOrdinal | public int getOrdinal() {
String configOrdinal = getValue(CONFIG_ORDINAL);
if (configOrdinal != null) {
try {
return Integer.parseInt(configOrdinal);
} catch (NumberFormatException ignored) {
// Ignored
}
}
return DEFAUL... | java | public int getOrdinal() {
String configOrdinal = getValue(CONFIG_ORDINAL);
if (configOrdinal != null) {
try {
return Integer.parseInt(configOrdinal);
} catch (NumberFormatException ignored) {
// Ignored
}
}
return DEFAUL... | [
"public",
"int",
"getOrdinal",
"(",
")",
"{",
"String",
"configOrdinal",
"=",
"getValue",
"(",
"CONFIG_ORDINAL",
")",
";",
"if",
"(",
"configOrdinal",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"configOrdinal",
")",
";",... | Return the ordinal for this config source. If a property is specified in multiple config sources, the value
in the config source with the highest ordinal takes precedence.
For the config sources with the same ordinal value, the config source names will
be used for sorting according to string sorting criteria.
Note that... | [
"Return",
"the",
"ordinal",
"for",
"this",
"config",
"source",
".",
"If",
"a",
"property",
"is",
"specified",
"in",
"multiple",
"config",
"sources",
"the",
"value",
"in",
"the",
"config",
"source",
"with",
"the",
"highest",
"ordinal",
"takes",
"precedence",
... | 80c06c6e535957514ffb51380948ecd351d5068c | https://github.com/atbashEE/atbash-config/blob/80c06c6e535957514ffb51380948ecd351d5068c/impl/src/main/java/be/atbash/config/spi/AbstractConfigSource.java#L62-L72 | train | Gets the ordinal value of the class system. | Create a Java method that does the following: "Gets the ordinal value of the class system.". | Of course, here is the Java code you requested:
```java
public int getOrdinal() {
String configOrdinal = getValue(CONFIG_ORDINAL);
if (configOrdinal != null) {
try {
return Integer.parseInt(configOrdinal);
} catch (NumberFormatException ignored) {
... | |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/dom/XMLDocument.java | XMLDocument.create | public static XMLDocument create(XMLStreamEventsSync stream) throws XMLException, IOException {
XMLDocument doc = new XMLDocument();
do {
switch (stream.event.type) {
case DOCTYPE:
if (doc.docType != null)
throw new XMLException(stream.getPosition(), "Unexpected element ", "DOCTYPE");
doc.... | java | public static XMLDocument create(XMLStreamEventsSync stream) throws XMLException, IOException {
XMLDocument doc = new XMLDocument();
do {
switch (stream.event.type) {
case DOCTYPE:
if (doc.docType != null)
throw new XMLException(stream.getPosition(), "Unexpected element ", "DOCTYPE");
doc.... | [
"public",
"static",
"XMLDocument",
"create",
"(",
"XMLStreamEventsSync",
"stream",
")",
"throws",
"XMLException",
",",
"IOException",
"{",
"XMLDocument",
"doc",
"=",
"new",
"XMLDocument",
"(",
")",
";",
"do",
"{",
"switch",
"(",
"stream",
".",
"event",
".",
... | Create a document from a XMLStreamEvents. | [
"Create",
"a",
"document",
"from",
"a",
"XMLStreamEvents",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/dom/XMLDocument.java#L95-L119 | train | Creates an XMLDocument object from an XMLStreamEventsSync. | Create a Java method that does the following: "Creates an XMLDocument object from an XMLStreamEventsSync.". | Of course, here is the Java code you requested:
```java
public static XMLDocument create(XMLStreamEventsSync stream) throws XMLException, IOException {
XMLDocument doc = new XMLDocument();
do {
switch (stream.event.type) {
case DOCTYPE:
if (doc.docType != null)
throw new XMLException(stream.ge... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java | Util.readTokenLength | private static int readTokenLength(ByteArrayInputStream bais) {
int tokenLength = 0;
byte lengthMarker = (byte) bais.read();
if (lengthMarker == (byte) 0x081) {
int firstByte = bais.read();
tokenLength = firstByte;
} else if (lengthMarker == (byte) 0x082) {
... | java | private static int readTokenLength(ByteArrayInputStream bais) {
int tokenLength = 0;
byte lengthMarker = (byte) bais.read();
if (lengthMarker == (byte) 0x081) {
int firstByte = bais.read();
tokenLength = firstByte;
} else if (lengthMarker == (byte) 0x082) {
... | [
"private",
"static",
"int",
"readTokenLength",
"(",
"ByteArrayInputStream",
"bais",
")",
"{",
"int",
"tokenLength",
"=",
"0",
";",
"byte",
"lengthMarker",
"=",
"(",
"byte",
")",
"bais",
".",
"read",
"(",
")",
";",
"if",
"(",
"lengthMarker",
"==",
"(",
"b... | /*
WARNING: The stream must have read up to the token length.
Read token length the same way as tWAS to ensure compatibility.
tWAS encodes lengths greater than 128 using a marker followed by 1, 2, 3, or 4 bytes. | [
"/",
"*",
"WARNING",
":",
"The",
"stream",
"must",
"have",
"read",
"up",
"to",
"the",
"token",
"length",
".",
"Read",
"token",
"length",
"the",
"same",
"way",
"as",
"tWAS",
"to",
"ensure",
"compatibility",
".",
"tWAS",
"encodes",
"lengths",
"greater",
"t... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java#L640-L668 | train | Read the length of the token. | Create a Java method that does the following: "Read the length of the token.". | Of course, here is the Java code you requested:
```java
private static int readTokenLength(ByteArrayInputStream bais) {
int tokenLength = 0;
byte lengthMarker = (byte) bais.read();
if (lengthMarker == (byte) 0x081) {
int firstByte = bais.read();
tokenLength = firstByte;... | |
Evol-Instruct | N/A | N/A | java | [] | [] | train | Create a Java class to represent a point in 2D space using two fields, x and y. The x and y values should be restricted to prime numbers between -100 and 100, inclusive. Additionally, the class should have a method to calculate the distance between two points in 2D space, but the distance calculation should only consid... | Here's a Java class that represents a point in 2D space using two fields, x and y, with restricted prime number values between -100 and 100, and includes a method to calculate the distance between two points in 2D space only considering the x-coordinate:
```java
import java.util.ArrayList;
public class Point {
pr... | |||||||
aspectran/aspectran | core/src/main/java/com/aspectran/core/component/session/SessionAgent.java | SessionAgent.access | public void access() {
Session session = getSession(false);
if (session == null) {
return;
}
sessionHandler.access(session);
} | java | public void access() {
Session session = getSession(false);
if (session == null) {
return;
}
sessionHandler.access(session);
} | [
"public",
"void",
"access",
"(",
")",
"{",
"Session",
"session",
"=",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"sessionHandler",
".",
"access",
"(",
"session",
")",
";",
"}"
] | Called by the {@link CoreActivity}
when a session is first accessed by a request. | [
"Called",
"by",
"the",
"{"
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/component/session/SessionAgent.java#L108-L114 | train | Access the session. | Create a Java method that does the following: "Access the session.". | Of course, here is the Java code you requested:
```java
public void access() {
Session session = getSession(false);
if (session == null) {
return;
}
sessionHandler.access(session);
}
```
Hope this helps! | |
dnsjava/dnsjava | org/xbill/DNS/Message.java | Message.newQuery | public static Message
newQuery(Record r) {
Message m = new Message();
m.header.setOpcode(Opcode.QUERY);
m.header.setFlag(Flags.RD);
m.addRecord(r, Section.QUESTION);
return m;
} | java | public static Message
newQuery(Record r) {
Message m = new Message();
m.header.setOpcode(Opcode.QUERY);
m.header.setFlag(Flags.RD);
m.addRecord(r, Section.QUESTION);
return m;
} | [
"public",
"static",
"Message",
"newQuery",
"(",
"Record",
"r",
")",
"{",
"Message",
"m",
"=",
"new",
"Message",
"(",
")",
";",
"m",
".",
"header",
".",
"setOpcode",
"(",
"Opcode",
".",
"QUERY",
")",
";",
"m",
".",
"header",
".",
"setFlag",
"(",
"Fl... | Creates a new Message with a random Message ID suitable for sending as a
query.
@param r A record containing the question | [
"Creates",
"a",
"new",
"Message",
"with",
"a",
"random",
"Message",
"ID",
"suitable",
"for",
"sending",
"as",
"a",
"query",
"."
] | d97b6a0685d59143372bb392ab591dd8dd840b61 | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Message.java#L80-L87 | train | Creates a new query message. | Create a Java method that does the following: "Creates a new query message.". | Of course, here is the Java code you requested:
```java
public static Message
newQuery(Record r) {
Message m = new Message();
m.header.setOpcode(Opcode.QUERY);
m.header.setFlag(Flags.RD);
m.addRecord(r, Section.QUESTION);
return m;
}
```
Hope this helps! | |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java | CheckMethodAdapter.checkInternalName | static void checkInternalName(final String name, final String msg) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Invalid " + msg
+ " (must not be null or empty)");
}
if (name.charAt(0) == '[') {
checkDesc(name, false);... | java | static void checkInternalName(final String name, final String msg) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Invalid " + msg
+ " (must not be null or empty)");
}
if (name.charAt(0) == '[') {
checkDesc(name, false);... | [
"static",
"void",
"checkInternalName",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"msg",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Checks that the given string is a valid internal class name.
@param name
the string to be checked.
@param msg
a message to be used in case of error. | [
"Checks",
"that",
"the",
"given",
"string",
"is",
"a",
"valid",
"internal",
"class",
"name",
"."
] | 01c216599ffa2e5f2d9c01df2adaad0f45567c04 | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java#L1310-L1320 | train | Check the name of a class. | Create a Java method that does the following: "Check the name of a class.". | Of course, here is the Java code you requested:
```java
static void checkInternalName(final String name, final String msg) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Invalid " + msg
+ " (must not be null or empty)");
}
if (nam... | |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/database/CmsHtmlImport.java | CmsHtmlImport.validate | public void validate(FileItem fi, boolean isdefault) throws CmsIllegalArgumentException {
// check the input directory and the HTTP upload file
if (fi == null) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_inputDir) && !isdefault) {
throw new CmsIllegalArgumentException(
... | java | public void validate(FileItem fi, boolean isdefault) throws CmsIllegalArgumentException {
// check the input directory and the HTTP upload file
if (fi == null) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_inputDir) && !isdefault) {
throw new CmsIllegalArgumentException(
... | [
"public",
"void",
"validate",
"(",
"FileItem",
"fi",
",",
"boolean",
"isdefault",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"// check the input directory and the HTTP upload file",
"if",
"(",
"fi",
"==",
"null",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"i... | Tests if all given input parameters for the HTML Import are valid, that is that all the
given folders do exist. <p>
@param fi a file item if a file is uploaded per HTTP otherwise <code>null</code>
@param isdefault if this sets, then the destination and input directory can be empty
@throws CmsIllegalArgumentException ... | [
"Tests",
"if",
"all",
"given",
"input",
"parameters",
"for",
"the",
"HTML",
"Import",
"are",
"valid",
"that",
"is",
"that",
"all",
"the",
"given",
"folders",
"do",
"exist",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/database/CmsHtmlImport.java#L696-L809 | train | Validates the file item. | Create a Java method that does the following: "Validates the file item.". | Of course, here is the Java code you requested:
```java
public void validate(FileItem fi, boolean isdefault) throws CmsIllegalArgumentException {
// check the input directory and the HTTP upload file
if (fi == null) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_inputDir) && !isdefault) {
... | |
zaproxy/zaproxy | src/org/parosproxy/paros/view/AbstractParamDialog.java | AbstractParamDialog.showDialog | public int showDialog(boolean showRoot, String panel) {
this.getJSplitPane().showDialog(showRoot, panel);
this.setVisible(true);
return this.exitResult;
} | java | public int showDialog(boolean showRoot, String panel) {
this.getJSplitPane().showDialog(showRoot, panel);
this.setVisible(true);
return this.exitResult;
} | [
"public",
"int",
"showDialog",
"(",
"boolean",
"showRoot",
",",
"String",
"panel",
")",
"{",
"this",
".",
"getJSplitPane",
"(",
")",
".",
"showDialog",
"(",
"showRoot",
",",
"panel",
")",
";",
"this",
".",
"setVisible",
"(",
"true",
")",
";",
"return",
... | ZAP: show the last selected panel | [
"ZAP",
":",
"show",
"the",
"last",
"selected",
"panel"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/AbstractParamDialog.java#L414-L418 | train | Show the dialog. | Create a Java method that does the following: "Show the dialog.". | Of course, here is the Java code you requested:
```java
public int showDialog(boolean showRoot, String panel) {
this.getJSplitPane().showDialog(showRoot, panel);
this.setVisible(true);
return this.exitResult;
}
```
Hope this helps! | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.newHashSet | @SafeVarargs
public static <T> HashSet<T> newHashSet(T... ts) {
return newHashSet(false, ts);
} | java | @SafeVarargs
public static <T> HashSet<T> newHashSet(T... ts) {
return newHashSet(false, ts);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"HashSet",
"<",
"T",
">",
"newHashSet",
"(",
"T",
"...",
"ts",
")",
"{",
"return",
"newHashSet",
"(",
"false",
",",
"ts",
")",
";",
"}"
] | 新建一个HashSet
@param <T> 集合元素类型
@param ts 元素数组
@return HashSet对象 | [
"新建一个HashSet"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L401-L404 | train | Creates a new HashSet instance containing all of the elements in the given array. | Create a Java method that does the following: "Creates a new HashSet instance containing all of the elements in the given array.". | Of course, here is the Java code you requested:
```java
@SafeVarargs
public static <T> HashSet<T> newHashSet(T... ts) {
return newHashSet(false, ts);
}
```
Hope this helps! | |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.getUsers | public Pager<User> getUsers(int itemsPerPage) throws GitLabApiException {
return (new Pager<User>(this, User.class, itemsPerPage, createGitLabApiForm().asMap(), "users"));
} | java | public Pager<User> getUsers(int itemsPerPage) throws GitLabApiException {
return (new Pager<User>(this, User.class, itemsPerPage, createGitLabApiForm().asMap(), "users"));
} | [
"public",
"Pager",
"<",
"User",
">",
"getUsers",
"(",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"new",
"Pager",
"<",
"User",
">",
"(",
"this",
",",
"User",
".",
"class",
",",
"itemsPerPage",
",",
"createGitLabApiForm",
... | Get a Pager of users.
<pre><code>GitLab Endpoint: GET /users</code></pre>
@param itemsPerPage the number of User instances that will be fetched per page
@return a Pager of User
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"of",
"users",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L82-L84 | train | Get a Pager of users. | Create a Java method that does the following: "Get a Pager of users.". | Of course, here is the Java code you requested:
```java
public Pager<User> getUsers(int itemsPerPage) throws GitLabApiException {
return (new Pager<User>(this, User.class, itemsPerPage, createGitLabApiForm().asMap(), "users"));
}
```
Hope this helps! | |
js-lib-com/tiny-container | src/main/java/js/servlet/TinyContainer.java | TinyContainer.getHttpServletRequest | private HttpServletRequest getHttpServletRequest() {
RequestContext context = getInstance(RequestContext.class);
HttpServletRequest request = context.getRequest();
if (request == null) {
throw new BugError("Attempt to use not initialized HTTP request.");
}
return request;
} | java | private HttpServletRequest getHttpServletRequest() {
RequestContext context = getInstance(RequestContext.class);
HttpServletRequest request = context.getRequest();
if (request == null) {
throw new BugError("Attempt to use not initialized HTTP request.");
}
return request;
} | [
"private",
"HttpServletRequest",
"getHttpServletRequest",
"(",
")",
"{",
"RequestContext",
"context",
"=",
"getInstance",
"(",
"RequestContext",
".",
"class",
")",
";",
"HttpServletRequest",
"request",
"=",
"context",
".",
"getRequest",
"(",
")",
";",
"if",
"(",
... | Get HTTP request from current request context.
@return current HTTP request.
@throws BugError if attempt to use not initialized HTTP request. | [
"Get",
"HTTP",
"request",
"from",
"current",
"request",
"context",
"."
] | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/TinyContainer.java#L481-L488 | test | Gets the HTTP request. | Create a Java method that does the following: "Gets the HTTP request.". | Of course, here is the Java code you requested:
```java
private HttpServletRequest getHttpServletRequest() {
RequestContext context = getInstance(RequestContext.class);
HttpServletRequest request = context.getRequest();
if (request == null) {
throw new BugError("Attempt to use not initialized HTTP request... | |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/experimental/SocketStreamIterator.java | SocketStreamIterator.hasNext | @Override
public boolean hasNext() {
if (next == null) {
try {
next = readNextFromStream();
} catch (Exception e) {
throw new RuntimeException("Failed to receive next element: " + e.getMessage(), e);
}
}
return next != null;
} | java | @Override
public boolean hasNext() {
if (next == null) {
try {
next = readNextFromStream();
} catch (Exception e) {
throw new RuntimeException("Failed to receive next element: " + e.getMessage(), e);
}
}
return next != null;
} | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"if",
"(",
"next",
"==",
"null",
")",
"{",
"try",
"{",
"next",
"=",
"readNextFromStream",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
... | Returns true if the DataStream has more elements.
(Note: blocks if there will be more elements, but they are not available yet.)
@return true if the DataStream has more elements | [
"Returns",
"true",
"if",
"the",
"DataStream",
"has",
"more",
"elements",
".",
"(",
"Note",
":",
"blocks",
"if",
"there",
"will",
"be",
"more",
"elements",
"but",
"they",
"are",
"not",
"available",
"yet",
".",
")"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/experimental/SocketStreamIterator.java#L130-L141 | train | Returns true if there is more elements in the stream. | Create a Java method that does the following: "Returns true if there is more elements in the stream.". | Of course, here is the Java code you requested:
```java
@Override
public boolean hasNext() {
if (next == null) {
try {
next = readNextFromStream();
} catch (Exception e) {
throw new RuntimeException("Failed to receive next element: " + e.getMessage(), e);
}
}
return next != null;
}
```
Hope ... | |
FasterXML/woodstox | src/main/java/com/ctc/wstx/util/TextBuffer.java | TextBuffer.unshare | public void unshare(int needExtra)
{
int len = mInputLen;
mInputLen = 0;
char[] inputBuf = mInputBuffer;
mInputBuffer = null;
int start = mInputStart;
mInputStart = -1;
// Is buffer big enough, or do we need to reallocate?
int needed = len+needExtra;
... | java | public void unshare(int needExtra)
{
int len = mInputLen;
mInputLen = 0;
char[] inputBuf = mInputBuffer;
mInputBuffer = null;
int start = mInputStart;
mInputStart = -1;
// Is buffer big enough, or do we need to reallocate?
int needed = len+needExtra;
... | [
"public",
"void",
"unshare",
"(",
"int",
"needExtra",
")",
"{",
"int",
"len",
"=",
"mInputLen",
";",
"mInputLen",
"=",
"0",
";",
"char",
"[",
"]",
"inputBuf",
"=",
"mInputBuffer",
";",
"mInputBuffer",
"=",
"null",
";",
"int",
"start",
"=",
"mInputStart",... | Method called if/when we need to append content when we have been
initialized to use shared buffer. | [
"Method",
"called",
"if",
"/",
"when",
"we",
"need",
"to",
"append",
"content",
"when",
"we",
"have",
"been",
"initialized",
"to",
"use",
"shared",
"buffer",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/TextBuffer.java#L1190-L1209 | train | Unshare the contents of this image. | Create a Java method that does the following: "Unshare the contents of this image.". | Of course, here is the Java code you requested:
```java
public void unshare(int needExtra)
{
int len = mInputLen;
mInputLen = 0;
char[] inputBuf = mInputBuffer;
mInputBuffer = null;
int start = mInputStart;
mInputStart = -1;
// Is buffer big enough, or do we... | |
jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.processWorkspaceBeforeDeletion | public boolean processWorkspaceBeforeDeletion(@Nonnull Job<?,?> project, @Nonnull FilePath workspace, @Nonnull Node node) throws IOException, InterruptedException {
if (project instanceof AbstractProject) {
return processWorkspaceBeforeDeletion((AbstractProject) project, workspace, node);
} ... | java | public boolean processWorkspaceBeforeDeletion(@Nonnull Job<?,?> project, @Nonnull FilePath workspace, @Nonnull Node node) throws IOException, InterruptedException {
if (project instanceof AbstractProject) {
return processWorkspaceBeforeDeletion((AbstractProject) project, workspace, node);
} ... | [
"public",
"boolean",
"processWorkspaceBeforeDeletion",
"(",
"@",
"Nonnull",
"Job",
"<",
"?",
",",
"?",
">",
"project",
",",
"@",
"Nonnull",
"FilePath",
"workspace",
",",
"@",
"Nonnull",
"Node",
"node",
")",
"throws",
"IOException",
",",
"InterruptedException",
... | Called before a workspace is deleted on the given node, to provide SCM an opportunity to perform clean up.
<p>
Hudson periodically scans through all the agents and removes old workspaces that are deemed unnecessary.
This behavior is implemented in {@link WorkspaceCleanupThread}, and it is necessary to control the
disk... | [
"Called",
"before",
"a",
"workspace",
"is",
"deleted",
"on",
"the",
"given",
"node",
"to",
"provide",
"SCM",
"an",
"opportunity",
"to",
"perform",
"clean",
"up",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L234-L240 | train | Process workspace before deletion. | Create a Java method that does the following: "Process workspace before deletion.". | Of course, here is the Java code you requested:
```java
public boolean processWorkspaceBeforeDeletion(@Nonnull Job<?,?> project, @Nonnull FilePath workspace, @Nonnull Node node) throws IOException, InterruptedException {
if (project instanceof AbstractProject) {
return processWorkspaceBeforeDeletio... | |
aws/aws-sdk-java | aws-java-sdk-acmpca/src/main/java/com/amazonaws/services/acmpca/model/ListCertificateAuthoritiesResult.java | ListCertificateAuthoritiesResult.withCertificateAuthorities | public ListCertificateAuthoritiesResult withCertificateAuthorities(CertificateAuthority... certificateAuthorities) {
if (this.certificateAuthorities == null) {
setCertificateAuthorities(new java.util.ArrayList<CertificateAuthority>(certificateAuthorities.length));
}
for (CertificateA... | java | public ListCertificateAuthoritiesResult withCertificateAuthorities(CertificateAuthority... certificateAuthorities) {
if (this.certificateAuthorities == null) {
setCertificateAuthorities(new java.util.ArrayList<CertificateAuthority>(certificateAuthorities.length));
}
for (CertificateA... | [
"public",
"ListCertificateAuthoritiesResult",
"withCertificateAuthorities",
"(",
"CertificateAuthority",
"...",
"certificateAuthorities",
")",
"{",
"if",
"(",
"this",
".",
"certificateAuthorities",
"==",
"null",
")",
"{",
"setCertificateAuthorities",
"(",
"new",
"java",
"... | <p>
Summary information about each certificate authority you have created.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setCertificateAuthorities(java.util.Collection)} or
{@link #withCertificateAuthorities(java.util.Collection)} if you want to override the existing va... | [
"<p",
">",
"Summary",
"information",
"about",
"each",
"certificate",
"authority",
"you",
"have",
"created",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"ex... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-acmpca/src/main/java/com/amazonaws/services/acmpca/model/ListCertificateAuthoritiesResult.java#L85-L93 | train | A list of CA certificates. | Create a Java method that does the following: "A list of CA certificates.". | Of course, here is the Java code you requested:
```java
public ListCertificateAuthoritiesResult withCertificateAuthorities(CertificateAuthority... certificateAuthorities) {
if (this.certificateAuthorities == null) {
setCertificateAuthorities(new java.util.ArrayList<CertificateAuthority>(certificate... | |
ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java | SelfJoinLikeExecutor.extractArguments | protected static ImmutableList<VariableOrGroundTerm> extractArguments(DataAtom atom,
ImmutableList<Integer> positions) {
ImmutableList.Builder<VariableOrGroundTerm> listBuilder = ImmutableList.builder();
int atomLength = atom.getA... | java | protected static ImmutableList<VariableOrGroundTerm> extractArguments(DataAtom atom,
ImmutableList<Integer> positions) {
ImmutableList.Builder<VariableOrGroundTerm> listBuilder = ImmutableList.builder();
int atomLength = atom.getA... | [
"protected",
"static",
"ImmutableList",
"<",
"VariableOrGroundTerm",
">",
"extractArguments",
"(",
"DataAtom",
"atom",
",",
"ImmutableList",
"<",
"Integer",
">",
"positions",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"VariableOrGroundTerm",
">",
"listBuilder",
... | Returns the list of the terms from atom corresponding
to the positions
TODO: explain | [
"Returns",
"the",
"list",
"of",
"the",
"terms",
"from",
"atom",
"corresponding",
"to",
"the",
"positions",
"TODO",
":",
"explain"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java#L363-L378 | train | Extract the arguments from the given positions. | Create a Java method that does the following: "Extract the arguments from the given positions.". | Of course, here is the Java code you requested:
```java
protected static ImmutableList<VariableOrGroundTerm> extractArguments(DataAtom atom,
ImmutableList<Integer> positions) {
ImmutableList.Builder<VariableOrGroundTerm> listBuilder = Im... | |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java | ManagementClient.getSubscriptions | public List<SubscriptionDescription> getSubscriptions(String topicName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionsAsync(topicName));
} | java | public List<SubscriptionDescription> getSubscriptions(String topicName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionsAsync(topicName));
} | [
"public",
"List",
"<",
"SubscriptionDescription",
">",
"getSubscriptions",
"(",
"String",
"topicName",
")",
"throws",
"ServiceBusException",
",",
"InterruptedException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"this",
".",
"asyncClient",
".",
"getSubscript... | Retrieves the list of subscriptions for a given topic in the namespace.
@param topicName - The name of the topic.
@return the first 100 subscriptions.
@throws TimeoutException - The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
@throws AuthorizationFailedException - No suf... | [
"Retrieves",
"the",
"list",
"of",
"subscriptions",
"for",
"a",
"given",
"topic",
"in",
"the",
"namespace",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java#L224-L226 | train | Get the subscriptions for a topic. | Create a Java method that does the following: "Get the subscriptions for a topic.". | Of course, here is the Java code you requested:
```java
public List<SubscriptionDescription> getSubscriptions(String topicName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionsAsync(topicName));
}
```
Hope this helps! | |
JakeWharton/scalpel | scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java | ScalpelFrameLayout.setChromeColor | public void setChromeColor(int color) {
if (chromeColor != color) {
viewBorderPaint.setColor(color);
chromeColor = color;
invalidate();
}
} | java | public void setChromeColor(int color) {
if (chromeColor != color) {
viewBorderPaint.setColor(color);
chromeColor = color;
invalidate();
}
} | [
"public",
"void",
"setChromeColor",
"(",
"int",
"color",
")",
"{",
"if",
"(",
"chromeColor",
"!=",
"color",
")",
"{",
"viewBorderPaint",
".",
"setColor",
"(",
"color",
")",
";",
"chromeColor",
"=",
"color",
";",
"invalidate",
"(",
")",
";",
"}",
"}"
] | Set the view border chrome color. | [
"Set",
"the",
"view",
"border",
"chrome",
"color",
"."
] | 97299acd1cc7b4138af714f1ed0bce47e9ce516d | https://github.com/JakeWharton/scalpel/blob/97299acd1cc7b4138af714f1ed0bce47e9ce516d/scalpel/src/main/java/com/jakewharton/scalpel/ScalpelFrameLayout.java#L150-L156 | train | Set the color of the view border. | Create a Java method that does the following: "Set the color of the view border.". | Of course, here is the Java code you requested:
```java
public void setChromeColor(int color) {
if (chromeColor != color) {
viewBorderPaint.setColor(color);
chromeColor = color;
invalidate();
}
}
```
Hope this helps! | |
apollographql/apollo-android | apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/CodegenGenerationTaskCommandArgsBuilder.java | CodegenGenerationTaskCommandArgsBuilder.getSourceSetNameFromFile | private String getSourceSetNameFromFile(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath());
return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
} | java | private String getSourceSetNameFromFile(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath());
return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
} | [
"private",
"String",
"getSourceSetNameFromFile",
"(",
"File",
"file",
")",
"{",
"Path",
"absolutePath",
"=",
"Paths",
".",
"get",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"Path",
"basePath",
"=",
"Paths",
".",
"get",
"(",
"task",
".",
"ge... | Returns the source set folder name given a file path. Assumes the source set name follows the "src" folder based on
the inputs received from GraphQLSourceDirectorySet.
@return - sourceSet name | [
"Returns",
"the",
"source",
"set",
"folder",
"name",
"given",
"a",
"file",
"path",
".",
"Assumes",
"the",
"source",
"set",
"name",
"follows",
"the",
"src",
"folder",
"based",
"on",
"the",
"inputs",
"received",
"from",
"GraphQLSourceDirectorySet",
"."
] | a78869a76e17f77e42c7a88f0099914fe7ffa5b6 | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/CodegenGenerationTaskCommandArgsBuilder.java#L206-L211 | train | Get source set name from file. | Create a Java method that does the following: "Get source set name from file.". | Of course, here is the Java code you requested:
```java
private String getSourceSetNameFromFile(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath());
return basePath.relativize(absolutePath).toString().split(Matcher.... | |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java | AbstractTagLayout.createDynamicStyleForComponents | protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc,
final String taregtTagColor) {
tagName.removeStyleName(SPUIDefinitions.TAG_NAME);
tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC);
getTargetDynamicStyles(taregtTagColor);
tagName... | java | protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc,
final String taregtTagColor) {
tagName.removeStyleName(SPUIDefinitions.TAG_NAME);
tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC);
getTargetDynamicStyles(taregtTagColor);
tagName... | [
"protected",
"void",
"createDynamicStyleForComponents",
"(",
"final",
"TextField",
"tagName",
",",
"final",
"TextArea",
"tagDesc",
",",
"final",
"String",
"taregtTagColor",
")",
"{",
"tagName",
".",
"removeStyleName",
"(",
"SPUIDefinitions",
".",
"TAG_NAME",
")",
";... | Set tag name and desc field border color based on chosen color.
@param tagName
@param tagDesc
@param taregtTagColor | [
"Set",
"tag",
"name",
"and",
"desc",
"field",
"border",
"color",
"based",
"on",
"chosen",
"color",
"."
] | 9884452ad42f3b4827461606d8a9215c8625a7fe | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L285-L292 | train | Create dynamic style for components. | Create a Java method that does the following: "Create dynamic style for components.". | Of course, here is the Java code you requested:
```java
protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc,
final String taregtTagColor) {
tagName.removeStyleName(SPUIDefinitions.TAG_NAME);
tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC);
... | |
mbrade/prefixedproperties | pp-core/src/main/java/net/sf/prefixedproperties/PrefixedProperties.java | PrefixedProperties.getArray | public String[] getArray(final String key, final String[] def) {
final String[] value = getArray(key);
if (value != null) {
return value;
}
return def;
} | java | public String[] getArray(final String key, final String[] def) {
final String[] value = getArray(key);
if (value != null) {
return value;
}
return def;
} | [
"public",
"String",
"[",
"]",
"getArray",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"[",
"]",
"def",
")",
"{",
"final",
"String",
"[",
"]",
"value",
"=",
"getArray",
"(",
"key",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"... | Gets the prefixed key and parse it to an String[]<br>
Each comma-separated list can be used. If the key couldn't get found, the
default will be used.
@param key
the key
@param def
default value
@return String[] | [
"Gets",
"the",
"prefixed",
"key",
"and",
"parse",
"it",
"to",
"an",
"String",
"[]",
"<br",
">",
"Each",
"comma",
"-",
"separated",
"list",
"can",
"be",
"used",
".",
"If",
"the",
"key",
"couldn",
"t",
"get",
"found",
"the",
"default",
"will",
"be",
"u... | ac430409ea37e244158002b3cf1504417835a0b2 | https://github.com/mbrade/prefixedproperties/blob/ac430409ea37e244158002b3cf1504417835a0b2/pp-core/src/main/java/net/sf/prefixedproperties/PrefixedProperties.java#L750-L756 | train | Get a property as an array. | Create a Java method that does the following: "Get a property as an array.". | Of course, here is the Java code you requested:
```java
public String[] getArray(final String key, final String[] def) {
final String[] value = getArray(key);
if (value != null) {
return value;
}
return def;
}
```
Hope this helps! | |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java | CommerceTierPriceEntryPersistenceImpl.findByC_LtM_First | @Override
public CommerceTierPriceEntry findByC_LtM_First(long commercePriceEntryId,
int minQuantity,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetchByC_LtM_First(commercePriceEntryId,
minQuantity, ord... | java | @Override
public CommerceTierPriceEntry findByC_LtM_First(long commercePriceEntryId,
int minQuantity,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetchByC_LtM_First(commercePriceEntryId,
minQuantity, ord... | [
"@",
"Override",
"public",
"CommerceTierPriceEntry",
"findByC_LtM_First",
"(",
"long",
"commercePriceEntryId",
",",
"int",
"minQuantity",
",",
"OrderByComparator",
"<",
"CommerceTierPriceEntry",
">",
"orderByComparator",
")",
"throws",
"NoSuchTierPriceEntryException",
"{",
... | Returns the first commerce tier price entry in the ordered set where commercePriceEntryId = ? and minQuantity ≤ ?.
@param commercePriceEntryId the commerce price entry ID
@param minQuantity the min quantity
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return th... | [
"Returns",
"the",
"first",
"commerce",
"tier",
"price",
"entry",
"in",
"the",
"ordered",
"set",
"where",
"commercePriceEntryId",
"=",
"?",
";",
"and",
"minQuantity",
"&le",
";",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L3470-L3495 | train | Returns the commerce tier price entry with the minimum quantity of this commerce tier price entry in the ordered set. | Create a Java method that does the following: "Returns the commerce tier price entry with the minimum quantity of this commerce tier price entry in the ordered set.". | Of course, here is the Java code you requested:
```java
@Override
public CommerceTierPriceEntry findByC_LtM_First(long commercePriceEntryId,
int minQuantity,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetc... | |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/dekker/island/IslandCollection.java | IslandCollection.doesCoordinateOverlapWithCommittedCoordinate | @Override
public boolean doesCoordinateOverlapWithCommittedCoordinate(Coordinate coordinate) {
return fixedRows.get(coordinate.row) || fixedVertices.contains(coordinate.match.vertex);
} | java | @Override
public boolean doesCoordinateOverlapWithCommittedCoordinate(Coordinate coordinate) {
return fixedRows.get(coordinate.row) || fixedVertices.contains(coordinate.match.vertex);
} | [
"@",
"Override",
"public",
"boolean",
"doesCoordinateOverlapWithCommittedCoordinate",
"(",
"Coordinate",
"coordinate",
")",
"{",
"return",
"fixedRows",
".",
"get",
"(",
"coordinate",
".",
"row",
")",
"||",
"fixedVertices",
".",
"contains",
"(",
"coordinate",
".",
... | /*
Return whether a coordinate overlaps with an already committed coordinate | [
"/",
"*",
"Return",
"whether",
"a",
"coordinate",
"overlaps",
"with",
"an",
"already",
"committed",
"coordinate"
] | 76dd1fcc36047bc66a87d31142e72e98b5347821 | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/dekker/island/IslandCollection.java#L53-L56 | train | Checks if the given coordinate overlaps with the committed coordinate. | Create a Java method that does the following: "Checks if the given coordinate overlaps with the committed coordinate.". | Of course, here is the Java code you requested:
```java
@Override
public boolean doesCoordinateOverlapWithCommittedCoordinate(Coordinate coordinate) {
return fixedRows.get(coordinate.row) || fixedVertices.contains(coordinate.match.vertex);
}
```
Hope this helps! | |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java | AbstractBigtableAdmin.deleteColumn | @Override
public void deleteColumn(TableName tableName, byte[] columnName) throws IOException {
String name = Bytes.toString(columnName);
modifyColumns(tableName, name, "delete",
ModifyTableBuilder.newBuilder(tableName).delete(name));
} | java | @Override
public void deleteColumn(TableName tableName, byte[] columnName) throws IOException {
String name = Bytes.toString(columnName);
modifyColumns(tableName, name, "delete",
ModifyTableBuilder.newBuilder(tableName).delete(name));
} | [
"@",
"Override",
"public",
"void",
"deleteColumn",
"(",
"TableName",
"tableName",
",",
"byte",
"[",
"]",
"columnName",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"Bytes",
".",
"toString",
"(",
"columnName",
")",
";",
"modifyColumns",
"(",
"tab... | {@inheritDoc} | [
"{"
] | 53543f36e4d6f9ed1963640d91a35be2a2047656 | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java#L567-L572 | train | Delete a column from a table. | Create a Java method that does the following: "Delete a column from a table.". | Of course, here is the Java code you requested:
```java
@Override
public void deleteColumn(TableName tableName, byte[] columnName) throws IOException {
String name = Bytes.toString(columnName);
modifyColumns(tableName, name, "delete",
ModifyTableBuilder.newBuilder(tableName).delete(name));
}
```
H... | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcWindowStyle | public EClass getIfcWindowStyle() {
if (ifcWindowStyleEClass == null) {
ifcWindowStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(648);
}
return ifcWindowStyleEClass;
} | java | public EClass getIfcWindowStyle() {
if (ifcWindowStyleEClass == null) {
ifcWindowStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(648);
}
return ifcWindowStyleEClass;
} | [
"public",
"EClass",
"getIfcWindowStyle",
"(",
")",
"{",
"if",
"(",
"ifcWindowStyleEClass",
"==",
"null",
")",
"{",
"ifcWindowStyleEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"Ifc2x3tc1Package",
".",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L32057-L32063 | train | Get the IfcWindowStyleEClass for this feature. | Create a Java method that does the following: "Get the IfcWindowStyleEClass for this feature.". | Of course, here is the Java code you requested:
```java
public EClass getIfcWindowStyle() {
if (ifcWindowStyleEClass == null) {
ifcWindowStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(648);
}
return ifcWindowStyleEClass;
}
```
Hope t... | |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.createTempFile | protected String createTempFile() throws CmsException {
return OpenCms.getWorkplaceManager().createTempFile(getCms(), getParamResource(), getSettings().getProject());
} | java | protected String createTempFile() throws CmsException {
return OpenCms.getWorkplaceManager().createTempFile(getCms(), getParamResource(), getSettings().getProject());
} | [
"protected",
"String",
"createTempFile",
"(",
")",
"throws",
"CmsException",
"{",
"return",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"createTempFile",
"(",
"getCms",
"(",
")",
",",
"getParamResource",
"(",
")",
",",
"getSettings",
"(",
")",
".",
... | Creates a temporary file which is needed while working in an editor with preview option.<p>
@return the file name of the temporary file
@throws CmsException if something goes wrong | [
"Creates",
"a",
"temporary",
"file",
"which",
"is",
"needed",
"while",
"working",
"in",
"an",
"editor",
"with",
"preview",
"option",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L846-L849 | train | Creates a temporary file name. | Create a Java method that does the following: "Creates a temporary file name.". | Of course, here is the Java code you requested:
```java
protected String createTempFile() throws CmsException {
return OpenCms.getWorkplaceManager().createTempFile(getCms(), getParamResource(), getSettings().getProject());
}
```
Hope this helps! | |
FasterXML/woodstox | src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java | WstxOutputFactory.createSW | protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
if (cfg.willSupportNamespaces()) {
if (cfg.automaticNamespacesEnabled()) {
return new RepairingNsStreamWriter(xw, enc, cfg);
}
return new SimpleNsStreamWriter(xw, enc, cfg);
... | java | protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
if (cfg.willSupportNamespaces()) {
if (cfg.automaticNamespacesEnabled()) {
return new RepairingNsStreamWriter(xw, enc, cfg);
}
return new SimpleNsStreamWriter(xw, enc, cfg);
... | [
"protected",
"XMLStreamWriter2",
"createSW",
"(",
"String",
"enc",
",",
"WriterConfig",
"cfg",
",",
"XmlWriter",
"xw",
")",
"{",
"if",
"(",
"cfg",
".",
"willSupportNamespaces",
"(",
")",
")",
"{",
"if",
"(",
"cfg",
".",
"automaticNamespacesEnabled",
"(",
")"... | Called by {@link #createSW(OutputStream, Writer, String, boolean)} after all of the nessesary configuration
logic is complete. | [
"Called",
"by",
"{"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/stax/WstxOutputFactory.java#L309-L317 | train | Create a new XMLStreamWriter2 instance. | Create a Java method that does the following: "Create a new XMLStreamWriter2 instance.". | Of course, here is the Java code you requested:
```java
protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
if (cfg.willSupportNamespaces()) {
if (cfg.automaticNamespacesEnabled()) {
return new RepairingNsStreamWriter(xw, enc, cfg);
}
... | |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.run | public Clustering<Model> run(Relation<V> rel) {
fulldatabase = preprocess(rel);
processedIDs = DBIDUtil.newHashSet(fulldatabase.size());
noiseDim = dimensionality(fulldatabase);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("CASH Clustering", fulldatabase.size(), LOG) : null;
Clust... | java | public Clustering<Model> run(Relation<V> rel) {
fulldatabase = preprocess(rel);
processedIDs = DBIDUtil.newHashSet(fulldatabase.size());
noiseDim = dimensionality(fulldatabase);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("CASH Clustering", fulldatabase.size(), LOG) : null;
Clust... | [
"public",
"Clustering",
"<",
"Model",
">",
"run",
"(",
"Relation",
"<",
"V",
">",
"rel",
")",
"{",
"fulldatabase",
"=",
"preprocess",
"(",
"rel",
")",
";",
"processedIDs",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
"fulldatabase",
".",
"size",
"(",
")",
... | Run CASH on the relation.
@param rel Relation
@return Clustering result | [
"Run",
"CASH",
"on",
"the",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L188-L211 | train | Run the CASH algorithm on the given relation. | Create a Java method that does the following: "Run the CASH algorithm on the given relation.". | Of course, here is the Java code you requested:
```java
public Clustering<Model> run(Relation<V> rel) {
fulldatabase = preprocess(rel);
processedIDs = DBIDUtil.newHashSet(fulldatabase.size());
noiseDim = dimensionality(fulldatabase);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("CASH... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkMessageItemStream.java | MQLinkMessageItemStream.issueDepthIntervalMessage | protected void issueDepthIntervalMessage(long depth)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueDepthIntervalMessage", new Long(depth));
// {0} messages queued for transmission from messaging engine {1} to foreign bus {2} on link {3}.
SibTr.info(tc... | java | protected void issueDepthIntervalMessage(long depth)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueDepthIntervalMessage", new Long(depth));
// {0} messages queued for transmission from messaging engine {1} to foreign bus {2} on link {3}.
SibTr.info(tc... | [
"protected",
"void",
"issueDepthIntervalMessage",
"(",
"long",
"depth",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"issueDepthIntervalM... | /*
Link specific warning message
(510343) | [
"/",
"*",
"Link",
"specific",
"warning",
"message",
"(",
"510343",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/MQLinkMessageItemStream.java#L174-L188 | train | Issue a depth interval message. | Create a Java method that does the following: "Issue a depth interval message.". | Of course, here is the Java code you requested:
```java
protected void issueDepthIntervalMessage(long depth)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueDepthIntervalMessage", new Long(depth));
// {0} messages queued for transmission from messaging eng... | |
groovy/groovy-core | src/main/org/codehaus/groovy/ast/ClassNode.java | ClassNode.hasPossibleMethod | public boolean hasPossibleMethod(String name, Expression arguments) {
int count = 0;
if (arguments instanceof TupleExpression) {
TupleExpression tuple = (TupleExpression) arguments;
// TODO this won't strictly be true when using list expansion in argument calls
count... | java | public boolean hasPossibleMethod(String name, Expression arguments) {
int count = 0;
if (arguments instanceof TupleExpression) {
TupleExpression tuple = (TupleExpression) arguments;
// TODO this won't strictly be true when using list expansion in argument calls
count... | [
"public",
"boolean",
"hasPossibleMethod",
"(",
"String",
"name",
",",
"Expression",
"arguments",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"arguments",
"instanceof",
"TupleExpression",
")",
"{",
"TupleExpression",
"tuple",
"=",
"(",
"TupleExpression",
... | Returns true if the given method has a possibly matching instance method with the given name and arguments.
@param name the name of the method of interest
@param arguments the arguments to match against
@return true if a matching method was found | [
"Returns",
"true",
"if",
"the",
"given",
"method",
"has",
"a",
"possibly",
"matching",
"instance",
"method",
"with",
"the",
"given",
"name",
"and",
"arguments",
"."
] | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ClassNode.java#L1221-L1240 | train | Checks if a method with the given name and arguments is a valid method. | Create a Java method that does the following: "Checks if a method with the given name and arguments is a valid method.". | Of course, here is the Java code you requested:
```java
public boolean hasPossibleMethod(String name, Expression arguments) {
int count = 0;
if (arguments instanceof TupleExpression) {
TupleExpression tuple = (TupleExpression) arguments;
// TODO this won't strictly be true when... | |
csc19601128/Phynixx | phynixx/phynixx-watchdog/src/main/java/org/csc/phynixx/watchdog/Watchdog.java | Watchdog.unregisterCondition | public void unregisterCondition(IWatchedCondition condition) {
synchronized (conditions) {
Set<IObjectReference<IWatchedCondition>> copiedRefs=new HashSet<IObjectReference<IWatchedCondition>>(this.conditions);
for (Iterator<IObjectReference<IWatchedCondition>> iterator = copiedRefs.iter... | java | public void unregisterCondition(IWatchedCondition condition) {
synchronized (conditions) {
Set<IObjectReference<IWatchedCondition>> copiedRefs=new HashSet<IObjectReference<IWatchedCondition>>(this.conditions);
for (Iterator<IObjectReference<IWatchedCondition>> iterator = copiedRefs.iter... | [
"public",
"void",
"unregisterCondition",
"(",
"IWatchedCondition",
"condition",
")",
"{",
"synchronized",
"(",
"conditions",
")",
"{",
"Set",
"<",
"IObjectReference",
"<",
"IWatchedCondition",
">>",
"copiedRefs",
"=",
"new",
"HashSet",
"<",
"IObjectReference",
"<",
... | /* (non-Javadoc)
@see org.csc.phynixx.watchdog.IWatchog#unregisterCondition(org.csc.phynixx.watchdog.IWatchedCondition) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | a26c03bc229a8882c647799834115bec6bdc0ac8 | https://github.com/csc19601128/Phynixx/blob/a26c03bc229a8882c647799834115bec6bdc0ac8/phynixx/phynixx-watchdog/src/main/java/org/csc/phynixx/watchdog/Watchdog.java#L195-L207 | train | Unregister a condition from the list of conditions. | Create a Java method that does the following: "Unregister a condition from the list of conditions.". | Of course, here is the Java code you requested:
```java
public void unregisterCondition(IWatchedCondition condition) {
synchronized (conditions) {
Set<IObjectReference<IWatchedCondition>> copiedRefs=new HashSet<IObjectReference<IWatchedCondition>>(this.conditions);
for (Iterator<IObjec... | |
jenkinsci/jenkins | core/src/main/java/hudson/util/BootFailure.java | BootFailure.publish | public void publish(ServletContext context, @CheckForNull File home) {
LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",this);
WebApp.get(context).setApp(this);
if (home == null) {
return;
}
new GroovyHookScript("boot-failure", context, home, BootFailure.class... | java | public void publish(ServletContext context, @CheckForNull File home) {
LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",this);
WebApp.get(context).setApp(this);
if (home == null) {
return;
}
new GroovyHookScript("boot-failure", context, home, BootFailure.class... | [
"public",
"void",
"publish",
"(",
"ServletContext",
"context",
",",
"@",
"CheckForNull",
"File",
"home",
")",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"Failed to initialize Jenkins\"",
",",
"this",
")",
";",
"WebApp",
".",
"get",
"(",
... | Exposes this failure to UI and invoke the hook.
@param home
JENKINS_HOME if it's already known. | [
"Exposes",
"this",
"failure",
"to",
"UI",
"and",
"invoke",
"the",
"hook",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/BootFailure.java#L39-L52 | train | Publishes the boot - failure page. | Create a Java method that does the following: "Publishes the boot - failure page.". | Of course, here is the Java code you requested:
```java
public void publish(ServletContext context, @CheckForNull File home) {
LOGGER.log(Level.SEVERE, "Failed to initialize Jenkins",this);
WebApp.get(context).setApp(this);
if (home == null) {
return;
}
new GroovyHo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.