repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/KriptonXmlContext.java | KriptonXmlContext.createSerializer | public XmlWrapperSerializer createSerializer(File file, JsonEncoding encoding) {
try {
XMLSerializer xmlStreamWriter=new XMLSerializer(new FileWriter(file));
return new XmlWrapperSerializer(xmlStreamWriter);
} catch (Exception e) {
e.printStackTrace();
throw new KriptonRuntimeExcep... | java | public XmlWrapperSerializer createSerializer(File file, JsonEncoding encoding) {
try {
XMLSerializer xmlStreamWriter=new XMLSerializer(new FileWriter(file));
return new XmlWrapperSerializer(xmlStreamWriter);
} catch (Exception e) {
e.printStackTrace();
throw new KriptonRuntimeExcep... | [
"public",
"XmlWrapperSerializer",
"createSerializer",
"(",
"File",
"file",
",",
"JsonEncoding",
"encoding",
")",
"{",
"try",
"{",
"XMLSerializer",
"xmlStreamWriter",
"=",
"new",
"XMLSerializer",
"(",
"new",
"FileWriter",
"(",
"file",
")",
")",
";",
"return",
"ne... | /* (non-Javadoc)
@see com.abubusoft.kripton.AbstractContext#createSerializer(java.io.File, com.fasterxml.jackson.core.JsonEncoding) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/KriptonXmlContext.java#L115-L124 | train | Create a serializer for the given file. | Of course, here is the Java code you requested:
```java
public XmlWrapperSerializer createSerializer(File file, JsonEncoding encoding) {
try {
XMLSerializer xmlStreamWriter=new XMLSerializer(new FileWriter(file));
return new XmlWrapperSerializer(xmlStreamWriter);
} catch (Exception e) {... |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/blogclient/atomprotocol/AtomBlog.java | AtomBlog.newResource | @Override
public BlogResource newResource(final String name, final String contentType, final byte[] bytes) throws BlogClientException {
if (resourcesCollection == null) {
throw new BlogClientException("No resource collection");
}
return resourcesCollection.newResource(name, conte... | java | @Override
public BlogResource newResource(final String name, final String contentType, final byte[] bytes) throws BlogClientException {
if (resourcesCollection == null) {
throw new BlogClientException("No resource collection");
}
return resourcesCollection.newResource(name, conte... | [
"@",
"Override",
"public",
"BlogResource",
"newResource",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"contentType",
",",
"final",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"BlogClientException",
"{",
"if",
"(",
"resourcesCollection",
"==",
"null",
... | {@inheritDoc} | [
"{"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/blogclient/atomprotocol/AtomBlog.java#L183-L189 | train | Create a new resource. | Of course, here is the Java code you requested:
```java
@Override
public BlogResource newResource(final String name, final String contentType, final byte[] bytes) throws BlogClientException {
if (resourcesCollection == null) {
throw new BlogClientException("No resource collection");
}
... |
aws/aws-sdk-java | aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/AmazonCloudFormationClient.java | AmazonCloudFormationClient.listChangeSets | @Override
public ListChangeSetsResult listChangeSets(ListChangeSetsRequest request) {
request = beforeClientExecution(request);
return executeListChangeSets(request);
} | java | @Override
public ListChangeSetsResult listChangeSets(ListChangeSetsRequest request) {
request = beforeClientExecution(request);
return executeListChangeSets(request);
} | [
"@",
"Override",
"public",
"ListChangeSetsResult",
"listChangeSets",
"(",
"ListChangeSetsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListChangeSets",
"(",
"request",
")",
";",
"}"
] | <p>
Returns the ID and status of each active change set for a stack. For example, AWS CloudFormation lists change
sets that are in the <code>CREATE_IN_PROGRESS</code> or <code>CREATE_PENDING</code> state.
</p>
@param listChangeSetsRequest
The input for the <a>ListChangeSets</a> action.
@return Result of the ListChange... | [
"<p",
">",
"Returns",
"the",
"ID",
"and",
"status",
"of",
"each",
"active",
"change",
"set",
"for",
"a",
"stack",
".",
"For",
"example",
"AWS",
"CloudFormation",
"lists",
"change",
"sets",
"that",
"are",
"in",
"the",
"<code",
">",
"CREATE_IN_PROGRESS<",
"/... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/AmazonCloudFormationClient.java#L2110-L2114 | train | Returns a list of ChangeSets that are contained in a CA. | Of course, here is the Java code you requested:
```java
@Override
public ListChangeSetsResult listChangeSets(ListChangeSetsRequest request) {
request = beforeClientExecution(request);
return executeListChangeSets(request);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/websphere/pmi/PmiDataInfo.java | PmiDataInfo.setType | public void setType(int type) {
this.type = type;
if (level == LEVEL_UNDEFINED) {
switch (type) {
case TYPE_INT:
case TYPE_LONG:
case TYPE_DOUBLE:
level = LEVEL_LOW;
break;
case TYPE_STAT:... | java | public void setType(int type) {
this.type = type;
if (level == LEVEL_UNDEFINED) {
switch (type) {
case TYPE_INT:
case TYPE_LONG:
case TYPE_DOUBLE:
level = LEVEL_LOW;
break;
case TYPE_STAT:... | [
"public",
"void",
"setType",
"(",
"int",
"type",
")",
"{",
"this",
".",
"type",
"=",
"type",
";",
"if",
"(",
"level",
"==",
"LEVEL_UNDEFINED",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"TYPE_INT",
":",
"case",
"TYPE_LONG",
":",
"case",
"TYPE... | (WebSphere internal use only) | [
"(",
"WebSphere",
"internal",
"use",
"only",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/websphere/pmi/PmiDataInfo.java#L123-L146 | train | Sets the type of the class. | Of course, here is the Java code you requested:
```java
public void setType(int type) {
this.type = type;
if (level == LEVEL_UNDEFINED) {
switch (type) {
case TYPE_INT:
case TYPE_LONG:
case TYPE_DOUBLE:
level = LEVEL_LOW;
... |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/sse/impl/legacy/EventSourceImpl.java | EventSourceImpl.getReadyState | public ReadyState getReadyState() {
if (stream == null) {
return EventSource.ReadyState.CONNECTING;
}
else {
switch (stream.getReadyState()) {
case CONNECTING:
return EventSource.ReadyState.CONNECTING;
case OPEN:
... | java | public ReadyState getReadyState() {
if (stream == null) {
return EventSource.ReadyState.CONNECTING;
}
else {
switch (stream.getReadyState()) {
case CONNECTING:
return EventSource.ReadyState.CONNECTING;
case OPEN:
... | [
"public",
"ReadyState",
"getReadyState",
"(",
")",
"{",
"if",
"(",
"stream",
"==",
"null",
")",
"{",
"return",
"EventSource",
".",
"ReadyState",
".",
"CONNECTING",
";",
"}",
"else",
"{",
"switch",
"(",
"stream",
".",
"getReadyState",
"(",
")",
")",
"{",
... | The ready state indicates the stream status, Possible values are 0 (CONNECTING), 1 (OPEN) and 2 (CLOSED)
@return current state | [
"The",
"ready",
"state",
"indicates",
"the",
"stream",
"status",
"Possible",
"values",
"are",
"0",
"(",
"CONNECTING",
")",
"1",
"(",
"OPEN",
")",
"and",
"2",
"(",
"CLOSED",
")"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/sse/impl/legacy/EventSourceImpl.java#L54-L72 | train | Gets the ReadyState of the EventSource. | Of course, here is the Java code you requested:
```java
public ReadyState getReadyState() {
if (stream == null) {
return EventSource.ReadyState.CONNECTING;
}
else {
switch (stream.getReadyState()) {
case CONNECTING:
return EventSource.ReadySta... |
alibaba/ARouter | arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/RouteProcessor.java | RouteProcessor.extractDocInfo | private RouteDoc extractDocInfo(RouteMeta routeMeta) {
RouteDoc routeDoc = new RouteDoc();
routeDoc.setGroup(routeMeta.getGroup());
routeDoc.setPath(routeMeta.getPath());
routeDoc.setDescription(routeMeta.getName());
routeDoc.setType(routeMeta.getType().name().toLowerCase());
... | java | private RouteDoc extractDocInfo(RouteMeta routeMeta) {
RouteDoc routeDoc = new RouteDoc();
routeDoc.setGroup(routeMeta.getGroup());
routeDoc.setPath(routeMeta.getPath());
routeDoc.setDescription(routeMeta.getName());
routeDoc.setType(routeMeta.getType().name().toLowerCase());
... | [
"private",
"RouteDoc",
"extractDocInfo",
"(",
"RouteMeta",
"routeMeta",
")",
"{",
"RouteDoc",
"routeDoc",
"=",
"new",
"RouteDoc",
"(",
")",
";",
"routeDoc",
".",
"setGroup",
"(",
"routeMeta",
".",
"getGroup",
"(",
")",
")",
";",
"routeDoc",
".",
"setPath",
... | Extra doc info from route meta
@param routeMeta meta
@return doc | [
"Extra",
"doc",
"info",
"from",
"route",
"meta"
] | 1a06912a6e14a57112db1204b43f81c43d721732 | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/RouteProcessor.java#L384-L393 | train | Extract doc info from RouteMeta | Of course, here is the Java code you requested:
```java
private RouteDoc extractDocInfo(RouteMeta routeMeta) {
RouteDoc routeDoc = new RouteDoc();
routeDoc.setGroup(routeMeta.getGroup());
routeDoc.setPath(routeMeta.getPath());
routeDoc.setDescription(routeMeta.getName());
routeD... |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java | AmazonIdentityManagementClient.getAccountPasswordPolicy | @Override
public GetAccountPasswordPolicyResult getAccountPasswordPolicy(GetAccountPasswordPolicyRequest request) {
request = beforeClientExecution(request);
return executeGetAccountPasswordPolicy(request);
} | java | @Override
public GetAccountPasswordPolicyResult getAccountPasswordPolicy(GetAccountPasswordPolicyRequest request) {
request = beforeClientExecution(request);
return executeGetAccountPasswordPolicy(request);
} | [
"@",
"Override",
"public",
"GetAccountPasswordPolicyResult",
"getAccountPasswordPolicy",
"(",
"GetAccountPasswordPolicyRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGetAccountPasswordPolicy",
"(",
"request"... | <p>
Retrieves the password policy for the AWS account. For more information about using a password policy, go to <a
href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html">Managing an IAM
Password Policy</a>.
</p>
@param getAccountPasswordPolicyRequest
@return Result of the GetAccou... | [
"<p",
">",
"Retrieves",
"the",
"password",
"policy",
"for",
"the",
"AWS",
"account",
".",
"For",
"more",
"information",
"about",
"using",
"a",
"password",
"policy",
"go",
"to",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java#L4249-L4253 | train | Retrieves the password policy for an account. | Of course, here is the Java code you requested:
```java
@Override
public GetAccountPasswordPolicyResult getAccountPasswordPolicy(GetAccountPasswordPolicyRequest request) {
request = beforeClientExecution(request);
return executeGetAccountPasswordPolicy(request);
}
```
Hope this helps! |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/dom/impl/types/DocumentTypeRepository.java | DocumentTypeRepository.create | @Programmatic
public DocumentType create(
final String reference,
final String name) {
final DocumentType documentType = new DocumentType(reference, name);
repositoryService.persistAndFlush(documentType);
return documentType;
} | java | @Programmatic
public DocumentType create(
final String reference,
final String name) {
final DocumentType documentType = new DocumentType(reference, name);
repositoryService.persistAndFlush(documentType);
return documentType;
} | [
"@",
"Programmatic",
"public",
"DocumentType",
"create",
"(",
"final",
"String",
"reference",
",",
"final",
"String",
"name",
")",
"{",
"final",
"DocumentType",
"documentType",
"=",
"new",
"DocumentType",
"(",
"reference",
",",
"name",
")",
";",
"repositoryServi... | region > create | [
"region",
">",
"create"
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/types/DocumentTypeRepository.java#L42-L49 | train | Create a new document type. | Of course, here is the Java code you requested:
```java
@Programmatic
public DocumentType create(
final String reference,
final String name) {
final DocumentType documentType = new DocumentType(reference, name);
repositoryService.persistAndFlush(documentType);
return... |
line/armeria | thrift/src/main/java/com/linecorp/armeria/internal/thrift/TApplicationExceptions.java | TApplicationExceptions.read | public static TApplicationException read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
String message = null;
int type = TApplicationException.UNKNOWN;
while (true) {
field = iprot.readFieldBegin();
if (field.type == TType.S... | java | public static TApplicationException read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
String message = null;
int type = TApplicationException.UNKNOWN;
while (true) {
field = iprot.readFieldBegin();
if (field.type == TType.S... | [
"public",
"static",
"TApplicationException",
"read",
"(",
"TProtocol",
"iprot",
")",
"throws",
"TException",
"{",
"TField",
"field",
";",
"iprot",
".",
"readStructBegin",
"(",
")",
";",
"String",
"message",
"=",
"null",
";",
"int",
"type",
"=",
"TApplicationEx... | Reads a {@link TApplicationException} from the specified {@link TProtocol}.
<p>Note: This has been copied from {@link TApplicationException#read(TProtocol)} due to API differences
between libthrift 0.9.x and 0.10.x. | [
"Reads",
"a",
"{",
"@link",
"TApplicationException",
"}",
"from",
"the",
"specified",
"{",
"@link",
"TProtocol",
"}",
"."
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/thrift/src/main/java/com/linecorp/armeria/internal/thrift/TApplicationExceptions.java#L34-L70 | train | read a TApplicationException object from the TProtocol. | Of course, here is the Java code you requested:
```java
public static TApplicationException read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
String message = null;
int type = TApplicationException.UNKNOWN;
while (true) {
field = ipro... |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipFileUtil.java | ZipFileUtil.isCharsetSupported | static boolean isCharsetSupported() throws IOException {
try {
ZipFile.class.getConstructor(new Class[] { File.class, Charset.class });
return true;
}
catch (NoSuchMethodException e) {
return false;
}
} | java | static boolean isCharsetSupported() throws IOException {
try {
ZipFile.class.getConstructor(new Class[] { File.class, Charset.class });
return true;
}
catch (NoSuchMethodException e) {
return false;
}
} | [
"static",
"boolean",
"isCharsetSupported",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"ZipFile",
".",
"class",
".",
"getConstructor",
"(",
"new",
"Class",
"[",
"]",
"{",
"File",
".",
"class",
",",
"Charset",
".",
"class",
"}",
")",
";",
"return"... | Returns <code>true</code> if charsets are supported in this JRE. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"charsets",
"are",
"supported",
"in",
"this",
"JRE",
"."
] | abb4dc43583e4d19339c0c021035019798970a13 | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipFileUtil.java#L119-L127 | train | Check if the charset is supported by the ZipFile. | Of course, here is the Java code you requested:
```java
static boolean isCharsetSupported() throws IOException {
try {
ZipFile.class.getConstructor(new Class[] { File.class, Charset.class });
return true;
}
catch (NoSuchMethodException e) {
return false;
}
}
```
Hope this helps! |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java | TypedInstanceToGraphMapper.mapPrimitiveOrEnumToVertex | private void mapPrimitiveOrEnumToVertex(ITypedInstance typedInstance, AtlasVertex instanceVertex,
AttributeInfo attributeInfo) throws AtlasException {
Object attrValue = typedInstance.get(attributeInfo.name);
final String vertexPropertyName = GraphHelper.getQ... | java | private void mapPrimitiveOrEnumToVertex(ITypedInstance typedInstance, AtlasVertex instanceVertex,
AttributeInfo attributeInfo) throws AtlasException {
Object attrValue = typedInstance.get(attributeInfo.name);
final String vertexPropertyName = GraphHelper.getQ... | [
"private",
"void",
"mapPrimitiveOrEnumToVertex",
"(",
"ITypedInstance",
"typedInstance",
",",
"AtlasVertex",
"instanceVertex",
",",
"AttributeInfo",
"attributeInfo",
")",
"throws",
"AtlasException",
"{",
"Object",
"attrValue",
"=",
"typedInstance",
".",
"get",
"(",
"att... | ****************************************** PRIMITIVES ************************************************* | [
"******************************************",
"PRIMITIVES",
"*************************************************"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java#L800-L842 | train | Map primitiveOrEnum to vertex. | Of course, here is the Java code you requested:
```java
private void mapPrimitiveOrEnumToVertex(ITypedInstance typedInstance, AtlasVertex instanceVertex,
AttributeInfo attributeInfo) throws AtlasException {
Object attrValue = typedInstance.get(attributeInfo.name);
... |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java | PersistenceXMLLoader.findPersistenceUnits | public static List<PersistenceUnitMetadata> findPersistenceUnits(final URL url, final String[] persistenceUnits,
PersistenceUnitTransactionType defaultTransactionType) throws InvalidConfigurationException
{
Document doc;
try
{
doc = getDocument(url);
}
... | java | public static List<PersistenceUnitMetadata> findPersistenceUnits(final URL url, final String[] persistenceUnits,
PersistenceUnitTransactionType defaultTransactionType) throws InvalidConfigurationException
{
Document doc;
try
{
doc = getDocument(url);
}
... | [
"public",
"static",
"List",
"<",
"PersistenceUnitMetadata",
">",
"findPersistenceUnits",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"[",
"]",
"persistenceUnits",
",",
"PersistenceUnitTransactionType",
"defaultTransactionType",
")",
"throws",
"InvalidConfiguration... | Find persistence units.
@param url
the url
@param defaultTransactionType
the default transaction type
@return the list
@throws Exception
the exception | [
"Find",
"persistence",
"units",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java#L264-L303 | train | Returns a list of persistence unit metadata from the URL. | Of course, here is the Java code you requested:
```java
public static List<PersistenceUnitMetadata> findPersistenceUnits(final URL url, final String[] persistenceUnits,
PersistenceUnitTransactionType defaultTransactionType) throws InvalidConfigurationException
{
Document doc;
try
... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/SimpleTimeZone.java | SimpleTimeZone.setEndRule | public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)
{
if (after) {
setEndRule(endMonth, endDay, -endDayOfWeek, endTime);
} else {
setEndRule(endMonth, -endDay, -endDayOfWeek, endTime);
}
} | java | public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)
{
if (after) {
setEndRule(endMonth, endDay, -endDayOfWeek, endTime);
} else {
setEndRule(endMonth, -endDay, -endDayOfWeek, endTime);
}
} | [
"public",
"void",
"setEndRule",
"(",
"int",
"endMonth",
",",
"int",
"endDay",
",",
"int",
"endDayOfWeek",
",",
"int",
"endTime",
",",
"boolean",
"after",
")",
"{",
"if",
"(",
"after",
")",
"{",
"setEndRule",
"(",
"endMonth",
",",
"endDay",
",",
"-",
"e... | Sets the daylight saving time end rule to a weekday before or after the given date within
a month, e.g., the first Monday on or after the 8th.
@param endMonth The daylight saving time ending month. Month is
a {@link Calendar#MONTH MONTH} field
value (0-based. e.g., 9 for October).
@param endDay The day... | [
"Sets",
"the",
"daylight",
"saving",
"time",
"end",
"rule",
"to",
"a",
"weekday",
"before",
"or",
"after",
"the",
"given",
"date",
"within",
"a",
"month",
"e",
".",
"g",
".",
"the",
"first",
"Monday",
"on",
"or",
"after",
"the",
"8th",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/SimpleTimeZone.java#L518-L525 | train | Set the EndRule attribute of the CrazDa disposition. | Of course, here is the Java code you requested:
```java
public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)
{
if (after) {
setEndRule(endMonth, endDay, -endDayOfWeek, endTime);
} else {
setEndRule(endMonth, -endDay, -endDayOfWeek, e... |
aws/aws-sdk-java | aws-java-sdk-cloudhsm/src/main/java/com/amazonaws/services/cloudhsm/model/DescribeHapgResult.java | DescribeHapgResult.setHsmsPendingDeletion | public void setHsmsPendingDeletion(java.util.Collection<String> hsmsPendingDeletion) {
if (hsmsPendingDeletion == null) {
this.hsmsPendingDeletion = null;
return;
}
this.hsmsPendingDeletion = new com.amazonaws.internal.SdkInternalList<String>(hsmsPendingDeletion);
} | java | public void setHsmsPendingDeletion(java.util.Collection<String> hsmsPendingDeletion) {
if (hsmsPendingDeletion == null) {
this.hsmsPendingDeletion = null;
return;
}
this.hsmsPendingDeletion = new com.amazonaws.internal.SdkInternalList<String>(hsmsPendingDeletion);
} | [
"public",
"void",
"setHsmsPendingDeletion",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"hsmsPendingDeletion",
")",
"{",
"if",
"(",
"hsmsPendingDeletion",
"==",
"null",
")",
"{",
"this",
".",
"hsmsPendingDeletion",
"=",
"null",
";",
"retur... | <p/>
@param hsmsPendingDeletion | [
"<p",
"/",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudhsm/src/main/java/com/amazonaws/services/cloudhsm/model/DescribeHapgResult.java#L233-L240 | train | Sets the value of the hsmsPendingDeletion property. | Of course, here is the Java code you requested:
```java
public void setHsmsPendingDeletion(java.util.Collection<String> hsmsPendingDeletion) {
if (hsmsPendingDeletion == null) {
this.hsmsPendingDeletion = null;
return;
}
this.hsmsPendingDeletion = new com.amazonaws.inte... |
ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/ClassifiedTBoxImpl.java | ClassifiedTBoxImpl.classify | static ClassifiedTBox classify(OntologyImpl.UnclassifiedOntologyTBox onto) {
DefaultDirectedGraph<ObjectPropertyExpression, DefaultEdge> objectPropertyGraph =
getObjectPropertyGraph(onto);
EquivalencesDAGImpl<ObjectPropertyExpression> objectPropertyDAG =
EquivalencesDAGImpl.getEquivalencesDAG(objectPropert... | java | static ClassifiedTBox classify(OntologyImpl.UnclassifiedOntologyTBox onto) {
DefaultDirectedGraph<ObjectPropertyExpression, DefaultEdge> objectPropertyGraph =
getObjectPropertyGraph(onto);
EquivalencesDAGImpl<ObjectPropertyExpression> objectPropertyDAG =
EquivalencesDAGImpl.getEquivalencesDAG(objectPropert... | [
"static",
"ClassifiedTBox",
"classify",
"(",
"OntologyImpl",
".",
"UnclassifiedOntologyTBox",
"onto",
")",
"{",
"DefaultDirectedGraph",
"<",
"ObjectPropertyExpression",
",",
"DefaultEdge",
">",
"objectPropertyGraph",
"=",
"getObjectPropertyGraph",
"(",
"onto",
")",
";",
... | constructs a TBox reasoner from an ontology
@param onto: ontology | [
"constructs",
"a",
"TBox",
"reasoner",
"from",
"an",
"ontology"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/ClassifiedTBoxImpl.java#L75-L118 | train | Classify an ontology. | Of course, here is the Java code you requested:
```java
static ClassifiedTBox classify(OntologyImpl.UnclassifiedOntologyTBox onto) {
DefaultDirectedGraph<ObjectPropertyExpression, DefaultEdge> objectPropertyGraph =
getObjectPropertyGraph(onto);
EquivalencesDAGImpl<ObjectPropertyExpression> objectPropertyDAG =... |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/extraction/AbstractTermExtractor.java | AbstractTermExtractor.collect | public List<String> collect(@NonNull HString hString) {
return stream(hString).collect(Collectors.toList());
} | java | public List<String> collect(@NonNull HString hString) {
return stream(hString).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"String",
">",
"collect",
"(",
"@",
"NonNull",
"HString",
"hString",
")",
"{",
"return",
"stream",
"(",
"hString",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList",
"(",
")",
")",
";",
"}"
] | Executes the TermSpec returning a list of stringified terms. This method does not use the TermSpec's {@link
com.davidbracewell.hermes.ml.feature.ValueCalculator}
@param hString the HString to process
@return a list of term counts | [
"Executes",
"the",
"TermSpec",
"returning",
"a",
"list",
"of",
"stringified",
"terms",
".",
"This",
"method",
"does",
"not",
"use",
"the",
"TermSpec",
"s",
"{",
"@link",
"com",
".",
"davidbracewell",
".",
"hermes",
".",
"ml",
".",
"feature",
".",
"ValueCal... | 9ebefe7ad5dea1b731ae6931a30771eb75325ea3 | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/extraction/AbstractTermExtractor.java#L85-L87 | train | Collect a list of HString | Of course, here is the Java code you requested:
```java
public List<String> collect(@NonNull HString hString) {
return stream(hString).collect(Collectors.toList());
}
```
Hope this helps! |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/Tensor.java | Tensor.elemAdd | @Override
public void elemAdd(MVec addend) {
if (addend instanceof Tensor) {
elemAdd((Tensor)addend);
} else {
throw new IllegalArgumentException("Addend must be of type " + this.getClass());
}
} | java | @Override
public void elemAdd(MVec addend) {
if (addend instanceof Tensor) {
elemAdd((Tensor)addend);
} else {
throw new IllegalArgumentException("Addend must be of type " + this.getClass());
}
} | [
"@",
"Override",
"public",
"void",
"elemAdd",
"(",
"MVec",
"addend",
")",
"{",
"if",
"(",
"addend",
"instanceof",
"Tensor",
")",
"{",
"elemAdd",
"(",
"(",
"Tensor",
")",
"addend",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Implements {@link MVec#elemAdd(MVec)}. | [
"Implements",
"{"
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/Tensor.java#L314-L321 | train | Add a vector to the Sequence. | Of course, here is the Java code you requested:
```java
@Override
public void elemAdd(MVec addend) {
if (addend instanceof Tensor) {
elemAdd((Tensor)addend);
} else {
throw new IllegalArgumentException("Addend must be of type " + this.getClass());
}
}
```
Hope t... |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.processAnonymousField | public void processAnonymousField(Properties attributes) throws XDocletException
{
if (!attributes.containsKey(ATTRIBUTE_NAME))
{
throw new XDocletException(Translator.getString(XDocletModulesOjbMessages.class,
XDocletModulesOjbMessages.PARAMET... | java | public void processAnonymousField(Properties attributes) throws XDocletException
{
if (!attributes.containsKey(ATTRIBUTE_NAME))
{
throw new XDocletException(Translator.getString(XDocletModulesOjbMessages.class,
XDocletModulesOjbMessages.PARAMET... | [
"public",
"void",
"processAnonymousField",
"(",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"if",
"(",
"!",
"attributes",
".",
"containsKey",
"(",
"ATTRIBUTE_NAME",
")",
")",
"{",
"throw",
"new",
"XDocletException",
"(",
"Translator",
".",
... | Processes an anonymous field definition specified at the class level.
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="content"
@doc.param name="attributes" optional="true" description="Attributes of the field as... | [
"Processes",
"an",
"anonymous",
"field",
"definition",
"specified",
"at",
"the",
"class",
"level",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L677-L705 | train | Processes an anonymous field. | Of course, here is the Java code you requested:
```java
public void processAnonymousField(Properties attributes) throws XDocletException
{
if (!attributes.containsKey(ATTRIBUTE_NAME))
{
throw new XDocletException(Translator.getString(XDocletModulesOjbMessages.class,
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist2/LinkedList.java | LinkedList.getLast | public Entry getLast()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getLast");
SibTr.exit(tc, "getLast", last);
}
return last;
} | java | public Entry getLast()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getLast");
SibTr.exit(tc, "getLast", last);
}
return last;
} | [
"public",
"Entry",
"getLast",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getLast\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getLast\"",
",",
"last",
")",
";",
"... | Synchronized. Get the last entry in the list.
@return the last entry in the list. | [
"Synchronized",
".",
"Get",
"the",
"last",
"entry",
"in",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist2/LinkedList.java#L322-L331 | train | Get the last entry in the list of the list. | Of course, here is the Java code you requested:
```java
public Entry getLast()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "getLast");
SibTr.exit(tc, "getLast", last);
}
return last;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPPort.java | TCPPort.destroyServerSocket | protected synchronized void destroyServerSocket() {
if (null == this.serverSocket) {
// already closed
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "ServerSocket being closed for port " + this.listenPort);
}... | java | protected synchronized void destroyServerSocket() {
if (null == this.serverSocket) {
// already closed
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "ServerSocket being closed for port " + this.listenPort);
}... | [
"protected",
"synchronized",
"void",
"destroyServerSocket",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"this",
".",
"serverSocket",
")",
"{",
"// already closed",
"return",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
... | Destroys the server socket associated with this end point. | [
"Destroys",
"the",
"server",
"socket",
"associated",
"with",
"this",
"end",
"point",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPPort.java#L306-L316 | train | Destroy the serverSocket. | Of course, here is the Java code you requested:
```java
protected synchronized void destroyServerSocket() {
if (null == this.serverSocket) {
// already closed
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "ServerSoc... |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java | UtilColor.multiplyRgb | public static int multiplyRgb(int rgb, double fr, double fg, double fb)
{
if (rgb == 0)
{
return rgb;
}
final int a = rgb >> Constant.BYTE_4 & 0xFF;
final int r = (int) UtilMath.clamp((rgb >> Constant.BYTE_3 & 0xFF) * fr, 0, 255);
final int g = (... | java | public static int multiplyRgb(int rgb, double fr, double fg, double fb)
{
if (rgb == 0)
{
return rgb;
}
final int a = rgb >> Constant.BYTE_4 & 0xFF;
final int r = (int) UtilMath.clamp((rgb >> Constant.BYTE_3 & 0xFF) * fr, 0, 255);
final int g = (... | [
"public",
"static",
"int",
"multiplyRgb",
"(",
"int",
"rgb",
",",
"double",
"fr",
",",
"double",
"fg",
",",
"double",
"fb",
")",
"{",
"if",
"(",
"rgb",
"==",
"0",
")",
"{",
"return",
"rgb",
";",
"}",
"final",
"int",
"a",
"=",
"rgb",
">>",
"Consta... | Apply an rgb factor.
@param rgb The original rgb.
@param fr The red factor.
@param fg The green factor.
@param fb The blue factor.
@return The multiplied rgb. | [
"Apply",
"an",
"rgb",
"factor",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java#L42-L59 | train | Multiply the RGB value of a single SHORT attribute. | Of course, here is the Java code you requested:
```java
public static int multiplyRgb(int rgb, double fr, double fg, double fb)
{
if (rgb == 0)
{
return rgb;
}
final int a = rgb >> Constant.BYTE_4 & 0xFF;
final int r = (int) UtilMath.clamp((rgb >> Consta... |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassNameRewriterUtil.java | ClassNameRewriterUtil.rewriteMethodSignature | public static String rewriteMethodSignature(ClassNameRewriter classNameRewriter, String methodSignature) {
if (classNameRewriter != IdentityClassNameRewriter.instance()) {
SignatureParser parser = new SignatureParser(methodSignature);
StringBuilder buf = new StringBuilder();
... | java | public static String rewriteMethodSignature(ClassNameRewriter classNameRewriter, String methodSignature) {
if (classNameRewriter != IdentityClassNameRewriter.instance()) {
SignatureParser parser = new SignatureParser(methodSignature);
StringBuilder buf = new StringBuilder();
... | [
"public",
"static",
"String",
"rewriteMethodSignature",
"(",
"ClassNameRewriter",
"classNameRewriter",
",",
"String",
"methodSignature",
")",
"{",
"if",
"(",
"classNameRewriter",
"!=",
"IdentityClassNameRewriter",
".",
"instance",
"(",
")",
")",
"{",
"SignatureParser",
... | Rewrite a method signature.
@param classNameRewriter
a ClassNameRewriter
@param methodSignature
a method signature
@return the rewritten method signature | [
"Rewrite",
"a",
"method",
"signature",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassNameRewriterUtil.java#L44-L62 | train | Rewrite method signature. | Of course, here is the Java code you requested:
```java
public static String rewriteMethodSignature(ClassNameRewriter classNameRewriter, String methodSignature) {
if (classNameRewriter != IdentityClassNameRewriter.instance()) {
SignatureParser parser = new SignatureParser(methodSignature);
... |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java | EntityFinder.getProteinSequence | private static ProteinSequence getProteinSequence(String str) {
try {
ProteinSequence s = new ProteinSequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating ProteinSequence",e);
}
return null;
} | java | private static ProteinSequence getProteinSequence(String str) {
try {
ProteinSequence s = new ProteinSequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating ProteinSequence",e);
}
return null;
} | [
"private",
"static",
"ProteinSequence",
"getProteinSequence",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"ProteinSequence",
"s",
"=",
"new",
"ProteinSequence",
"(",
"str",
")",
";",
"return",
"s",
";",
"}",
"catch",
"(",
"CompoundNotFoundException",
"e",
")",... | Returns the ProteinSequence or null if one can't be created
@param str
@return | [
"Returns",
"the",
"ProteinSequence",
"or",
"null",
"if",
"one",
"can",
"t",
"be",
"created"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java#L498-L507 | train | Get a ProteinSequence from a String | Of course, here is the Java code you requested:
```java
private static ProteinSequence getProteinSequence(String str) {
try {
ProteinSequence s = new ProteinSequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating ProteinSequence",e);
}
return null... |
google/guava | android/guava/src/com/google/common/net/InetAddresses.java | InetAddresses.isMappedIPv4Address | public static boolean isMappedIPv4Address(String ipString) {
byte[] bytes = ipStringToBytes(ipString);
if (bytes != null && bytes.length == 16) {
for (int i = 0; i < 10; i++) {
if (bytes[i] != 0) {
return false;
}
}
for (int i = 10; i < 12; i++) {
if (bytes[i]... | java | public static boolean isMappedIPv4Address(String ipString) {
byte[] bytes = ipStringToBytes(ipString);
if (bytes != null && bytes.length == 16) {
for (int i = 0; i < 10; i++) {
if (bytes[i] != 0) {
return false;
}
}
for (int i = 10; i < 12; i++) {
if (bytes[i]... | [
"public",
"static",
"boolean",
"isMappedIPv4Address",
"(",
"String",
"ipString",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"ipStringToBytes",
"(",
"ipString",
")",
";",
"if",
"(",
"bytes",
"!=",
"null",
"&&",
"bytes",
".",
"length",
"==",
"16",
")",
"{",... | Evaluates whether the argument is an "IPv4 mapped" IPv6 address.
<p>An "IPv4 mapped" address is anything in the range ::ffff:0:0/96 (sometimes written as
::ffff:0.0.0.0/96), with the last 32 bits interpreted as an IPv4 address.
<p>For more on IPv4 mapped addresses see section 2.5.5.2 of <a target="_parent"
href="http... | [
"Evaluates",
"whether",
"the",
"argument",
"is",
"an",
"IPv4",
"mapped",
"IPv6",
"address",
"."
] | 7155d12b70a2406fa84d94d4b8b3bc108e89abfd | https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/android/guava/src/com/google/common/net/InetAddresses.java#L795-L811 | valid | Checks if the given string is a mapped IPv4 address. | Of course, here is the Java code you requested:
```java
public static boolean isMappedIPv4Address(String ipString) {
byte[] bytes = ipStringToBytes(ipString);
if (bytes != null && bytes.length == 16) {
for (int i = 0; i < 10; i++) {
if (bytes[i] != 0) {
return false;
}
}
... |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/GOMention.java | GOMention.getCategories | public String getCategories(int i) {
if (GOMention_Type.featOkTst && ((GOMention_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.GOMention");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((GOMention_Type)jcasType).casF... | java | public String getCategories(int i) {
if (GOMention_Type.featOkTst && ((GOMention_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.GOMention");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((GOMention_Type)jcasType).casF... | [
"public",
"String",
"getCategories",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"GOMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"GOMention_Type",
")",
"jcasType",
")",
".",
"casFeat_categories",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissi... | indexed getter for categories - gets an indexed value - created for the shared task, here we add the group
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"categories",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"created",
"for",
"the",
"shared",
"task",
"here",
"we",
"add",
"the",
"group"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/GOMention.java#L105-L109 | train | indexed getter for categories - gets an indexed value - | Of course, here is the Java code you requested:
```java
public String getCategories(int i) {
if (GOMention_Type.featOkTst && ((GOMention_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.GOMention");
jcasType.jcas.checkArrayBounds(jcasType.ll... |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.fetchByPrimaryKey | @Override
public CommerceSubscriptionEntry fetchByPrimaryKey(Serializable primaryKey) {
Serializable serializable = entityCache.getResult(CommerceSubscriptionEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceSubscriptionEntryImpl.class, primaryKey);
if (serializable == nullModel) {
return null;
}
CommerceS... | java | @Override
public CommerceSubscriptionEntry fetchByPrimaryKey(Serializable primaryKey) {
Serializable serializable = entityCache.getResult(CommerceSubscriptionEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceSubscriptionEntryImpl.class, primaryKey);
if (serializable == nullModel) {
return null;
}
CommerceS... | [
"@",
"Override",
"public",
"CommerceSubscriptionEntry",
"fetchByPrimaryKey",
"(",
"Serializable",
"primaryKey",
")",
"{",
"Serializable",
"serializable",
"=",
"entityCache",
".",
"getResult",
"(",
"CommerceSubscriptionEntryModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"Comm... | Returns the commerce subscription entry with the primary key or returns <code>null</code> if it could not be found.
@param primaryKey the primary key of the commerce subscription entry
@return the commerce subscription entry, or <code>null</code> if a commerce subscription entry with the primary key could not be found | [
"Returns",
"the",
"commerce",
"subscription",
"entry",
"with",
"the",
"primary",
"key",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L3970-L4011 | train | Returns the commerce subscription entry with the primary key. | Of course, here is the Java code you requested:
```java
@Override
public CommerceSubscriptionEntry fetchByPrimaryKey(Serializable primaryKey) {
Serializable serializable = entityCache.getResult(CommerceSubscriptionEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceSubscriptionEntryImpl.class, primaryKey);
if (seri... |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.closureCollector | public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
ClosureHolder::add,
ClosureHolder::merge,
ClosureHolder::closure);
... | java | public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
ClosureHolder::add,
ClosureHolder::merge,
ClosureHolder::closure);
... | [
"public",
"Collector",
"<",
"Type",
",",
"ClosureHolder",
",",
"List",
"<",
"Type",
">",
">",
"closureCollector",
"(",
"boolean",
"minClosure",
",",
"BiPredicate",
"<",
"Type",
",",
"Type",
">",
"shouldSkip",
")",
"{",
"return",
"Collector",
".",
"of",
"("... | Collect types into a new closure (using a @code{ClosureHolder}) | [
"Collect",
"types",
"into",
"a",
"new",
"closure",
"(",
"using",
"a"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L3436-L3441 | train | Collect a list of types to a closure. | Of course, here is the Java code you requested:
```java
public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
ClosureHolder::add,
ClosureHo... |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java | Utils.copyTypeParametersFromJvmOperation | public static void copyTypeParametersFromJvmOperation(List<JvmTypeParameter> inputParameters,
List<JvmTypeParameter> outputParameters,
Map<String, JvmTypeReference> superTypeParameterMapping,
JvmTypeReferenceBuilder typeParameterBuilder, JvmTypesBuilder typeBuilder,
TypeReferences typeReferences, TypesFacto... | java | public static void copyTypeParametersFromJvmOperation(List<JvmTypeParameter> inputParameters,
List<JvmTypeParameter> outputParameters,
Map<String, JvmTypeReference> superTypeParameterMapping,
JvmTypeReferenceBuilder typeParameterBuilder, JvmTypesBuilder typeBuilder,
TypeReferences typeReferences, TypesFacto... | [
"public",
"static",
"void",
"copyTypeParametersFromJvmOperation",
"(",
"List",
"<",
"JvmTypeParameter",
">",
"inputParameters",
",",
"List",
"<",
"JvmTypeParameter",
">",
"outputParameters",
",",
"Map",
"<",
"String",
",",
"JvmTypeReference",
">",
"superTypeParameterMap... | Copy the type parameters from a JvmOperation.
<p>This function differs from {@link XtendJvmModelInferrer#copyAndFixTypeParameters(List,
org.eclipse.xtext.common.types.JvmTypeParameterDeclarator)}
and {@link XtendJvmModelInferrer#copyTypeParameters(List, org.eclipse.xtext.common.types.JvmTypeParameterDeclarator)}
in th... | [
"Copy",
"the",
"type",
"parameters",
"from",
"a",
"JvmOperation",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java#L1655-L1687 | train | Copy the type parameters from the jvm operation. | Of course, here is the Java code you requested:
```java
public static void copyTypeParametersFromJvmOperation(List<JvmTypeParameter> inputParameters,
List<JvmTypeParameter> outputParameters,
Map<String, JvmTypeReference> superTypeParameterMapping,
JvmTypeReferenceBuilder typeParameterBuilder, JvmTypesBuilder ... |
jboss/jboss-saaj-api_spec | src/main/java/javax/xml/soap/FactoryFinder.java | FactoryFinder.find | static Object find(String factoryId)
throws SOAPException
{
ClassLoader classLoader;
try {
classLoader = getContextClassLoader();
} catch (Exception x) {
throw new SOAPException(x.toString(), x);
}
// Use the system property first
try ... | java | static Object find(String factoryId)
throws SOAPException
{
ClassLoader classLoader;
try {
classLoader = getContextClassLoader();
} catch (Exception x) {
throw new SOAPException(x.toString(), x);
}
// Use the system property first
try ... | [
"static",
"Object",
"find",
"(",
"String",
"factoryId",
")",
"throws",
"SOAPException",
"{",
"ClassLoader",
"classLoader",
";",
"try",
"{",
"classLoader",
"=",
"getContextClassLoader",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"x",
")",
"{",
"throw",
"n... | Finds the implementation <code>Class</code> object for the given
factory name, or null if that fails.
<P>
This method is package private so that this code can be shared.
@return the <code>Class</code> object of the specified message factory;
or <code>null</code>
@param factoryId the name of the factory to... | [
"Finds",
"the",
"implementation",
"<code",
">",
"Class<",
"/",
"code",
">",
"object",
"for",
"the",
"given",
"factory",
"name",
"or",
"null",
"if",
"that",
"fails",
".",
"<P",
">",
"This",
"method",
"is",
"package",
"private",
"so",
"that",
"this",
"code... | 2dda4e662e4f99b289f3a8d944a68cf537c78dd4 | https://github.com/jboss/jboss-saaj-api_spec/blob/2dda4e662e4f99b289f3a8d944a68cf537c78dd4/src/main/java/javax/xml/soap/FactoryFinder.java#L83-L202 | train | Find a single instance of the class with the specified factory id. | Of course, here is the Java code you requested:
```java
static Object find(String factoryId)
throws SOAPException
{
ClassLoader classLoader;
try {
classLoader = getContextClassLoader();
} catch (Exception x) {
throw new SOAPException(x.toString(), x);
... |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java | RolesInner.createOrUpdate | public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().last().body();
} | java | public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().last().body();
} | [
"public",
"RoleInner",
"createOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"RoleInner",
"role",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroup... | Create or update a role.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@param role The role properties.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws ... | [
"Create",
"or",
"update",
"a",
"role",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java#L322-L324 | train | Creates or updates a role. | Of course, here is the Java code you requested:
```java
public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().last().body();
}
```
Hope this helps! |
tobato/FastDFS_Client | src/main/java/com/github/tobato/fastdfs/domain/proto/tracker/internal/TrackerListStoragesResponse.java | TrackerListStoragesResponse.decodeContent | @Override
public List<StorageState> decodeContent(InputStream in, Charset charset) throws IOException {
// 解析报文内容
byte[] bytes = new byte[(int) getContentLength()];
int contentSize = in.read(bytes);
if (contentSize != getContentLength()) {
throw new IOException("读取到的数据长度与... | java | @Override
public List<StorageState> decodeContent(InputStream in, Charset charset) throws IOException {
// 解析报文内容
byte[] bytes = new byte[(int) getContentLength()];
int contentSize = in.read(bytes);
if (contentSize != getContentLength()) {
throw new IOException("读取到的数据长度与... | [
"@",
"Override",
"public",
"List",
"<",
"StorageState",
">",
"decodeContent",
"(",
"InputStream",
"in",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"// 解析报文内容",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"(",
"int",
")",
"getCont... | 解析反馈内容 | [
"解析反馈内容"
] | 8e3bfe712f1739028beed7f3a6b2cc4579a231e4 | https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/domain/proto/tracker/internal/TrackerListStoragesResponse.java#L24-L34 | train | Decode content. | Of course, here is the Java code you requested:
```java
@Override
public List<StorageState> decodeContent(InputStream in, Charset charset) throws IOException {
// 解析报文内容
byte[] bytes = new byte[(int) getContentLength()];
int contentSize = in.read(bytes);
if (contentSize != getConten... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java | XmlUtil.createDocumentBuilder | public static DocumentBuilder createDocumentBuilder() {
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
disableXXE(dbf);
DocumentBuilder builder = null;
try {
builder = dbf.newDocumentBuilder();
} catch (Exception e) {
throw new UtilException(e, "Create xml document error... | java | public static DocumentBuilder createDocumentBuilder() {
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
disableXXE(dbf);
DocumentBuilder builder = null;
try {
builder = dbf.newDocumentBuilder();
} catch (Exception e) {
throw new UtilException(e, "Create xml document error... | [
"public",
"static",
"DocumentBuilder",
"createDocumentBuilder",
"(",
")",
"{",
"final",
"DocumentBuilderFactory",
"dbf",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"disableXXE",
"(",
"dbf",
")",
";",
"DocumentBuilder",
"builder",
"=",
"null",
... | 创建 DocumentBuilder
@return DocumentBuilder
@since 4.1.2 | [
"创建",
"DocumentBuilder"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L386-L396 | train | Create a DocumentBuilder object. | Of course, here is the Java code you requested:
```java
public static DocumentBuilder createDocumentBuilder() {
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
disableXXE(dbf);
DocumentBuilder builder = null;
try {
builder = dbf.newDocumentBuilder();
} catch (Exception e) {
... |
nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/XlsxExporter.java | XlsxExporter.updateSubreportBandElementStyle | private XSSFCellStyle updateSubreportBandElementStyle(XSSFCellStyle cellStyle, BandElement bandElement, Object value, int gridRow, int gridColumn, int colSpan) {
if (subreportCellStyle == null) {
return cellStyle;
}
if (gridColumn == 0) {
cellStyle.setBorderLeft(sub... | java | private XSSFCellStyle updateSubreportBandElementStyle(XSSFCellStyle cellStyle, BandElement bandElement, Object value, int gridRow, int gridColumn, int colSpan) {
if (subreportCellStyle == null) {
return cellStyle;
}
if (gridColumn == 0) {
cellStyle.setBorderLeft(sub... | [
"private",
"XSSFCellStyle",
"updateSubreportBandElementStyle",
"(",
"XSSFCellStyle",
"cellStyle",
",",
"BandElement",
"bandElement",
",",
"Object",
"value",
",",
"int",
"gridRow",
",",
"int",
"gridColumn",
",",
"int",
"colSpan",
")",
"{",
"if",
"(",
"subreportCellSt... | If a border style is set on a ReportBandElement we must apply it to all subreport cells | [
"If",
"a",
"border",
"style",
"is",
"set",
"on",
"a",
"ReportBandElement",
"we",
"must",
"apply",
"it",
"to",
"all",
"subreport",
"cells"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/XlsxExporter.java#L470-L492 | train | Update the subreport band element style | Of course, here is the Java code you requested:
```java
private XSSFCellStyle updateSubreportBandElementStyle(XSSFCellStyle cellStyle, BandElement bandElement, Object value, int gridRow, int gridColumn, int colSpan) {
if (subreportCellStyle == null) {
return cellStyle;
}
if (g... |
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.acceptEncoding | public Request acceptEncoding(String encoding){
final String acceptEncoding = RequestHeaderFields.ACCEPT_ENCODING.getName();
String encodingValue = headers.get(acceptEncoding);
if (encodingValue == null){
encodingValue = encoding;
} else {
encodingValue = encoding... | java | public Request acceptEncoding(String encoding){
final String acceptEncoding = RequestHeaderFields.ACCEPT_ENCODING.getName();
String encodingValue = headers.get(acceptEncoding);
if (encodingValue == null){
encodingValue = encoding;
} else {
encodingValue = encoding... | [
"public",
"Request",
"acceptEncoding",
"(",
"String",
"encoding",
")",
"{",
"final",
"String",
"acceptEncoding",
"=",
"RequestHeaderFields",
".",
"ACCEPT_ENCODING",
".",
"getName",
"(",
")",
";",
"String",
"encodingValue",
"=",
"headers",
".",
"get",
"(",
"accep... | sets the accept encoding header for the request, if exists then appends
@param encoding : header field value to add
@return : Request Object with accept encoding header value set | [
"sets",
"the",
"accept",
"encoding",
"header",
"for",
"the",
"request",
"if",
"exists",
"then",
"appends"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L209-L218 | train | Sets the request header to accept the given encoding. | Of course, here is the Java code you requested:
```java
public Request acceptEncoding(String encoding){
final String acceptEncoding = RequestHeaderFields.ACCEPT_ENCODING.getName();
String encodingValue = headers.get(acceptEncoding);
if (encodingValue == null){
encodingValue = encodi... |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/APNSSandboxChannelResponseMarshaller.java | APNSSandboxChannelResponseMarshaller.marshall | public void marshall(APNSSandboxChannelResponse aPNSSandboxChannelResponse, ProtocolMarshaller protocolMarshaller) {
if (aPNSSandboxChannelResponse == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(a... | java | public void marshall(APNSSandboxChannelResponse aPNSSandboxChannelResponse, ProtocolMarshaller protocolMarshaller) {
if (aPNSSandboxChannelResponse == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(a... | [
"public",
"void",
"marshall",
"(",
"APNSSandboxChannelResponse",
"aPNSSandboxChannelResponse",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"aPNSSandboxChannelResponse",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/APNSSandboxChannelResponseMarshaller.java#L64-L86 | train | marshalls the given APNSSandboxChannelResponse to the JSON file. | Of course, here is the Java code you requested:
```java
public void marshall(APNSSandboxChannelResponse aPNSSandboxChannelResponse, ProtocolMarshaller protocolMarshaller) {
if (aPNSSandboxChannelResponse == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java | LiveReloadServer.createConnection | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | java | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | [
"protected",
"Connection",
"createConnection",
"(",
"Socket",
"socket",
",",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Connection",
"(",
"socket",
",",
"inputStream",
",",
"outputStream",
... | Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@return a connection
@throws IOException in case of I/O errors | [
"Factory",
"method",
"used",
"to",
"create",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java#L236-L239 | train | Creates a new connection to the server. | Of course, here is the Java code you requested:
```java
protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
}
```
Hope this helps! |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormField.java | FormField.getFirstValueAsDate | public Date getFirstValueAsDate() throws ParseException {
String valueString = getFirstValue();
if (valueString == null) {
return null;
}
return XmppDateTime.parseXEP0082Date(valueString);
} | java | public Date getFirstValueAsDate() throws ParseException {
String valueString = getFirstValue();
if (valueString == null) {
return null;
}
return XmppDateTime.parseXEP0082Date(valueString);
} | [
"public",
"Date",
"getFirstValueAsDate",
"(",
")",
"throws",
"ParseException",
"{",
"String",
"valueString",
"=",
"getFirstValue",
"(",
")",
";",
"if",
"(",
"valueString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"XmppDateTime",
".",
"pa... | Parses the first value of this form field as XEP-0082 date/time format and returns a date instance or {@code null}.
@return a Date instance representing the date/time information of the first value of this field.
@throws ParseException if parsing fails.
@since 4.3.0 | [
"Parses",
"the",
"first",
"value",
"of",
"this",
"form",
"field",
"as",
"XEP",
"-",
"0082",
"date",
"/",
"time",
"format",
"and",
"returns",
"a",
"date",
"instance",
"or",
"{",
"@code",
"null",
"}",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormField.java#L283-L289 | train | Gets the first value as a Date. | Of course, here is the Java code you requested:
```java
public Date getFirstValueAsDate() throws ParseException {
String valueString = getFirstValue();
if (valueString == null) {
return null;
}
return XmppDateTime.parseXEP0082Date(valueString);
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getPermissions | public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException {
// reading permissions is allowed even if the resource is marked as deleted
CmsResource resource = readResource(resourceName, CmsResourceFilter.ALL);
CmsUser user = readUser(userName);
ret... | java | public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException {
// reading permissions is allowed even if the resource is marked as deleted
CmsResource resource = readResource(resourceName, CmsResourceFilter.ALL);
CmsUser user = readUser(userName);
ret... | [
"public",
"CmsPermissionSet",
"getPermissions",
"(",
"String",
"resourceName",
",",
"String",
"userName",
")",
"throws",
"CmsException",
"{",
"// reading permissions is allowed even if the resource is marked as deleted",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"res... | Returns the set of permissions of a given user for a given resource.<p>
@param resourceName the name of the resource
@param userName the name of the user
@return the current permissions on this resource
@throws CmsException if something goes wrong | [
"Returns",
"the",
"set",
"of",
"permissions",
"of",
"a",
"given",
"user",
"for",
"a",
"given",
"resource",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1677-L1683 | train | Returns the permissions for the given resource and user. | Of course, here is the Java code you requested:
```java
public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException {
// reading permissions is allowed even if the resource is marked as deleted
CmsResource resource = readResource(resourceName, CmsResourceFilter.ALL... |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendarWeek.java | ProjectCalendarWeek.addCalendarHours | public ProjectCalendarHours addCalendarHours(Day day)
{
ProjectCalendarHours bch = new ProjectCalendarHours(this);
bch.setDay(day);
m_hours[day.getValue() - 1] = bch;
return (bch);
} | java | public ProjectCalendarHours addCalendarHours(Day day)
{
ProjectCalendarHours bch = new ProjectCalendarHours(this);
bch.setDay(day);
m_hours[day.getValue() - 1] = bch;
return (bch);
} | [
"public",
"ProjectCalendarHours",
"addCalendarHours",
"(",
"Day",
"day",
")",
"{",
"ProjectCalendarHours",
"bch",
"=",
"new",
"ProjectCalendarHours",
"(",
"this",
")",
";",
"bch",
".",
"setDay",
"(",
"day",
")",
";",
"m_hours",
"[",
"day",
".",
"getValue",
"... | Used to add working hours to the calendar. Note that the MPX file
definition allows a maximum of 7 calendar hours records to be added to
a single calendar.
@param day day number
@return new ProjectCalendarHours instance | [
"Used",
"to",
"add",
"working",
"hours",
"to",
"the",
"calendar",
".",
"Note",
"that",
"the",
"MPX",
"file",
"definition",
"allows",
"a",
"maximum",
"of",
"7",
"calendar",
"hours",
"records",
"to",
"be",
"added",
"to",
"a",
"single",
"calendar",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendarWeek.java#L222-L228 | train | Add calendar hours to this calendar. | Of course, here is the Java code you requested:
```java
public ProjectCalendarHours addCalendarHours(Day day)
{
ProjectCalendarHours bch = new ProjectCalendarHours(this);
bch.setDay(day);
m_hours[day.getValue() - 1] = bch;
return (bch);
}
```
Hope this helps! |
spring-projects/spring-analytics | src/main/java/org/springframework/analytics/rest/controller/AggregateCounterController.java | AggregateCounterController.providedOrDefaultFromValue | private DateTime providedOrDefaultFromValue(DateTime from, DateTime to,
AggregateCounterResolution resolution) {
if (from != null) {
return from;
}
switch (resolution) {
case minute:
return to.minusMinutes(59);
case hour:
return to.minusHours(23);
case day:
return to.minusDays(6);
case mont... | java | private DateTime providedOrDefaultFromValue(DateTime from, DateTime to,
AggregateCounterResolution resolution) {
if (from != null) {
return from;
}
switch (resolution) {
case minute:
return to.minusMinutes(59);
case hour:
return to.minusHours(23);
case day:
return to.minusDays(6);
case mont... | [
"private",
"DateTime",
"providedOrDefaultFromValue",
"(",
"DateTime",
"from",
",",
"DateTime",
"to",
",",
"AggregateCounterResolution",
"resolution",
")",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"return",
"from",
";",
"}",
"switch",
"(",
"resolution",
... | Return a default value for the interval start if none has been provided. | [
"Return",
"a",
"default",
"value",
"for",
"the",
"interval",
"start",
"if",
"none",
"has",
"been",
"provided",
"."
] | e3ef19d2b794d6dc10265c171bba46cd757b1abd | https://github.com/spring-projects/spring-analytics/blob/e3ef19d2b794d6dc10265c171bba46cd757b1abd/src/main/java/org/springframework/analytics/rest/controller/AggregateCounterController.java#L177-L197 | train | Given two dates return the value of the provided value. | Of course, here is the Java code you requested:
```java
private DateTime providedOrDefaultFromValue(DateTime from, DateTime to,
AggregateCounterResolution resolution) {
if (from != null) {
return from;
}
switch (resolution) {
case minute:
return to.minusMinutes(59);
case hour:
return to.minusHour... |
cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java | HighlightGenerator.generate | @Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
final Map<IChemObject, Integer> highlight = container.getProperty(ID_MAP);
if (highlight == null) return null;
final Palette palette = model.getParameter(HighlightPalette.class).getValue();
... | java | @Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
final Map<IChemObject, Integer> highlight = container.getProperty(ID_MAP);
if (highlight == null) return null;
final Palette palette = model.getParameter(HighlightPalette.class).getValue();
... | [
"@",
"Override",
"public",
"IRenderingElement",
"generate",
"(",
"IAtomContainer",
"container",
",",
"RendererModel",
"model",
")",
"{",
"final",
"Map",
"<",
"IChemObject",
",",
"Integer",
">",
"highlight",
"=",
"container",
".",
"getProperty",
"(",
"ID_MAP",
")... | {@inheritDoc} | [
"{"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java#L122-L181 | train | Generate the CRS for the given atom container. | Of course, here is the Java code you requested:
```java
@Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
final Map<IChemObject, Integer> highlight = container.getProperty(ID_MAP);
if (highlight == null) return null;
final Palette palette = mode... |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java | CPDefinitionLocalizationPersistenceImpl.fetchByCPDefinitionId_Last | @Override
public CPDefinitionLocalization fetchByCPDefinitionId_Last(
long CPDefinitionId,
OrderByComparator<CPDefinitionLocalization> orderByComparator) {
int count = countByCPDefinitionId(CPDefinitionId);
if (count == 0) {
return null;
}
List<CPDefinitionLocalization> list = findByCPDefinitionId(CPD... | java | @Override
public CPDefinitionLocalization fetchByCPDefinitionId_Last(
long CPDefinitionId,
OrderByComparator<CPDefinitionLocalization> orderByComparator) {
int count = countByCPDefinitionId(CPDefinitionId);
if (count == 0) {
return null;
}
List<CPDefinitionLocalization> list = findByCPDefinitionId(CPD... | [
"@",
"Override",
"public",
"CPDefinitionLocalization",
"fetchByCPDefinitionId_Last",
"(",
"long",
"CPDefinitionId",
",",
"OrderByComparator",
"<",
"CPDefinitionLocalization",
">",
"orderByComparator",
")",
"{",
"int",
"count",
"=",
"countByCPDefinitionId",
"(",
"CPDefinitio... | Returns the last cp definition localization in the ordered set where CPDefinitionId = ?.
@param CPDefinitionId the cp definition ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching cp definition localization, or <code>null</code> if a matching cp ... | [
"Returns",
"the",
"last",
"cp",
"definition",
"localization",
"in",
"the",
"ordered",
"set",
"where",
"CPDefinitionId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java#L380-L398 | train | Returns the last cp definition localization in the ordered set. | Of course, here is the Java code you requested:
```java
@Override
public CPDefinitionLocalization fetchByCPDefinitionId_Last(
long CPDefinitionId,
OrderByComparator<CPDefinitionLocalization> orderByComparator) {
int count = countByCPDefinitionId(CPDefinitionId);
if (count == 0) {
return null;
}
List<... |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java | SparkDl4jMultiLayer.evaluateRegression | public <T extends RegressionEvaluation> T evaluateRegression(JavaRDD<DataSet> data, int minibatchSize) {
long nOut = ((FeedForwardLayer) network.getOutputLayer().conf().getLayer()).getNOut();
return (T)doEvaluation(data, new org.deeplearning4j.eval.RegressionEvaluation(nOut), minibatchSize);
} | java | public <T extends RegressionEvaluation> T evaluateRegression(JavaRDD<DataSet> data, int minibatchSize) {
long nOut = ((FeedForwardLayer) network.getOutputLayer().conf().getLayer()).getNOut();
return (T)doEvaluation(data, new org.deeplearning4j.eval.RegressionEvaluation(nOut), minibatchSize);
} | [
"public",
"<",
"T",
"extends",
"RegressionEvaluation",
">",
"T",
"evaluateRegression",
"(",
"JavaRDD",
"<",
"DataSet",
">",
"data",
",",
"int",
"minibatchSize",
")",
"{",
"long",
"nOut",
"=",
"(",
"(",
"FeedForwardLayer",
")",
"network",
".",
"getOutputLayer",... | Evaluate the network (regression performance) in a distributed manner on the provided data
@param data Data to evaluate
@param minibatchSize Minibatch size to use when doing performing evaluation
@return {@link RegressionEvaluation} instance with regression performance | [
"Evaluate",
"the",
"network",
"(",
"regression",
"performance",
")",
"in",
"a",
"distributed",
"manner",
"on",
"the",
"provided",
"data"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/multilayer/SparkDl4jMultiLayer.java#L581-L584 | train | Evaluates a regression model. | Of course, here is the Java code you requested:
```java
public <T extends RegressionEvaluation> T evaluateRegression(JavaRDD<DataSet> data, int minibatchSize) {
long nOut = ((FeedForwardLayer) network.getOutputLayer().conf().getLayer()).getNOut();
return (T)doEvaluation(data, new org.deeplearning4j.eva... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java | AfplibPackageImpl.getObjectClassificationStrucFlgs | public EEnum getObjectClassificationStrucFlgs() {
if (objectClassificationStrucFlgsEEnum == null) {
objectClassificationStrucFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(101);
}
return objectClassificationStrucFlgsEEnum;
} | java | public EEnum getObjectClassificationStrucFlgs() {
if (objectClassificationStrucFlgsEEnum == null) {
objectClassificationStrucFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(101);
}
return objectClassificationStrucFlgsEEnum;
} | [
"public",
"EEnum",
"getObjectClassificationStrucFlgs",
"(",
")",
"{",
"if",
"(",
"objectClassificationStrucFlgsEEnum",
"==",
"null",
")",
"{",
"objectClassificationStrucFlgsEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L17158-L17163 | train | Get the object classification StrucFlgs attribute. | Of course, here is the Java code you requested:
```java
public EEnum getObjectClassificationStrucFlgs() {
if (objectClassificationStrucFlgsEEnum == null) {
objectClassificationStrucFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(101);
}
return objectClass... |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java | JingleSession.startNegotiators | private void startNegotiators() {
for (ContentNegotiator contentNegotiator : contentNegotiators) {
TransportNegotiator transNeg = contentNegotiator.getTransportNegotiator();
transNeg.start();
}
} | java | private void startNegotiators() {
for (ContentNegotiator contentNegotiator : contentNegotiators) {
TransportNegotiator transNeg = contentNegotiator.getTransportNegotiator();
transNeg.start();
}
} | [
"private",
"void",
"startNegotiators",
"(",
")",
"{",
"for",
"(",
"ContentNegotiator",
"contentNegotiator",
":",
"contentNegotiators",
")",
"{",
"TransportNegotiator",
"transNeg",
"=",
"contentNegotiator",
".",
"getTransportNegotiator",
"(",
")",
";",
"transNeg",
".",... | When we initiate a session we need to start a bunch of negotiators right after we receive the result
stanza for our session-initiate. This is where we start them. | [
"When",
"we",
"initiate",
"a",
"session",
"we",
"need",
"to",
"start",
"a",
"bunch",
"of",
"negotiators",
"right",
"after",
"we",
"receive",
"the",
"result",
"stanza",
"for",
"our",
"session",
"-",
"initiate",
".",
"This",
"is",
"where",
"we",
"start",
"... | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java#L1159-L1165 | train | Start all the negotiators. | Of course, here is the Java code you requested:
```java
private void startNegotiators() {
for (ContentNegotiator contentNegotiator : contentNegotiators) {
TransportNegotiator transNeg = contentNegotiator.getTransportNegotiator();
transNeg.start();
}
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java | AWSOpsWorksClient.deleteInstance | @Override
public DeleteInstanceResult deleteInstance(DeleteInstanceRequest request) {
request = beforeClientExecution(request);
return executeDeleteInstance(request);
} | java | @Override
public DeleteInstanceResult deleteInstance(DeleteInstanceRequest request) {
request = beforeClientExecution(request);
return executeDeleteInstance(request);
} | [
"@",
"Override",
"public",
"DeleteInstanceResult",
"deleteInstance",
"(",
"DeleteInstanceRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteInstance",
"(",
"request",
")",
";",
"}"
] | <p>
Deletes a specified instance, which terminates the associated Amazon EC2 instance. You must stop an instance
before you can delete it.
</p>
<p>
For more information, see <a
href="http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html">Deleting Instances</a>.
</p>
<p>
<b>Required Permissio... | [
"<p",
">",
"Deletes",
"a",
"specified",
"instance",
"which",
"terminates",
"the",
"associated",
"Amazon",
"EC2",
"instance",
".",
"You",
"must",
"stop",
"an",
"instance",
"before",
"you",
"can",
"delete",
"it",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java#L1261-L1265 | train | Deletes an instance. | Of course, here is the Java code you requested:
```java
@Override
public DeleteInstanceResult deleteInstance(DeleteInstanceRequest request) {
request = beforeClientExecution(request);
return executeDeleteInstance(request);
}
```
Hope this helps! |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Error.java | Error.printSystemOut | public static void printSystemOut(String message1, long message2) {
if (TRACESYSTEMOUT) {
System.out.print(message1);
System.out.println(message2);
}
} | java | public static void printSystemOut(String message1, long message2) {
if (TRACESYSTEMOUT) {
System.out.print(message1);
System.out.println(message2);
}
} | [
"public",
"static",
"void",
"printSystemOut",
"(",
"String",
"message1",
",",
"long",
"message2",
")",
"{",
"if",
"(",
"TRACESYSTEMOUT",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"message1",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
... | Used to print messages to System.out
@param message1 message to print
@param message2 message to print | [
"Used",
"to",
"print",
"messages",
"to",
"System",
".",
"out"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Error.java#L264-L270 | train | Print the system out. | Of course, here is the Java code you requested:
```java
public static void printSystemOut(String message1, long message2) {
if (TRACESYSTEMOUT) {
System.out.print(message1);
System.out.println(message2);
}
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/transform/ListTagsForProjectRequestMarshaller.java | ListTagsForProjectRequestMarshaller.marshall | public void marshall(ListTagsForProjectRequest listTagsForProjectRequest, ProtocolMarshaller protocolMarshaller) {
if (listTagsForProjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(list... | java | public void marshall(ListTagsForProjectRequest listTagsForProjectRequest, ProtocolMarshaller protocolMarshaller) {
if (listTagsForProjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(list... | [
"public",
"void",
"marshall",
"(",
"ListTagsForProjectRequest",
"listTagsForProjectRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"listTagsForProjectRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid ar... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/transform/ListTagsForProjectRequestMarshaller.java#L46-L59 | train | marshalls the given parameter object. | Of course, here is the Java code you requested:
```java
public void marshall(ListTagsForProjectRequest listTagsForProjectRequest, ProtocolMarshaller protocolMarshaller) {
if (listTagsForProjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java | AiMaterial.getTextureFile | public String getTextureFile(AiTextureType type, int index) {
checkTexRange(type, index);
return getTyped(PropertyKey.TEX_FILE, type, index, String.class);
} | java | public String getTextureFile(AiTextureType type, int index) {
checkTexRange(type, index);
return getTyped(PropertyKey.TEX_FILE, type, index, String.class);
} | [
"public",
"String",
"getTextureFile",
"(",
"AiTextureType",
"type",
",",
"int",
"index",
")",
"{",
"checkTexRange",
"(",
"type",
",",
"index",
")",
";",
"return",
"getTyped",
"(",
"PropertyKey",
".",
"TEX_FILE",
",",
"type",
",",
"index",
",",
"String",
".... | Returns the texture file.<p>
If missing, defaults to empty string
@param type the texture type
@param index the index in the texture stack
@return the file
@throws IndexOutOfBoundsException if index is invalid | [
"Returns",
"the",
"texture",
"file",
".",
"<p",
">"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L906-L910 | train | Gets the texture file. | Of course, here is the Java code you requested:
```java
public String getTextureFile(AiTextureType type, int index) {
checkTexRange(type, index);
return getTyped(PropertyKey.TEX_FILE, type, index, String.class);
}
```
Hope this helps! |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/BoundingBox.java | BoundingBox.copyVertices | static private Vector3f[] copyVertices(Vector3f[] vertices) {
if (vertices == null) {
return null;
}
Vector3f[] copy = new Vector3f[vertices.length];
for (int i = 0; i < vertices.length; ++i) {
copy[i] = new Vector3f(vertices[i]);
}
return copy;
... | java | static private Vector3f[] copyVertices(Vector3f[] vertices) {
if (vertices == null) {
return null;
}
Vector3f[] copy = new Vector3f[vertices.length];
for (int i = 0; i < vertices.length; ++i) {
copy[i] = new Vector3f(vertices[i]);
}
return copy;
... | [
"static",
"private",
"Vector3f",
"[",
"]",
"copyVertices",
"(",
"Vector3f",
"[",
"]",
"vertices",
")",
"{",
"if",
"(",
"vertices",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Vector3f",
"[",
"]",
"copy",
"=",
"new",
"Vector3f",
"[",
"vertices"... | Makes a deep copy of an array of {@link Vector3f}.
@param vertices
Array to copy
@return Array of {@code Vector3f} | [
"Makes",
"a",
"deep",
"copy",
"of",
"an",
"array",
"of",
"{",
"@link",
"Vector3f",
"}",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/BoundingBox.java#L256-L265 | train | Copy the vertices array. | Of course, here is the Java code you requested:
```java
static private Vector3f[] copyVertices(Vector3f[] vertices) {
if (vertices == null) {
return null;
}
Vector3f[] copy = new Vector3f[vertices.length];
for (int i = 0; i < vertices.length; ++i) {
copy[i] = new... |
icode/ameba | src/main/java/ameba/db/model/Model.java | Model.withFinder | public static <ID, T extends Model> Finder<ID, T> withFinder() {
return withFinder(DataSourceManager.getDefaultDataSourceName());
} | java | public static <ID, T extends Model> Finder<ID, T> withFinder() {
return withFinder(DataSourceManager.getDefaultDataSourceName());
} | [
"public",
"static",
"<",
"ID",
",",
"T",
"extends",
"Model",
">",
"Finder",
"<",
"ID",
",",
"T",
">",
"withFinder",
"(",
")",
"{",
"return",
"withFinder",
"(",
"DataSourceManager",
".",
"getDefaultDataSourceName",
"(",
")",
")",
";",
"}"
] | <p>withFinder.</p>
@param <ID> a ID object.
@return a {@link ameba.db.model.Finder} object.
@param <T> a T object. | [
"<p",
">",
"withFinder",
".",
"<",
"/",
"p",
">"
] | 9d4956e935898e41331b2745e400ef869cd265e0 | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/model/Model.java#L55-L57 | train | Returns a Finder that will use the default datasource name. | Of course, here is the Java code you requested:
```java
public static <ID, T extends Model> Finder<ID, T> withFinder() {
return withFinder(DataSourceManager.getDefaultDataSourceName());
}
```
Hope this helps! |
wisdom-framework/wisdom | documentation/samples/src/main/java/org/wisdom/samples/validation/DriverController.java | DriverController.auto | @Route(method = HttpMethod.POST, uri = "samples/auto-validation")
public Result auto(@Valid @Body Car car) throws IOException {
return ok();
} | java | @Route(method = HttpMethod.POST, uri = "samples/auto-validation")
public Result auto(@Valid @Body Car car) throws IOException {
return ok();
} | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"POST",
",",
"uri",
"=",
"\"samples/auto-validation\"",
")",
"public",
"Result",
"auto",
"(",
"@",
"Valid",
"@",
"Body",
"Car",
"car",
")",
"throws",
"IOException",
"{",
"return",
"ok",
"(",
")",
";",
... | Displays the result (automatic check). | [
"Displays",
"the",
"result",
"(",
"automatic",
"check",
")",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/documentation/samples/src/main/java/org/wisdom/samples/validation/DriverController.java#L66-L69 | train | Auto validation of a single entity. | Of course, here is the Java code you requested:
```java
@Route(method = HttpMethod.POST, uri = "samples/auto-validation")
public Result auto(@Valid @Body Car car) throws IOException {
return ok();
}
```
Hope this helps! |
webfirmframework/wff | wffweb/src/main/java/com/webfirmframework/wffweb/css/css3/Columns.java | Columns.isValid | public static boolean isValid(final String cssValue) {
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final String[] cssValueParts = StringUtil.splitBySpace(cssValue);
ColumnWidth columnWidth = null;
ColumnCount columnCount = null;
... | java | public static boolean isValid(final String cssValue) {
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final String[] cssValueParts = StringUtil.splitBySpace(cssValue);
ColumnWidth columnWidth = null;
ColumnCount columnCount = null;
... | [
"public",
"static",
"boolean",
"isValid",
"(",
"final",
"String",
"cssValue",
")",
"{",
"if",
"(",
"cssValue",
"==",
"null",
"||",
"StringUtil",
".",
"isBlank",
"(",
"cssValue",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"String",
"[",
"]",
"... | checks the given css value is valid for this class. It does't do a strict
validation.
@param cssValue
@return
@since 1.0.0
@author WFF | [
"checks",
"the",
"given",
"css",
"value",
"is",
"valid",
"for",
"this",
"class",
".",
"It",
"does",
"t",
"do",
"a",
"strict",
"validation",
"."
] | e59def3a20d44f91e112b113448d951d7514af2e | https://github.com/webfirmframework/wff/blob/e59def3a20d44f91e112b113448d951d7514af2e/wffweb/src/main/java/com/webfirmframework/wffweb/css/css3/Columns.java#L247-L272 | valid | Checks if the given CSS value is a valid CSP image. | Of course, here is the Java code you requested:
```java
public static boolean isValid(final String cssValue) {
if (cssValue == null || StringUtil.isBlank(cssValue)) {
return false;
}
final String[] cssValueParts = StringUtil.splitBySpace(cssValue);
ColumnWidth columnWidth ... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.concatWith | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> concatWith(@NonNull CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new ObservableConcatWithCompletable<T>(this, other));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> concatWith(@NonNull CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new ObservableConcatWithCompletable<T>(this, other));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"concatWith",
"(",
"@",
"NonNull",
"CompletableSource",
"other",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"o... | Returns an {@code Observable} that emits items from this {@code Observable} and when it completes normally, the
other {@link CompletableSource} is subscribed to and the returned {@code Observable} emits its terminal events.
<p>
<img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-op... | [
"Returns",
"an",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7243-L7248 | test | Concatenates two set of images. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> concatWith(@NonNull CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new ObservableConcatW... |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.closeWindow | public static void closeWindow(Component component) {
Window window = getWindow(component);
if (window != null) {
window.close();
}
} | java | public static void closeWindow(Component component) {
Window window = getWindow(component);
if (window != null) {
window.close();
}
} | [
"public",
"static",
"void",
"closeWindow",
"(",
"Component",
"component",
")",
"{",
"Window",
"window",
"=",
"getWindow",
"(",
"component",
")",
";",
"if",
"(",
"window",
"!=",
"null",
")",
"{",
"window",
".",
"close",
"(",
")",
";",
"}",
"}"
] | Closes the window containing the given component.
@param component a component | [
"Closes",
"the",
"window",
"containing",
"the",
"given",
"component",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L294-L300 | train | Close the window. | Of course, here is the Java code you requested:
```java
public static void closeWindow(Component component) {
Window window = getWindow(component);
if (window != null) {
window.close();
}
}
```
Hope this helps! |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPRuleUtil.java | CPRuleUtil.fetchByGroupId_Last | public static CPRule fetchByGroupId_Last(long groupId,
OrderByComparator<CPRule> orderByComparator) {
return getPersistence().fetchByGroupId_Last(groupId, orderByComparator);
} | java | public static CPRule fetchByGroupId_Last(long groupId,
OrderByComparator<CPRule> orderByComparator) {
return getPersistence().fetchByGroupId_Last(groupId, orderByComparator);
} | [
"public",
"static",
"CPRule",
"fetchByGroupId_Last",
"(",
"long",
"groupId",
",",
"OrderByComparator",
"<",
"CPRule",
">",
"orderByComparator",
")",
"{",
"return",
"getPersistence",
"(",
")",
".",
"fetchByGroupId_Last",
"(",
"groupId",
",",
"orderByComparator",
")",... | Returns the last cp rule in the ordered set where groupId = ?.
@param groupId the group ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching cp rule, or <code>null</code> if a matching cp rule could not be found | [
"Returns",
"the",
"last",
"cp",
"rule",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPRuleUtil.java#L225-L228 | train | Returns the last cp rule in the ordered set where groupId = ? ;. | Of course, here is the Java code you requested:
```java
public static CPRule fetchByGroupId_Last(long groupId,
OrderByComparator<CPRule> orderByComparator) {
return getPersistence().fetchByGroupId_Last(groupId, orderByComparator);
}
```
Hope this helps! |
threerings/nenya | core/src/main/java/com/threerings/media/util/LinePath.java | LinePath.computePosition | public static void computePosition (
Point start, Point end, long elapsed, long duration, Point pos)
{
float pct = (float)elapsed / duration;
int travx = (int)((end.x - start.x) * pct);
int travy = (int)((end.y - start.y) * pct);
pos.setLocation(start.x + travx, start.y + tra... | java | public static void computePosition (
Point start, Point end, long elapsed, long duration, Point pos)
{
float pct = (float)elapsed / duration;
int travx = (int)((end.x - start.x) * pct);
int travy = (int)((end.y - start.y) * pct);
pos.setLocation(start.x + travx, start.y + tra... | [
"public",
"static",
"void",
"computePosition",
"(",
"Point",
"start",
",",
"Point",
"end",
",",
"long",
"elapsed",
",",
"long",
"duration",
",",
"Point",
"pos",
")",
"{",
"float",
"pct",
"=",
"(",
"float",
")",
"elapsed",
"/",
"duration",
";",
"int",
"... | Computes the position of an entity along the path defined by the supplied start and end
points assuming that it must finish the path in the specified duration (in millis) and has
been traveling the path for the specified number of elapsed milliseconds. | [
"Computes",
"the",
"position",
"of",
"an",
"entity",
"along",
"the",
"path",
"defined",
"by",
"the",
"supplied",
"start",
"and",
"end",
"points",
"assuming",
"that",
"it",
"must",
"finish",
"the",
"path",
"in",
"the",
"specified",
"duration",
"(",
"in",
"m... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/LinePath.java#L132-L139 | train | Compute the position of a page in a page. | Of course, here is the Java code you requested:
```java
public static void computePosition (
Point start, Point end, long elapsed, long duration, Point pos)
{
float pct = (float)elapsed / duration;
int travx = (int)((end.x - start.x) * pct);
int travy = (int)((end.y - start.y) * pct... |
aws/aws-sdk-java | aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java | AmazonKinesisFirehoseClient.deleteDeliveryStream | @Override
public DeleteDeliveryStreamResult deleteDeliveryStream(DeleteDeliveryStreamRequest request) {
request = beforeClientExecution(request);
return executeDeleteDeliveryStream(request);
} | java | @Override
public DeleteDeliveryStreamResult deleteDeliveryStream(DeleteDeliveryStreamRequest request) {
request = beforeClientExecution(request);
return executeDeleteDeliveryStream(request);
} | [
"@",
"Override",
"public",
"DeleteDeliveryStreamResult",
"deleteDeliveryStream",
"(",
"DeleteDeliveryStreamRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDeleteDeliveryStream",
"(",
"request",
")",
";",
... | <p>
Deletes a delivery stream and its data.
</p>
<p>
You can delete a delivery stream only if it is in <code>ACTIVE</code> or <code>DELETING</code> state, and not in
the <code>CREATING</code> state. While the deletion request is in process, the delivery stream is in the
<code>DELETING</code> state.
</p>
<p>
To check th... | [
"<p",
">",
"Deletes",
"a",
"delivery",
"stream",
"and",
"its",
"data",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"can",
"delete",
"a",
"delivery",
"stream",
"only",
"if",
"it",
"is",
"in",
"<code",
">",
"ACTIVE<",
"/",
"code",
">",
"or",
"<code",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java#L450-L454 | train | Deletes an existing delivery source. | Of course, here is the Java code you requested:
```java
@Override
public DeleteDeliveryStreamResult deleteDeliveryStream(DeleteDeliveryStreamRequest request) {
request = beforeClientExecution(request);
return executeDeleteDeliveryStream(request);
}
```
Hope this helps! |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java | LogicSchemas.renew | @Subscribe
public synchronized void renew(final SchemaAddedEvent schemaAddedEvent) {
logicSchemas.put(schemaAddedEvent.getShardingSchemaName(), createLogicSchema(schemaAddedEvent.getShardingSchemaName(),
Collections.singletonMap(schemaAddedEvent.getShardingSchemaName(), DataSourceConverter.... | java | @Subscribe
public synchronized void renew(final SchemaAddedEvent schemaAddedEvent) {
logicSchemas.put(schemaAddedEvent.getShardingSchemaName(), createLogicSchema(schemaAddedEvent.getShardingSchemaName(),
Collections.singletonMap(schemaAddedEvent.getShardingSchemaName(), DataSourceConverter.... | [
"@",
"Subscribe",
"public",
"synchronized",
"void",
"renew",
"(",
"final",
"SchemaAddedEvent",
"schemaAddedEvent",
")",
"{",
"logicSchemas",
".",
"put",
"(",
"schemaAddedEvent",
".",
"getShardingSchemaName",
"(",
")",
",",
"createLogicSchema",
"(",
"schemaAddedEvent",... | Renew to add new schema.
@param schemaAddedEvent schema add changed event | [
"Renew",
"to",
"add",
"new",
"schema",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java#L160-L165 | train | Renews the logic schema. | Of course, here is the Java code you requested:
```java
@Subscribe
public synchronized void renew(final SchemaAddedEvent schemaAddedEvent) {
logicSchemas.put(schemaAddedEvent.getShardingSchemaName(), createLogicSchema(schemaAddedEvent.getShardingSchemaName(),
Collections.singletonMap(schem... |
apereo/cas | support/cas-server-support-wsfederation-webflow/src/main/java/org/apereo/cas/web/flow/WsFederationAction.java | WsFederationAction.doExecute | @Override
protected Event doExecute(final RequestContext context) {
try {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
val wa = request.getParameter(WA);
if (StringUtils.isNotBlank(wa) && wa.equalsIgnoreCase(WSIGNIN)) {
... | java | @Override
protected Event doExecute(final RequestContext context) {
try {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
val wa = request.getParameter(WA);
if (StringUtils.isNotBlank(wa) && wa.equalsIgnoreCase(WSIGNIN)) {
... | [
"@",
"Override",
"protected",
"Event",
"doExecute",
"(",
"final",
"RequestContext",
"context",
")",
"{",
"try",
"{",
"val",
"request",
"=",
"WebUtils",
".",
"getHttpServletRequestFromExternalWebflowContext",
"(",
"context",
")",
";",
"val",
"wa",
"=",
"request",
... | Executes the webflow action.
@param context the context
@return the event | [
"Executes",
"the",
"webflow",
"action",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-wsfederation-webflow/src/main/java/org/apereo/cas/web/flow/WsFederationAction.java#L51-L65 | train | Override doExecute to validate WA param. | Of course, here is the Java code you requested:
```java
@Override
protected Event doExecute(final RequestContext context) {
try {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
val wa = request.getParameter(WA);
if (StringUtils.isNotBlan... |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-data/src/main/java/com/intuit/ipp/data/ObjectFactory.java | ObjectFactory.createStatus | @XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "Status", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<Status> createStatus(Status value) {
return new JAXBElement<Status>(_Status_QNAME, Status.class, nu... | java | @XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "Status", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<Status> createStatus(Status value) {
return new JAXBElement<Status>(_Status_QNAME, Status.class, nu... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://schema.intuit.com/finance/v3\"",
",",
"name",
"=",
"\"Status\"",
",",
"substitutionHeadNamespace",
"=",
"\"http://schema.intuit.com/finance/v3\"",
",",
"substitutionHeadName",
"=",
"\"IntuitObject\"",
")",
"public",
"JAX... | Create an instance of {@link JAXBElement }{@code <}{@link Status }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Status",
"}",
"{",
"@code",
">",
"}}"
] | 59f988d0776d46620d0b34711c411b2b5b1da06b | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-data/src/main/java/com/intuit/ipp/data/ObjectFactory.java#L1799-L1802 | train | Create an instance of the Status class | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "Status", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<Status> createStatus(Status value) {
retur... |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java | AbstractHistogram.subtract | public void subtract(final AbstractHistogram otherHistogram)
throws ArrayIndexOutOfBoundsException, IllegalArgumentException {
long highestRecordableValue = valueFromIndex(countsArrayLength - 1);
if (highestRecordableValue < otherHistogram.getMaxValue()) {
if (!isAutoResize()) {
... | java | public void subtract(final AbstractHistogram otherHistogram)
throws ArrayIndexOutOfBoundsException, IllegalArgumentException {
long highestRecordableValue = valueFromIndex(countsArrayLength - 1);
if (highestRecordableValue < otherHistogram.getMaxValue()) {
if (!isAutoResize()) {
... | [
"public",
"void",
"subtract",
"(",
"final",
"AbstractHistogram",
"otherHistogram",
")",
"throws",
"ArrayIndexOutOfBoundsException",
",",
"IllegalArgumentException",
"{",
"long",
"highestRecordableValue",
"=",
"valueFromIndex",
"(",
"countsArrayLength",
"-",
"1",
")",
";",... | Subtract the contents of another histogram from this one.
<p>
The start/end timestamps of this histogram will remain unchanged.
@param otherHistogram The other histogram.
@throws ArrayIndexOutOfBoundsException (may throw) if values in otherHistogram's are higher than highestTrackableValue. | [
"Subtract",
"the",
"contents",
"of",
"another",
"histogram",
"from",
"this",
"one",
".",
"<p",
">",
"The",
"start",
"/",
"end",
"timestamps",
"of",
"this",
"histogram",
"will",
"remain",
"unchanged",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java#L635-L684 | train | Subtracts the given histogram from this one. | Of course, here is the Java code you requested:
```java
public void subtract(final AbstractHistogram otherHistogram)
throws ArrayIndexOutOfBoundsException, IllegalArgumentException {
long highestRecordableValue = valueFromIndex(countsArrayLength - 1);
if (highestRecordableValue < otherHisto... |
apache/groovy | src/main/groovy/groovy/lang/MetaMethod.java | MetaMethod.processDoMethodInvokeException | public final RuntimeException processDoMethodInvokeException (Exception e, Object object, Object [] argumentArray) {
// if (e instanceof IllegalArgumentException) {
// //TODO: test if this is OK with new MOP, should be changed!
// // we don't want the exception being unwrapped if it is a Il... | java | public final RuntimeException processDoMethodInvokeException (Exception e, Object object, Object [] argumentArray) {
// if (e instanceof IllegalArgumentException) {
// //TODO: test if this is OK with new MOP, should be changed!
// // we don't want the exception being unwrapped if it is a Il... | [
"public",
"final",
"RuntimeException",
"processDoMethodInvokeException",
"(",
"Exception",
"e",
",",
"Object",
"object",
",",
"Object",
"[",
"]",
"argumentArray",
")",
"{",
"// if (e instanceof IllegalArgumentException) {",
"// //TODO: test if this is OK with ne... | This method is called when an exception occurs while invoking this method. | [
"This",
"method",
"is",
"called",
"when",
"an",
"exception",
"occurs",
"while",
"invoking",
"this",
"method",
"."
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaMethod.java#L291-L310 | train | Process a do method invoke exception. | Of course, here is the Java code you requested:
```java
public final RuntimeException processDoMethodInvokeException (Exception e, Object object, Object [] argumentArray) {
// if (e instanceof IllegalArgumentException) {
// //TODO: test if this is OK with new MOP, should be changed!
// // ... |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/CopyToModule.java | CopyToModule.getCopyToMap | private Map<FileInfo, FileInfo> getCopyToMap() {
final Map<FileInfo, FileInfo> copyToMap = new HashMap<>();
if (forceUnique) {
forceUniqueFilter.copyToMap.forEach((dstFi, srcFi) -> {
job.add(dstFi);
copyToMap.put(dstFi, srcFi);
});
}
... | java | private Map<FileInfo, FileInfo> getCopyToMap() {
final Map<FileInfo, FileInfo> copyToMap = new HashMap<>();
if (forceUnique) {
forceUniqueFilter.copyToMap.forEach((dstFi, srcFi) -> {
job.add(dstFi);
copyToMap.put(dstFi, srcFi);
});
}
... | [
"private",
"Map",
"<",
"FileInfo",
",",
"FileInfo",
">",
"getCopyToMap",
"(",
")",
"{",
"final",
"Map",
"<",
"FileInfo",
",",
"FileInfo",
">",
"copyToMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"forceUnique",
")",
"{",
"forceUniqueFilter... | Get copy-to map based on map processing.
@return target to source map of URIs relative to temporary directory | [
"Get",
"copy",
"-",
"to",
"map",
"based",
"on",
"map",
"processing",
"."
] | ea776b3c60c03d9f033b6f7ea072349e49dbcdd2 | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/CopyToModule.java#L130-L155 | train | Get a copy of the map from the job to the temp directory. | Of course, here is the Java code you requested:
```java
private Map<FileInfo, FileInfo> getCopyToMap() {
final Map<FileInfo, FileInfo> copyToMap = new HashMap<>();
if (forceUnique) {
forceUniqueFilter.copyToMap.forEach((dstFi, srcFi) -> {
job.add(dstFi);
cop... |
savoirtech/hecate | pojo/src/main/java/com/savoirtech/hecate/pojo/binding/def/DefaultPojoBinding.java | DefaultPojoBinding.bindInsert | @Override
public BoundStatement bindInsert(PreparedStatement statement, P pojo, int ttl) {
List<Object> parameters = new LinkedList<>();
keyBinding.collectParameters(pojo, parameters);
facetBindings.forEach(facetBinding -> facetBinding.collectParameters(pojo, parameters));
parameters... | java | @Override
public BoundStatement bindInsert(PreparedStatement statement, P pojo, int ttl) {
List<Object> parameters = new LinkedList<>();
keyBinding.collectParameters(pojo, parameters);
facetBindings.forEach(facetBinding -> facetBinding.collectParameters(pojo, parameters));
parameters... | [
"@",
"Override",
"public",
"BoundStatement",
"bindInsert",
"(",
"PreparedStatement",
"statement",
",",
"P",
"pojo",
",",
"int",
"ttl",
")",
"{",
"List",
"<",
"Object",
">",
"parameters",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"keyBinding",
".",
"co... | ---------------------------------------------------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------------------------------------------------"
] | 74e6fd15805fb441f0b5af00ccf963385fbfdee6 | https://github.com/savoirtech/hecate/blob/74e6fd15805fb441f0b5af00ccf963385fbfdee6/pojo/src/main/java/com/savoirtech/hecate/pojo/binding/def/DefaultPojoBinding.java#L72-L79 | train | Binds the given POJO to the given statement. | Of course, here is the Java code you requested:
```java
@Override
public BoundStatement bindInsert(PreparedStatement statement, P pojo, int ttl) {
List<Object> parameters = new LinkedList<>();
keyBinding.collectParameters(pojo, parameters);
facetBindings.forEach(facetBinding -> facetBinding... |
buschmais/jqa-maven-plugin | src/main/java/com/buschmais/jqassistant/scm/maven/provider/CachingStoreProvider.java | CachingStoreProvider.close | private void close(Store store) {
StoreKey key = keysByStore.get(store);
LOGGER.info("Closing store in directory '" + key.getUri() + "'.");
store.stop();
} | java | private void close(Store store) {
StoreKey key = keysByStore.get(store);
LOGGER.info("Closing store in directory '" + key.getUri() + "'.");
store.stop();
} | [
"private",
"void",
"close",
"(",
"Store",
"store",
")",
"{",
"StoreKey",
"key",
"=",
"keysByStore",
".",
"get",
"(",
"store",
")",
";",
"LOGGER",
".",
"info",
"(",
"\"Closing store in directory '\"",
"+",
"key",
".",
"getUri",
"(",
")",
"+",
"\"'.\"",
")... | Close the given store.
@param store The store. | [
"Close",
"the",
"given",
"store",
"."
] | 5c21a8058fc1b013333081907fbf00d3525e11c3 | https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/provider/CachingStoreProvider.java#L90-L94 | train | Close the store. | Of course, here is the Java code you requested:
```java
private void close(Store store) {
StoreKey key = keysByStore.get(store);
LOGGER.info("Closing store in directory '" + key.getUri() + "'.");
store.stop();
}
```
Hope this helps! |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/sse/impl/SseEventReaderImpl.java | SseEventReaderImpl.readData | @SuppressWarnings("unused")
private CharSequence readData() throws IOException {
if (!_eventSource.isConnected()) {
String s = "Can't read using the MessageReader if the event " +
"source is not connected";
throw new SseException(s);
}
synchron... | java | @SuppressWarnings("unused")
private CharSequence readData() throws IOException {
if (!_eventSource.isConnected()) {
String s = "Can't read using the MessageReader if the event " +
"source is not connected";
throw new SseException(s);
}
synchron... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"CharSequence",
"readData",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"_eventSource",
".",
"isConnected",
"(",
")",
")",
"{",
"String",
"s",
"=",
"\"Can't read using the MessageReader if the... | Returns the payload of the event. Use this method to retrieve the
payload only if the event's type is {@link SseEventType.DATA}.
<p>
If this method is invoked AFTER {@link #next()} method, then it will not
block. If this method is invoked before {@link #next()} method, then it
will block till a message is received. If ... | [
"Returns",
"the",
"payload",
"of",
"the",
"event",
".",
"Use",
"this",
"method",
"to",
"retrieve",
"the",
"payload",
"only",
"if",
"the",
"event",
"s",
"type",
"is",
"{"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/sse/impl/SseEventReaderImpl.java#L154-L198 | train | readData - Reads the data from the event source. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unused")
private CharSequence readData() throws IOException {
if (!_eventSource.isConnected()) {
String s = "Can't read using the MessageReader if the event " +
"source is not connected";
... |
square/picasso | picasso/src/main/java/com/squareup/picasso3/RequestCreator.java | RequestCreator.into | public void into(@NonNull BitmapTarget target) {
long started = System.nanoTime();
checkMain();
if (target == null) {
throw new IllegalArgumentException("Target must not be null.");
}
if (deferred) {
throw new IllegalStateException("Fit cannot be used with a Target.");
}
if (!d... | java | public void into(@NonNull BitmapTarget target) {
long started = System.nanoTime();
checkMain();
if (target == null) {
throw new IllegalArgumentException("Target must not be null.");
}
if (deferred) {
throw new IllegalStateException("Fit cannot be used with a Target.");
}
if (!d... | [
"public",
"void",
"into",
"(",
"@",
"NonNull",
"BitmapTarget",
"target",
")",
"{",
"long",
"started",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"checkMain",
"(",
")",
";",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgume... | Asynchronously fulfills the request into the specified {@link BitmapTarget}. In most cases, you
should use this when you are dealing with a custom {@link android.view.View View} or view
holder which should implement the {@link BitmapTarget} interface.
<p>
Implementing on a {@link android.view.View View}:
<blockquote><p... | [
"Asynchronously",
"fulfills",
"the",
"request",
"into",
"the",
"specified",
"{",
"@link",
"BitmapTarget",
"}",
".",
"In",
"most",
"cases",
"you",
"should",
"use",
"this",
"when",
"you",
"are",
"dealing",
"with",
"a",
"custom",
"{",
"@link",
"android",
".",
... | 89f55b76e3be2b65e5997b7698f782f16f8547e3 | https://github.com/square/picasso/blob/89f55b76e3be2b65e5997b7698f782f16f8547e3/picasso/src/main/java/com/squareup/picasso3/RequestCreator.java#L524-L556 | train | Converts the image into the target. | Of course, here is the Java code you requested:
```java
public void into(@NonNull BitmapTarget target) {
long started = System.nanoTime();
checkMain();
if (target == null) {
throw new IllegalArgumentException("Target must not be null.");
}
if (deferred) {
throw new IllegalStateExceptio... |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java | BandedLinearAligner.align | public static Alignment<NucleotideSequence> align(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int offset2, int length2, int width) {
try {
MutationsBuilder<NucleotideSequence> mut... | java | public static Alignment<NucleotideSequence> align(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int offset2, int length2, int width) {
try {
MutationsBuilder<NucleotideSequence> mut... | [
"public",
"static",
"Alignment",
"<",
"NucleotideSequence",
">",
"align",
"(",
"LinearGapAlignmentScoring",
"scoring",
",",
"NucleotideSequence",
"seq1",
",",
"NucleotideSequence",
"seq2",
",",
"int",
"offset1",
",",
"int",
"length1",
",",
"int",
"offset2",
",",
"... | Classical Banded Alignment
<p/>
<p>Both sequences must be highly similar</p> <p>Align 2 sequence completely (i.e. while first sequence will be
aligned against whole second sequence)</p>
@param scoring scoring system
@param seq1 first sequence
@param seq2 second sequence
@param offset1 offset in first sequence
@p... | [
"Classical",
"Banded",
"Alignment",
"<p",
"/",
">",
"<p",
">",
"Both",
"sequences",
"must",
"be",
"highly",
"similar<",
"/",
"p",
">",
"<p",
">",
"Align",
"2",
"sequence",
"completely",
"(",
"i",
".",
"e",
".",
"while",
"first",
"sequence",
"will",
"be... | 2349b3dccdd3c7948643760e570238d6e30d5a34 | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java#L564-L575 | train | Aligns two nucleotides using LinearGapAlignmentScoring. | Of course, here is the Java code you requested:
```java
public static Alignment<NucleotideSequence> align(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int offset2, int length2, int width) {
t... |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.getUniqueConstraintForExprs | Constraint getUniqueConstraintForExprs(Expression[] indexExprs) {
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint exprc = constraintList[i];
if (exprc.isUniqueWithExprs(indexExprs)) {
return exprc;
}
}
return null;
... | java | Constraint getUniqueConstraintForExprs(Expression[] indexExprs) {
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint exprc = constraintList[i];
if (exprc.isUniqueWithExprs(indexExprs)) {
return exprc;
}
}
return null;
... | [
"Constraint",
"getUniqueConstraintForExprs",
"(",
"Expression",
"[",
"]",
"indexExprs",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"constraintList",
".",
"length",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"Constraint",
"exprc",... | Returns the UNIQUE constraint with the given expression signature -- a VoltDB extension. | [
"Returns",
"the",
"UNIQUE",
"constraint",
"with",
"the",
"given",
"expression",
"signature",
"--",
"a",
"VoltDB",
"extension",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L2644-L2653 | train | Get the UniqueConstraint for the given indexExprs. | Of course, here is the Java code you requested:
```java
Constraint getUniqueConstraintForExprs(Expression[] indexExprs) {
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint exprc = constraintList[i];
if (exprc.isUniqueWithExprs(indexExprs)) {
retu... |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.addLibrary | public static void addLibrary(final JobID jobID, final Path name, final long size, final DataInput in)
throws IOException {
final LibraryCacheManager lib = get();
lib.addLibraryInternal(jobID, name, size, in);
} | java | public static void addLibrary(final JobID jobID, final Path name, final long size, final DataInput in)
throws IOException {
final LibraryCacheManager lib = get();
lib.addLibraryInternal(jobID, name, size, in);
} | [
"public",
"static",
"void",
"addLibrary",
"(",
"final",
"JobID",
"jobID",
",",
"final",
"Path",
"name",
",",
"final",
"long",
"size",
",",
"final",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"final",
"LibraryCacheManager",
"lib",
"=",
"get",
"(",
... | Reads a library from the given input stream and adds it to the local library cache. The cache name of
the library is determined by the checksum of the received data and cannot be specified manually.
@param jobID
the ID of the job the library data belongs to
@param name
the name of the library at the clients host
@para... | [
"Reads",
"a",
"library",
"from",
"the",
"given",
"input",
"stream",
"and",
"adds",
"it",
"to",
"the",
"local",
"library",
"cache",
".",
"The",
"cache",
"name",
"of",
"the",
"library",
"is",
"determined",
"by",
"the",
"checksum",
"of",
"the",
"received",
... | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L614-L619 | train | Add a library to the cache. | Of course, here is the Java code you requested:
```java
public static void addLibrary(final JobID jobID, final Path name, final long size, final DataInput in)
throws IOException {
final LibraryCacheManager lib = get();
lib.addLibraryInternal(jobID, name, size, in);
}
```
Hope this helps! |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcStructuralLoadGroupImpl.java | IfcStructuralLoadGroupImpl.getLoadGroupFor | @SuppressWarnings("unchecked")
public EList<IfcStructuralAnalysisModel> getLoadGroupFor() {
return (EList<IfcStructuralAnalysisModel>) eGet(
Ifc2x3tc1Package.Literals.IFC_STRUCTURAL_LOAD_GROUP__LOAD_GROUP_FOR, true);
} | java | @SuppressWarnings("unchecked")
public EList<IfcStructuralAnalysisModel> getLoadGroupFor() {
return (EList<IfcStructuralAnalysisModel>) eGet(
Ifc2x3tc1Package.Literals.IFC_STRUCTURAL_LOAD_GROUP__LOAD_GROUP_FOR, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"EList",
"<",
"IfcStructuralAnalysisModel",
">",
"getLoadGroupFor",
"(",
")",
"{",
"return",
"(",
"EList",
"<",
"IfcStructuralAnalysisModel",
">",
")",
"eGet",
"(",
"Ifc2x3tc1Package",
".",
"Literals",
... | <!-- 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/IfcStructuralLoadGroupImpl.java#L282-L286 | train | Gets the named LoadGroup for. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public EList<IfcStructuralAnalysisModel> getLoadGroupFor() {
return (EList<IfcStructuralAnalysisModel>) eGet(
Ifc2x3tc1Package.Literals.IFC_STRUCTURAL_LOAD_GROUP__LOAD_GROUP_FOR, true);
}
```
Hope this helps! |
ReactiveX/RxJavaFX | src/main/java/io/reactivex/rxjavafx/observers/ObservableListenerHelper.java | ObservableListenerHelper.removeListener | @Override
public void removeListener(InvalidationListener listener) {
Objects.requireNonNull(listener);
if (0 < invalidationSize) {
if (size == 1) {
if (invalidationSize == 1 && this.listener.equals(listener)) {
sentinel = false;
this.listener = null;
invalidationSize--;
size--;
}
... | java | @Override
public void removeListener(InvalidationListener listener) {
Objects.requireNonNull(listener);
if (0 < invalidationSize) {
if (size == 1) {
if (invalidationSize == 1 && this.listener.equals(listener)) {
sentinel = false;
this.listener = null;
invalidationSize--;
size--;
}
... | [
"@",
"Override",
"public",
"void",
"removeListener",
"(",
"InvalidationListener",
"listener",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"listener",
")",
";",
"if",
"(",
"0",
"<",
"invalidationSize",
")",
"{",
"if",
"(",
"size",
"==",
"1",
")",
"{",
... | {@inheritDoc} | [
"{"
] | 8f44d4cc1caba9a8919f01cb1897aaea5514c7e5 | https://github.com/ReactiveX/RxJavaFX/blob/8f44d4cc1caba9a8919f01cb1897aaea5514c7e5/src/main/java/io/reactivex/rxjavafx/observers/ObservableListenerHelper.java#L56-L102 | train | Removes the listener. | Of course, here is the Java code you requested:
```java
@Override
public void removeListener(InvalidationListener listener) {
Objects.requireNonNull(listener);
if (0 < invalidationSize) {
if (size == 1) {
if (invalidationSize == 1 && this.listener.equals(listener)) {
sentinel = false;
this.listen... |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushUserPreferences.java | WonderPushUserPreferences.setChannelGroups | public static synchronized void setChannelGroups(Collection<WonderPushChannelGroup> channelGroups) {
if (channelGroups == null) return;
boolean save = false;
try {
Set<String> groupIdsToRemove = new HashSet<>(sChannelGroups.keySet());
for (WonderPushChannelGroup channelGr... | java | public static synchronized void setChannelGroups(Collection<WonderPushChannelGroup> channelGroups) {
if (channelGroups == null) return;
boolean save = false;
try {
Set<String> groupIdsToRemove = new HashSet<>(sChannelGroups.keySet());
for (WonderPushChannelGroup channelGr... | [
"public",
"static",
"synchronized",
"void",
"setChannelGroups",
"(",
"Collection",
"<",
"WonderPushChannelGroup",
">",
"channelGroups",
")",
"{",
"if",
"(",
"channelGroups",
"==",
"null",
")",
"return",
";",
"boolean",
"save",
"=",
"false",
";",
"try",
"{",
"S... | Create, update and remove channel existing groups to match the given channel groups.
<p>Creates, updates and removes channel groups both in this class registry and in Android.</p>
<p>Any non listed, previously existing channel group will be removed.</p>
@param channelGroups The channel groups to create or update.
An... | [
"Create",
"update",
"and",
"remove",
"channel",
"existing",
"groups",
"to",
"match",
"the",
"given",
"channel",
"groups",
"."
] | ba0a1568f705cdd6206639bfab1e5cf529084b59 | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushUserPreferences.java#L344-L368 | train | Set the channel groups. | Of course, here is the Java code you requested:
```java
public static synchronized void setChannelGroups(Collection<WonderPushChannelGroup> channelGroups) {
if (channelGroups == null) return;
boolean save = false;
try {
Set<String> groupIdsToRemove = new HashSet<>(sChannelGroups.key... |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java | BindM2MBuilder.generateEntity | private void generateEntity(M2MEntity entity) {
entity.propertyPrimaryKey = TypeName.LONG;
entity.propertyKey1 = findPrimaryKeyFieldType(entity.entity1Name.toString());
entity.propertyKey2 = findPrimaryKeyFieldType(entity.entity2Name.toString());
if (!entity.needToCreate) {
return;
}
String tableName = ... | java | private void generateEntity(M2MEntity entity) {
entity.propertyPrimaryKey = TypeName.LONG;
entity.propertyKey1 = findPrimaryKeyFieldType(entity.entity1Name.toString());
entity.propertyKey2 = findPrimaryKeyFieldType(entity.entity2Name.toString());
if (!entity.needToCreate) {
return;
}
String tableName = ... | [
"private",
"void",
"generateEntity",
"(",
"M2MEntity",
"entity",
")",
"{",
"entity",
".",
"propertyPrimaryKey",
"=",
"TypeName",
".",
"LONG",
";",
"entity",
".",
"propertyKey1",
"=",
"findPrimaryKeyFieldType",
"(",
"entity",
".",
"entity1Name",
".",
"toString",
... | Generate entity.
@param entity
the entity
@return
@throws IOException
Signals that an I/O exception has occurred. | [
"Generate",
"entity",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L438-L591 | train | generate entity. | Of course, here is the Java code you requested:
```java
private void generateEntity(M2MEntity entity) {
entity.propertyPrimaryKey = TypeName.LONG;
entity.propertyKey1 = findPrimaryKeyFieldType(entity.entity1Name.toString());
entity.propertyKey2 = findPrimaryKeyFieldType(entity.entity2Name.toString());
if (!ent... |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.set | public static void set(MutableIntTuple t, int v)
{
for (int i=0; i<t.getSize(); i++)
{
t.set(i, v);
}
} | java | public static void set(MutableIntTuple t, int v)
{
for (int i=0; i<t.getSize(); i++)
{
t.set(i, v);
}
} | [
"public",
"static",
"void",
"set",
"(",
"MutableIntTuple",
"t",
",",
"int",
"v",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"t",
".",
"getSize",
"(",
")",
";",
"i",
"++",
")",
"{",
"t",
".",
"set",
"(",
"i",
",",
"v",
")",
... | Set all elements of the given tuple to the given value
@param t The tuple
@param v The value | [
"Set",
"all",
"elements",
"of",
"the",
"given",
"tuple",
"to",
"the",
"given",
"value"
] | bcb655aaf5fc88af6194f73a27cca079186ff559 | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L352-L358 | train | Sets the contents of the MutableIntTuple to the given value. | Of course, here is the Java code you requested:
```java
public static void set(MutableIntTuple t, int v)
{
for (int i=0; i<t.getSize(); i++)
{
t.set(i, v);
}
}
```
Hope this helps! |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.createInstance | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();
break;
case COMPOSITES:
... | java | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();
break;
case COMPOSITES:
... | [
"public",
"static",
"SecondaryIndex",
"createInstance",
"(",
"ColumnFamilyStore",
"baseCfs",
",",
"ColumnDefinition",
"cdef",
")",
"throws",
"ConfigurationException",
"{",
"SecondaryIndex",
"index",
";",
"switch",
"(",
"cdef",
".",
"getIndexType",
"(",
")",
")",
"{"... | This is the primary way to create a secondary index instance for a CF column.
It will validate the index_options before initializing.
@param baseCfs the source of data for the Index
@param cdef the meta information about this column (index_type, index_options, name, etc...)
@return The secondary index instance for th... | [
"This",
"is",
"the",
"primary",
"way",
"to",
"create",
"a",
"secondary",
"index",
"instance",
"for",
"a",
"CF",
"column",
".",
"It",
"will",
"validate",
"the",
"index_options",
"before",
"initializing",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L322-L356 | train | Creates a secondary index instance. | Of course, here is the Java code you requested:
```java
public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();... |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/view/DynamicFlipper.java | DynamicFlipper.onTouchEvent | @Override
public boolean onTouchEvent(MotionEvent ev) {
if (null != mGestureDetector) {
return mGestureDetector.onTouchEvent(ev);
} else {
return super.onTouchEvent(ev);
}
} | java | @Override
public boolean onTouchEvent(MotionEvent ev) {
if (null != mGestureDetector) {
return mGestureDetector.onTouchEvent(ev);
} else {
return super.onTouchEvent(ev);
}
} | [
"@",
"Override",
"public",
"boolean",
"onTouchEvent",
"(",
"MotionEvent",
"ev",
")",
"{",
"if",
"(",
"null",
"!=",
"mGestureDetector",
")",
"{",
"return",
"mGestureDetector",
".",
"onTouchEvent",
"(",
"ev",
")",
";",
"}",
"else",
"{",
"return",
"super",
".... | } | [
"}"
] | e4d6cf3e3f60e5efb5a75672607ded94d1725519 | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/view/DynamicFlipper.java#L89-L96 | train | Override onTouchEvent to call the appropriate GestureDetector. | Of course, here is the Java code you requested:
```java
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (null != mGestureDetector) {
return mGestureDetector.onTouchEvent(ev);
} else {
return super.onTouchEvent(ev);
}
}
```
Hope this helps! |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java | RegistriesInner.regenerateCredentials | public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) {
return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
} | java | public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) {
return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
} | [
"public",
"RegistryCredentialsInner",
"regenerateCredentials",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
")",
"{",
"return",
"regenerateCredentialsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")",
".",
"toBlocking",
"(",
... | Regenerates the administrator login credentials for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@throw... | [
"Regenerates",
"the",
"administrator",
"login",
"credentials",
"for",
"the",
"specified",
"container",
"registry",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java#L877-L879 | train | Regenerate access to a container registry. | Of course, here is the Java code you requested:
```java
public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) {
return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
}
```
Hope this helps! |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.replaceMultipleTo | public static void replaceMultipleTo (@Nullable final String sInputString,
@Nonnull final char [] aSearchChars,
final char cReplacementChar,
@Nonnull final StringBuilder aTarget)
{
ValueEnforcer... | java | public static void replaceMultipleTo (@Nullable final String sInputString,
@Nonnull final char [] aSearchChars,
final char cReplacementChar,
@Nonnull final StringBuilder aTarget)
{
ValueEnforcer... | [
"public",
"static",
"void",
"replaceMultipleTo",
"(",
"@",
"Nullable",
"final",
"String",
"sInputString",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aSearchChars",
",",
"final",
"char",
"cReplacementChar",
",",
"@",
"Nonnull",
"final",
"StringBuilder",
"aT... | Optimized replace method that replaces a set of characters with another
character. This method was created for efficient unsafe character
replacements!
@param sInputString
The input string.
@param aSearchChars
The characters to replace.
@param cReplacementChar
The new char to be used instead of the search chars.
@para... | [
"Optimized",
"replace",
"method",
"that",
"replaces",
"a",
"set",
"of",
"characters",
"with",
"another",
"character",
".",
"This",
"method",
"was",
"created",
"for",
"efficient",
"unsafe",
"character",
"replacements!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4218-L4246 | train | Replace multiple to. | Of course, here is the Java code you requested:
```java
public static void replaceMultipleTo (@Nullable final String sInputString,
@Nonnull final char [] aSearchChars,
final char cReplacementChar,
@N... |
hal/core | gui/src/main/java/org/useware/kernel/gui/behaviour/DialogState.java | DialogState.flushChildScopes | public void flushChildScopes(QName unitId) {
Set<Integer> childScopes = findChildScopes(unitId);
for(Integer scopeId : childScopes)
{
MutableContext mutableContext = statementContexts.get(scopeId);
mutableContext.clearStatements();
}
} | java | public void flushChildScopes(QName unitId) {
Set<Integer> childScopes = findChildScopes(unitId);
for(Integer scopeId : childScopes)
{
MutableContext mutableContext = statementContexts.get(scopeId);
mutableContext.clearStatements();
}
} | [
"public",
"void",
"flushChildScopes",
"(",
"QName",
"unitId",
")",
"{",
"Set",
"<",
"Integer",
">",
"childScopes",
"=",
"findChildScopes",
"(",
"unitId",
")",
";",
"for",
"(",
"Integer",
"scopeId",
":",
"childScopes",
")",
"{",
"MutableContext",
"mutableContex... | Flush the scope of unit and all children.
@param unitId | [
"Flush",
"the",
"scope",
"of",
"unit",
"and",
"all",
"children",
"."
] | d6d03f0bb128dc0470f5dc75fdb1ea1014400602 | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/useware/kernel/gui/behaviour/DialogState.java#L115-L122 | train | Flush all child scopes of a unit. | Of course, here is the Java code you requested:
```java
public void flushChildScopes(QName unitId) {
Set<Integer> childScopes = findChildScopes(unitId);
for(Integer scopeId : childScopes)
{
MutableContext mutableContext = statementContexts.get(scopeId);
mutableContext.cl... |
riversun/d6 | src/main/java/org/riversun/d6/core/D6Crud.java | D6Crud.execInsert | public boolean execInsert(D6Model[] modelObjects, D6Inex includeExcludeColumnNames) {
boolean ignoreDuplicate = false;
return execInsert(modelObjects, includeExcludeColumnNames, ignoreDuplicate);
} | java | public boolean execInsert(D6Model[] modelObjects, D6Inex includeExcludeColumnNames) {
boolean ignoreDuplicate = false;
return execInsert(modelObjects, includeExcludeColumnNames, ignoreDuplicate);
} | [
"public",
"boolean",
"execInsert",
"(",
"D6Model",
"[",
"]",
"modelObjects",
",",
"D6Inex",
"includeExcludeColumnNames",
")",
"{",
"boolean",
"ignoreDuplicate",
"=",
"false",
";",
"return",
"execInsert",
"(",
"modelObjects",
",",
"includeExcludeColumnNames",
",",
"i... | Insert the specified model object into the DB
@param modelObjects
@param includeExcludeColumnNames
You can select either 'the column name you want to reflected
in the database' AND 'the column name you don't want to
reflect in the database'. When omitted (null specified)
,reflects all properties in the model class has... | [
"Insert",
"the",
"specified",
"model",
"object",
"into",
"the",
"DB"
] | 2798bd876b9380dbfea8182d11ad306cb1b0e114 | https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/D6Crud.java#L507-L510 | train | Insert a sequence of D6Models into the database. | Of course, here is the Java code you requested:
```java
public boolean execInsert(D6Model[] modelObjects, D6Inex includeExcludeColumnNames) {
boolean ignoreDuplicate = false;
return execInsert(modelObjects, includeExcludeColumnNames, ignoreDuplicate);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java | ConfigurationItem.setRelatedEvents | public void setRelatedEvents(java.util.Collection<String> relatedEvents) {
if (relatedEvents == null) {
this.relatedEvents = null;
return;
}
this.relatedEvents = new com.amazonaws.internal.SdkInternalList<String>(relatedEvents);
} | java | public void setRelatedEvents(java.util.Collection<String> relatedEvents) {
if (relatedEvents == null) {
this.relatedEvents = null;
return;
}
this.relatedEvents = new com.amazonaws.internal.SdkInternalList<String>(relatedEvents);
} | [
"public",
"void",
"setRelatedEvents",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"relatedEvents",
")",
"{",
"if",
"(",
"relatedEvents",
"==",
"null",
")",
"{",
"this",
".",
"relatedEvents",
"=",
"null",
";",
"return",
";",
"}",
"thi... | <p>
A list of CloudTrail event IDs.
</p>
<p>
A populated field indicates that the current configuration was initiated by the events recorded in the CloudTrail
log. For more information about CloudTrail, see <a
href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html">What Is A... | [
"<p",
">",
"A",
"list",
"of",
"CloudTrail",
"event",
"IDs",
".",
"<",
"/",
"p",
">",
"<p",
">",
"A",
"populated",
"field",
"indicates",
"that",
"the",
"current",
"configuration",
"was",
"initiated",
"by",
"the",
"events",
"recorded",
"in",
"the",
"CloudT... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java#L880-L887 | train | Sets the value of the relatedEvents property. | Of course, here is the Java code you requested:
```java
public void setRelatedEvents(java.util.Collection<String> relatedEvents) {
if (relatedEvents == null) {
this.relatedEvents = null;
return;
}
this.relatedEvents = new com.amazonaws.internal.SdkInternalList<String>(r... |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.sort1 | private static void sort1(Quicksortable q, int off, int k, int len) {
// we don't care about anything >= to k
if (off >= k)
return;
// Insertion sort on smallest arrays
if (len < 7) {
for (int i = off; i < len + off; i++)
for (int j = i; j > off &&... | java | private static void sort1(Quicksortable q, int off, int k, int len) {
// we don't care about anything >= to k
if (off >= k)
return;
// Insertion sort on smallest arrays
if (len < 7) {
for (int i = off; i < len + off; i++)
for (int j = i; j > off &&... | [
"private",
"static",
"void",
"sort1",
"(",
"Quicksortable",
"q",
",",
"int",
"off",
",",
"int",
"k",
",",
"int",
"len",
")",
"{",
"// we don't care about anything >= to k",
"if",
"(",
"off",
">=",
"k",
")",
"return",
";",
"// Insertion sort on smallest arrays",
... | Sorts the specified sub-array of integers into ascending order.
@param q The quicksortable to sort.
@param off The offset to start at.
@param k The length of q.
@param len The number of elements to sort. | [
"Sorts",
"the",
"specified",
"sub",
"-",
"array",
"of",
"integers",
"into",
"ascending",
"order",
"."
] | 332008426cf14b57e7fc3e817d9423e3f84fb922 | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L151-L211 | train | sort1 Method. | Of course, here is the Java code you requested:
```java
private static void sort1(Quicksortable q, int off, int k, int len) {
// we don't care about anything >= to k
if (off >= k)
return;
// Insertion sort on smallest arrays
if (len < 7) {
for (int i = off; i < l... |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/AwsHostNameUtils.java | AwsHostNameUtils.parseRegionName | @Deprecated
public static String parseRegionName(final String host,
final String serviceHint) {
String region = parseRegion(host, serviceHint);
// If region is null, then endpoint is totally non-standard;
// guess us-east-1 for lack of a better optio... | java | @Deprecated
public static String parseRegionName(final String host,
final String serviceHint) {
String region = parseRegion(host, serviceHint);
// If region is null, then endpoint is totally non-standard;
// guess us-east-1 for lack of a better optio... | [
"@",
"Deprecated",
"public",
"static",
"String",
"parseRegionName",
"(",
"final",
"String",
"host",
",",
"final",
"String",
"serviceHint",
")",
"{",
"String",
"region",
"=",
"parseRegion",
"(",
"host",
",",
"serviceHint",
")",
";",
"// If region is null, then endp... | Attempts to parse the region name from an endpoint based on conventions
about the endpoint format.
@param host the hostname to parse
@param serviceHint an optional hint about the service for the endpoint
@return the region parsed from the hostname, or
"us-east-1" if no region information... | [
"Attempts",
"to",
"parse",
"the",
"region",
"name",
"from",
"an",
"endpoint",
"based",
"on",
"conventions",
"about",
"the",
"endpoint",
"format",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/AwsHostNameUtils.java#L56-L64 | train | Parse region name from host and service hint. | Of course, here is the Java code you requested:
```java
@Deprecated
public static String parseRegionName(final String host,
final String serviceHint) {
String region = parseRegion(host, serviceHint);
// If region is null, then endpoint is totally non-standa... |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.getRealDeptId | private static String getRealDeptId(String deptId){
int start=deptId.indexOf("[");
String realKey=deptId;
if(start>0){
realKey=deptId.substring(0,start);
}
return realKey;
} | java | private static String getRealDeptId(String deptId){
int start=deptId.indexOf("[");
String realKey=deptId;
if(start>0){
realKey=deptId.substring(0,start);
}
return realKey;
} | [
"private",
"static",
"String",
"getRealDeptId",
"(",
"String",
"deptId",
")",
"{",
"int",
"start",
"=",
"deptId",
".",
"indexOf",
"(",
"\"[\"",
")",
";",
"String",
"realKey",
"=",
"deptId",
";",
"if",
"(",
"start",
">",
"0",
")",
"{",
"realKey",
"=",
... | 获取非index的路径 | [
"获取非index的路径"
] | f1cb420a092f8ba94317519ede739974decb5617 | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L2941-L2948 | train | Gets the real deptId. | Of course, here is the Java code you requested:
```java
private static String getRealDeptId(String deptId){
int start=deptId.indexOf("[");
String realKey=deptId;
if(start>0){
realKey=deptId.substring(0,start);
}
return realKey;
}
```
Hope this helps! |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/cpool/Utf8Constant.java | Utf8Constant.write | void write(ByteCodeWriter out)
throws IOException
{
out.write(ConstantPool.CP_UTF8);
out.writeUTF8(_value);
} | java | void write(ByteCodeWriter out)
throws IOException
{
out.write(ConstantPool.CP_UTF8);
out.writeUTF8(_value);
} | [
"void",
"write",
"(",
"ByteCodeWriter",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"ConstantPool",
".",
"CP_UTF8",
")",
";",
"out",
".",
"writeUTF8",
"(",
"_value",
")",
";",
"}"
] | Writes the contents of the pool entry. | [
"Writes",
"the",
"contents",
"of",
"the",
"pool",
"entry",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/cpool/Utf8Constant.java#L73-L78 | train | Write the content of this object to the specified output stream. | Of course, here is the Java code you requested:
```java
void write(ByteCodeWriter out)
throws IOException
{
out.write(ConstantPool.CP_UTF8);
out.writeUTF8(_value);
}
```
Hope this helps! |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XSynchronizedExpression | protected void sequence_XSynchronizedExpression(ISerializationContext context, XSynchronizedExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XSYNCHRONIZED_EXPRESSION__PARAM) == ValueTransient.YES)
errorAcceptor.accept(diagnosti... | java | protected void sequence_XSynchronizedExpression(ISerializationContext context, XSynchronizedExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XSYNCHRONIZED_EXPRESSION__PARAM) == ValueTransient.YES)
errorAcceptor.accept(diagnosti... | [
"protected",
"void",
"sequence_XSynchronizedExpression",
"(",
"ISerializationContext",
"context",
",",
"XSynchronizedExpression",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
... | Contexts:
XExpression returns XSynchronizedExpression
XAssignment returns XSynchronizedExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XSynchronizedExpression
XOrExpression returns XSynchronizedExpression
XOrExpression.XBinaryOperation_1_0_0_0 returns XSynchronizedExpression
XAndExpression returns XSynchroniz... | [
"Contexts",
":",
"XExpression",
"returns",
"XSynchronizedExpression",
"XAssignment",
"returns",
"XSynchronizedExpression",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XSynchronizedExpression",
"XOrExpression",
"returns",
"XSynchronizedExpression",
"XOrExpression",
... | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1566-L1577 | train | Sequence the given XSynchronizedExpression. | Of course, here is the Java code you requested:
```java
protected void sequence_XSynchronizedExpression(ISerializationContext context, XSynchronizedExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XSYNCHRONIZED_EXPRESSION__PARAM) ... |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/token/grant/redirect/AbstractRedirectResourceDetails.java | AbstractRedirectResourceDetails.getRedirectUri | public String getRedirectUri(AccessTokenRequest request) {
String redirectUri = request.getFirst("redirect_uri");
if (redirectUri == null && request.getCurrentUri() != null && useCurrentUri) {
redirectUri = request.getCurrentUri();
}
if (redirectUri == null && getPreEstablishedRedirectUri() != null) {
... | java | public String getRedirectUri(AccessTokenRequest request) {
String redirectUri = request.getFirst("redirect_uri");
if (redirectUri == null && request.getCurrentUri() != null && useCurrentUri) {
redirectUri = request.getCurrentUri();
}
if (redirectUri == null && getPreEstablishedRedirectUri() != null) {
... | [
"public",
"String",
"getRedirectUri",
"(",
"AccessTokenRequest",
"request",
")",
"{",
"String",
"redirectUri",
"=",
"request",
".",
"getFirst",
"(",
"\"redirect_uri\"",
")",
";",
"if",
"(",
"redirectUri",
"==",
"null",
"&&",
"request",
".",
"getCurrentUri",
"(",... | Extract a redirect uri from the resource and/or the current request.
@param request the current {@link DefaultAccessTokenRequest}
@return a redirect uri if one can be established | [
"Extract",
"a",
"redirect",
"uri",
"from",
"the",
"resource",
"and",
"/",
"or",
"the",
"current",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/token/grant/redirect/AbstractRedirectResourceDetails.java#L82-L97 | train | Get the redirect uri from the request. | Of course, here is the Java code you requested:
```java
public String getRedirectUri(AccessTokenRequest request) {
String redirectUri = request.getFirst("redirect_uri");
if (redirectUri == null && request.getCurrentUri() != null && useCurrentUri) {
redirectUri = request.getCurrentUri();
}
if (redirectUri... |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/SetContext.java | SetContext.remove | public boolean remove(Set<?> set, Object object) {
if (set == null || object == null) {
return false;
}
return set.remove(object);
} | java | public boolean remove(Set<?> set, Object object) {
if (set == null || object == null) {
return false;
}
return set.remove(object);
} | [
"public",
"boolean",
"remove",
"(",
"Set",
"<",
"?",
">",
"set",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"set",
"==",
"null",
"||",
"object",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"set",
".",
"remove",
"(",
"object",
... | Remove the given object from the given set.
@param set The set to remove from
@param object The object to remove
@return <code>true</code> if the object was removed and contained in the
set, <code>false</code> otherwise
@see Set#remove(Object) | [
"Remove",
"the",
"given",
"object",
"from",
"the",
"given",
"set",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/SetContext.java#L130-L136 | train | Removes the specified object from the specified set. | Of course, here is the Java code you requested:
```java
public boolean remove(Set<?> set, Object object) {
if (set == null || object == null) {
return false;
}
return set.remove(object);
}
```
Hope this helps! |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/BitChromosome.java | BitChromosome.ones | public IntStream ones() {
return IntStream.range(0, length())
.filter(index -> bit.get(_genes, index));
} | java | public IntStream ones() {
return IntStream.range(0, length())
.filter(index -> bit.get(_genes, index));
} | [
"public",
"IntStream",
"ones",
"(",
")",
"{",
"return",
"IntStream",
".",
"range",
"(",
"0",
",",
"length",
"(",
")",
")",
".",
"filter",
"(",
"index",
"->",
"bit",
".",
"get",
"(",
"_genes",
",",
"index",
")",
")",
";",
"}"
] | Return the indexes of the <i>ones</i> of this bit-chromosome as stream.
@since 3.0
@return the indexes of the <i>ones</i> of this bit-chromosome | [
"Return",
"the",
"indexes",
"of",
"the",
"<i",
">",
"ones<",
"/",
"i",
">",
"of",
"this",
"bit",
"-",
"chromosome",
"as",
"stream",
"."
] | ee516770c65ef529b27deb283f071c85f344eff4 | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/BitChromosome.java#L373-L376 | train | Returns an IntStream of all the values in this set. | Of course, here is the Java code you requested:
```java
public IntStream ones() {
return IntStream.range(0, length())
.filter(index -> bit.get(_genes, index));
}
```
Hope this helps! |
jblas-project/jblas | src/main/java/org/jblas/Decompose.java | Decompose.lu | public static LUDecomposition<FloatMatrix> lu(FloatMatrix A) {
int[] ipiv = new int[min(A.rows, A.columns)];
FloatMatrix result = A.dup();
NativeBlas.sgetrf(A.rows, A.columns, result.data, 0, A.rows, ipiv, 0);
// collect result
FloatMatrix l = new FloatMatrix(A.rows, min(A.rows, A.columns... | java | public static LUDecomposition<FloatMatrix> lu(FloatMatrix A) {
int[] ipiv = new int[min(A.rows, A.columns)];
FloatMatrix result = A.dup();
NativeBlas.sgetrf(A.rows, A.columns, result.data, 0, A.rows, ipiv, 0);
// collect result
FloatMatrix l = new FloatMatrix(A.rows, min(A.rows, A.columns... | [
"public",
"static",
"LUDecomposition",
"<",
"FloatMatrix",
">",
"lu",
"(",
"FloatMatrix",
"A",
")",
"{",
"int",
"[",
"]",
"ipiv",
"=",
"new",
"int",
"[",
"min",
"(",
"A",
".",
"rows",
",",
"A",
".",
"columns",
")",
"]",
";",
"FloatMatrix",
"result",
... | Compute LU Decomposition of a general matrix.
Computes the LU decomposition using GETRF. Returns three matrices L, U, P,
where L is lower diagonal, U is upper diagonal, and P is a permutation
matrix such that A = P * L * U.
@param A general matrix
@return An LUDecomposition object. | [
"Compute",
"LU",
"Decomposition",
"of",
"a",
"general",
"matrix",
"."
] | 2818f231228e655cda80dfd8e0b87709fdfd8a70 | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Decompose.java#L114-L125 | train | Returns the LU decomposition of A. | Of course, here is the Java code you requested:
```java
public static LUDecomposition<FloatMatrix> lu(FloatMatrix A) {
int[] ipiv = new int[min(A.rows, A.columns)];
FloatMatrix result = A.dup();
NativeBlas.sgetrf(A.rows, A.columns, result.data, 0, A.rows, ipiv, 0);
// collect result
Floa... |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java | TemplateFilter.containsRestrictedPrefix | private boolean containsRestrictedPrefix(String tpl)
{
for (String i : blackPrefixList) {
if (tpl.startsWith(i))
return true;
}
return false;
} | java | private boolean containsRestrictedPrefix(String tpl)
{
for (String i : blackPrefixList) {
if (tpl.startsWith(i))
return true;
}
return false;
} | [
"private",
"boolean",
"containsRestrictedPrefix",
"(",
"String",
"tpl",
")",
"{",
"for",
"(",
"String",
"i",
":",
"blackPrefixList",
")",
"{",
"if",
"(",
"tpl",
".",
"startsWith",
"(",
"i",
")",
")",
"return",
"true",
";",
"}",
"return",
"false",
";",
... | Checks if the input string contains prefixes from black list
@param tpl
string to check
@return | [
"Checks",
"if",
"the",
"input",
"string",
"contains",
"prefixes",
"from",
"black",
"list"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java#L115-L122 | train | Checks if the template contains a restricted prefix. | Of course, here is the Java code you requested:
```java
private boolean containsRestrictedPrefix(String tpl)
{
for (String i : blackPrefixList) {
if (tpl.startsWith(i))
return true;
}
return false;
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/auth0/Auth0Client.java | Auth0Client.getUserProfileInfo | public NormalizedUserProfile getUserProfileInfo(AccessToken accessTokenParam)
{
if(accessTokenParam == null || (accessTokenParam.getAccessToken() == null ||
accessTokenParam.getAccessToken().trim().isEmpty()))
{
throw new FluidClientException(
"Code mu... | java | public NormalizedUserProfile getUserProfileInfo(AccessToken accessTokenParam)
{
if(accessTokenParam == null || (accessTokenParam.getAccessToken() == null ||
accessTokenParam.getAccessToken().trim().isEmpty()))
{
throw new FluidClientException(
"Code mu... | [
"public",
"NormalizedUserProfile",
"getUserProfileInfo",
"(",
"AccessToken",
"accessTokenParam",
")",
"{",
"if",
"(",
"accessTokenParam",
"==",
"null",
"||",
"(",
"accessTokenParam",
".",
"getAccessToken",
"(",
")",
"==",
"null",
"||",
"accessTokenParam",
".",
"getA... | Gets Auth0 Normalized User Profile info.
@param accessTokenParam The access token used to get
user profile info from.
@return User Profile.
@see NormalizedUserProfile
@see AccessToken | [
"Gets",
"Auth0",
"Normalized",
"User",
"Profile",
"info",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/auth0/Auth0Client.java#L117-L146 | test | Gets user profile info. | Of course, here is the Java code you requested:
```java
public NormalizedUserProfile getUserProfileInfo(AccessToken accessTokenParam)
{
if(accessTokenParam == null || (accessTokenParam.getAccessToken() == null ||
accessTokenParam.getAccessToken().trim().isEmpty()))
{
thr... |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.newDate | public static java.sql.Date newDate() {
return new java.sql.Date((System.currentTimeMillis() / DAY_MILLIS) * DAY_MILLIS);
} | java | public static java.sql.Date newDate() {
return new java.sql.Date((System.currentTimeMillis() / DAY_MILLIS) * DAY_MILLIS);
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"newDate",
"(",
")",
"{",
"return",
"new",
"java",
".",
"sql",
".",
"Date",
"(",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"DAY_MILLIS",
")",
"*",
"DAY_MILLIS",
")",
";",
"}"
] | Create a new Date. To the last day. | [
"Create",
"a",
"new",
"Date",
".",
"To",
"the",
"last",
"day",
"."
] | 223c4443c2cee662576ce644e552588fa114aa94 | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L72-L74 | train | Creates a new date. | Of course, here is the Java code you requested:
```java
public static java.sql.Date newDate() {
return new java.sql.Date((System.currentTimeMillis() / DAY_MILLIS) * DAY_MILLIS);
}
```
Hope this helps! |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/lang/DRL5Expressions.java | DRL5Expressions.castExpression | public final void castExpression() throws RecognitionException {
BaseDescr expr =null;
try {
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:521:5: ( ( LEFT_PAREN primitiveType )=> LEFT_PAREN primitiveType RIGHT_PAREN expr= unaryExpression | ( LEFT_PAREN type )=> LEFT_PAREN type RIGHT_PAREN una... | java | public final void castExpression() throws RecognitionException {
BaseDescr expr =null;
try {
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:521:5: ( ( LEFT_PAREN primitiveType )=> LEFT_PAREN primitiveType RIGHT_PAREN expr= unaryExpression | ( LEFT_PAREN type )=> LEFT_PAREN type RIGHT_PAREN una... | [
"public",
"final",
"void",
"castExpression",
"(",
")",
"throws",
"RecognitionException",
"{",
"BaseDescr",
"expr",
"=",
"null",
";",
"try",
"{",
"// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:521:5: ( ( LEFT_PAREN primitiveType )=> LEFT_PAREN primitiveType RIGHT_PA... | src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:520:1: castExpression : ( ( LEFT_PAREN primitiveType )=> LEFT_PAREN primitiveType RIGHT_PAREN expr= unaryExpression | ( LEFT_PAREN type )=> LEFT_PAREN type RIGHT_PAREN unaryExpressionNotPlusMinus ); | [
"src",
"/",
"main",
"/",
"resources",
"/",
"org",
"/",
"drools",
"/",
"compiler",
"/",
"lang",
"/",
"DRL5Expressions",
".",
"g",
":",
"520",
":",
"1",
":",
"castExpression",
":",
"(",
"(",
"LEFT_PAREN",
"primitiveType",
")",
"=",
">",
"LEFT_PAREN",
"pr... | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/lang/DRL5Expressions.java#L3643-L3723 | train | Parses the expression | Of course, here is the Java code you requested:
```java
public final void castExpression() throws RecognitionException {
BaseDescr expr =null;
try {
// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:521:5: ( ( LEFT_PAREN primitiveType )=> LEFT_PAREN primitiveType RIGHT_PAREN expr= unaryExpressio... |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIOutput.java | UIOutput.markInitialState | @Override
public void markInitialState() {
super.markInitialState();
Converter c = getConverter();
if (c != null && c instanceof PartialStateHolder) {
((PartialStateHolder) c).markInitialState();
}
} | java | @Override
public void markInitialState() {
super.markInitialState();
Converter c = getConverter();
if (c != null && c instanceof PartialStateHolder) {
((PartialStateHolder) c).markInitialState();
}
} | [
"@",
"Override",
"public",
"void",
"markInitialState",
"(",
")",
"{",
"super",
".",
"markInitialState",
"(",
")",
";",
"Converter",
"c",
"=",
"getConverter",
"(",
")",
";",
"if",
"(",
"c",
"!=",
"null",
"&&",
"c",
"instanceof",
"PartialStateHolder",
")",
... | <p>
In addition to the actions taken in {@link UIComponentBase}
when {@link PartialStateHolder#markInitialState()} is called,
check if the installed {@link Converter} is a PartialStateHolder and
if it is, call {@link javax.faces.component.PartialStateHolder#markInitialState()}
on it.
</p> | [
"<p",
">",
"In",
"addition",
"to",
"the",
"actions",
"taken",
"in",
"{"
] | cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3 | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIOutput.java#L205-L214 | train | Override markInitialState to mark the initial state of the record. | Of course, here is the Java code you requested:
```java
@Override
public void markInitialState() {
super.markInitialState();
Converter c = getConverter();
if (c != null && c instanceof PartialStateHolder) {
((PartialStateHolder) c).markInitialState();
}
}
```
Hope... |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PartialMerkleTree.java | PartialMerkleTree.recursiveExtractHashes | private Sha256Hash recursiveExtractHashes(int height, int pos, ValuesUsed used, List<Sha256Hash> matchedHashes) throws VerificationException {
if (used.bitsUsed >= matchedChildBits.length*8) {
// overflowed the bits array - failure
throw new VerificationException("PartialMerkleTree overf... | java | private Sha256Hash recursiveExtractHashes(int height, int pos, ValuesUsed used, List<Sha256Hash> matchedHashes) throws VerificationException {
if (used.bitsUsed >= matchedChildBits.length*8) {
// overflowed the bits array - failure
throw new VerificationException("PartialMerkleTree overf... | [
"private",
"Sha256Hash",
"recursiveExtractHashes",
"(",
"int",
"height",
",",
"int",
"pos",
",",
"ValuesUsed",
"used",
",",
"List",
"<",
"Sha256Hash",
">",
"matchedHashes",
")",
"throws",
"VerificationException",
"{",
"if",
"(",
"used",
".",
"bitsUsed",
">=",
... | it returns the hash of the respective node. | [
"it",
"returns",
"the",
"hash",
"of",
"the",
"respective",
"node",
"."
] | 9cf13d29315014ed59cf4fc5944e5f227e8df9a6 | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PartialMerkleTree.java#L186-L215 | train | Recursive method to extract the hashes from the merkle tree. | Of course, here is the Java code you requested:
```java
private Sha256Hash recursiveExtractHashes(int height, int pos, ValuesUsed used, List<Sha256Hash> matchedHashes) throws VerificationException {
if (used.bitsUsed >= matchedChildBits.length*8) {
// overflowed the bits array - failure
... |
JOML-CI/JOML | src/org/joml/AABBf.java | AABBf.setMax | public AABBf setMax(float maxX, float maxY, float maxZ) {
this.maxX = maxX;
this.maxY = maxY;
this.maxZ = maxZ;
return this;
} | java | public AABBf setMax(float maxX, float maxY, float maxZ) {
this.maxX = maxX;
this.maxY = maxY;
this.maxZ = maxZ;
return this;
} | [
"public",
"AABBf",
"setMax",
"(",
"float",
"maxX",
",",
"float",
"maxY",
",",
"float",
"maxZ",
")",
"{",
"this",
".",
"maxX",
"=",
"maxX",
";",
"this",
".",
"maxY",
"=",
"maxY",
";",
"this",
".",
"maxZ",
"=",
"maxZ",
";",
"return",
"this",
";",
"... | Set the maximum corner coordinates.
@param maxX
the x coordinate of the maximum corner
@param maxY
the y coordinate of the maximum corner
@param maxZ
the z coordinate of the maximum corner
@return this | [
"Set",
"the",
"maximum",
"corner",
"coordinates",
"."
] | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBf.java#L135-L140 | train | Sets the maximum value of the AABBf. | Of course, here is the Java code you requested:
```java
public AABBf setMax(float maxX, float maxY, float maxZ) {
this.maxX = maxX;
this.maxY = maxY;
this.maxZ = maxZ;
return this;
}
```
Hope this helps! |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java | IssueDto.setComponentUuid | public IssueDto setComponentUuid(@Nullable String s) {
checkArgument(s == null || s.length() <= 50, "Value is too long for column ISSUES.COMPONENT_UUID: %s", s);
this.componentUuid = s;
return this;
} | java | public IssueDto setComponentUuid(@Nullable String s) {
checkArgument(s == null || s.length() <= 50, "Value is too long for column ISSUES.COMPONENT_UUID: %s", s);
this.componentUuid = s;
return this;
} | [
"public",
"IssueDto",
"setComponentUuid",
"(",
"@",
"Nullable",
"String",
"s",
")",
"{",
"checkArgument",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"<=",
"50",
",",
"\"Value is too long for column ISSUES.COMPONENT_UUID: %s\"",
",",
"s",
")",
... | Should only be used to persist in E/S
<p/>
Please use {@link #setComponent(ComponentDto)} instead | [
"Should",
"only",
"be",
"used",
"to",
"persist",
"in",
"E",
"/",
"S",
"<p",
"/",
">",
"Please",
"use",
"{"
] | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IssueDto.java#L528-L532 | train | Sets the value of the componentUuid column. | Of course, here is the Java code you requested:
```java
public IssueDto setComponentUuid(@Nullable String s) {
checkArgument(s == null || s.length() <= 50, "Value is too long for column ISSUES.COMPONENT_UUID: %s", s);
this.componentUuid = s;
return this;
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.