repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
samskivert/pythagoras | src/main/java/pythagoras/f/RectangularShape.java | RectangularShape.setFrameFromDiagonal | public void setFrameFromDiagonal (float x1, float y1, float x2, float y2) {
float rx, ry, rw, rh;
if (x1 < x2) {
rx = x1;
rw = x2 - x1;
} else {
rx = x2;
rw = x1 - x2;
}
if (y1 < y2) {
ry = y1;
rh = y2 - y1;
... | java | public void setFrameFromDiagonal (float x1, float y1, float x2, float y2) {
float rx, ry, rw, rh;
if (x1 < x2) {
rx = x1;
rw = x2 - x1;
} else {
rx = x2;
rw = x1 - x2;
}
if (y1 < y2) {
ry = y1;
rh = y2 - y1;
... | [
"public",
"void",
"setFrameFromDiagonal",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"float",
"rx",
",",
"ry",
",",
"rw",
",",
"rh",
";",
"if",
"(",
"x1",
"<",
"x2",
")",
"{",
"rx",
"=",
"x1",
";",... | Sets the location and size of the framing rectangle of this shape based on the specified
diagonal line. | [
"Sets",
"the",
"location",
"and",
"size",
"of",
"the",
"framing",
"rectangle",
"of",
"this",
"shape",
"based",
"on",
"the",
"specified",
"diagonal",
"line",
"."
] | b8fea743ee8a7d742ad9c06ee4f11f50571fbd32 | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/RectangularShape.java#L37-L54 | train | Sets the frame from diagonal. | Create a Java method that does the following: "Sets the frame from diagonal.". | Of course, here is the Java code you requested:
```java
public void setFrameFromDiagonal (float x1, float y1, float x2, float y2) {
float rx, ry, rw, rh;
if (x1 < x2) {
rx = x1;
rw = x2 - x1;
} else {
rx = x2;
rw = x1 - x2;
}
if (y... | |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/codec/statemachine/FixedLengthDecodingState.java | FixedLengthDecodingState.finishDecode | public DecodingState finishDecode(ProtocolDecoderOutput out)
throws Exception {
IoBuffer readData;
if (buffer == null) {
readData = IoBuffer.allocate(0);
} else {
readData = buffer.flip();
buffer = null;
}
return finishDecode(readDa... | java | public DecodingState finishDecode(ProtocolDecoderOutput out)
throws Exception {
IoBuffer readData;
if (buffer == null) {
readData = IoBuffer.allocate(0);
} else {
readData = buffer.flip();
buffer = null;
}
return finishDecode(readDa... | [
"public",
"DecodingState",
"finishDecode",
"(",
"ProtocolDecoderOutput",
"out",
")",
"throws",
"Exception",
"{",
"IoBuffer",
"readData",
";",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"readData",
"=",
"IoBuffer",
".",
"allocate",
"(",
"0",
")",
";",
"}",
... | {@inheritDoc} | [
"{"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/codec/statemachine/FixedLengthDecodingState.java#L81-L91 | train | Decode a single ACSCTYPE. | Create a Java method that does the following: "Decode a single ACSCTYPE.". | Of course, here is the Java code you requested:
```java
public DecodingState finishDecode(ProtocolDecoderOutput out)
throws Exception {
IoBuffer readData;
if (buffer == null) {
readData = IoBuffer.allocate(0);
} else {
readData = buffer.flip();
bu... | |
alkacon/opencms-core | src/org/opencms/db/CmsAliasManager.java | CmsAliasManager.messageImportOk | private String messageImportOk(Locale locale) {
return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_OK_0);
} | java | private String messageImportOk(Locale locale) {
return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_OK_0);
} | [
"private",
"String",
"messageImportOk",
"(",
"Locale",
"locale",
")",
"{",
"return",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
"(",
"locale",
")",
".",
"key",
"(",
"Messages",
".",
"ERR_ALIAS_IMPORT_OK_0",
")",
";",
"}"
] | Message accessor.<p>
@param locale the message locale
@return the message string | [
"Message",
"accessor",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L570-L573 | train | Returns the message that should be used to display the message for the
CTYPE alias. | Create a Java method that does the following: "Returns the message that should be used to display the message for the
CTYPE alias.". | Of course, here is the Java code you requested:
```java
private String messageImportOk(Locale locale) {
return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_OK_0);
}
```
Hope this helps! | |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_snmp.java | syslog_snmp.get | public static syslog_snmp[] get(nitro_service client) throws Exception
{
syslog_snmp resource = new syslog_snmp();
resource.validate("get");
return (syslog_snmp[]) resource.get_resources(client);
} | java | public static syslog_snmp[] get(nitro_service client) throws Exception
{
syslog_snmp resource = new syslog_snmp();
resource.validate("get");
return (syslog_snmp[]) resource.get_resources(client);
} | [
"public",
"static",
"syslog_snmp",
"[",
"]",
"get",
"(",
"nitro_service",
"client",
")",
"throws",
"Exception",
"{",
"syslog_snmp",
"resource",
"=",
"new",
"syslog_snmp",
"(",
")",
";",
"resource",
".",
"validate",
"(",
"\"get\"",
")",
";",
"return",
"(",
... | <pre>
Report for snmp syslog message received by this collector..
</pre> | [
"<pre",
">",
"Report",
"for",
"snmp",
"syslog",
"message",
"received",
"by",
"this",
"collector",
"..",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_snmp.java#L474-L479 | train | Use this API to fetch all the syslog_snmp resources that are configured on netscaler. | Create a Java method that does the following: "Use this API to fetch all the syslog_snmp resources that are configured on netscaler.". | Of course, here is the Java code you requested:
```java
public static syslog_snmp[] get(nitro_service client) throws Exception
{
syslog_snmp resource = new syslog_snmp();
resource.validate("get");
return (syslog_snmp[]) resource.get_resources(client);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/ListOfferingTransactionsResult.java | ListOfferingTransactionsResult.withOfferingTransactions | public ListOfferingTransactionsResult withOfferingTransactions(OfferingTransaction... offeringTransactions) {
if (this.offeringTransactions == null) {
setOfferingTransactions(new java.util.ArrayList<OfferingTransaction>(offeringTransactions.length));
}
for (OfferingTransaction ele : ... | java | public ListOfferingTransactionsResult withOfferingTransactions(OfferingTransaction... offeringTransactions) {
if (this.offeringTransactions == null) {
setOfferingTransactions(new java.util.ArrayList<OfferingTransaction>(offeringTransactions.length));
}
for (OfferingTransaction ele : ... | [
"public",
"ListOfferingTransactionsResult",
"withOfferingTransactions",
"(",
"OfferingTransaction",
"...",
"offeringTransactions",
")",
"{",
"if",
"(",
"this",
".",
"offeringTransactions",
"==",
"null",
")",
"{",
"setOfferingTransactions",
"(",
"new",
"java",
".",
"util... | <p>
The audit log of subscriptions you have purchased and modified through AWS Device Farm.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setOfferingTransactions(java.util.Collection)} or {@link #withOfferingTransactions(java.util.Collection)}
if you want to override th... | [
"<p",
">",
"The",
"audit",
"log",
"of",
"subscriptions",
"you",
"have",
"purchased",
"and",
"modified",
"through",
"AWS",
"Device",
"Farm",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/ListOfferingTransactionsResult.java#L88-L96 | train | A list of offering transactions. | Create a Java method that does the following: "A list of offering transactions.". | Of course, here is the Java code you requested:
```java
public ListOfferingTransactionsResult withOfferingTransactions(OfferingTransaction... offeringTransactions) {
if (this.offeringTransactions == null) {
setOfferingTransactions(new java.util.ArrayList<OfferingTransaction>(offeringTransactions.le... | |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/Component.java | Component.getRequiredProperty | protected final Property getRequiredProperty(String name) throws ConstraintViolationException {
Property p = getProperties().getProperty(name);
if (p == null) {
throw new ConstraintViolationException(String.format("Missing %s property", name));
}
return p;
} | java | protected final Property getRequiredProperty(String name) throws ConstraintViolationException {
Property p = getProperties().getProperty(name);
if (p == null) {
throw new ConstraintViolationException(String.format("Missing %s property", name));
}
return p;
} | [
"protected",
"final",
"Property",
"getRequiredProperty",
"(",
"String",
"name",
")",
"throws",
"ConstraintViolationException",
"{",
"Property",
"p",
"=",
"getProperties",
"(",
")",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"p",
"==",
"null",
")",
... | Convenience method for retrieving a required named property.
@param name name of the property to retrieve
@return the first matching property in the property list with the specified name
@throws ConstraintViolationException when a property is not found | [
"Convenience",
"method",
"for",
"retrieving",
"a",
"required",
"named",
"property",
"."
] | 7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156 | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/Component.java#L201-L207 | train | Gets the required property. | Create a Java method that does the following: "Gets the required property.". | Of course, here is the Java code you requested:
```java
protected final Property getRequiredProperty(String name) throws ConstraintViolationException {
Property p = getProperties().getProperty(name);
if (p == null) {
throw new ConstraintViolationException(String.format("Missing %s property"... | |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java | DataFactory.calculateCplcDate | public static Date calculateCplcDate(byte[] dateBytes)
throws IllegalArgumentException {
if (dateBytes == null || dateBytes.length != 2) {
throw new IllegalArgumentException(
"Error! CLCP Date values consist always of exactly 2 bytes");
}
// Check empty date
if (dateBytes[0] == 0 && dateBytes[1] == 0... | java | public static Date calculateCplcDate(byte[] dateBytes)
throws IllegalArgumentException {
if (dateBytes == null || dateBytes.length != 2) {
throw new IllegalArgumentException(
"Error! CLCP Date values consist always of exactly 2 bytes");
}
// Check empty date
if (dateBytes[0] == 0 && dateBytes[1] == 0... | [
"public",
"static",
"Date",
"calculateCplcDate",
"(",
"byte",
"[",
"]",
"dateBytes",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"dateBytes",
"==",
"null",
"||",
"dateBytes",
".",
"length",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentEx... | Takes a date value as used in CPLC Date fields (represented by 2 bytes)
@param dateBytes raw bytes
@throws IllegalArgumentException when the data size is wrong
@return the date | [
"Takes",
"a",
"date",
"value",
"as",
"used",
"in",
"CPLC",
"Date",
"fields",
"(",
"represented",
"by",
"2",
"bytes",
")"
] | bfbd3960708689154a7a75c8a9a934197d738a5b | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L86-L121 | train | Calculate the CLCP date from the given byte array. | Create a Java method that does the following: "Calculate the CLCP date from the given byte array.". | Of course, here is the Java code you requested:
```java
public static Date calculateCplcDate(byte[] dateBytes)
throws IllegalArgumentException {
if (dateBytes == null || dateBytes.length != 2) {
throw new IllegalArgumentException(
"Error! CLCP Date values consist always of exactly 2 bytes");
}
// Chec... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/PooledWsByteBufferImpl.java | PooledWsByteBufferImpl.addOwner | public void addOwner(String owner) {
if (this.owners == null) {
this.owners = new Hashtable<String, String>();
}
this.owners.put(owner, owner);
} | java | public void addOwner(String owner) {
if (this.owners == null) {
this.owners = new Hashtable<String, String>();
}
this.owners.put(owner, owner);
} | [
"public",
"void",
"addOwner",
"(",
"String",
"owner",
")",
"{",
"if",
"(",
"this",
".",
"owners",
"==",
"null",
")",
"{",
"this",
".",
"owners",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"this",
".",
"owners",
... | Add the following owner to the list for this buffer.
@param owner | [
"Add",
"the",
"following",
"owner",
"to",
"the",
"list",
"for",
"this",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/PooledWsByteBufferImpl.java#L127-L132 | train | Add an owner to the class. | Create a Java method that does the following: "Add an owner to the class.". | Of course, here is the Java code you requested:
```java
public void addOwner(String owner) {
if (this.owners == null) {
this.owners = new Hashtable<String, String>();
}
this.owners.put(owner, owner);
}
```
Hope this helps! | |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java | CmsListItemWidget.setBackground | public void setBackground(Background background) {
switch (background) {
case BLUE:
m_backgroundStyle.setValue(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().itemBlue());
break;
case RED:
m_backgroundStyle.setValue(I_CmsLayoutBundle.INSTAN... | java | public void setBackground(Background background) {
switch (background) {
case BLUE:
m_backgroundStyle.setValue(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().itemBlue());
break;
case RED:
m_backgroundStyle.setValue(I_CmsLayoutBundle.INSTAN... | [
"public",
"void",
"setBackground",
"(",
"Background",
"background",
")",
"{",
"switch",
"(",
"background",
")",
"{",
"case",
"BLUE",
":",
"m_backgroundStyle",
".",
"setValue",
"(",
"I_CmsLayoutBundle",
".",
"INSTANCE",
".",
"listItemWidgetCss",
"(",
")",
".",
... | Sets the background color.<p>
@param background the color | [
"Sets",
"the",
"background",
"color",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L675-L691 | train | Sets the background. | Create a Java method that does the following: "Sets the background.". | Of course, here is the Java code you requested:
```java
public void setBackground(Background background) {
switch (background) {
case BLUE:
m_backgroundStyle.setValue(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().itemBlue());
break;
case RED:
... | |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java | RuleBasedNumberFormat.format | public String format(long number, String ruleSet) throws IllegalArgumentException {
if (ruleSet.startsWith("%%")) {
throw new IllegalArgumentException("Can't use internal rule set");
}
return adjustForContext(format(number, findRuleSet(ruleSet)));
} | java | public String format(long number, String ruleSet) throws IllegalArgumentException {
if (ruleSet.startsWith("%%")) {
throw new IllegalArgumentException("Can't use internal rule set");
}
return adjustForContext(format(number, findRuleSet(ruleSet)));
} | [
"public",
"String",
"format",
"(",
"long",
"number",
",",
"String",
"ruleSet",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"ruleSet",
".",
"startsWith",
"(",
"\"%%\"",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't use in... | Formats the specified number according to the specified rule set.
(If the specified rule set specifies a master ["x.0"] rule, this function
ignores it. Convert the number to a double first if you ned it.) This
function preserves all the precision in the long-- it doesn't convert it
to a double.
@param number The numb... | [
"Formats",
"the",
"specified",
"number",
"according",
"to",
"the",
"specified",
"rule",
"set",
".",
"(",
"If",
"the",
"specified",
"rule",
"set",
"specifies",
"a",
"master",
"[",
"x",
".",
"0",
"]",
"rule",
"this",
"function",
"ignores",
"it",
".",
"Conv... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java#L1147-L1152 | train | Format a number with the specified rule set. | Create a Java method that does the following: "Format a number with the specified rule set.". | Of course, here is the Java code you requested:
```java
public String format(long number, String ruleSet) throws IllegalArgumentException {
if (ruleSet.startsWith("%%")) {
throw new IllegalArgumentException("Can't use internal rule set");
}
return adjustForContext(format(number, fin... | |
belaban/JGroups | src/org/jgroups/util/RequestTable.java | RequestTable._contiguousSpaceAvailable | @GuardedBy("lock")
protected boolean _contiguousSpaceAvailable(int space_needed) {
int num_slots_scanned=0;
int size_of_contiguous_area=0;
if(high-low-1 < space_needed)
return false;
for(long i=low+1; i < high; i++) {
num_slots_scanned++;
int ind... | java | @GuardedBy("lock")
protected boolean _contiguousSpaceAvailable(int space_needed) {
int num_slots_scanned=0;
int size_of_contiguous_area=0;
if(high-low-1 < space_needed)
return false;
for(long i=low+1; i < high; i++) {
num_slots_scanned++;
int ind... | [
"@",
"GuardedBy",
"(",
"\"lock\"",
")",
"protected",
"boolean",
"_contiguousSpaceAvailable",
"(",
"int",
"space_needed",
")",
"{",
"int",
"num_slots_scanned",
"=",
"0",
";",
"int",
"size_of_contiguous_area",
"=",
"0",
";",
"if",
"(",
"high",
"-",
"low",
"-",
... | Check if we have at least space_needed contiguous free slots available in range [low+1 .. high-1]
@param space_needed the number of contiguous free slots required to do compaction, usually half of the current
buffer size
@return true if a contiguous space was found, false otherwise | [
"Check",
"if",
"we",
"have",
"at",
"least",
"space_needed",
"contiguous",
"free",
"slots",
"available",
"in",
"range",
"[",
"low",
"+",
"1",
"..",
"high",
"-",
"1",
"]"
] | bd3ca786aa57fed41dfbc10a94b1281e388be03b | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/RequestTable.java#L347-L371 | train | Returns true if the contiguous space is available. | Create a Java method that does the following: "Returns true if the contiguous space is available.". | Of course, here is the Java code you requested:
```java
@GuardedBy("lock")
protected boolean _contiguousSpaceAvailable(int space_needed) {
int num_slots_scanned=0;
int size_of_contiguous_area=0;
if(high-low-1 < space_needed)
return false;
for(long i=low+1; i < high; i+... | |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/util/css_query/PseudoClassSpecifierChecker.java | PseudoClassSpecifierChecker.addLastOfType | private void addLastOfType() {
for (Node node : nodes) {
Index index = helper.getIndexInParent(node, true);
if (index.index == (index.size-1))
result.add(node);
}
} | java | private void addLastOfType() {
for (Node node : nodes) {
Index index = helper.getIndexInParent(node, true);
if (index.index == (index.size-1))
result.add(node);
}
} | [
"private",
"void",
"addLastOfType",
"(",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"nodes",
")",
"{",
"Index",
"index",
"=",
"helper",
".",
"getIndexInParent",
"(",
"node",
",",
"true",
")",
";",
"if",
"(",
"index",
".",
"index",
"==",
"(",
"index",... | Add {@code :last-of-type} elements.
@see <a href="http://www.w3.org/TR/css3-selectors/#last-of-type-pseudo"><code>:last-of-type</code> pseudo-class</a> | [
"Add",
"{",
"@code",
":",
"last",
"-",
"of",
"-",
"type",
"}",
"elements",
"."
] | 32ddd0774439a4c08513c05d7ac7416a3899efed | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/util/css_query/PseudoClassSpecifierChecker.java#L135-L141 | train | Add the last node of type node. | Create a Java method that does the following: "Add the last node of type node.". | Of course, here is the Java code you requested:
```java
private void addLastOfType() {
for (Node node : nodes) {
Index index = helper.getIndexInParent(node, true);
if (index.index == (index.size-1))
result.add(node);
}
}
```
Hope this helps! | |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java | MsgPackOutput.writeString | void writeString(String value) throws IOException {
byte[] bytes = toUTF8(value);
int size = bytes.length;
if (size < 32) {
output.writeByte(MIN_FIX_STR + size);
} else if (size < 256) {
output.writeByte(STR_8);
output.writeByte(size);
} else i... | java | void writeString(String value) throws IOException {
byte[] bytes = toUTF8(value);
int size = bytes.length;
if (size < 32) {
output.writeByte(MIN_FIX_STR + size);
} else if (size < 256) {
output.writeByte(STR_8);
output.writeByte(size);
} else i... | [
"void",
"writeString",
"(",
"String",
"value",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"toUTF8",
"(",
"value",
")",
";",
"int",
"size",
"=",
"bytes",
".",
"length",
";",
"if",
"(",
"size",
"<",
"32",
")",
"{",
"output",
"... | Writes a MessagePack string.
@param value the value
@throws IOException if an error occurs | [
"Writes",
"a",
"MessagePack",
"string",
"."
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L203-L219 | train | Write a string to the output stream. | Create a Java method that does the following: "Write a string to the output stream.". | Of course, here is the Java code you requested:
```java
void writeString(String value) throws IOException {
byte[] bytes = toUTF8(value);
int size = bytes.length;
if (size < 32) {
output.writeByte(MIN_FIX_STR + size);
} else if (size < 256) {
output.writeByte(STR... | |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/temporal/FileBasedTemporalSemanticSpace.java | FileBasedTemporalSemanticSpace.loadSparseText | private Map<String,SemanticVector> loadSparseText(File sspaceFile)
throws IOException {
LOGGER.info("loading sparse text TSS from " + sspaceFile);
BufferedReader br = new BufferedReader(new FileReader(sspaceFile));
String[] header = br.readLine().split("\\s+");
int words = Int... | java | private Map<String,SemanticVector> loadSparseText(File sspaceFile)
throws IOException {
LOGGER.info("loading sparse text TSS from " + sspaceFile);
BufferedReader br = new BufferedReader(new FileReader(sspaceFile));
String[] header = br.readLine().split("\\s+");
int words = Int... | [
"private",
"Map",
"<",
"String",
",",
"SemanticVector",
">",
"loadSparseText",
"(",
"File",
"sspaceFile",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"info",
"(",
"\"loading sparse text TSS from \"",
"+",
"sspaceFile",
")",
";",
"BufferedReader",
"br",
"=",
... | Loads the {@link TemporalSemanticSpace} from the sparse text formatted
file.
@param sspaceFile a file in {@link TSSpaceFormat#SPARSE_TEXT sparse text}
format | [
"Loads",
"the",
"{",
"@link",
"TemporalSemanticSpace",
"}",
"from",
"the",
"sparse",
"text",
"formatted",
"file",
"."
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/temporal/FileBasedTemporalSemanticSpace.java#L218-L260 | train | Load sparse text TSS. | Create a Java method that does the following: "Load sparse text TSS.". | Of course, here is the Java code you requested:
```java
private Map<String,SemanticVector> loadSparseText(File sspaceFile)
throws IOException {
LOGGER.info("loading sparse text TSS from " + sspaceFile);
BufferedReader br = new BufferedReader(new FileReader(sspaceFile));
String[] head... | |
aws/aws-sdk-java | aws-java-sdk-workmail/src/main/java/com/amazonaws/services/workmail/model/transform/ListAliasesRequestMarshaller.java | ListAliasesRequestMarshaller.marshall | public void marshall(ListAliasesRequest listAliasesRequest, ProtocolMarshaller protocolMarshaller) {
if (listAliasesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAliasesRequest.getOrg... | java | public void marshall(ListAliasesRequest listAliasesRequest, ProtocolMarshaller protocolMarshaller) {
if (listAliasesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAliasesRequest.getOrg... | [
"public",
"void",
"marshall",
"(",
"ListAliasesRequest",
"listAliasesRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"listAliasesRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to mars... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workmail/src/main/java/com/amazonaws/services/workmail/model/transform/ListAliasesRequestMarshaller.java#L48-L62 | train | marshalls the given parameter object. | Create a Java method that does the following: "marshalls the given parameter object.". | Of course, here is the Java code you requested:
```java
public void marshall(ListAliasesRequest listAliasesRequest, ProtocolMarshaller protocolMarshaller) {
if (listAliasesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... | |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java | XmlReader.hasChild | public boolean hasChild(String child)
{
final NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++)
{
final Node node = list.item(i);
if (node.getNodeName().equals(child))
{
return true;
}
}
... | java | public boolean hasChild(String child)
{
final NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++)
{
final Node node = list.item(i);
if (node.getNodeName().equals(child))
{
return true;
}
}
... | [
"public",
"boolean",
"hasChild",
"(",
"String",
"child",
")",
"{",
"final",
"NodeList",
"list",
"=",
"root",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"getLength",
"(",
")",
";",
"i",
"++",
... | Check if node has the following child.
@param child The child name (can be <code>null</code>).
@return <code>true</code> if child exists, <code>false</code> else. | [
"Check",
"if",
"node",
"has",
"the",
"following",
"child",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java#L384-L396 | train | Check if a child node is present in the XML document. | Create a Java method that does the following: "Check if a child node is present in the XML document.". | Of course, here is the Java code you requested:
```java
public boolean hasChild(String child)
{
final NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++)
{
final Node node = list.item(i);
if (node.getNodeName().equals(child))
... | |
netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSsl.java | OpenSsl.isCipherSuiteAvailable | public static boolean isCipherSuiteAvailable(String cipherSuite) {
String converted = CipherSuiteConverter.toOpenSsl(cipherSuite, IS_BORINGSSL);
if (converted != null) {
cipherSuite = converted;
}
return AVAILABLE_OPENSSL_CIPHER_SUITES.contains(cipherSuite);
} | java | public static boolean isCipherSuiteAvailable(String cipherSuite) {
String converted = CipherSuiteConverter.toOpenSsl(cipherSuite, IS_BORINGSSL);
if (converted != null) {
cipherSuite = converted;
}
return AVAILABLE_OPENSSL_CIPHER_SUITES.contains(cipherSuite);
} | [
"public",
"static",
"boolean",
"isCipherSuiteAvailable",
"(",
"String",
"cipherSuite",
")",
"{",
"String",
"converted",
"=",
"CipherSuiteConverter",
".",
"toOpenSsl",
"(",
"cipherSuite",
",",
"IS_BORINGSSL",
")",
";",
"if",
"(",
"converted",
"!=",
"null",
")",
"... | Returns {@code true} if and only if the specified cipher suite is available in OpenSSL.
Both Java-style cipher suite and OpenSSL-style cipher suite are accepted. | [
"Returns",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSsl.java#L500-L506 | train | Check if the specified cipher suite is available in the OpenSSL library. | Create a Java method that does the following: "Check if the specified cipher suite is available in the OpenSSL library.". | Of course, here is the Java code you requested:
```java
public static boolean isCipherSuiteAvailable(String cipherSuite) {
String converted = CipherSuiteConverter.toOpenSsl(cipherSuite, IS_BORINGSSL);
if (converted != null) {
cipherSuite = converted;
}
return AVAILABLE_OPENS... | |
EXIficient/exificient-grammars | src/main/java/com/siemens/ct/exi/grammars/regex/Match.java | Match.getBeginning | public int getBeginning(int index) {
if (this.beginpos == null)
throw new IllegalStateException("A result is not set.");
if (index < 0 || this.nofgroups <= index)
throw new IllegalArgumentException(
"The parameter must be less than " + this.nofgroups + ": "
+ index);
return this.beginpos[... | java | public int getBeginning(int index) {
if (this.beginpos == null)
throw new IllegalStateException("A result is not set.");
if (index < 0 || this.nofgroups <= index)
throw new IllegalArgumentException(
"The parameter must be less than " + this.nofgroups + ": "
+ index);
return this.beginpos[... | [
"public",
"int",
"getBeginning",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"beginpos",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"A result is not set.\"",
")",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"this",
".",
"n... | Return a start position in the target text matched to specified regular
expression group.
@param index
Less than <code>getNumberOfGroups()</code>. | [
"Return",
"a",
"start",
"position",
"in",
"the",
"target",
"text",
"matched",
"to",
"specified",
"regular",
"expression",
"group",
"."
] | d96477062ebdd4245920e44cc1995259699fc7fb | https://github.com/EXIficient/exificient-grammars/blob/d96477062ebdd4245920e44cc1995259699fc7fb/src/main/java/com/siemens/ct/exi/grammars/regex/Match.java#L145-L153 | train | Gets the beginning of the group. | Create a Java method that does the following: "Gets the beginning of the group.". | Of course, here is the Java code you requested:
```java
public int getBeginning(int index) {
if (this.beginpos == null)
throw new IllegalStateException("A result is not set.");
if (index < 0 || this.nofgroups <= index)
throw new IllegalArgumentException(
"The parameter must be less than " + this.no... | |
h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java | LinkedTransferQueue.writeObject | private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.defaultWriteObject();
for (E e : this)
s.writeObject(e);
// Use trailing null as sentinel
s.writeObject(null);
} | java | private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.defaultWriteObject();
for (E e : this)
s.writeObject(e);
// Use trailing null as sentinel
s.writeObject(null);
} | [
"private",
"void",
"writeObject",
"(",
"java",
".",
"io",
".",
"ObjectOutputStream",
"s",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"s",
".",
"defaultWriteObject",
"(",
")",
";",
"for",
"(",
"E",
"e",
":",
"this",
")",
"s",
".",
"wri... | Saves the state to a stream (that is, serializes it).
@serialData All of the elements (each an {@code E}) in
the proper order, followed by a null
@param s the stream | [
"Saves",
"the",
"state",
"to",
"a",
"stream",
"(",
"that",
"is",
"serializes",
"it",
")",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java#L1275-L1282 | train | Write the object in the object stream. | Create a Java method that does the following: "Write the object in the object stream.". | Of course, here is the Java code you requested:
```java
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.defaultWriteObject();
for (E e : this)
s.writeObject(e);
// Use trailing null as sentinel
s.writeObject(null);
}
```
Hop... | |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/http/io/ChunkedInputStream.java | ChunkedInputStream.before | private boolean before() throws IOException {
if (closed) {
throw new IOException("Attempted read from closed stream.");
}
switch (length) {
case EOF:
return false;
case UNKNOWN:
length = readLength();
pos = 0;
... | java | private boolean before() throws IOException {
if (closed) {
throw new IOException("Attempted read from closed stream.");
}
switch (length) {
case EOF:
return false;
case UNKNOWN:
length = readLength();
pos = 0;
... | [
"private",
"boolean",
"before",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Attempted read from closed stream.\"",
")",
";",
"}",
"switch",
"(",
"length",
")",
"{",
"case",
"EOF",
":",
"return... | Standard processing before reading data.
@return false for eof | [
"Standard",
"processing",
"before",
"reading",
"data",
"."
] | 4af33414b04bd58584d4febe5cc63ef6c7346a75 | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/http/io/ChunkedInputStream.java#L114-L132 | train | This method is called before the read method. | Create a Java method that does the following: "This method is called before the read method.". | Of course, here is the Java code you requested:
```java
private boolean before() throws IOException {
if (closed) {
throw new IOException("Attempted read from closed stream.");
}
switch (length) {
case EOF:
return false;
case UNKNOWN:
... | |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java | CSVDumper.computeLinkFanouts | private void computeLinkFanouts(TableDefinition tableDef,
Map<String, MutableFloat> tableLinkFanoutMap) {
m_logger.info("Computing link field fanouts for table: {}", tableDef.getTableName());
StringBuilder buffer = new StringBuilder();
for (Field... | java | private void computeLinkFanouts(TableDefinition tableDef,
Map<String, MutableFloat> tableLinkFanoutMap) {
m_logger.info("Computing link field fanouts for table: {}", tableDef.getTableName());
StringBuilder buffer = new StringBuilder();
for (Field... | [
"private",
"void",
"computeLinkFanouts",
"(",
"TableDefinition",
"tableDef",
",",
"Map",
"<",
"String",
",",
"MutableFloat",
">",
"tableLinkFanoutMap",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Computing link field fanouts for table: {}\"",
",",
"tableDef",
".",
"get... | Compute link fanouts for the given table | [
"Compute",
"link",
"fanouts",
"for",
"the",
"given",
"table"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java#L358-L410 | train | Compute the fanouts for a single table. | Create a Java method that does the following: "Compute the fanouts for a single table.". | Of course, here is the Java code you requested:
```java
private void computeLinkFanouts(TableDefinition tableDef,
Map<String, MutableFloat> tableLinkFanoutMap) {
m_logger.info("Computing link field fanouts for table: {}", tableDef.getTableName());
String... | |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.sign | public static byte[] sign(byte[] text, PrivateKey key, String algorithm) throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initSign(key);
} catch (GeneralSecurityException e) {
throw new IllegalArgum... | java | public static byte[] sign(byte[] text, PrivateKey key, String algorithm) throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initSign(key);
} catch (GeneralSecurityException e) {
throw new IllegalArgum... | [
"public",
"static",
"byte",
"[",
"]",
"sign",
"(",
"byte",
"[",
"]",
"text",
",",
"PrivateKey",
"key",
",",
"String",
"algorithm",
")",
"throws",
"SignatureException",
"{",
"Signature",
"signature",
";",
"try",
"{",
"signature",
"=",
"Signature",
".",
"get... | create a signature for the given text using the PrivateKey and algorithm
Example: CipherUtils.sign(data, key, CipherUtils.DEFAULT_SIGN_ALGORITHM)
@throws SignatureException if the data cannot not be signed | [
"create",
"a",
"signature",
"for",
"the",
"given",
"text",
"using",
"the",
"PrivateKey",
"and",
"algorithm"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L207-L217 | train | Sign a byte array using the specified private key and algorithm. | Create a Java method that does the following: "Sign a byte array using the specified private key and algorithm.". | Of course, here is the Java code you requested:
```java
public static byte[] sign(byte[] text, PrivateKey key, String algorithm) throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initSign(key);
} catch (General... | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java | ZooKeeperStateHandleStore.replace | public void replace(String pathInZooKeeper, int expectedVersion, T state) throws Exception {
checkNotNull(pathInZooKeeper, "Path in ZooKeeper");
checkNotNull(state, "State");
final String path = normalizePath(pathInZooKeeper);
RetrievableStateHandle<T> oldStateHandle = get(path, false);
RetrievableStateHan... | java | public void replace(String pathInZooKeeper, int expectedVersion, T state) throws Exception {
checkNotNull(pathInZooKeeper, "Path in ZooKeeper");
checkNotNull(state, "State");
final String path = normalizePath(pathInZooKeeper);
RetrievableStateHandle<T> oldStateHandle = get(path, false);
RetrievableStateHan... | [
"public",
"void",
"replace",
"(",
"String",
"pathInZooKeeper",
",",
"int",
"expectedVersion",
",",
"T",
"state",
")",
"throws",
"Exception",
"{",
"checkNotNull",
"(",
"pathInZooKeeper",
",",
"\"Path in ZooKeeper\"",
")",
";",
"checkNotNull",
"(",
"state",
",",
"... | Replaces a state handle in ZooKeeper and discards the old state handle.
@param pathInZooKeeper Destination path in ZooKeeper (expected to exist and start with a '/')
@param expectedVersion Expected version of the node to replace
@param state The new state to replace the old one
@throws Exception If a ZooKeep... | [
"Replaces",
"a",
"state",
"handle",
"in",
"ZooKeeper",
"and",
"discards",
"the",
"old",
"state",
"handle",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L179-L210 | train | Replace the state handle in ZooKeeper with the given state. | Create a Java method that does the following: "Replace the state handle in ZooKeeper with the given state.". | Of course, here is the Java code you requested:
```java
public void replace(String pathInZooKeeper, int expectedVersion, T state) throws Exception {
checkNotNull(pathInZooKeeper, "Path in ZooKeeper");
checkNotNull(state, "State");
final String path = normalizePath(pathInZooKeeper);
RetrievableStateHandle<T> ... | |
Jasig/uPortal | uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java | Authentication.configureSecurityContextChain | private void configureSecurityContextChain(
final Map<String, String> principals,
final Map<String, String> credentials,
final ISecurityContext securityContext,
final String baseContextName)
throws PortalSecurityException {
this.setContextParameters(pr... | java | private void configureSecurityContextChain(
final Map<String, String> principals,
final Map<String, String> credentials,
final ISecurityContext securityContext,
final String baseContextName)
throws PortalSecurityException {
this.setContextParameters(pr... | [
"private",
"void",
"configureSecurityContextChain",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"principals",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
",",
"final",
"ISecurityContext",
"securityContext",
",",
"final",
"S... | Recurse through the {@link ISecurityContext} chain, setting the credentials for each. TODO
This functionality should be moved into the {@link
org.apereo.portal.security.provider.ChainingSecurityContext}.
@param principals
@param credentials
@param securityContext
@param baseContextName
@throws PortalSecurityException | [
"Recurse",
"through",
"the",
"{",
"@link",
"ISecurityContext",
"}",
"chain",
"setting",
"the",
"credentials",
"for",
"each",
".",
"TODO",
"This",
"functionality",
"should",
"be",
"moved",
"into",
"the",
"{",
"@link",
"org",
".",
"apereo",
".",
"portal",
".",... | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-services/src/main/java/org/apereo/portal/services/Authentication.java#L354-L377 | train | Configure the security context chain. | Create a Java method that does the following: "Configure the security context chain.". | Of course, here is the Java code you requested:
```java
private void configureSecurityContextChain(
final Map<String, String> principals,
final Map<String, String> credentials,
final ISecurityContext securityContext,
final String baseContextName)
throws Porta... | |
qos-ch/slf4j | log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java | Category.info | public void info(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, null);
} | java | public void info(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, null);
} | [
"public",
"void",
"info",
"(",
"Object",
"message",
")",
"{",
"differentiatedLog",
"(",
"null",
",",
"CATEGORY_FQCN",
",",
"LocationAwareLogger",
".",
"INFO_INT",
",",
"message",
",",
"null",
")",
";",
"}"
] | Delegates to {@link org.slf4j.Logger#info(String)} method in SLF4J. | [
"Delegates",
"to",
"{"
] | 905443f39fadd88a8dd2c467e44affd8cb072a4d | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java#L233-L235 | train | Issue a log message with a level of INFO. | Create a Java method that does the following: "Issue a log message with a level of INFO.". | Of course, here is the Java code you requested:
```java
public void info(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, null);
}
```
Hope this helps! | |
playn/playn | scene/src/playn/scene/LayerUtil.java | LayerUtil.layerToParent | public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
Point into = new Point(x, y);
return layerToParent(layer, parent, into, into);
} | java | public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
Point into = new Point(x, y);
return layerToParent(layer, parent, into, into);
} | [
"public",
"static",
"Point",
"layerToParent",
"(",
"Layer",
"layer",
",",
"Layer",
"parent",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"Point",
"into",
"=",
"new",
"Point",
"(",
"x",
",",
"y",
")",
";",
"return",
"layerToParent",
"(",
"layer",
... | Converts the supplied point from coordinates relative to the specified
child layer to coordinates relative to the specified parent layer. | [
"Converts",
"the",
"supplied",
"point",
"from",
"coordinates",
"relative",
"to",
"the",
"specified",
"child",
"layer",
"to",
"coordinates",
"relative",
"to",
"the",
"specified",
"parent",
"layer",
"."
] | 7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66 | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L74-L77 | train | Convert a layer to its parent. | Create a Java method that does the following: "Convert a layer to its parent.". | Of course, here is the Java code you requested:
```java
public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
Point into = new Point(x, y);
return layerToParent(layer, parent, into, into);
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/SweepLruEvictionStrategy.java | SweepLruEvictionStrategy.sweep | private void sweep()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
if (isTraceOn && isTraceEnabled(false))
Tr.entry(tc.isEntryEnabled() ? tc : tcOOM,
ivCache.getName() + ": Sweep (" + ivCache.numSweeps +
... | java | private void sweep()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
if (isTraceOn && isTraceEnabled(false))
Tr.entry(tc.isEntryEnabled() ? tc : tcOOM,
ivCache.getName() + ": Sweep (" + ivCache.numSweeps +
... | [
"private",
"void",
"sweep",
"(",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"// d532639.2",
"if",
"(",
"isTraceOn",
"&&",
"isTraceEnabled",
"(",
"false",
")",
")",
"Tr",
".",
"entry",
"(",
"... | Loop through the Cache, evicting all eligible objects based on an LRU
algorithm. Evictions will continue even though the Cache may fall below
the soft limit as determined by the {@link Cache}'s
preferred maximum size. <p>
No need to reset the LRU data here, as that is done by the Cache when
the elements are accessed. ... | [
"Loop",
"through",
"the",
"Cache",
"evicting",
"all",
"eligible",
"objects",
"based",
"on",
"an",
"LRU",
"algorithm",
".",
"Evictions",
"will",
"continue",
"even",
"though",
"the",
"Cache",
"may",
"fall",
"below",
"the",
"soft",
"limit",
"as",
"determined",
... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/SweepLruEvictionStrategy.java#L573-L643 | train | Sweep the cache. | Create a Java method that does the following: "Sweep the cache.". | Of course, here is the Java code you requested:
```java
private void sweep()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
if (isTraceOn && isTraceEnabled(false))
Tr.entry(tc.isEntryEnabled() ? tc : tcOOM,
ivCache.getName() + ": Swe... | |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsObjectWrapper.java | CmsObjectWrapper.readPropertyObject | public CmsProperty readPropertyObject(CmsResource resource, String property, boolean search) throws CmsException {
return m_cms.readPropertyObject(resource, property, search);
} | java | public CmsProperty readPropertyObject(CmsResource resource, String property, boolean search) throws CmsException {
return m_cms.readPropertyObject(resource, property, search);
} | [
"public",
"CmsProperty",
"readPropertyObject",
"(",
"CmsResource",
"resource",
",",
"String",
"property",
",",
"boolean",
"search",
")",
"throws",
"CmsException",
"{",
"return",
"m_cms",
".",
"readPropertyObject",
"(",
"resource",
",",
"property",
",",
"search",
"... | Delegate method for {@link CmsObject#readPropertyObject(CmsResource, String, boolean)}.<p>
@see CmsObject#readPropertyObject(CmsResource, String, boolean)
@param resource the resource where the property is attached to
@param property the property name
@param search if true, the property is searched on all parent fold... | [
"Delegate",
"method",
"for",
"{",
"@link",
"CmsObject#readPropertyObject",
"(",
"CmsResource",
"String",
"boolean",
")",
"}",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsObjectWrapper.java#L597-L600 | train | Reads a property object from the given resource. | Create a Java method that does the following: "Reads a property object from the given resource.". | Of course, here is the Java code you requested:
```java
public CmsProperty readPropertyObject(CmsResource resource, String property, boolean search) throws CmsException {
return m_cms.readPropertyObject(resource, property, search);
}
```
Hope this helps! | |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/util/NetWorkCenter.java | NetWorkCenter.post | public static void post(String url, String paramData, List<File> fileList,
ResponseCallback callback) {
doRequest(RequestMethod.POST, url, paramData, fileList, callback);
} | java | public static void post(String url, String paramData, List<File> fileList,
ResponseCallback callback) {
doRequest(RequestMethod.POST, url, paramData, fileList, callback);
} | [
"public",
"static",
"void",
"post",
"(",
"String",
"url",
",",
"String",
"paramData",
",",
"List",
"<",
"File",
">",
"fileList",
",",
"ResponseCallback",
"callback",
")",
"{",
"doRequest",
"(",
"RequestMethod",
".",
"POST",
",",
"url",
",",
"paramData",
",... | 发起HTTP POST同步请求
jdk8使用函数式方式处理请求结果
jdk6使用内部类方式处理请求结果
@param url 请求对应的URL地址
@param paramData 请求所带参数,目前支持JSON格式的参数
@param fileList 需要一起发送的文件列表
@param callback 请求收到响应后回调函数,参数有2个,第一个为resultCode,即响应码,比如200为成功,404为不存在,500为服务器发生错误;
第二个为resultJson,即响应回来的数据报文 | [
"发起HTTP",
"POST同步请求",
"jdk8使用函数式方式处理请求结果",
"jdk6使用内部类方式处理请求结果"
] | 6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447 | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/util/NetWorkCenter.java#L105-L108 | train | Perform a POST request to a URL with the specified parameters and file list and response callback. | Create a Java method that does the following: "Perform a POST request to a URL with the specified parameters and file list and response callback.". | Of course, here is the Java code you requested:
```java
public static void post(String url, String paramData, List<File> fileList,
ResponseCallback callback) {
doRequest(RequestMethod.POST, url, paramData, fileList, callback);
}
```
Hope this helps! | |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java | SARLProjectConfigurator.addSarlLibraries | @SuppressWarnings("static-method")
protected void addSarlLibraries(IClasspathDescriptor classpath) {
final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID);
classpath.addEntry(entry);
} | java | @SuppressWarnings("static-method")
protected void addSarlLibraries(IClasspathDescriptor classpath) {
final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID);
classpath.addEntry(entry);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"void",
"addSarlLibraries",
"(",
"IClasspathDescriptor",
"classpath",
")",
"{",
"final",
"IClasspathEntry",
"entry",
"=",
"JavaCore",
".",
"newContainerEntry",
"(",
"SARLClasspathContainerInitializer",
"... | Add the SARL libraries into the given classpath.
@param classpath the classpath to update. | [
"Add",
"the",
"SARL",
"libraries",
"into",
"the",
"given",
"classpath",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L378-L382 | train | Add the SARL libraries. | Create a Java method that does the following: "Add the SARL libraries.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("static-method")
protected void addSarlLibraries(IClasspathDescriptor classpath) {
final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID);
classpath.addEntry(entry);
}
```
Hope this helps! | |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java | SpanCell.setTitle | public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
} | java | public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
} | [
"public",
"void",
"setTitle",
"(",
"String",
"title",
")",
"{",
"_spanState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"TITLE",
",",
"title",
")",
";",
"}"
] | Sets the value of the title attribute for the HTML span.
@param title
@jsptagref.attributedescription The title for the HTML span.
@jsptagref.attributesyntaxvalue <i>string_title</i>
@netui:attribute required="false" rtexprvalue="true" description="The title for the HTML span." | [
"Sets",
"the",
"value",
"of",
"the",
"title",
"attribute",
"for",
"the",
"HTML",
"span",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L248-L250 | train | Sets the title attribute for the HTML span. | Create a Java method that does the following: "Sets the title attribute for the HTML span.". | Of course, here is the Java code you requested:
```java
public void setTitle(String title) {
_spanState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.TITLE, title);
}
```
Hope this helps! | |
metamx/java-util | src/main/java/com/metamx/emitter/core/Emitters.java | Emitters.makeLoggingMap | static Map<String, Object> makeLoggingMap(Properties props)
{
Map<String, Object> loggingMap = Maps.newHashMap();
loggingMap.put(
"loggerClass", props.getProperty("com.metamx.emitter.logging.class", LoggingEmitter.class.getName())
);
loggingMap.put(
"logLevel", props.getProperty("com.... | java | static Map<String, Object> makeLoggingMap(Properties props)
{
Map<String, Object> loggingMap = Maps.newHashMap();
loggingMap.put(
"loggerClass", props.getProperty("com.metamx.emitter.logging.class", LoggingEmitter.class.getName())
);
loggingMap.put(
"logLevel", props.getProperty("com.... | [
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"makeLoggingMap",
"(",
"Properties",
"props",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"loggingMap",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"loggingMap",
".",
"put",
"(",
"\"loggerCla... | Package-visible for unit tests | [
"Package",
"-",
"visible",
"for",
"unit",
"tests"
] | 9d204043da1136e94fb2e2d63e3543a29bf54b4d | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/emitter/core/Emitters.java#L112-L123 | train | Make a logging map from the properties. | Create a Java method that does the following: "Make a logging map from the properties.". | Of course, here is the Java code you requested:
```java
static Map<String, Object> makeLoggingMap(Properties props)
{
Map<String, Object> loggingMap = Maps.newHashMap();
loggingMap.put(
"loggerClass", props.getProperty("com.metamx.emitter.logging.class", LoggingEmitter.class.getName())
);
lo... | |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/ChannelMapping.java | ChannelMapping.withOutputChannels | public ChannelMapping withOutputChannels(OutputChannelMapping... outputChannels) {
if (this.outputChannels == null) {
setOutputChannels(new java.util.ArrayList<OutputChannelMapping>(outputChannels.length));
}
for (OutputChannelMapping ele : outputChannels) {
this.outputCh... | java | public ChannelMapping withOutputChannels(OutputChannelMapping... outputChannels) {
if (this.outputChannels == null) {
setOutputChannels(new java.util.ArrayList<OutputChannelMapping>(outputChannels.length));
}
for (OutputChannelMapping ele : outputChannels) {
this.outputCh... | [
"public",
"ChannelMapping",
"withOutputChannels",
"(",
"OutputChannelMapping",
"...",
"outputChannels",
")",
"{",
"if",
"(",
"this",
".",
"outputChannels",
"==",
"null",
")",
"{",
"setOutputChannels",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"Outp... | List of output channels
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setOutputChannels(java.util.Collection)} or {@link #withOutputChannels(java.util.Collection)} if you want
to override the existing values.
</p>
@param outputChannels
List of output channels
@return Return... | [
"List",
"of",
"output",
"channels",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"any",
")",
".",
"Use",
"{",
"@link",
"#setOutputChannels",
"(",
"jav... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/ChannelMapping.java#L73-L81 | train | A list of output channels to be used in this message. | Create a Java method that does the following: "A list of output channels to be used in this message.". | Of course, here is the Java code you requested:
```java
public ChannelMapping withOutputChannels(OutputChannelMapping... outputChannels) {
if (this.outputChannels == null) {
setOutputChannels(new java.util.ArrayList<OutputChannelMapping>(outputChannels.length));
}
for (OutputChannel... | |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/eval/DocumentCrossValidator.java | DocumentCrossValidator.createDocumentClassificationFactory | public void createDocumentClassificationFactory(
final TrainingParameters params) throws IOException {
final String featureDescription = DocumentFeatureDescriptor
.createDocumentFeatureDescriptor(params);
System.err.println(featureDescription);
final byte[] featureGeneratorBytes = featureDescr... | java | public void createDocumentClassificationFactory(
final TrainingParameters params) throws IOException {
final String featureDescription = DocumentFeatureDescriptor
.createDocumentFeatureDescriptor(params);
System.err.println(featureDescription);
final byte[] featureGeneratorBytes = featureDescr... | [
"public",
"void",
"createDocumentClassificationFactory",
"(",
"final",
"TrainingParameters",
"params",
")",
"throws",
"IOException",
"{",
"final",
"String",
"featureDescription",
"=",
"DocumentFeatureDescriptor",
".",
"createDocumentFeatureDescriptor",
"(",
"params",
")",
"... | Create {@code createDocumentClassificationFactory} .
@param params
the parameter training file
@throws IOException
if io error | [
"Create",
"{",
"@code",
"createDocumentClassificationFactory",
"}",
"."
] | c817fa1e40e96ed15fc79d22c3a7c25f1a40d172 | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/eval/DocumentCrossValidator.java#L93-L106 | train | Create the document classification factory. | Create a Java method that does the following: "Create the document classification factory.". | Of course, here is the Java code you requested:
```java
public void createDocumentClassificationFactory(
final TrainingParameters params) throws IOException {
final String featureDescription = DocumentFeatureDescriptor
.createDocumentFeatureDescriptor(params);
System.err.println(featureDescriptio... | |
signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessagePipe.java | SignalServiceMessagePipe.read | public SignalServiceEnvelope read(long timeout, TimeUnit unit, MessagePipeCallback callback)
throws TimeoutException, IOException, InvalidVersionException
{
if (!credentialsProvider.isPresent()) {
throw new IllegalArgumentException("You can't read messages if you haven't specified credentials");
}... | java | public SignalServiceEnvelope read(long timeout, TimeUnit unit, MessagePipeCallback callback)
throws TimeoutException, IOException, InvalidVersionException
{
if (!credentialsProvider.isPresent()) {
throw new IllegalArgumentException("You can't read messages if you haven't specified credentials");
}... | [
"public",
"SignalServiceEnvelope",
"read",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
",",
"MessagePipeCallback",
"callback",
")",
"throws",
"TimeoutException",
",",
"IOException",
",",
"InvalidVersionException",
"{",
"if",
"(",
"!",
"credentialsProvider",
".",
... | A blocking call that reads a message off the pipe (see {@link #read(long, java.util.concurrent.TimeUnit)}
Unlike {@link #read(long, java.util.concurrent.TimeUnit)}, this method allows you
to specify a callback that will be called before the received message is acknowledged.
This allows you to write the received messag... | [
"A",
"blocking",
"call",
"that",
"reads",
"a",
"message",
"off",
"the",
"pipe",
"(",
"see",
"{",
"@link",
"#read",
"(",
"long",
"java",
".",
"util",
".",
"concurrent",
".",
"TimeUnit",
")",
"}"
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessagePipe.java#L93-L118 | train | Read a message from the server. | Create a Java method that does the following: "Read a message from the server.". | Of course, here is the Java code you requested:
```java
public SignalServiceEnvelope read(long timeout, TimeUnit unit, MessagePipeCallback callback)
throws TimeoutException, IOException, InvalidVersionException
{
if (!credentialsProvider.isPresent()) {
throw new IllegalArgumentException("You can't re... | |
MenoData/Time4J | base/src/main/java/net/time4j/format/expert/ChronoFormatter.java | ChronoFormatter.ofDatePattern | public static ChronoFormatter<PlainDate> ofDatePattern(
String pattern,
PatternType type,
Locale locale
) {
Builder<PlainDate> builder = new Builder<>(PlainDate.axis(), locale);
addPattern(builder, pattern, type);
try {
return builder.build();
} ... | java | public static ChronoFormatter<PlainDate> ofDatePattern(
String pattern,
PatternType type,
Locale locale
) {
Builder<PlainDate> builder = new Builder<>(PlainDate.axis(), locale);
addPattern(builder, pattern, type);
try {
return builder.build();
} ... | [
"public",
"static",
"ChronoFormatter",
"<",
"PlainDate",
">",
"ofDatePattern",
"(",
"String",
"pattern",
",",
"PatternType",
"type",
",",
"Locale",
"locale",
")",
"{",
"Builder",
"<",
"PlainDate",
">",
"builder",
"=",
"new",
"Builder",
"<>",
"(",
"PlainDate",
... | /*[deutsch]
<p>Konstruiert einen Formatierer für reine Datumsobjekte. </p>
@param pattern format pattern
@param type the type of the pattern to be used
@param locale format locale
@return new {@code ChronoFormatter}-instance
@throws IllegalArgumentException if resolving of pattern fails
@s... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"einen",
"Formatierer",
"fü",
";",
"r",
"reine",
"Datumsobjekte",
".",
"<",
"/",
"p",
">"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/ChronoFormatter.java#L2226-L2241 | train | Gets a ChronoFormatter for a calendar using the specified pattern and pattern type. | Create a Java method that does the following: "Gets a ChronoFormatter for a calendar using the specified pattern and pattern type.". | Of course, here is the Java code you requested:
```java
public static ChronoFormatter<PlainDate> ofDatePattern(
String pattern,
PatternType type,
Locale locale
) {
Builder<PlainDate> builder = new Builder<>(PlainDate.axis(), locale);
addPattern(builder, pattern, type);
... | |
phax/ph-commons | ph-matrix/src/main/java/com/helger/matrix/EigenvalueDecomposition.java | EigenvalueDecomposition._symmetricTql2 | private void _symmetricTql2 ()
{
// This is derived from the Algol procedures tql2, by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutine in EISPACK.
for (int i = 1; i < m_nDim; i++)
m_aEVe[i - 1] = m_aE... | java | private void _symmetricTql2 ()
{
// This is derived from the Algol procedures tql2, by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutine in EISPACK.
for (int i = 1; i < m_nDim; i++)
m_aEVe[i - 1] = m_aE... | [
"private",
"void",
"_symmetricTql2",
"(",
")",
"{",
"// This is derived from the Algol procedures tql2, by",
"// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for",
"// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding",
"// Fortran subroutine in EISPACK.",
"for",
"(",
"int",
"... | Symmetric tridiagonal QL algorithm. | [
"Symmetric",
"tridiagonal",
"QL",
"algorithm",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-matrix/src/main/java/com/helger/matrix/EigenvalueDecomposition.java#L230-L347 | train | TQL 2 implementation of the symmetric TQL algorithm. | Create a Java method that does the following: "TQL 2 implementation of the symmetric TQL algorithm.". | Of course, here is the Java code you requested:
```java
private void _symmetricTql2 ()
{
// This is derived from the Algol procedures tql2, by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutine in EISPACK.
fo... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/EIMImpl.java | EIMImpl.eIsSet | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.EIM__IDO_NAME:
return IDO_NAME_EDEFAULT == null ? idoName != null : !IDO_NAME_EDEFAULT.equals(idoName);
case AfplibPackage.EIM__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(fe... | java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.EIM__IDO_NAME:
return IDO_NAME_EDEFAULT == null ? idoName != null : !IDO_NAME_EDEFAULT.equals(idoName);
case AfplibPackage.EIM__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(fe... | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"EIM__IDO_NAME",
":",
"return",
"IDO_NAME_EDEFAULT",
"==",
"null",
"?",
"idoName",
"!=",
"null",
":",
"!",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/EIMImpl.java#L197-L206 | train | Replies if the feature is set to a value. | Create a Java method that does the following: "Replies if the feature is set to a value.". | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.EIM__IDO_NAME:
return IDO_NAME_EDEFAULT == null ? idoName != null : !IDO_NAME_EDEFAULT.equals(idoName);
case AfplibPackage.EIM__TRIPLETS:
return triplets != ... | |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/FSSpecStore.java | FSSpecStore.getAllVersionsOfSpec | @Override
public Collection<Spec> getAllVersionsOfSpec(URI specUri) {
Preconditions.checkArgument(null != specUri, "Spec URI should not be null");
Path specPath = getPathForURI(this.fsSpecStoreDirPath, specUri, FlowSpec.Builder.DEFAULT_VERSION);
return getAllVersionsOfSpec(specPath);
} | java | @Override
public Collection<Spec> getAllVersionsOfSpec(URI specUri) {
Preconditions.checkArgument(null != specUri, "Spec URI should not be null");
Path specPath = getPathForURI(this.fsSpecStoreDirPath, specUri, FlowSpec.Builder.DEFAULT_VERSION);
return getAllVersionsOfSpec(specPath);
} | [
"@",
"Override",
"public",
"Collection",
"<",
"Spec",
">",
"getAllVersionsOfSpec",
"(",
"URI",
"specUri",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"null",
"!=",
"specUri",
",",
"\"Spec URI should not be null\"",
")",
";",
"Path",
"specPath",
"=",
"g... | Returns all versions of the spec defined by specUri.
Currently, multiple versions are not supported, so this should return exactly one spec.
@param specUri URI for the {@link Spec} to be retrieved.
@return all versions of the spec. | [
"Returns",
"all",
"versions",
"of",
"the",
"spec",
"defined",
"by",
"specUri",
".",
"Currently",
"multiple",
"versions",
"are",
"not",
"supported",
"so",
"this",
"should",
"return",
"exactly",
"one",
"spec",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/FSSpecStore.java#L136-L141 | train | Get all versions of a Spec | Create a Java method that does the following: "Get all versions of a Spec". | Of course, here is the Java code you requested:
```java
@Override
public Collection<Spec> getAllVersionsOfSpec(URI specUri) {
Preconditions.checkArgument(null != specUri, "Spec URI should not be null");
Path specPath = getPathForURI(this.fsSpecStoreDirPath, specUri, FlowSpec.Builder.DEFAULT_VERSION);
ret... | |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/CssCharsetFilterPostProcessor.java | CssCharsetFilterPostProcessor.doPostProcessBundle | @Override
protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
throws IOException {
Matcher matcher = CHARSET_DECLARATION.matcher(bundleData.toString());
StringBuffer sb = new StringBuffer();
String currentCharset = null;
boolean charsetDefinedAtBegining = fals... | java | @Override
protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
throws IOException {
Matcher matcher = CHARSET_DECLARATION.matcher(bundleData.toString());
StringBuffer sb = new StringBuffer();
String currentCharset = null;
boolean charsetDefinedAtBegining = fals... | [
"@",
"Override",
"protected",
"StringBuffer",
"doPostProcessBundle",
"(",
"BundleProcessingStatus",
"status",
",",
"StringBuffer",
"bundleData",
")",
"throws",
"IOException",
"{",
"Matcher",
"matcher",
"=",
"CHARSET_DECLARATION",
".",
"matcher",
"(",
"bundleData",
".",
... | /*
(non-Javadoc)
@see net.jawr.web.resource.bundle.postprocess.
AbstractChainedResourceBundlePostProcessor
#doPostProcessBundle(net.jawr.web
.resource.bundle.postprocess.BundleProcessingStatus,
java.lang.StringBuffer) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 5381f6acf461cd2502593c67a77bd6ef9eab848d | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/CssCharsetFilterPostProcessor.java#L67-L103 | train | Override this method to add the charset declaration to the bundle data. | Create a Java method that does the following: "Override this method to add the charset declaration to the bundle data.". | Of course, here is the Java code you requested:
```java
@Override
protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
throws IOException {
Matcher matcher = CHARSET_DECLARATION.matcher(bundleData.toString());
StringBuffer sb = new StringBuffer();
String current... | |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java | AbstractConnection.setTraceLevel | public int setTraceLevel(final int level) {
final int oldLevel = traceLevel;
// pin the value
int theLevel = level;
if (level < 0) {
theLevel = 0;
} else if (level > 4) {
theLevel = 4;
}
traceLevel = theLevel;
return oldLevel;
... | java | public int setTraceLevel(final int level) {
final int oldLevel = traceLevel;
// pin the value
int theLevel = level;
if (level < 0) {
theLevel = 0;
} else if (level > 4) {
theLevel = 4;
}
traceLevel = theLevel;
return oldLevel;
... | [
"public",
"int",
"setTraceLevel",
"(",
"final",
"int",
"level",
")",
"{",
"final",
"int",
"oldLevel",
"=",
"traceLevel",
";",
"// pin the value",
"int",
"theLevel",
"=",
"level",
";",
"if",
"(",
"level",
"<",
"0",
")",
"{",
"theLevel",
"=",
"0",
";",
"... | <p>
Set the trace level for this connection. Normally tracing is off by
default unless System property OtpConnection.trace was set.
</p>
<p>
The following levels are valid: 0 turns off tracing completely, 1 shows
ordinary send and receive messages, 2 shows control messages such as link
and unlink, 3 shows handshaking ... | [
"<p",
">",
"Set",
"the",
"trace",
"level",
"for",
"this",
"connection",
".",
"Normally",
"tracing",
"is",
"off",
"by",
"default",
"unless",
"System",
"property",
"OtpConnection",
".",
"trace",
"was",
"set",
".",
"<",
"/",
"p",
">"
] | ac6084fd83240355f72e94adbf303e57832d1fab | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java#L758-L772 | train | Sets the trace level. | Create a Java method that does the following: "Sets the trace level.". | Of course, here is the Java code you requested:
```java
public int setTraceLevel(final int level) {
final int oldLevel = traceLevel;
// pin the value
int theLevel = level;
if (level < 0) {
theLevel = 0;
} else if (level > 4) {
theLevel = 4;
}
... | |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java | AmazonIdentityManagementClient.listServiceSpecificCredentials | @Override
public ListServiceSpecificCredentialsResult listServiceSpecificCredentials(ListServiceSpecificCredentialsRequest request) {
request = beforeClientExecution(request);
return executeListServiceSpecificCredentials(request);
} | java | @Override
public ListServiceSpecificCredentialsResult listServiceSpecificCredentials(ListServiceSpecificCredentialsRequest request) {
request = beforeClientExecution(request);
return executeListServiceSpecificCredentials(request);
} | [
"@",
"Override",
"public",
"ListServiceSpecificCredentialsResult",
"listServiceSpecificCredentials",
"(",
"ListServiceSpecificCredentialsRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeListServiceSpecificCredenti... | <p>
Returns information about the service-specific credentials associated with the specified IAM user. If none
exists, the operation returns an empty list. The service-specific credentials returned by this operation are used
only for authenticating the IAM user to a specific service. For more information about using se... | [
"<p",
">",
"Returns",
"information",
"about",
"the",
"service",
"-",
"specific",
"credentials",
"associated",
"with",
"the",
"specified",
"IAM",
"user",
".",
"If",
"none",
"exists",
"the",
"operation",
"returns",
"an",
"empty",
"list",
".",
"The",
"service",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java#L7284-L7288 | train | Returns a list of service - specific credentials. | Create a Java method that does the following: "Returns a list of service - specific credentials.". | Of course, here is the Java code you requested:
```java
@Override
public ListServiceSpecificCredentialsResult listServiceSpecificCredentials(ListServiceSpecificCredentialsRequest request) {
request = beforeClientExecution(request);
return executeListServiceSpecificCredentials(request);
}
```
H... | |
bit-man/SwissArmyJavaGit | javagit/src/main/java/edu/nyu/cs/javagit/utilities/CheckUtilities.java | CheckUtilities.checkStringListArgument | public static void checkStringListArgument(List<String> str, String variableName) {
if (null == str) {
throw new NullPointerException(ExceptionMessageMap.getMessage("000002")
+ " { variableName=[" + variableName + "] }");
}
if (str.size() == 0) {
throw new IllegalArgumentException(Exc... | java | public static void checkStringListArgument(List<String> str, String variableName) {
if (null == str) {
throw new NullPointerException(ExceptionMessageMap.getMessage("000002")
+ " { variableName=[" + variableName + "] }");
}
if (str.size() == 0) {
throw new IllegalArgumentException(Exc... | [
"public",
"static",
"void",
"checkStringListArgument",
"(",
"List",
"<",
"String",
">",
"str",
",",
"String",
"variableName",
")",
"{",
"if",
"(",
"null",
"==",
"str",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"ExceptionMessageMap",
".",
"getMessa... | Checks a <code>List<String></code> argument to make sure it is not null, none of its
elements are null, and all its elements contain one or more characters. If the
<code>List<String></code> or a contained <code>String</code> is null, a
<code>NullPointerException</code> is thrown. If the <code>List<String... | [
"Checks",
"a",
"<code",
">",
"List<",
";",
"String>",
";",
"<",
"/",
"code",
">",
"argument",
"to",
"make",
"sure",
"it",
"is",
"not",
"null",
"none",
"of",
"its",
"elements",
"are",
"null",
"and",
"all",
"its",
"elements",
"contain",
"one",
"or",
... | ba045a76d1a3ae6d07272520501daebf5159a8bd | https://github.com/bit-man/SwissArmyJavaGit/blob/ba045a76d1a3ae6d07272520501daebf5159a8bd/javagit/src/main/java/edu/nyu/cs/javagit/utilities/CheckUtilities.java#L220-L232 | valid | checkStringListArgument This method checks if the list of strings is a list of strings. | Create a Java method that does the following: "checkStringListArgument This method checks if the list of strings is a list of strings.". | Of course, here is the Java code you requested:
```java
public static void checkStringListArgument(List<String> str, String variableName) {
if (null == str) {
throw new NullPointerException(ExceptionMessageMap.getMessage("000002")
+ " { variableName=[" + variableName + "] }");
}
if (str.si... | |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java | ServiceManagerSparql.clearServices | @Override
public boolean clearServices() throws ServiceException {
if (!this.graphStoreManager.canBeModified()) {
log.warn("The dataset cannot be modified.");
return false;
}
log.info("Clearing services registry.");
this.graphStoreManager.clearDataset();
... | java | @Override
public boolean clearServices() throws ServiceException {
if (!this.graphStoreManager.canBeModified()) {
log.warn("The dataset cannot be modified.");
return false;
}
log.info("Clearing services registry.");
this.graphStoreManager.clearDataset();
... | [
"@",
"Override",
"public",
"boolean",
"clearServices",
"(",
")",
"throws",
"ServiceException",
"{",
"if",
"(",
"!",
"this",
".",
"graphStoreManager",
".",
"canBeModified",
"(",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"The dataset cannot be modified.\"",
")",
... | Deletes all the services on the registry.
This operation cannot be undone. Use with care.
@return
@throws uk.ac.open.kmi.iserve.sal.exception.ServiceException | [
"Deletes",
"all",
"the",
"services",
"on",
"the",
"registry",
".",
"This",
"operation",
"cannot",
"be",
"undone",
".",
"Use",
"with",
"care",
"."
] | 13e7016e64c1d5a539b838c6debf1a5cc4aefcb7 | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java#L553-L568 | train | Clears the services. | Create a Java method that does the following: "Clears the services.". | Of course, here is the Java code you requested:
```java
@Override
public boolean clearServices() throws ServiceException {
if (!this.graphStoreManager.canBeModified()) {
log.warn("The dataset cannot be modified.");
return false;
}
log.info("Clearing services regist... | |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.splitString | public static int splitString(String line, char[][][] buff) {
int len=line.length();
int wordCount=0;
int pos=0;
while(pos<len) {
// Skip past blank space
while(pos<len&&line.charAt(pos)<=' ') pos++;
int start=pos;
// Skip to the next blank space
while(pos<len&&line.charAt(pos)>' ') pos++;
if(... | java | public static int splitString(String line, char[][][] buff) {
int len=line.length();
int wordCount=0;
int pos=0;
while(pos<len) {
// Skip past blank space
while(pos<len&&line.charAt(pos)<=' ') pos++;
int start=pos;
// Skip to the next blank space
while(pos<len&&line.charAt(pos)>' ') pos++;
if(... | [
"public",
"static",
"int",
"splitString",
"(",
"String",
"line",
",",
"char",
"[",
"]",
"[",
"]",
"[",
"]",
"buff",
")",
"{",
"int",
"len",
"=",
"line",
".",
"length",
"(",
")",
";",
"int",
"wordCount",
"=",
"0",
";",
"int",
"pos",
"=",
"0",
";... | Splits a <code>String</code> into a <code>String[]</code>. | [
"Splits",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"into",
"a",
"<code",
">",
"String",
"[]",
"<",
"/",
"code",
">",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L838-L870 | train | Splits a string into words and puts them into buff. | Create a Java method that does the following: "Splits a string into words and puts them into buff.". | Of course, here is the Java code you requested:
```java
public static int splitString(String line, char[][][] buff) {
int len=line.length();
int wordCount=0;
int pos=0;
while(pos<len) {
// Skip past blank space
while(pos<len&&line.charAt(pos)<=' ') pos++;
int start=pos;
// Skip to the next blank sp... | |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java | JsonUtils.fromJsonParser | public static Object fromJsonParser(JsonParser jp) throws IOException {
Object rval;
final JsonToken initialToken = jp.nextToken();
if (initialToken == JsonToken.START_ARRAY) {
rval = jp.readValueAs(List.class);
} else if (initialToken == JsonToken.START_OBJECT) {
... | java | public static Object fromJsonParser(JsonParser jp) throws IOException {
Object rval;
final JsonToken initialToken = jp.nextToken();
if (initialToken == JsonToken.START_ARRAY) {
rval = jp.readValueAs(List.class);
} else if (initialToken == JsonToken.START_OBJECT) {
... | [
"public",
"static",
"Object",
"fromJsonParser",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"Object",
"rval",
";",
"final",
"JsonToken",
"initialToken",
"=",
"jp",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"initialToken",
"==",
"JsonToken",
... | Parses a JSON-LD document from the given {@link JsonParser} to an object
that can be used as input for the {@link JsonLdApi} and
{@link JsonLdProcessor} methods.
@param jp
The JSON-LD document in a {@link JsonParser}.
@return A JSON Object.
@throws JsonParseException
If there was a JSON related error during parsing.
@... | [
"Parses",
"a",
"JSON",
"-",
"LD",
"document",
"from",
"the",
"given",
"{",
"@link",
"JsonParser",
"}",
"to",
"an",
"object",
"that",
"can",
"be",
"used",
"as",
"input",
"for",
"the",
"{",
"@link",
"JsonLdApi",
"}",
"and",
"{",
"@link",
"JsonLdProcessor",... | efeef6ee96029a0011649633457035fa6be42da1 | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java#L189-L226 | train | Deserialize a JsonParser object into a class. | Create a Java method that does the following: "Deserialize a JsonParser object into a class.". | Of course, here is the Java code you requested:
```java
public static Object fromJsonParser(JsonParser jp) throws IOException {
Object rval;
final JsonToken initialToken = jp.nextToken();
if (initialToken == JsonToken.START_ARRAY) {
rval = jp.readValueAs(List.class);
} else... | |
lucmoreau/ProvToolbox | prov-xml/src/main/java/org/openprovenance/prov/xml/Entity.java | Entity.getValue | public org.openprovenance.prov.model.Value getValue() {
if (value==null) {
if (all!=null) { // TODO: inefficient, I search this list every time getValue is called, though there may be no value
for (Attribute attr: all) {
if (attr instanceof org.openprovenance.prov.model.Value) {
... | java | public org.openprovenance.prov.model.Value getValue() {
if (value==null) {
if (all!=null) { // TODO: inefficient, I search this list every time getValue is called, though there may be no value
for (Attribute attr: all) {
if (attr instanceof org.openprovenance.prov.model.Value) {
... | [
"public",
"org",
".",
"openprovenance",
".",
"prov",
".",
"model",
".",
"Value",
"getValue",
"(",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"all",
"!=",
"null",
")",
"{",
"// TODO: inefficient, I search this list every time getValue is c... | Gets the value of the value property.
@return
possible object is
{@link org.openprovenance.prov.xml.Value } | [
"Gets",
"the",
"value",
"of",
"the",
"value",
"property",
"."
] | f865952868ffb69432937b08728c86bebbe4678a | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-xml/src/main/java/org/openprovenance/prov/xml/Entity.java#L214-L225 | train | Gets the value. | Create a Java method that does the following: "Gets the value.". | Of course, here is the Java code you requested:
```java
public org.openprovenance.prov.model.Value getValue() {
if (value==null) {
if (all!=null) { // TODO: inefficient, I search this list every time getValue is called, though there may be no value
for (Attribute attr: all) {
if (attr insta... | |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java | TopologyMetricContext.updateMetricCounters | protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
metricNameCounters.put(metricName, 1);
... | java | protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
metricNameCounters.put(metricName, 1);
... | [
"protected",
"void",
"updateMetricCounters",
"(",
"String",
"metricName",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"metricNameCounters",
")",
"{",
"if",
"(",
"metricNameCounters",
".",
"containsKey",
"(",
"metricName",
")",
")",
"{",
"metricNameCounters",
... | computes occurrences of specified metric name | [
"computes",
"occurrences",
"of",
"specified",
"metric",
"name"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/TopologyMetricContext.java#L393-L399 | train | Update the metric counters. | Create a Java method that does the following: "Update the metric counters.". | Of course, here is the Java code you requested:
```java
protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java | AfplibPackageImpl.getIPGIPgFlgs | public EEnum getIPGIPgFlgs() {
if (ipgiPgFlgsEEnum == null) {
ipgiPgFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(42);
}
return ipgiPgFlgsEEnum;
} | java | public EEnum getIPGIPgFlgs() {
if (ipgiPgFlgsEEnum == null) {
ipgiPgFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(42);
}
return ipgiPgFlgsEEnum;
} | [
"public",
"EEnum",
"getIPGIPgFlgs",
"(",
")",
"{",
"if",
"(",
"ipgiPgFlgsEEnum",
"==",
"null",
")",
"{",
"ipgiPgFlgsEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"AfplibPackage",
".",
"eNS_URI",
")",
... | <!-- 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#L16450-L16455 | train | Get the IPGIPgFlgs attribute value. | Create a Java method that does the following: "Get the IPGIPgFlgs attribute value.". | Of course, here is the Java code you requested:
```java
public EEnum getIPGIPgFlgs() {
if (ipgiPgFlgsEEnum == null) {
ipgiPgFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(42);
}
return ipgiPgFlgsEEnum;
}
```
Hope this helps! | |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.exchange | public Reply exchange(Command cmd)
throws ServerException, IOException, FTPReplyParseException {
// send the command
write(cmd);
// get the reply
return read();
} | java | public Reply exchange(Command cmd)
throws ServerException, IOException, FTPReplyParseException {
// send the command
write(cmd);
// get the reply
return read();
} | [
"public",
"Reply",
"exchange",
"(",
"Command",
"cmd",
")",
"throws",
"ServerException",
",",
"IOException",
",",
"FTPReplyParseException",
"{",
"// send the command",
"write",
"(",
"cmd",
")",
";",
"// get the reply",
"return",
"read",
"(",
")",
";",
"}"
] | Write the command to the control channel,
block until reply arrives and return the reply.
Before calling this method make sure that no old replies are
waiting on the control channel. Otherwise the reply returned
may not be the reply to this command.
@throws java.io.IOException on I/O error
@throws FTPReplyParseExceptio... | [
"Write",
"the",
"command",
"to",
"the",
"control",
"channel",
"block",
"until",
"reply",
"arrives",
"and",
"return",
"the",
"reply",
".",
"Before",
"calling",
"this",
"method",
"make",
"sure",
"that",
"no",
"old",
"replies",
"are",
"waiting",
"on",
"the",
... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L415-L421 | train | Exchange a command to a CRASSA Cookie set command. | Create a Java method that does the following: "Exchange a command to a CRASSA Cookie set command.". | Of course, here is the Java code you requested:
```java
public Reply exchange(Command cmd)
throws ServerException, IOException, FTPReplyParseException {
// send the command
write(cmd);
// get the reply
return read();
}
```
Hope this helps! | |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/tokenization/WordSegmenterTrainer.java | WordSegmenterTrainer.getDataset | protected Dataset<Sequence> getDataset(SequenceFeaturizer<Character> featurizer) {
List<Sequence> trainingData = new ArrayList<>();
try (MStream<String> lines = corpus.lines()) {
lines.forEach(line -> {
line = line.trim();
if (StringUtils.isNotNullOrBlank(line)) {
... | java | protected Dataset<Sequence> getDataset(SequenceFeaturizer<Character> featurizer) {
List<Sequence> trainingData = new ArrayList<>();
try (MStream<String> lines = corpus.lines()) {
lines.forEach(line -> {
line = line.trim();
if (StringUtils.isNotNullOrBlank(line)) {
... | [
"protected",
"Dataset",
"<",
"Sequence",
">",
"getDataset",
"(",
"SequenceFeaturizer",
"<",
"Character",
">",
"featurizer",
")",
"{",
"List",
"<",
"Sequence",
">",
"trainingData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"(",
"MStream",
"<",
"S... | Gets dataset.
@param featurizer the featurizer
@return the dataset | [
"Gets",
"dataset",
"."
] | 9ebefe7ad5dea1b731ae6931a30771eb75325ea3 | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/tokenization/WordSegmenterTrainer.java#L64-L90 | train | Get Dataset from corpus | Create a Java method that does the following: "Get Dataset from corpus". | Of course, here is the Java code you requested:
```java
protected Dataset<Sequence> getDataset(SequenceFeaturizer<Character> featurizer) {
List<Sequence> trainingData = new ArrayList<>();
try (MStream<String> lines = corpus.lines()) {
lines.forEach(line -> {
line = line.trim();
... | |
floragunncom/search-guard | src/main/java/com/floragunn/searchguard/compliance/ComplianceConfig.java | ComplianceConfig.readHistoryEnabledForIndex | public boolean readHistoryEnabledForIndex(String index) {
if(!this.enabled) {
return false;
}
if(searchguardIndex.equals(index)) {
return logInternalConfig;
}
try {
return !cache.get(index).isEmpty();
} catch ... | java | public boolean readHistoryEnabledForIndex(String index) {
if(!this.enabled) {
return false;
}
if(searchguardIndex.equals(index)) {
return logInternalConfig;
}
try {
return !cache.get(index).isEmpty();
} catch ... | [
"public",
"boolean",
"readHistoryEnabledForIndex",
"(",
"String",
"index",
")",
"{",
"if",
"(",
"!",
"this",
".",
"enabled",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"searchguardIndex",
".",
"equals",
"(",
"index",
")",
")",
"{",
"return",
"logI... | check for isEnabled | [
"check",
"for",
"isEnabled"
] | f9828004e11dc0e4b6da4dead1fafcf3be8f7f6d | https://github.com/floragunncom/search-guard/blob/f9828004e11dc0e4b6da4dead1fafcf3be8f7f6d/src/main/java/com/floragunn/searchguard/compliance/ComplianceConfig.java#L237-L253 | train | Read History enabled for the given index. | Create a Java method that does the following: "Read History enabled for the given index.". | Of course, here is the Java code you requested:
```java
public boolean readHistoryEnabledForIndex(String index) {
if(!this.enabled) {
return false;
}
if(searchguardIndex.equals(index)) {
return logInternalConfig;
}
try {
... | |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.scaling | public Matrix4d scaling(Vector3dc xyz) {
return scaling(xyz.x(), xyz.y(), xyz.z());
} | java | public Matrix4d scaling(Vector3dc xyz) {
return scaling(xyz.x(), xyz.y(), xyz.z());
} | [
"public",
"Matrix4d",
"scaling",
"(",
"Vector3dc",
"xyz",
")",
"{",
"return",
"scaling",
"(",
"xyz",
".",
"x",
"(",
")",
",",
"xyz",
".",
"y",
"(",
")",
",",
"xyz",
".",
"z",
"(",
")",
")",
";",
"}"
] | Set this matrix to be a simple scale matrix which scales the base axes by
<code>xyz.x</code>, <code>xyz.y</code> and <code>xyz.z</code>, respectively.
<p>
The resulting matrix can be multiplied against another transformation
matrix to obtain an additional scaling.
<p>
In order to post-multiply a scaling transformation ... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"simple",
"scale",
"matrix",
"which",
"scales",
"the",
"base",
"axes",
"by",
"<code",
">",
"xyz",
".",
"x<",
"/",
"code",
">",
"<code",
">",
"xyz",
".",
"y<",
"/",
"code",
">",
"and",
"<code",
">",
"xyz",
... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L3586-L3588 | train | Scaling the matrix to the given coordinates. | Create a Java method that does the following: "Scaling the matrix to the given coordinates.". | Of course, here is the Java code you requested:
```java
public Matrix4d scaling(Vector3dc xyz) {
return scaling(xyz.x(), xyz.y(), xyz.z());
}
```
Hope this helps! | |
atomix/atomix | protocols/log/src/main/java/io/atomix/protocols/log/roles/LogServerRole.java | LogServerRole.backup | public CompletableFuture<BackupResponse> backup(BackupRequest request) {
logRequest(request);
return CompletableFuture.completedFuture(logResponse(BackupResponse.error()));
} | java | public CompletableFuture<BackupResponse> backup(BackupRequest request) {
logRequest(request);
return CompletableFuture.completedFuture(logResponse(BackupResponse.error()));
} | [
"public",
"CompletableFuture",
"<",
"BackupResponse",
">",
"backup",
"(",
"BackupRequest",
"request",
")",
"{",
"logRequest",
"(",
"request",
")",
";",
"return",
"CompletableFuture",
".",
"completedFuture",
"(",
"logResponse",
"(",
"BackupResponse",
".",
"error",
... | Handles a backup request.
@param request the backup request
@return future to be completed with the backup response | [
"Handles",
"a",
"backup",
"request",
"."
] | 3a94b7c80576d762dd0d396d4645df07a0b37c31 | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/log/src/main/java/io/atomix/protocols/log/roles/LogServerRole.java#L116-L119 | train | Backup a single resource. | Create a Java method that does the following: "Backup a single resource.". | Of course, here is the Java code you requested:
```java
public CompletableFuture<BackupResponse> backup(BackupRequest request) {
logRequest(request);
return CompletableFuture.completedFuture(logResponse(BackupResponse.error()));
}
```
Hope this helps! | |
authlete/authlete-java-jaxrs | src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java | UserInfoRequestHandler.handle | public Response handle(String accessToken) throws WebApplicationException
{
// If an access token is not available.
if (accessToken == null)
{
// Return "400 Bad Request".
return ResponseUtil.bearerError(
Status.BAD_REQUEST, CHALLENGE_ON_MISSING_AC... | java | public Response handle(String accessToken) throws WebApplicationException
{
// If an access token is not available.
if (accessToken == null)
{
// Return "400 Bad Request".
return ResponseUtil.bearerError(
Status.BAD_REQUEST, CHALLENGE_ON_MISSING_AC... | [
"public",
"Response",
"handle",
"(",
"String",
"accessToken",
")",
"throws",
"WebApplicationException",
"{",
"// If an access token is not available.",
"if",
"(",
"accessToken",
"==",
"null",
")",
"{",
"// Return \"400 Bad Request\".",
"return",
"ResponseUtil",
".",
"bear... | Handle a userinfo request to a <a href=
"http://openid.net/specs/openid-connect-core-1_0.html#UserInfo"
>UserInfo Endpoint</a> defined in <a href=
"http://openid.net/specs/openid-connect-core-1_0.html">OpenID Connect
Core 1.0</a>.
@param accessToken
An access token.
@return
A response that should be returned f... | [
"Handle",
"a",
"userinfo",
"request",
"to",
"a",
"<a",
"href",
"=",
"http",
":",
"//",
"openid",
".",
"net",
"/",
"specs",
"/",
"openid",
"-",
"connect",
"-",
"core",
"-",
"1_0",
".",
"html#UserInfo",
">",
"UserInfo",
"Endpoint<",
"/",
"a",
">",
"def... | 9b043732c57b5ad2aebb8ffebb5ab56b9c5d86ad | https://github.com/authlete/authlete-java-jaxrs/blob/9b043732c57b5ad2aebb8ffebb5ab56b9c5d86ad/src/main/java/com/authlete/jaxrs/UserInfoRequestHandler.java#L98-L122 | valid | Handle a request with an access token. | Create a Java method that does the following: "Handle a request with an access token.". | Of course, here is the Java code you requested:
```java
public Response handle(String accessToken) throws WebApplicationException
{
// If an access token is not available.
if (accessToken == null)
{
// Return "400 Bad Request".
return ResponseUtil.bearerError(
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/AbstractItem.java | AbstractItem.persistLock | public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
Membership membership = _getMembership();
if (null == membership)
{
throw new NotInMessageStore();
}
membership.persistLock(t... | java | public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
Membership membership = _getMembership();
if (null == membership)
{
throw new NotInMessageStore();
}
membership.persistLock(t... | [
"public",
"final",
"void",
"persistLock",
"(",
"final",
"Transaction",
"transaction",
")",
"throws",
"ProtocolException",
",",
"TransactionException",
",",
"SevereMessageStoreException",
"{",
"Membership",
"membership",
"=",
"_getMembership",
"(",
")",
";",
"if",
"(",... | Use this method to persist the lock currently active on the item.
Item MUST be locked.
@param transaction
@throws SevereMessageStoreException
@throws {@ProtocolException} Thrown if an add is attempted when the
transaction cannot allow any further work to be added i.e. after
completion of the transaction.
@throws {@Tr... | [
"Use",
"this",
"method",
"to",
"persist",
"the",
"lock",
"currently",
"active",
"on",
"the",
"item",
".",
"Item",
"MUST",
"be",
"locked",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/AbstractItem.java#L880-L888 | train | Persists the message store lock. | Create a Java method that does the following: "Persists the message store lock.". | Of course, here is the Java code you requested:
```java
public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
Membership membership = _getMembership();
if (null == membership)
{
throw new NotInM... | |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java | FairScheduler.reconfigureProperty | @Override
public final String reconfigureProperty(String property, String newVal)
throws ReconfigurationException {
if (isPropertyReconfigurable(property)) {
String oldVal;
synchronized(getConf()) {
oldVal = getConf().get(property);
reconfigurePropertyImpl(property, newVal);
... | java | @Override
public final String reconfigureProperty(String property, String newVal)
throws ReconfigurationException {
if (isPropertyReconfigurable(property)) {
String oldVal;
synchronized(getConf()) {
oldVal = getConf().get(property);
reconfigurePropertyImpl(property, newVal);
... | [
"@",
"Override",
"public",
"final",
"String",
"reconfigureProperty",
"(",
"String",
"property",
",",
"String",
"newVal",
")",
"throws",
"ReconfigurationException",
"{",
"if",
"(",
"isPropertyReconfigurable",
"(",
"property",
")",
")",
"{",
"String",
"oldVal",
";",... | Based on ReconfigurableBase.reconfigureProperty(). | [
"Based",
"on",
"ReconfigurableBase",
".",
"reconfigureProperty",
"()",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L2580-L2599 | train | Reconfigure a single SECTYPE property. | Create a Java method that does the following: "Reconfigure a single SECTYPE property.". | Of course, here is the Java code you requested:
```java
@Override
public final String reconfigureProperty(String property, String newVal)
throws ReconfigurationException {
if (isPropertyReconfigurable(property)) {
String oldVal;
synchronized(getConf()) {
oldVal = getConf().get(property);
... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePreInvokeBegins | public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeEntry_Type_Str).append(Dat... | java | public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeEntry_Type_Str).append(Dat... | [
"public",
"static",
"void",
"tracePreInvokeBegins",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffe... | This is called by the EJB container server code to write a
EJB method call preinvoke begins record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"preinvoke",
"begins",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L31-L45 | train | Trace a message indicating that preInvoke begins is enabled on the EJSDeployedSupport object. | Create a Java method that does the following: "Trace a message indicating that preInvoke begins is enabled on the EJSDeployedSupport object.". | Of course, here is the Java code you requested:
```java
public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
... | |
MenoData/Time4J | base/src/main/java/net/time4j/engine/CalendarDays.java | CalendarDays.plus | public CalendarDays plus(CalendarDays other) {
return CalendarDays.of(Math.addExact(this.days, other.days));
} | java | public CalendarDays plus(CalendarDays other) {
return CalendarDays.of(Math.addExact(this.days, other.days));
} | [
"public",
"CalendarDays",
"plus",
"(",
"CalendarDays",
"other",
")",
"{",
"return",
"CalendarDays",
".",
"of",
"(",
"Math",
".",
"addExact",
"(",
"this",
".",
"days",
",",
"other",
".",
"days",
")",
")",
";",
"}"
] | /*[deutsch]
<p>Liefert die Summe der Kalendertage dieser Instanz und des angegebenen Arguments. </p>
@param other calendar days to be added
@return sum of calendar days
@since 3.4/4.3 | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Liefert",
"die",
"Summe",
"der",
"Kalendertage",
"dieser",
"Instanz",
"und",
"des",
"angegebenen",
"Arguments",
".",
"<",
"/",
"p",
">"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/engine/CalendarDays.java#L234-L238 | train | Add the specified calendar days to this calendar. | Create a Java method that does the following: "Add the specified calendar days to this calendar.". | Of course, here is the Java code you requested:
```java
public CalendarDays plus(CalendarDays other) {
return CalendarDays.of(Math.addExact(this.days, other.days));
}
```
Hope this helps! | |
arnaudroger/SimpleFlatMapper | sfm-springjdbc/src/main/java/org/simpleflatmapper/jdbc/spring/JdbcTemplateCrud.java | JdbcTemplateCrud.update | public void update(final Collection<T> values) throws DataAccessException {
jdbcTemplate.execute(new ConnectionCallback<Object>() {
@Override
public Object doInConnection(Connection connection) throws SQLException, DataAccessException {
crud.update(connection, values);
... | java | public void update(final Collection<T> values) throws DataAccessException {
jdbcTemplate.execute(new ConnectionCallback<Object>() {
@Override
public Object doInConnection(Connection connection) throws SQLException, DataAccessException {
crud.update(connection, values);
... | [
"public",
"void",
"update",
"(",
"final",
"Collection",
"<",
"T",
">",
"values",
")",
"throws",
"DataAccessException",
"{",
"jdbcTemplate",
".",
"execute",
"(",
"new",
"ConnectionCallback",
"<",
"Object",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Objec... | update the objects.
@param values the objects
@throws DataAccessException if an error occurs | [
"update",
"the",
"objects",
"."
] | 93435438c18f26c87963d5e0f3ebf0f264dcd8c2 | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-springjdbc/src/main/java/org/simpleflatmapper/jdbc/spring/JdbcTemplateCrud.java#L153-L161 | train | Update the records in the database. | Create a Java method that does the following: "Update the records in the database.". | Of course, here is the Java code you requested:
```java
public void update(final Collection<T> values) throws DataAccessException {
jdbcTemplate.execute(new ConnectionCallback<Object>() {
@Override
public Object doInConnection(Connection connection) throws SQLException, DataAccessExcept... | |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/component/SeaGlassInternalFrameTitlePane.java | SeaGlassInternalFrameTitlePane.uninstallDefaults | public void uninstallDefaults() {
SeaGlassContext context = getContext(this, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
JInternalFrame.JDesktopIcon di = frame.getDesktopIcon();
if (di != null && di.getComponentPopupMenu() == systemPopup... | java | public void uninstallDefaults() {
SeaGlassContext context = getContext(this, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
JInternalFrame.JDesktopIcon di = frame.getDesktopIcon();
if (di != null && di.getComponentPopupMenu() == systemPopup... | [
"public",
"void",
"uninstallDefaults",
"(",
")",
"{",
"SeaGlassContext",
"context",
"=",
"getContext",
"(",
"this",
",",
"ENABLED",
")",
";",
"style",
".",
"uninstallDefaults",
"(",
"context",
")",
";",
"context",
".",
"dispose",
"(",
")",
";",
"style",
"=... | Uninstall the defaults. | [
"Uninstall",
"the",
"defaults",
"."
] | f25ecba622923d7b29b64cb7d6068dd8005989b3 | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/component/SeaGlassInternalFrameTitlePane.java#L258-L271 | train | Uninstall the defaults. | Create a Java method that does the following: "Uninstall the defaults.". | Of course, here is the Java code you requested:
```java
public void uninstallDefaults() {
SeaGlassContext context = getContext(this, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
JInternalFrame.JDesktopIcon di = frame.getDesktopIcon();
if... | |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java | BaseNeo4jEntityQueries.initMultiGetEntitiesQuery | private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) {
StringBuilder queryBuilder = new StringBuilder( "MATCH " );
queryBuilder.append( "(" );
queryBuilder.append( ENTITY_ALIAS );
queryBuilder.append( ":" );
queryBuilder.append( ENTITY );
queryBuilder... | java | private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) {
StringBuilder queryBuilder = new StringBuilder( "MATCH " );
queryBuilder.append( "(" );
queryBuilder.append( ENTITY_ALIAS );
queryBuilder.append( ":" );
queryBuilder.append( ENTITY );
queryBuilder... | [
"private",
"static",
"String",
"initMultiGetEntitiesQuery",
"(",
"EntityKeyMetadata",
"entityKeyMetadata",
",",
"boolean",
"includeEmbedded",
")",
"{",
"StringBuilder",
"queryBuilder",
"=",
"new",
"StringBuilder",
"(",
"\"MATCH \"",
")",
";",
"queryBuilder",
".",
"appen... | /*
This method will initialize the query string for a multi get.
The query is different in the two scenarios:
1) the id is mapped on a single property:
MATCH (n:ENTITY:table)
WHERE n.id IN {0}
RETURN n
2) id is mapped on multiple columns:
MATCH (n:ENTITY:table)
WHERE
In this case the query depends on how many id we... | [
"/",
"*",
"This",
"method",
"will",
"initialize",
"the",
"query",
"string",
"for",
"a",
"multi",
"get",
".",
"The",
"query",
"is",
"different",
"in",
"the",
"two",
"scenarios",
":",
"1",
")",
"the",
"id",
"is",
"mapped",
"on",
"a",
"single",
"property"... | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java#L165-L183 | train | Initialize the query for a multi - get entity query. | Create a Java method that does the following: "Initialize the query for a multi - get entity query.". | Of course, here is the Java code you requested:
```java
private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) {
StringBuilder queryBuilder = new StringBuilder( "MATCH " );
queryBuilder.append( "(" );
queryBuilder.append( ENTITY_ALIAS );
queryBuilder.appen... | |
aws/aws-sdk-java | aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/CreateDeploymentGroupRequest.java | CreateDeploymentGroupRequest.withEcsServices | public CreateDeploymentGroupRequest withEcsServices(ECSService... ecsServices) {
if (this.ecsServices == null) {
setEcsServices(new com.amazonaws.internal.SdkInternalList<ECSService>(ecsServices.length));
}
for (ECSService ele : ecsServices) {
this.ecsServices.add(ele);
... | java | public CreateDeploymentGroupRequest withEcsServices(ECSService... ecsServices) {
if (this.ecsServices == null) {
setEcsServices(new com.amazonaws.internal.SdkInternalList<ECSService>(ecsServices.length));
}
for (ECSService ele : ecsServices) {
this.ecsServices.add(ele);
... | [
"public",
"CreateDeploymentGroupRequest",
"withEcsServices",
"(",
"ECSService",
"...",
"ecsServices",
")",
"{",
"if",
"(",
"this",
".",
"ecsServices",
"==",
"null",
")",
"{",
"setEcsServices",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkIntern... | <p>
The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the
Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name
pair using the format <code><clustername>:<servicename></code>.
</p>
<p>
<b>NOTE:</b... | [
"<p",
">",
"The",
"target",
"Amazon",
"ECS",
"services",
"in",
"the",
"deployment",
"group",
".",
"This",
"applies",
"only",
"to",
"deployment",
"groups",
"that",
"use",
"the",
"Amazon",
"ECS",
"compute",
"platform",
".",
"A",
"target",
"Amazon",
"ECS",
"s... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/CreateDeploymentGroupRequest.java#L1010-L1018 | train | Adds the value of the ecsServices property. | Create a Java method that does the following: "Adds the value of the ecsServices property.". | Of course, here is the Java code you requested:
```java
public CreateDeploymentGroupRequest withEcsServices(ECSService... ecsServices) {
if (this.ecsServices == null) {
setEcsServices(new com.amazonaws.internal.SdkInternalList<ECSService>(ecsServices.length));
}
for (ECSService ele ... | |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java | Util.guarded | public static @Nullable View.OnClickListener guarded(@Nullable final View.OnClickListener listener) {
if (listener != null) {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
listener.onClick(v);
} catch (Exception e) {
ApptentiveLog.e(e, "Exception wh... | java | public static @Nullable View.OnClickListener guarded(@Nullable final View.OnClickListener listener) {
if (listener != null) {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
listener.onClick(v);
} catch (Exception e) {
ApptentiveLog.e(e, "Exception wh... | [
"public",
"static",
"@",
"Nullable",
"View",
".",
"OnClickListener",
"guarded",
"(",
"@",
"Nullable",
"final",
"View",
".",
"OnClickListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
")",
"{",
"return",
"new",
"View",
".",
"OnClickListener... | Creates a fail-safe try..catch wrapped listener | [
"Creates",
"a",
"fail",
"-",
"safe",
"try",
"..",
"catch",
"wrapped",
"listener"
] | 887c08d7bd5ae6488a90366dfb58f58938861a93 | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java#L1207-L1223 | train | Guarded method to create a listener which allows to handle click events on a view. | Create a Java method that does the following: "Guarded method to create a listener which allows to handle click events on a view.". | Of course, here is the Java code you requested:
```java
public static @Nullable View.OnClickListener guarded(@Nullable final View.OnClickListener listener) {
if (listener != null) {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
listener.onClick(v);
} cat... | |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPatternUtil.java | CronPatternUtil.matchedDates | public static List<Date> matchedDates(String patternStr, Date start, int count, boolean isMatchSecond) {
return matchedDates(patternStr, start, DateUtil.endOfYear(start), count, isMatchSecond);
} | java | public static List<Date> matchedDates(String patternStr, Date start, int count, boolean isMatchSecond) {
return matchedDates(patternStr, start, DateUtil.endOfYear(start), count, isMatchSecond);
} | [
"public",
"static",
"List",
"<",
"Date",
">",
"matchedDates",
"(",
"String",
"patternStr",
",",
"Date",
"start",
",",
"int",
"count",
",",
"boolean",
"isMatchSecond",
")",
"{",
"return",
"matchedDates",
"(",
"patternStr",
",",
"start",
",",
"DateUtil",
".",
... | 列举指定日期之后(到开始日期对应年年底)内所有匹配表达式的日期
@param patternStr 表达式字符串
@param start 起始时间
@param count 列举数量
@param isMatchSecond 是否匹配秒
@return 日期列表 | [
"列举指定日期之后(到开始日期对应年年底)内所有匹配表达式的日期"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPatternUtil.java#L28-L30 | train | Returns a list of dates that match the given pattern string. | Create a Java method that does the following: "Returns a list of dates that match the given pattern string.". | Of course, here is the Java code you requested:
```java
public static List<Date> matchedDates(String patternStr, Date start, int count, boolean isMatchSecond) {
return matchedDates(patternStr, start, DateUtil.endOfYear(start), count, isMatchSecond);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/AWSCognitoIdentityProviderClient.java | AWSCognitoIdentityProviderClient.describeIdentityProvider | @Override
public DescribeIdentityProviderResult describeIdentityProvider(DescribeIdentityProviderRequest request) {
request = beforeClientExecution(request);
return executeDescribeIdentityProvider(request);
} | java | @Override
public DescribeIdentityProviderResult describeIdentityProvider(DescribeIdentityProviderRequest request) {
request = beforeClientExecution(request);
return executeDescribeIdentityProvider(request);
} | [
"@",
"Override",
"public",
"DescribeIdentityProviderResult",
"describeIdentityProvider",
"(",
"DescribeIdentityProviderRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeIdentityProvider",
"(",
"request"... | <p>
Gets information about a specific identity provider.
</p>
@param describeIdentityProviderRequest
@return Result of the DescribeIdentityProvider operation returned by the service.
@throws InvalidParameterException
This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
@throws Reso... | [
"<p",
">",
"Gets",
"information",
"about",
"a",
"specific",
"identity",
"provider",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/AWSCognitoIdentityProviderClient.java#L3805-L3809 | train | Retrieves information about an identity provider. | Create a Java method that does the following: "Retrieves information about an identity provider.". | Of course, here is the Java code you requested:
```java
@Override
public DescribeIdentityProviderResult describeIdentityProvider(DescribeIdentityProviderRequest request) {
request = beforeClientExecution(request);
return executeDescribeIdentityProvider(request);
}
```
Hope this helps! | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcBoundaryNodeConditionWarping | public EClass getIfcBoundaryNodeConditionWarping() {
if (ifcBoundaryNodeConditionWarpingEClass == null) {
ifcBoundaryNodeConditionWarpingEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(49);
}
return ifcBoundaryNodeConditionWarpingEClass;
} | java | public EClass getIfcBoundaryNodeConditionWarping() {
if (ifcBoundaryNodeConditionWarpingEClass == null) {
ifcBoundaryNodeConditionWarpingEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(49);
}
return ifcBoundaryNodeConditionWarpingEClass;
} | [
"public",
"EClass",
"getIfcBoundaryNodeConditionWarping",
"(",
")",
"{",
"if",
"(",
"ifcBoundaryNodeConditionWarpingEClass",
"==",
"null",
")",
"{",
"ifcBoundaryNodeConditionWarpingEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"g... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L8871-L8877 | train | Get the IfcBoundaryNodeConditionWarpingEClass from the Registry. | Create a Java method that does the following: "Get the IfcBoundaryNodeConditionWarpingEClass from the Registry.". | Of course, here is the Java code you requested:
```java
public EClass getIfcBoundaryNodeConditionWarping() {
if (ifcBoundaryNodeConditionWarpingEClass == null) {
ifcBoundaryNodeConditionWarpingEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(49);
... | |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/config/refresher/HttpRefresher.java | HttpRefresher.isValidConfigNode | private static boolean isValidConfigNode(final boolean sslEnabled, final NodeInfo nodeInfo) {
if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.CONFIG)) {
return true;
} else if (nodeInfo.services().containsKey(ServiceType.CONFIG)) {
return true;
}
... | java | private static boolean isValidConfigNode(final boolean sslEnabled, final NodeInfo nodeInfo) {
if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.CONFIG)) {
return true;
} else if (nodeInfo.services().containsKey(ServiceType.CONFIG)) {
return true;
}
... | [
"private",
"static",
"boolean",
"isValidConfigNode",
"(",
"final",
"boolean",
"sslEnabled",
",",
"final",
"NodeInfo",
"nodeInfo",
")",
"{",
"if",
"(",
"sslEnabled",
"&&",
"nodeInfo",
".",
"sslServices",
"(",
")",
".",
"containsKey",
"(",
"ServiceType",
".",
"C... | Helper method to detect if the given node can actually perform http config refresh.
@param sslEnabled true if ssl enabled, false otherwise.
@param nodeInfo the node info for the given node.
@return true if it is a valid config node, false otherwise. | [
"Helper",
"method",
"to",
"detect",
"if",
"the",
"given",
"node",
"can",
"actually",
"perform",
"http",
"config",
"refresh",
"."
] | 97f0427112c2168fee1d6499904f5fa0e24c6797 | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/HttpRefresher.java#L367-L374 | train | Check if the node is a valid configuration node. | Create a Java method that does the following: "Check if the node is a valid configuration node.". | Of course, here is the Java code you requested:
```java
private static boolean isValidConfigNode(final boolean sslEnabled, final NodeInfo nodeInfo) {
if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.CONFIG)) {
return true;
} else if (nodeInfo.services().containsKey(ServiceTy... | |
lazy-koala/java-toolkit | fast-toolkit/src/main/java/com/thankjava/toolkit/core/io/FileAppendWriter.java | FileAppendWriter.write | public FileAppendWriter write(char[] chars) {
try {
writer.write(chars);
} catch (IOException e) {
e.printStackTrace();
}
return this;
} | java | public FileAppendWriter write(char[] chars) {
try {
writer.write(chars);
} catch (IOException e) {
e.printStackTrace();
}
return this;
} | [
"public",
"FileAppendWriter",
"write",
"(",
"char",
"[",
"]",
"chars",
")",
"{",
"try",
"{",
"writer",
".",
"write",
"(",
"chars",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"return",
... | 追加写入char数组数据
@param chars | [
"追加写入char数组数据"
] | f46055fae0cc73049597a3708e515f5c6582d27a | https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit/src/main/java/com/thankjava/toolkit/core/io/FileAppendWriter.java#L51-L58 | train | Write a sequence of characters to the file. | Create a Java method that does the following: "Write a sequence of characters to the file.". | Of course, here is the Java code you requested:
```java
public FileAppendWriter write(char[] chars) {
try {
writer.write(chars);
} catch (IOException e) {
e.printStackTrace();
}
return this;
}
```
Hope this helps! | |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/html/HtmlOutcomeTargetLink.java | HtmlOutcomeTargetLink.getRel | public java.lang.String getRel() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.rel);
} | java | public java.lang.String getRel() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.rel);
} | [
"public",
"java",
".",
"lang",
".",
"String",
"getRel",
"(",
")",
"{",
"return",
"(",
"java",
".",
"lang",
".",
"String",
")",
"getStateHelper",
"(",
")",
".",
"eval",
"(",
"PropertyKeys",
".",
"rel",
")",
";",
"}"
] | <p>Return the value of the <code>rel</code> property.</p>
<p>Contents: The relationship from the current document
to the anchor specified by this hyperlink.
The value of this attribute is a space-separated
list of link types. | [
"<p",
">",
"Return",
"the",
"value",
"of",
"the",
"<code",
">",
"rel<",
"/",
"code",
">",
"property",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Contents",
":",
"The",
"relationship",
"from",
"the",
"current",
"document",
"to",
"the",
"anchor",
"specified",
... | cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3 | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/html/HtmlOutcomeTargetLink.java#L491-L494 | train | Gets the value of the rel property. | Create a Java method that does the following: "Gets the value of the rel property.". | Of course, here is the Java code you requested:
```java
public java.lang.String getRel() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.rel);
}
```
Hope this helps! | |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java | AVIMConversationEventHandler.onMuted | public void onMuted(AVIMClient client, AVIMConversation conversation, String operator) {
LOGGER.d("Notification --- " + " you are muted by " + operator );
} | java | public void onMuted(AVIMClient client, AVIMConversation conversation, String operator) {
LOGGER.d("Notification --- " + " you are muted by " + operator );
} | [
"public",
"void",
"onMuted",
"(",
"AVIMClient",
"client",
",",
"AVIMConversation",
"conversation",
",",
"String",
"operator",
")",
"{",
"LOGGER",
".",
"d",
"(",
"\"Notification --- \"",
"+",
"\" you are muted by \"",
"+",
"operator",
")",
";",
"}"
] | 当前用户被禁言通知处理函数
@param client 聊天客户端
@param conversation 对话
@param operator 操作者 id | [
"当前用户被禁言通知处理函数"
] | 323f8e7ee38051b1350790e5192304768c5c9f5f | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java#L72-L74 | train | onMuted - notify user of a muted conversation | Create a Java method that does the following: "onMuted - notify user of a muted conversation". | Of course, here is the Java code you requested:
```java
public void onMuted(AVIMClient client, AVIMConversation conversation, String operator) {
LOGGER.d("Notification --- " + " you are muted by " + operator );
}
```
Hope this helps! | |
Netflix/Turbine | turbine-core/src/main/java/com/netflix/turbine/aggregator/StreamAggregator.java | StreamAggregator.previousAndCurrentToDelta | static final Map<String, Object> previousAndCurrentToDelta(List<Map<String, Object>> data) {
if (data.size() == 2) {
Map<String, Object> previous = data.get(0);
Map<String, Object> current = data.get(1);
return previousAndCurrentToDelta(previous, current);
} else {
... | java | static final Map<String, Object> previousAndCurrentToDelta(List<Map<String, Object>> data) {
if (data.size() == 2) {
Map<String, Object> previous = data.get(0);
Map<String, Object> current = data.get(1);
return previousAndCurrentToDelta(previous, current);
} else {
... | [
"static",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"previousAndCurrentToDelta",
"(",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"data",
")",
"{",
"if",
"(",
"data",
".",
"size",
"(",
")",
"==",
"2",
")",
"{",
"Map",
"<",
... | /* package for unit tests | [
"/",
"*",
"package",
"for",
"unit",
"tests"
] | 0e924058aa4d1d526310206a51dcf82f65274d58 | https://github.com/Netflix/Turbine/blob/0e924058aa4d1d526310206a51dcf82f65274d58/turbine-core/src/main/java/com/netflix/turbine/aggregator/StreamAggregator.java#L137-L146 | train | Get previous and current to delta map from list of maps. | Create a Java method that does the following: "Get previous and current to delta map from list of maps.". | Of course, here is the Java code you requested:
```java
static final Map<String, Object> previousAndCurrentToDelta(List<Map<String, Object>> data) {
if (data.size() == 2) {
Map<String, Object> previous = data.get(0);
Map<String, Object> current = data.get(1);
return previous... | |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/subsystem/EJB3SubsystemXMLPersister.java | EJB3SubsystemXMLPersister.writeEntityBean | private void writeEntityBean(final XMLExtendedStreamWriter writer, final ModelNode entityModelNode) throws XMLStreamException {
if (entityModelNode.hasDefined(EJB3SubsystemModel.DEFAULT_ENTITY_BEAN_INSTANCE_POOL)) {
// <bean-instance-pool-ref>
writer.writeStartElement(EJB3SubsystemXMLEle... | java | private void writeEntityBean(final XMLExtendedStreamWriter writer, final ModelNode entityModelNode) throws XMLStreamException {
if (entityModelNode.hasDefined(EJB3SubsystemModel.DEFAULT_ENTITY_BEAN_INSTANCE_POOL)) {
// <bean-instance-pool-ref>
writer.writeStartElement(EJB3SubsystemXMLEle... | [
"private",
"void",
"writeEntityBean",
"(",
"final",
"XMLExtendedStreamWriter",
"writer",
",",
"final",
"ModelNode",
"entityModelNode",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"entityModelNode",
".",
"hasDefined",
"(",
"EJB3SubsystemModel",
".",
"DEFAULT_ENT... | Writes out the <entity-bean> element and its nested elements
@param writer XML writer
@param entityModelNode The <mdb> element {@link org.jboss.dmr.ModelNode}
@throws javax.xml.stream.XMLStreamException | [
"Writes",
"out",
"the",
"<entity",
"-",
"bean",
">",
"element",
"and",
"its",
"nested",
"elements"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/EJB3SubsystemXMLPersister.java#L375-L394 | test | Write the entity bean. | Create a Java method that does the following: "Write the entity bean.". | Of course, here is the Java code you requested:
```java
private void writeEntityBean(final XMLExtendedStreamWriter writer, final ModelNode entityModelNode) throws XMLStreamException {
if (entityModelNode.hasDefined(EJB3SubsystemModel.DEFAULT_ENTITY_BEAN_INSTANCE_POOL)) {
// <bean-instance-pool-ref>... | |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/Assert.java | Assert.notNull | public static void notNull(Object... objects) {
notNull((Object) objects);
for (Object object : objects) {
notNull(object);
}
} | java | public static void notNull(Object... objects) {
notNull((Object) objects);
for (Object object : objects) {
notNull(object);
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"Object",
"...",
"objects",
")",
"{",
"notNull",
"(",
"(",
"Object",
")",
"objects",
")",
";",
"for",
"(",
"Object",
"object",
":",
"objects",
")",
"{",
"notNull",
"(",
"object",
")",
";",
"}",
"}"
] | Verifies that the given list of objects does not contain a single element that is <code>null</code> and throws an
<code>IllegalArgumentException</code> with a default message otherwise.
@param objects objects that should be checked | [
"Verifies",
"that",
"the",
"given",
"list",
"of",
"objects",
"does",
"not",
"contain",
"a",
"single",
"element",
"that",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"throws",
"an",
"<code",
">",
"IllegalArgumentException<",
"/",
"code",
">",
"wit... | cef6d9af60d684e41294981c10b6d92c8f063a4e | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/Assert.java#L31-L36 | train | Check that the given objects are not null. | Create a Java method that does the following: "Check that the given objects are not null.". | Of course, here is the Java code you requested:
```java
public static void notNull(Object... objects) {
notNull((Object) objects);
for (Object object : objects) {
notNull(object);
}
}
```
Hope this helps! | |
spotify/scio | scio-examples/src/main/java/org/apache/beam/examples/complete/game/GameStats.java | GameStats.configureSessionWindowWrite | protected static Map<String, WriteWindowedToBigQuery.FieldInfo<Double>>
configureSessionWindowWrite() {
Map<String, WriteWindowedToBigQuery.FieldInfo<Double>> tableConfigure = new HashMap<>();
tableConfigure.put(
"window_start",
new WriteWindowedToBigQuery.FieldInfo<>(
"STRING... | java | protected static Map<String, WriteWindowedToBigQuery.FieldInfo<Double>>
configureSessionWindowWrite() {
Map<String, WriteWindowedToBigQuery.FieldInfo<Double>> tableConfigure = new HashMap<>();
tableConfigure.put(
"window_start",
new WriteWindowedToBigQuery.FieldInfo<>(
"STRING... | [
"protected",
"static",
"Map",
"<",
"String",
",",
"WriteWindowedToBigQuery",
".",
"FieldInfo",
"<",
"Double",
">",
">",
"configureSessionWindowWrite",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"WriteWindowedToBigQuery",
".",
"FieldInfo",
"<",
"Double",
">",
">",... | Create a map of information that describes how to write pipeline output to BigQuery. This map
is used to write information about mean user session time. | [
"Create",
"a",
"map",
"of",
"information",
"that",
"describes",
"how",
"to",
"write",
"pipeline",
"output",
"to",
"BigQuery",
".",
"This",
"map",
"is",
"used",
"to",
"write",
"information",
"about",
"mean",
"user",
"session",
"time",
"."
] | ed9a44428251b0c6834aad231b463d8eda418471 | https://github.com/spotify/scio/blob/ed9a44428251b0c6834aad231b463d8eda418471/scio-examples/src/main/java/org/apache/beam/examples/complete/game/GameStats.java#L212-L227 | train | Configure session window write. | Create a Java method that does the following: "Configure session window write.". | Of course, here is the Java code you requested:
```java
protected static Map<String, WriteWindowedToBigQuery.FieldInfo<Double>>
configureSessionWindowWrite() {
Map<String, WriteWindowedToBigQuery.FieldInfo<Double>> tableConfigure = new HashMap<>();
tableConfigure.put(
"window_start",
new... | |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/model/workflow/LinkedProcessInstance.java | LinkedProcessInstance.getJson | public JSONObject getJson() throws JSONException {
JSONObject json = create();
json.put("processInstance", processInstance.getJson());
if (!children.isEmpty()) {
JSONArray childrenArr = new JSONArray();
for (LinkedProcessInstance child : children) {
childr... | java | public JSONObject getJson() throws JSONException {
JSONObject json = create();
json.put("processInstance", processInstance.getJson());
if (!children.isEmpty()) {
JSONArray childrenArr = new JSONArray();
for (LinkedProcessInstance child : children) {
childr... | [
"public",
"JSONObject",
"getJson",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"json",
"=",
"create",
"(",
")",
";",
"json",
".",
"put",
"(",
"\"processInstance\"",
",",
"processInstance",
".",
"getJson",
"(",
")",
")",
";",
"if",
"(",
"!",
"... | Includes children (not parent). | [
"Includes",
"children",
"(",
"not",
"parent",
")",
"."
] | 91167fe65a25a5d7022cdcf8b0fae8506f5b87ce | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/model/workflow/LinkedProcessInstance.java#L67-L78 | train | Get the JSON representation of the instance. | Create a Java method that does the following: "Get the JSON representation of the instance.". | Of course, here is the Java code you requested:
```java
public JSONObject getJson() throws JSONException {
JSONObject json = create();
json.put("processInstance", processInstance.getJson());
if (!children.isEmpty()) {
JSONArray childrenArr = new JSONArray();
for (LinkedP... | |
bThink-BGU/BPjs | src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java | BProgramJsProxy.registerBThread | public void registerBThread(String name, Function func) {
program.registerBThread(new BThreadSyncSnapshot(name, func));
} | java | public void registerBThread(String name, Function func) {
program.registerBThread(new BThreadSyncSnapshot(name, func));
} | [
"public",
"void",
"registerBThread",
"(",
"String",
"name",
",",
"Function",
"func",
")",
"{",
"program",
".",
"registerBThread",
"(",
"new",
"BThreadSyncSnapshot",
"(",
"name",
",",
"func",
")",
")",
";",
"}"
] | Called from JS to add BThreads running func as their runnable code.
@param name Name of the registered BThread (useful for debugging).
@param func Script entry point of the BThread.
@see #registerBThread(org.mozilla.javascript.Function) | [
"Called",
"from",
"JS",
"to",
"add",
"BThreads",
"running",
"func",
"as",
"their",
"runnable",
"code",
"."
] | 2d388365a27ad79ded108eaf98a35a7ef292ae1f | https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java#L122-L124 | train | Registers a new BThread with the given name and function. | Create a Java method that does the following: "Registers a new BThread with the given name and function.". | Of course, here is the Java code you requested:
```java
public void registerBThread(String name, Function func) {
program.registerBThread(new BThreadSyncSnapshot(name, func));
}
```
Hope this helps! | |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parseQName | private String parseQName() {
String qName = parseNCName(); // can be prefix or localPartName
if (is(TokenType.COLON, false)) {
qName += ":";
qName += parseNCName(); // is localPartName
}
return qName;
} | java | private String parseQName() {
String qName = parseNCName(); // can be prefix or localPartName
if (is(TokenType.COLON, false)) {
qName += ":";
qName += parseNCName(); // is localPartName
}
return qName;
} | [
"private",
"String",
"parseQName",
"(",
")",
"{",
"String",
"qName",
"=",
"parseNCName",
"(",
")",
";",
"// can be prefix or localPartName",
"if",
"(",
"is",
"(",
"TokenType",
".",
"COLON",
",",
"false",
")",
")",
"{",
"qName",
"+=",
"\":\"",
";",
"qName",... | Parses the the rule QName according to the following production rule:
http://www.w3.org/TR/REC-xml-names
<p>
[7] QName ::= PrefixedName | UnprefixedName
</p>
<p>
[8] PrefixedName ::= Prefix ':' LocalPart
</p>
<p>
[9] UnprefixedName ::= LocalPart
</p>
<p>
[10] Prefix ::= NCName
</p>
<p>
[11] LocalPart ::= NCName => QNam... | [
"Parses",
"the",
"the",
"rule",
"QName",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"REC",
"-",
"xml",
"-",
"names",
"<p",
">",
"[",
"7",
"]",
"QName",
"::",
... | 9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60 | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L2047-L2058 | train | Parse a QName. | Create a Java method that does the following: "Parse a QName.". | Of course, here is the Java code you requested:
```java
private String parseQName() {
String qName = parseNCName(); // can be prefix or localPartName
if (is(TokenType.COLON, false)) {
qName += ":";
qName += parseNCName(); // is localPartName
}
return qName;
... | |
highsource/jaxb2-basics | tools/src/main/java/org/jvnet/jaxb2_commons/util/FieldUtils.java | FieldUtils.getPossibleTypes | public static Set<JType> getPossibleTypes(FieldOutline fieldOutline,
Aspect aspect) {
Validate.notNull(fieldOutline);
final ClassOutline classOutline = fieldOutline.parent();
final Outline outline = classOutline.parent();
final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo();
final Set<JType> ... | java | public static Set<JType> getPossibleTypes(FieldOutline fieldOutline,
Aspect aspect) {
Validate.notNull(fieldOutline);
final ClassOutline classOutline = fieldOutline.parent();
final Outline outline = classOutline.parent();
final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo();
final Set<JType> ... | [
"public",
"static",
"Set",
"<",
"JType",
">",
"getPossibleTypes",
"(",
"FieldOutline",
"fieldOutline",
",",
"Aspect",
"aspect",
")",
"{",
"Validate",
".",
"notNull",
"(",
"fieldOutline",
")",
";",
"final",
"ClassOutline",
"classOutline",
"=",
"fieldOutline",
"."... | } | [
"}"
] | 571cca0ce58a75d984324d33d8af453bf5862e75 | https://github.com/highsource/jaxb2-basics/blob/571cca0ce58a75d984324d33d8af453bf5862e75/tools/src/main/java/org/jvnet/jaxb2_commons/util/FieldUtils.java#L176-L197 | train | Get the possible types for a field outline. | Create a Java method that does the following: "Get the possible types for a field outline.". | Of course, here is the Java code you requested:
```java
public static Set<JType> getPossibleTypes(FieldOutline fieldOutline,
Aspect aspect) {
Validate.notNull(fieldOutline);
final ClassOutline classOutline = fieldOutline.parent();
final Outline outline = classOutline.parent();
final CPropertyInfo propertyIn... | |
playframework/playframework | documentation/manual/working/javaGuide/main/logging/code/javaguide/logging/JavaMarkerController.java | JavaMarkerController.requestMarker | private Marker requestMarker(Http.Request request) {
return append("host", request.host()).and(append("path", request.path()));
} | java | private Marker requestMarker(Http.Request request) {
return append("host", request.host()).and(append("path", request.path()));
} | [
"private",
"Marker",
"requestMarker",
"(",
"Http",
".",
"Request",
"request",
")",
"{",
"return",
"append",
"(",
"\"host\"",
",",
"request",
".",
"host",
"(",
")",
")",
".",
"and",
"(",
"append",
"(",
"\"path\"",
",",
"request",
".",
"path",
"(",
")",
... | ###insert: import static net.logstash.logback.marker.Markers.append; | [
"###insert",
":",
"import",
"static",
"net",
".",
"logstash",
".",
"logback",
".",
"marker",
".",
"Markers",
".",
"append",
";"
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/documentation/manual/working/javaGuide/main/logging/code/javaguide/logging/JavaMarkerController.java#L34-L36 | test | Returns the Marker for the given request. | Create a Java method that does the following: "Returns the Marker for the given request.". | Of course, here is the Java code you requested:
```java
private Marker requestMarker(Http.Request request) {
return append("host", request.host()).and(append("path", request.path()));
}
```
Hope this helps! | |
Unidata/thredds | cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java | CalendarPeriod.of | public static CalendarPeriod of(String udunit) {
int value;
String units;
String[] split = StringUtil2.splitString(udunit);
if (split.length == 1) {
value = 1;
units = split[0];
} else if (split.length == 2) {
try {
value = Integer.parseInt(split[0]);
}... | java | public static CalendarPeriod of(String udunit) {
int value;
String units;
String[] split = StringUtil2.splitString(udunit);
if (split.length == 1) {
value = 1;
units = split[0];
} else if (split.length == 2) {
try {
value = Integer.parseInt(split[0]);
}... | [
"public",
"static",
"CalendarPeriod",
"of",
"(",
"String",
"udunit",
")",
"{",
"int",
"value",
";",
"String",
"units",
";",
"String",
"[",
"]",
"split",
"=",
"StringUtil2",
".",
"splitString",
"(",
"udunit",
")",
";",
"if",
"(",
"split",
".",
"length",
... | Convert a udunit period string into a CalendarPeriod
@param udunit period string : "[val] unit"
@return CalendarPeriod or null if illegal | [
"Convert",
"a",
"udunit",
"period",
"string",
"into",
"a",
"CalendarPeriod"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java#L106-L128 | test | Creates a CalendarPeriod object from the UDUNIT string. | Create a Java method that does the following: "Creates a CalendarPeriod object from the UDUNIT string.". | Of course, here is the Java code you requested:
```java
public static CalendarPeriod of(String udunit) {
int value;
String units;
String[] split = StringUtil2.splitString(udunit);
if (split.length == 1) {
value = 1;
units = split[0];
} else if (split.length == 2) {
tr... | |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java | RevisionApi.getRevision | public Revision getRevision(final int articleID, final int revisionCounter)
throws WikiApiException
{
try {
if (articleID < 1 || revisionCounter < 1) {
throw new IllegalArgumentException();
}
int revisionIndex = checkMapping(articleID, revisionCo... | java | public Revision getRevision(final int articleID, final int revisionCounter)
throws WikiApiException
{
try {
if (articleID < 1 || revisionCounter < 1) {
throw new IllegalArgumentException();
}
int revisionIndex = checkMapping(articleID, revisionCo... | [
"public",
"Revision",
"getRevision",
"(",
"final",
"int",
"articleID",
",",
"final",
"int",
"revisionCounter",
")",
"throws",
"WikiApiException",
"{",
"try",
"{",
"if",
"(",
"articleID",
"<",
"1",
"||",
"revisionCounter",
"<",
"1",
")",
"{",
"throw",
"new",
... | Returns the by the article ID and revisionCounter specified revision. Note that this method
returns the revision in chronological order.
@param articleID
ID of the article
@param revisionCounter
number of revision
@return Revision
@throws WikiApiException
if an error occurs or the revision does not exists. | [
"Returns",
"the",
"by",
"the",
"article",
"ID",
"and",
"revisionCounter",
"specified",
"revision",
".",
"Note",
"that",
"this",
"method",
"returns",
"the",
"revision",
"in",
"chronological",
"order",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1394-L1444 | train | Gets the Revision object for the specified article ID and revision counter. | Create a Java method that does the following: "Gets the Revision object for the specified article ID and revision counter.". | Of course, here is the Java code you requested:
```java
public Revision getRevision(final int articleID, final int revisionCounter)
throws WikiApiException
{
try {
if (articleID < 1 || revisionCounter < 1) {
throw new IllegalArgumentException();
}
... | |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/ConvolveImage.java | ConvolveImage.convolve | public static void convolve(Kernel2D_S32 kernel,
InterleavedU8 input, InterleavedI16 output , ImageBorder_IL_S32<InterleavedU8> border ) {
InputSanityCheck.checkSameShapeB(input, output);
boolean processed = BOverrideConvolveImage.invokeNativeConvolve(kernel,input,output,border);
if( !processed ) {
... | java | public static void convolve(Kernel2D_S32 kernel,
InterleavedU8 input, InterleavedI16 output , ImageBorder_IL_S32<InterleavedU8> border ) {
InputSanityCheck.checkSameShapeB(input, output);
boolean processed = BOverrideConvolveImage.invokeNativeConvolve(kernel,input,output,border);
if( !processed ) {
... | [
"public",
"static",
"void",
"convolve",
"(",
"Kernel2D_S32",
"kernel",
",",
"InterleavedU8",
"input",
",",
"InterleavedI16",
"output",
",",
"ImageBorder_IL_S32",
"<",
"InterleavedU8",
">",
"border",
")",
"{",
"InputSanityCheck",
".",
"checkSameShapeB",
"(",
"input",... | Performs a 2D convolution across the image.
@param input The original image. Not modified.
@param output Where the resulting image is written to. Modified.
@param kernel The kernel that is being convolved. Not modified.
@param border How the image borders are handled. | [
"Performs",
"a",
"2D",
"convolution",
"across",
"the",
"image",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/convolve/ConvolveImage.java#L284-L295 | train | Performs a 2D convolution across the image. | Create a Java method that does the following: "Performs a 2D convolution across the image.". | Of course, here is the Java code you requested:
```java
public static void convolve(Kernel2D_S32 kernel,
InterleavedU8 input, InterleavedI16 output , ImageBorder_IL_S32<InterleavedU8> border ) {
InputSanityCheck.checkSameShapeB(input, output);
boolean processed = BOverrideConvolveImage.invokeNativeConvo... | |
dimaki/refuel | src/main/java/de/dimaki/refuel/updater/boundary/Updater.java | Updater.getApplicationStatus | public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) {
return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT);
} | java | public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) {
return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT);
} | [
"public",
"ApplicationStatus",
"getApplicationStatus",
"(",
"String",
"localVersion",
",",
"final",
"URL",
"updateUrl",
")",
"{",
"return",
"getApplicationStatus",
"(",
"localVersion",
",",
"updateUrl",
",",
"null",
",",
"AppcastManager",
".",
"DEFAULT_CONNECT_TIMEOUT",... | Get the update status of the application specified.
@param localVersion The local version string, e.g. "2.0.1344"
@param updateUrl The update URL (Appcast URL)
@return The application status or 'null' if the status could not be evaluated | [
"Get",
"the",
"update",
"status",
"of",
"the",
"application",
"specified",
"."
] | 8024ac34f52b33de291d859c3b12fc237783f873 | https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/updater/boundary/Updater.java#L68-L70 | train | Get the application status. | Create a Java method that does the following: "Get the application status.". | Of course, here is the Java code you requested:
```java
public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) {
return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT);
}
```
Hope this helps! | |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/base/NlsFormatterMap.java | NlsFormatterMap.getFormatter | public NlsFormatterPlugin<?> getFormatter(String formatType, String formatStyle) {
NlsFormatterPlugin<?> result = null;
Map<String, NlsFormatterPlugin<?>> style2builderMap = this.builders.get(formatType);
if (style2builderMap != null) {
result = style2builderMap.get(formatStyle);
if ((res... | java | public NlsFormatterPlugin<?> getFormatter(String formatType, String formatStyle) {
NlsFormatterPlugin<?> result = null;
Map<String, NlsFormatterPlugin<?>> style2builderMap = this.builders.get(formatType);
if (style2builderMap != null) {
result = style2builderMap.get(formatStyle);
if ((res... | [
"public",
"NlsFormatterPlugin",
"<",
"?",
">",
"getFormatter",
"(",
"String",
"formatType",
",",
"String",
"formatStyle",
")",
"{",
"NlsFormatterPlugin",
"<",
"?",
">",
"result",
"=",
"null",
";",
"Map",
"<",
"String",
",",
"NlsFormatterPlugin",
"<",
"?",
">... | @see net.sf.mmm.util.nls.api.NlsFormatterManager#getFormatter(String, String)
@param formatType is the type to be formatted.
@param formatStyle is the style defining details of formatting. May be {@code null} for default formatter
of the given {@code formatType}.
@return the according {@link NlsFormatter} instance or ... | [
"@see",
"net",
".",
"sf",
".",
"mmm",
".",
"util",
".",
"nls",
".",
"api",
".",
"NlsFormatterManager#getFormatter",
"(",
"String",
"String",
")"
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/base/NlsFormatterMap.java#L87-L98 | train | Get a formatter for the specified format type and style | Create a Java method that does the following: "Get a formatter for the specified format type and style". | Of course, here is the Java code you requested:
```java
public NlsFormatterPlugin<?> getFormatter(String formatType, String formatStyle) {
NlsFormatterPlugin<?> result = null;
Map<String, NlsFormatterPlugin<?>> style2builderMap = this.builders.get(formatType);
if (style2builderMap != null) {
re... | |
aws/aws-sdk-java | aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/StageDeclaration.java | StageDeclaration.withActions | public StageDeclaration withActions(ActionDeclaration... actions) {
if (this.actions == null) {
setActions(new java.util.ArrayList<ActionDeclaration>(actions.length));
}
for (ActionDeclaration ele : actions) {
this.actions.add(ele);
}
return this;
} | java | public StageDeclaration withActions(ActionDeclaration... actions) {
if (this.actions == null) {
setActions(new java.util.ArrayList<ActionDeclaration>(actions.length));
}
for (ActionDeclaration ele : actions) {
this.actions.add(ele);
}
return this;
} | [
"public",
"StageDeclaration",
"withActions",
"(",
"ActionDeclaration",
"...",
"actions",
")",
"{",
"if",
"(",
"this",
".",
"actions",
"==",
"null",
")",
"{",
"setActions",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"ActionDeclaration",
">",
"(",... | <p>
The actions included in a stage.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setActions(java.util.Collection)} or {@link #withActions(java.util.Collection)} if you want to override
the existing values.
</p>
@param actions
The actions included in a stage.
@return ... | [
"<p",
">",
"The",
"actions",
"included",
"in",
"a",
"stage",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"any",
")",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/StageDeclaration.java#L205-L213 | train | A list of action declarations to be performed on the resource. | Create a Java method that does the following: "A list of action declarations to be performed on the resource.". | Of course, here is the Java code you requested:
```java
public StageDeclaration withActions(ActionDeclaration... actions) {
if (this.actions == null) {
setActions(new java.util.ArrayList<ActionDeclaration>(actions.length));
}
for (ActionDeclaration ele : actions) {
this.... | |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_runningconfig.java | ns_ns_runningconfig.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ns_runningconfig_responses result = (ns_ns_runningconfig_responses) service.get_payload_formatter().string_to_resource(ns_ns_runningconfig_responses.class, response);
if(result.errorcode != 0)
{
... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ns_runningconfig_responses result = (ns_ns_runningconfig_responses) service.get_payload_formatter().string_to_resource(ns_ns_runningconfig_responses.class, response);
if(result.errorcode != 0)
{
... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_ns_runningconfig_responses",
"result",
"=",
"(",
"ns_ns_runningconfig_responses",
")",
"service",
".",
"ge... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ns_runningconfig.java#L215-L232 | train | Use this API to fetch an array of ns_ns_runningconfig_responses resources of given name. | Create a Java method that does the following: "Use this API to fetch an array of ns_ns_runningconfig_responses resources of given name.". | Of course, here is the Java code you requested:
```java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_ns_runningconfig_responses result = (ns_ns_runningconfig_responses) service.get_payload_formatter().string_to_resource(ns_ns_runningconfig_respons... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/SessionContextRegistryImpl.java | SessionContextRegistryImpl.getJ2EEName | public String getJ2EEName(DeployedModule webModuleConfig)
{
WebAppConfiguration webAppConfiguration = webModuleConfig.getWebAppConfig();
WebModuleMetaData webModuleMetaData = webAppConfiguration.getMetaData();
J2EEName j2eeName = webModuleMetaData.getJ2EEName();
if(j2eeName==null) {
... | java | public String getJ2EEName(DeployedModule webModuleConfig)
{
WebAppConfiguration webAppConfiguration = webModuleConfig.getWebAppConfig();
WebModuleMetaData webModuleMetaData = webAppConfiguration.getMetaData();
J2EEName j2eeName = webModuleMetaData.getJ2EEName();
if(j2eeName==null) {
... | [
"public",
"String",
"getJ2EEName",
"(",
"DeployedModule",
"webModuleConfig",
")",
"{",
"WebAppConfiguration",
"webAppConfiguration",
"=",
"webModuleConfig",
".",
"getWebAppConfig",
"(",
")",
";",
"WebModuleMetaData",
"webModuleMetaData",
"=",
"webAppConfiguration",
".",
"... | /*
Construct internal j2ee representation | [
"/",
"*",
"Construct",
"internal",
"j2ee",
"representation"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/SessionContextRegistryImpl.java#L149-L160 | train | Get the J2EEName of the current module. | Create a Java method that does the following: "Get the J2EEName of the current module.". | Of course, here is the Java code you requested:
```java
public String getJ2EEName(DeployedModule webModuleConfig)
{
WebAppConfiguration webAppConfiguration = webModuleConfig.getWebAppConfig();
WebModuleMetaData webModuleMetaData = webAppConfiguration.getMetaData();
J2EEName j2eeName = webMo... | |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.addValueEncryptionInfo | @InterfaceAudience.Private
private void addValueEncryptionInfo(String path, String providerName, boolean escape) {
if (escape) {
path = path.replaceAll("~", "~0").replaceAll("/", "~1");
}
if (this.encryptionPathInfo == null) {
this.encryptionPathInfo = new HashMap<Str... | java | @InterfaceAudience.Private
private void addValueEncryptionInfo(String path, String providerName, boolean escape) {
if (escape) {
path = path.replaceAll("~", "~0").replaceAll("/", "~1");
}
if (this.encryptionPathInfo == null) {
this.encryptionPathInfo = new HashMap<Str... | [
"@",
"InterfaceAudience",
".",
"Private",
"private",
"void",
"addValueEncryptionInfo",
"(",
"String",
"path",
",",
"String",
"providerName",
",",
"boolean",
"escape",
")",
"{",
"if",
"(",
"escape",
")",
"{",
"path",
"=",
"path",
".",
"replaceAll",
"(",
"\"~\... | Adds to the encryption info with optional escape for json pointer syntax
@param path Name of the key
@param providerName Value encryption configuration | [
"Adds",
"to",
"the",
"encryption",
"info",
"with",
"optional",
"escape",
"for",
"json",
"pointer",
"syntax"
] | f36a0ee0c66923bdde47838ca543e50cbaa99e14 | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L1219-L1228 | train | Add value encryption info. | Create a Java method that does the following: "Add value encryption info.". | Of course, here is the Java code you requested:
```java
@InterfaceAudience.Private
private void addValueEncryptionInfo(String path, String providerName, boolean escape) {
if (escape) {
path = path.replaceAll("~", "~0").replaceAll("/", "~1");
}
if (this.encryptionPathInfo == null... | |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractRole.java | AbstractRole.forward | protected <T extends RaftRequest, U extends RaftResponse> CompletableFuture<U> forward(T request, BiFunction<MemberId, T, CompletableFuture<U>> function) {
CompletableFuture<U> future = new CompletableFuture<>();
DefaultRaftMember leader = raft.getLeader();
if (leader == null) {
return Futures.excepti... | java | protected <T extends RaftRequest, U extends RaftResponse> CompletableFuture<U> forward(T request, BiFunction<MemberId, T, CompletableFuture<U>> function) {
CompletableFuture<U> future = new CompletableFuture<>();
DefaultRaftMember leader = raft.getLeader();
if (leader == null) {
return Futures.excepti... | [
"protected",
"<",
"T",
"extends",
"RaftRequest",
",",
"U",
"extends",
"RaftResponse",
">",
"CompletableFuture",
"<",
"U",
">",
"forward",
"(",
"T",
"request",
",",
"BiFunction",
"<",
"MemberId",
",",
"T",
",",
"CompletableFuture",
"<",
"U",
">",
">",
"func... | Forwards the given request to the leader if possible. | [
"Forwards",
"the",
"given",
"request",
"to",
"the",
"leader",
"if",
"possible",
"."
] | 3a94b7c80576d762dd0d396d4645df07a0b37c31 | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractRole.java#L89-L104 | train | Forward a request to the leader. | Create a Java method that does the following: "Forward a request to the leader.". | Of course, here is the Java code you requested:
```java
protected <T extends RaftRequest, U extends RaftResponse> CompletableFuture<U> forward(T request, BiFunction<MemberId, T, CompletableFuture<U>> function) {
CompletableFuture<U> future = new CompletableFuture<>();
DefaultRaftMember leader = raft.getLeader(... | |
eclipse/xtext-extras | org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xtype/impl/XImportDeclarationImpl.java | XImportDeclarationImpl.setImportedNamespace | public void setImportedNamespace(String newImportedNamespace)
{
String oldImportedNamespace = importedNamespace;
importedNamespace = newImportedNamespace;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtypePackage.XIMPORT_DECLARATION__IMPORTED_NAMESPACE, oldImportedNamespa... | java | public void setImportedNamespace(String newImportedNamespace)
{
String oldImportedNamespace = importedNamespace;
importedNamespace = newImportedNamespace;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtypePackage.XIMPORT_DECLARATION__IMPORTED_NAMESPACE, oldImportedNamespa... | [
"public",
"void",
"setImportedNamespace",
"(",
"String",
"newImportedNamespace",
")",
"{",
"String",
"oldImportedNamespace",
"=",
"importedNamespace",
";",
"importedNamespace",
"=",
"newImportedNamespace",
";",
"if",
"(",
"eNotificationRequired",
"(",
")",
")",
"eNotify... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xtype/impl/XImportDeclarationImpl.java#L324-L330 | train | Sets the value of the importedNamespace property. | Create a Java method that does the following: "Sets the value of the importedNamespace property.". | Of course, here is the Java code you requested:
```java
public void setImportedNamespace(String newImportedNamespace)
{
String oldImportedNamespace = importedNamespace;
importedNamespace = newImportedNamespace;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtypePackage.XI... | |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/RepeatedFieldBuilder.java | RepeatedFieldBuilder.build | public List<MType> build() {
// Now that build has been called, we are required to dispatch
// invalidations.
isClean = true;
if (!isMessagesListMutable && builders == null) {
// We still have an immutable list and we never created a builder.
return messages;
}
boolean allMessagesI... | java | public List<MType> build() {
// Now that build has been called, we are required to dispatch
// invalidations.
isClean = true;
if (!isMessagesListMutable && builders == null) {
// We still have an immutable list and we never created a builder.
return messages;
}
boolean allMessagesI... | [
"public",
"List",
"<",
"MType",
">",
"build",
"(",
")",
"{",
"// Now that build has been called, we are required to dispatch",
"// invalidations.",
"isClean",
"=",
"true",
";",
"if",
"(",
"!",
"isMessagesListMutable",
"&&",
"builders",
"==",
"null",
")",
"{",
"// We... | Builds the list of messages from the builder and returns them.
@return an immutable list of messages | [
"Builds",
"the",
"list",
"of",
"messages",
"from",
"the",
"builder",
"and",
"returns",
"them",
"."
] | b4161d2b138e3edb8fa9420cc3cc653d5764cf5b | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/RepeatedFieldBuilder.java#L478-L519 | train | Build the list of messages. | Create a Java method that does the following: "Build the list of messages.". | Of course, here is the Java code you requested:
```java
public List<MType> build() {
// Now that build has been called, we are required to dispatch
// invalidations.
isClean = true;
if (!isMessagesListMutable && builders == null) {
// We still have an immutable list and we never created a builde... | |
aws/aws-sdk-java | aws-java-sdk-cognitosync/src/main/java/com/amazonaws/services/cognitosync/model/transform/DatasetMarshaller.java | DatasetMarshaller.marshall | public void marshall(Dataset dataset, ProtocolMarshaller protocolMarshaller) {
if (dataset == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(dataset.getIdentityId(), IDENTITYID_BINDING);
... | java | public void marshall(Dataset dataset, ProtocolMarshaller protocolMarshaller) {
if (dataset == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(dataset.getIdentityId(), IDENTITYID_BINDING);
... | [
"public",
"void",
"marshall",
"(",
"Dataset",
"dataset",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"dataset",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\"",
")",
";",
"}"... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitosync/src/main/java/com/amazonaws/services/cognitosync/model/transform/DatasetMarshaller.java#L54-L71 | train | marshalls the given dataset to the JSON object. | Create a Java method that does the following: "marshalls the given dataset to the JSON object.". | Of course, here is the Java code you requested:
```java
public void marshall(Dataset dataset, ProtocolMarshaller protocolMarshaller) {
if (dataset == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(d... | |
yavijava/yavijava | src/main/java/com/vmware/vim/cf/CacheInstance.java | CacheInstance.get | public Object get(ManagedObject mo, String propName)
{
return get(mo.getMOR(), propName);
} | java | public Object get(ManagedObject mo, String propName)
{
return get(mo.getMOR(), propName);
} | [
"public",
"Object",
"get",
"(",
"ManagedObject",
"mo",
",",
"String",
"propName",
")",
"{",
"return",
"get",
"(",
"mo",
".",
"getMOR",
"(",
")",
",",
"propName",
")",
";",
"}"
] | Get the value of cached property whose name is propName.
You should NEVER change the returned data object.
@param mo Managed object on which the cached property is requested
@param propName Property name, can include "."
@return the data object identified by the propName.
NullObject.NULL if the data object is really nu... | [
"Get",
"the",
"value",
"of",
"cached",
"property",
"whose",
"name",
"is",
"propName",
".",
"You",
"should",
"NEVER",
"change",
"the",
"returned",
"data",
"object",
"."
] | 27fd2c5826115782d5eeb934f86e3e39240179cd | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim/cf/CacheInstance.java#L119-L122 | train | Gets the property of the ManagedObjectReference. | Create a Java method that does the following: "Gets the property of the ManagedObjectReference.". | Of course, here is the Java code you requested:
```java
public Object get(ManagedObject mo, String propName)
{
return get(mo.getMOR(), propName);
}
```
Hope this helps! | |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/StripeReader.java | StripeReader.buildInputsFromStripeInfo | public static InputStream[] buildInputsFromStripeInfo(
DistributedFileSystem srcFs,
FileStatus srcStat, Codec codec,
StripeInfo si, long offsetInBlock, long limit,
List<Integer> erasedLocations,
Set<Integer> locationsToNotRead, ErasureCode code
) throws IOException{
Input... | java | public static InputStream[] buildInputsFromStripeInfo(
DistributedFileSystem srcFs,
FileStatus srcStat, Codec codec,
StripeInfo si, long offsetInBlock, long limit,
List<Integer> erasedLocations,
Set<Integer> locationsToNotRead, ErasureCode code
) throws IOException{
Input... | [
"public",
"static",
"InputStream",
"[",
"]",
"buildInputsFromStripeInfo",
"(",
"DistributedFileSystem",
"srcFs",
",",
"FileStatus",
"srcStat",
",",
"Codec",
"codec",
",",
"StripeInfo",
"si",
",",
"long",
"offsetInBlock",
",",
"long",
"limit",
",",
"List",
"<",
"... | Build the InputStream arrays from the StripeInfo.
@return
@throws IOException | [
"Build",
"the",
"InputStream",
"arrays",
"from",
"the",
"StripeInfo",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/StripeReader.java#L169-L257 | train | Build input stream from stripe info. | Create a Java method that does the following: "Build input stream from stripe info.". | Of course, here is the Java code you requested:
```java
public static InputStream[] buildInputsFromStripeInfo(
DistributedFileSystem srcFs,
FileStatus srcStat, Codec codec,
StripeInfo si, long offsetInBlock, long limit,
List<Integer> erasedLocations,
Set<Integer> locationsToNotRead, Er... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterConfigurator.java | MessageRouterConfigurator.stop | public void stop() {
if (msgRouter != null) {
TrConfigurator.unsetMessageRouter(msgRouter);
}
if (configListener != null) {
configListener.unregister();
}
} | java | public void stop() {
if (msgRouter != null) {
TrConfigurator.unsetMessageRouter(msgRouter);
}
if (configListener != null) {
configListener.unregister();
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"msgRouter",
"!=",
"null",
")",
"{",
"TrConfigurator",
".",
"unsetMessageRouter",
"(",
"msgRouter",
")",
";",
"}",
"if",
"(",
"configListener",
"!=",
"null",
")",
"{",
"configListener",
".",
"unregister",... | The bundle is stopping. Inform the TrConfigurator, who in turn will inform
the TrService. Unregister the config listener service. | [
"The",
"bundle",
"is",
"stopping",
".",
"Inform",
"the",
"TrConfigurator",
"who",
"in",
"turn",
"will",
"inform",
"the",
"TrService",
".",
"Unregister",
"the",
"config",
"listener",
"service",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterConfigurator.java#L324-L331 | train | Stop the application. | Create a Java method that does the following: "Stop the application.". | Of course, here is the Java code you requested:
```java
public void stop() {
if (msgRouter != null) {
TrConfigurator.unsetMessageRouter(msgRouter);
}
if (configListener != null) {
configListener.unregister();
}
}
```
Hope this helps! | |
shevek/jcpp | src/main/java/org/anarres/cpp/Source.java | Source.skipline | @Nonnull
public Token skipline(boolean white)
throws IOException,
LexerException {
for (;;) {
Token tok = token();
switch (tok.getType()) {
case EOF:
/* There ought to be a newline before EOF.
* At least... | java | @Nonnull
public Token skipline(boolean white)
throws IOException,
LexerException {
for (;;) {
Token tok = token();
switch (tok.getType()) {
case EOF:
/* There ought to be a newline before EOF.
* At least... | [
"@",
"Nonnull",
"public",
"Token",
"skipline",
"(",
"boolean",
"white",
")",
"throws",
"IOException",
",",
"LexerException",
"{",
"for",
"(",
";",
";",
")",
"{",
"Token",
"tok",
"=",
"token",
"(",
")",
";",
"switch",
"(",
"tok",
".",
"getType",
"(",
... | Skips tokens until the end of line.
@param white true if only whitespace is permitted on the
remainder of the line.
@return the NL token. | [
"Skips",
"tokens",
"until",
"the",
"end",
"of",
"line",
"."
] | 71462c702097cabf8304202c740f780285fc35a8 | https://github.com/shevek/jcpp/blob/71462c702097cabf8304202c740f780285fc35a8/src/main/java/org/anarres/cpp/Source.java#L240-L272 | train | This method is called to skipline the tokens in the input stream. | Create a Java method that does the following: "This method is called to skipline the tokens in the input stream.". | Of course, here is the Java code you requested:
```java
@Nonnull
public Token skipline(boolean white)
throws IOException,
LexerException {
for (;;) {
Token tok = token();
switch (tok.getType()) {
case EOF:
/* There ought to... | |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/panels/MappingAssistantPanel.java | MappingAssistantPanel.txtRowCountFocusLost | private void txtRowCountFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_txtRowCountFocusLost
if (selectedSource != null && !txtQueryEditor.getText().isEmpty()) {
executeQuery();
txtClassUriTemplate.requestFocus();
}
} | java | private void txtRowCountFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_txtRowCountFocusLost
if (selectedSource != null && !txtQueryEditor.getText().isEmpty()) {
executeQuery();
txtClassUriTemplate.requestFocus();
}
} | [
"private",
"void",
"txtRowCountFocusLost",
"(",
"java",
".",
"awt",
".",
"event",
".",
"FocusEvent",
"evt",
")",
"{",
"// GEN-FIRST:event_txtRowCountFocusLost",
"if",
"(",
"selectedSource",
"!=",
"null",
"&&",
"!",
"txtQueryEditor",
".",
"getText",
"(",
")",
"."... | GEN-LAST:event_txtQueryEditorKeyPressed | [
"GEN",
"-",
"LAST",
":",
"event_txtQueryEditorKeyPressed"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/panels/MappingAssistantPanel.java#L416-L421 | train | The focus event handler for the row count focus lost. | Create a Java method that does the following: "The focus event handler for the row count focus lost.". | Of course, here is the Java code you requested:
```java
private void txtRowCountFocusLost(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_txtRowCountFocusLost
if (selectedSource != null && !txtQueryEditor.getText().isEmpty()) {
executeQuery();
txtClassUriTemplate.requestFocus();
}
}
```
Hope this helps! | |
robovm/robovm-jfx78-compat | src/main/java/sun/util/logging/PlatformLogger.java | PlatformLogger.getLogger | public static synchronized PlatformLogger getLogger(String name) {
PlatformLogger log = null;
WeakReference<PlatformLogger> ref = loggers.get(name);
if (ref != null) {
log = ref.get();
}
if (log == null) {
log = new PlatformLogger(name);
logger... | java | public static synchronized PlatformLogger getLogger(String name) {
PlatformLogger log = null;
WeakReference<PlatformLogger> ref = loggers.get(name);
if (ref != null) {
log = ref.get();
}
if (log == null) {
log = new PlatformLogger(name);
logger... | [
"public",
"static",
"synchronized",
"PlatformLogger",
"getLogger",
"(",
"String",
"name",
")",
"{",
"PlatformLogger",
"log",
"=",
"null",
";",
"WeakReference",
"<",
"PlatformLogger",
">",
"ref",
"=",
"loggers",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
... | Returns a PlatformLogger of a given name. | [
"Returns",
"a",
"PlatformLogger",
"of",
"a",
"given",
"name",
"."
] | 5c1fd20488d19a10c3d69d4ca8b22957254d3811 | https://github.com/robovm/robovm-jfx78-compat/blob/5c1fd20488d19a10c3d69d4ca8b22957254d3811/src/main/java/sun/util/logging/PlatformLogger.java#L193-L204 | train | Gets the platform logger with the given name. | Create a Java method that does the following: "Gets the platform logger with the given name.". | Of course, here is the Java code you requested:
```java
public static synchronized PlatformLogger getLogger(String name) {
PlatformLogger log = null;
WeakReference<PlatformLogger> ref = loggers.get(name);
if (ref != null) {
log = ref.get();
}
if (log == null) {
... | |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/RebindConfiguration.java | RebindConfiguration.getInstance | private MapperInstance getInstance( JType mappedType, JClassType classType, boolean isSerializers ) throws UnableToCompleteException {
int nbParam = 0;
if ( null != mappedType.isGenericType() && (!isSerializers || !typeOracle.isEnumSupertype( mappedType )) ) {
nbParam = mappedType.isGenericT... | java | private MapperInstance getInstance( JType mappedType, JClassType classType, boolean isSerializers ) throws UnableToCompleteException {
int nbParam = 0;
if ( null != mappedType.isGenericType() && (!isSerializers || !typeOracle.isEnumSupertype( mappedType )) ) {
nbParam = mappedType.isGenericT... | [
"private",
"MapperInstance",
"getInstance",
"(",
"JType",
"mappedType",
",",
"JClassType",
"classType",
",",
"boolean",
"isSerializers",
")",
"throws",
"UnableToCompleteException",
"{",
"int",
"nbParam",
"=",
"0",
";",
"if",
"(",
"null",
"!=",
"mappedType",
".",
... | Search a static method or constructor to instantiate the mapper and return a {@link String} calling it. | [
"Search",
"a",
"static",
"method",
"or",
"constructor",
"to",
"instantiate",
"the",
"mapper",
"and",
"return",
"a",
"{"
] | 3fdc4350a27a9b64fc437d5fe516bf9191b74824 | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/RebindConfiguration.java#L373-L409 | train | Get the instance of the class type. | Create a Java method that does the following: "Get the instance of the class type.". | Of course, here is the Java code you requested:
```java
private MapperInstance getInstance( JType mappedType, JClassType classType, boolean isSerializers ) throws UnableToCompleteException {
int nbParam = 0;
if ( null != mappedType.isGenericType() && (!isSerializers || !typeOracle.isEnumSupertype( mapp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.