repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java | TimeUtils.timetMillisFromEpochSecs | private static long timetMillisFromEpochSecs(long epochSecs, TimeZone zone) {
"""
Get a "time_t" in milliseconds given a number of seconds since the
Dershowitz/Reingold epoch relative to a given timezone.
@param epochSecs the number of seconds since the Dershowitz/Reingold
epoch relative to the given timezone
... | java | private static long timetMillisFromEpochSecs(long epochSecs, TimeZone zone) {
DateTimeValue date = timeFromSecsSinceEpoch(epochSecs);
Calendar cal = new GregorianCalendar(zone);
cal.clear();
cal.set(date.year(), date.month() - 1, date.day(), date.hour(), date.minute(), date.second());
return cal.getTimeInMill... | [
"private",
"static",
"long",
"timetMillisFromEpochSecs",
"(",
"long",
"epochSecs",
",",
"TimeZone",
"zone",
")",
"{",
"DateTimeValue",
"date",
"=",
"timeFromSecsSinceEpoch",
"(",
"epochSecs",
")",
";",
"Calendar",
"cal",
"=",
"new",
"GregorianCalendar",
"(",
"zone... | Get a "time_t" in milliseconds given a number of seconds since the
Dershowitz/Reingold epoch relative to a given timezone.
@param epochSecs the number of seconds since the Dershowitz/Reingold
epoch relative to the given timezone
@param zone timezone against which epochSecs applies
@return the number of milliseconds sin... | [
"Get",
"a",
"time_t",
"in",
"milliseconds",
"given",
"a",
"number",
"of",
"seconds",
"since",
"the",
"Dershowitz",
"/",
"Reingold",
"epoch",
"relative",
"to",
"a",
"given",
"timezone",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L83-L89 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java | PebbleDictionary.addInt8 | public void addInt8(final int key, final byte b) {
"""
Associate the specified signed byte with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param b
valu... | java | public void addInt8(final int key, final byte b) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.INT, PebbleTuple.Width.BYTE, b);
addTuple(t);
} | [
"public",
"void",
"addInt8",
"(",
"final",
"int",
"key",
",",
"final",
"byte",
"b",
")",
"{",
"PebbleTuple",
"t",
"=",
"PebbleTuple",
".",
"create",
"(",
"key",
",",
"PebbleTuple",
".",
"TupleType",
".",
"INT",
",",
"PebbleTuple",
".",
"Width",
".",
"B... | Associate the specified signed byte with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param b
value to be associated with the specified key | [
"Associate",
"the",
"specified",
"signed",
"byte",
"with",
"the",
"provided",
"key",
"in",
"the",
"dictionary",
".",
"If",
"another",
"key",
"-",
"value",
"pair",
"with",
"the",
"same",
"key",
"is",
"already",
"present",
"in",
"the",
"dictionary",
"it",
"w... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java#L107-L110 |
operasoftware/operaprestodriver | src/com/opera/core/systems/scope/WaitState.java | WaitState.pollResultItem | private ResultItem pollResultItem(long timeout, boolean idle) {
"""
Checks for a result item. <p/> If no result item is available this method will wait for timeout
milliseconds and try again. If still no result if available then a ResponseNotReceivedException
is thrown.
@param timeout time in milliseconds to ... | java | private ResultItem pollResultItem(long timeout, boolean idle) {
ResultItem result = getResult();
if (result != null) {
result.remainingIdleTimeout = timeout;
}
if (result == null && timeout > 0) {
long start = System.currentTimeMillis();
internalWait(timeout);
long end = System.... | [
"private",
"ResultItem",
"pollResultItem",
"(",
"long",
"timeout",
",",
"boolean",
"idle",
")",
"{",
"ResultItem",
"result",
"=",
"getResult",
"(",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"result",
".",
"remainingIdleTimeout",
"=",
"timeout",
... | Checks for a result item. <p/> If no result item is available this method will wait for timeout
milliseconds and try again. If still no result if available then a ResponseNotReceivedException
is thrown.
@param timeout time in milliseconds to wait before retrying.
@param idle whether you are waiting for an Idle even... | [
"Checks",
"for",
"a",
"result",
"item",
".",
"<p",
"/",
">",
"If",
"no",
"result",
"item",
"is",
"available",
"this",
"method",
"will",
"wait",
"for",
"timeout",
"milliseconds",
"and",
"try",
"again",
".",
"If",
"still",
"no",
"result",
"if",
"available"... | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/WaitState.java#L428-L454 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java | SqlGeneratorDefaultImpl.getPreparedDeleteStatement | public SqlStatement getPreparedDeleteStatement(Query query, ClassDescriptor cld) {
"""
generate a prepared DELETE-Statement according to query
@param query the Query
@param cld the ClassDescriptor
"""
return new SqlDeleteByQuery(m_platform, cld, query, logger);
} | java | public SqlStatement getPreparedDeleteStatement(Query query, ClassDescriptor cld)
{
return new SqlDeleteByQuery(m_platform, cld, query, logger);
} | [
"public",
"SqlStatement",
"getPreparedDeleteStatement",
"(",
"Query",
"query",
",",
"ClassDescriptor",
"cld",
")",
"{",
"return",
"new",
"SqlDeleteByQuery",
"(",
"m_platform",
",",
"cld",
",",
"query",
",",
"logger",
")",
";",
"}"
] | generate a prepared DELETE-Statement according to query
@param query the Query
@param cld the ClassDescriptor | [
"generate",
"a",
"prepared",
"DELETE",
"-",
"Statement",
"according",
"to",
"query"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java#L557-L560 |
arturmkrtchyan/iban4j | src/main/java/org/iban4j/Iban.java | Iban.valueOf | public static Iban valueOf(final String iban, final IbanFormat format) throws IbanFormatException,
InvalidCheckDigitException, UnsupportedCountryException {
"""
Returns an Iban object holding the value of the specified String.
@param iban the String to be parsed.
@param format the format of the Iba... | java | public static Iban valueOf(final String iban, final IbanFormat format) throws IbanFormatException,
InvalidCheckDigitException, UnsupportedCountryException {
switch (format) {
case Default:
final String ibanWithoutSpaces = iban.replace(" ", "");
final Iban ... | [
"public",
"static",
"Iban",
"valueOf",
"(",
"final",
"String",
"iban",
",",
"final",
"IbanFormat",
"format",
")",
"throws",
"IbanFormatException",
",",
"InvalidCheckDigitException",
",",
"UnsupportedCountryException",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
... | Returns an Iban object holding the value of the specified String.
@param iban the String to be parsed.
@param format the format of the Iban.
@return an Iban object holding the value represented by the string argument.
@throws IbanFormatException if the String doesn't contain parsable Iban
InvalidCheckDigitException if... | [
"Returns",
"an",
"Iban",
"object",
"holding",
"the",
"value",
"of",
"the",
"specified",
"String",
"."
] | train | https://github.com/arturmkrtchyan/iban4j/blob/9889e8873c4ba5c34fc61d17594af935d2ca28a3/src/main/java/org/iban4j/Iban.java#L165-L180 |
liferay/com-liferay-commerce | commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java | CommerceTaxFixedRateAddressRelPersistenceImpl.findAll | @Override
public List<CommerceTaxFixedRateAddressRel> findAll(int start, int end) {
"""
Returns a range of all the commerce tax fixed rate address rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, th... | java | @Override
public List<CommerceTaxFixedRateAddressRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTaxFixedRateAddressRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce tax fixed rate address rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Set... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"tax",
"fixed",
"rate",
"address",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java#L1737-L1740 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java | MaterialComboBox.setValues | public void setValues(List<T> values, boolean fireEvents) {
"""
Set directly all the values that will be stored into
combobox and build options into it.
"""
String[] stringValues = new String[values.size()];
for (int i = 0; i < values.size(); i++) {
stringValues[i] = keyFactory.gen... | java | public void setValues(List<T> values, boolean fireEvents) {
String[] stringValues = new String[values.size()];
for (int i = 0; i < values.size(); i++) {
stringValues[i] = keyFactory.generateKey(values.get(i));
}
suppressChangeEvent = !fireEvents;
$(listbox.getElement(... | [
"public",
"void",
"setValues",
"(",
"List",
"<",
"T",
">",
"values",
",",
"boolean",
"fireEvents",
")",
"{",
"String",
"[",
"]",
"stringValues",
"=",
"new",
"String",
"[",
"values",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",... | Set directly all the values that will be stored into
combobox and build options into it. | [
"Set",
"directly",
"all",
"the",
"values",
"that",
"will",
"be",
"stored",
"into",
"combobox",
"and",
"build",
"options",
"into",
"it",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L584-L592 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java | Modifiers.setProtected | public static int setProtected(int modifier, boolean b) {
"""
When set protected, the modifier is cleared from being public or
private.
"""
if (b) {
return (modifier | PROTECTED) & (~PUBLIC & ~PRIVATE);
}
else {
return modifier & ~PROTECTED;
}
} | java | public static int setProtected(int modifier, boolean b) {
if (b) {
return (modifier | PROTECTED) & (~PUBLIC & ~PRIVATE);
}
else {
return modifier & ~PROTECTED;
}
} | [
"public",
"static",
"int",
"setProtected",
"(",
"int",
"modifier",
",",
"boolean",
"b",
")",
"{",
"if",
"(",
"b",
")",
"{",
"return",
"(",
"modifier",
"|",
"PROTECTED",
")",
"&",
"(",
"~",
"PUBLIC",
"&",
"~",
"PRIVATE",
")",
";",
"}",
"else",
"{",
... | When set protected, the modifier is cleared from being public or
private. | [
"When",
"set",
"protected",
"the",
"modifier",
"is",
"cleared",
"from",
"being",
"public",
"or",
"private",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java#L60-L67 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugAccumulator.java | BugAccumulator.accumulateBug | public void accumulateBug(BugInstance bug, BytecodeScanningDetector visitor) {
"""
Accumulate a warning at source location currently being visited by given
BytecodeScanningDetector.
@param bug
the warning
@param visitor
the BytecodeScanningDetector
"""
SourceLineAnnotation source = SourceLineAnn... | java | public void accumulateBug(BugInstance bug, BytecodeScanningDetector visitor) {
SourceLineAnnotation source = SourceLineAnnotation.fromVisitedInstruction(visitor);
accumulateBug(bug, source);
} | [
"public",
"void",
"accumulateBug",
"(",
"BugInstance",
"bug",
",",
"BytecodeScanningDetector",
"visitor",
")",
"{",
"SourceLineAnnotation",
"source",
"=",
"SourceLineAnnotation",
".",
"fromVisitedInstruction",
"(",
"visitor",
")",
";",
"accumulateBug",
"(",
"bug",
","... | Accumulate a warning at source location currently being visited by given
BytecodeScanningDetector.
@param bug
the warning
@param visitor
the BytecodeScanningDetector | [
"Accumulate",
"a",
"warning",
"at",
"source",
"location",
"currently",
"being",
"visited",
"by",
"given",
"BytecodeScanningDetector",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugAccumulator.java#L159-L162 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/logging/WebContainerLogger.java | WebContainerLogger.logp | public void logp(Level level, String sourceClass, String sourceMethod,String msg) {
"""
Override every method from Logger to be called on the delegateLogger.
"""
delegateLogger.logp(level,sourceClass,sourceMethod,msg);
} | java | public void logp(Level level, String sourceClass, String sourceMethod,String msg) {
delegateLogger.logp(level,sourceClass,sourceMethod,msg);
} | [
"public",
"void",
"logp",
"(",
"Level",
"level",
",",
"String",
"sourceClass",
",",
"String",
"sourceMethod",
",",
"String",
"msg",
")",
"{",
"delegateLogger",
".",
"logp",
"(",
"level",
",",
"sourceClass",
",",
"sourceMethod",
",",
"msg",
")",
";",
"}"
] | Override every method from Logger to be called on the delegateLogger. | [
"Override",
"every",
"method",
"from",
"Logger",
"to",
"be",
"called",
"on",
"the",
"delegateLogger",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/logging/WebContainerLogger.java#L69-L71 |
RuedigerMoeller/kontraktor | modules/kontraktor-bare/src/main/java/org/nustaq/kontraktor/barebone/RemoteActorConnection.java | RemoteActorConnection.sendRequests | protected void sendRequests() {
"""
sends pending requests async. needs be executed inside lock (see calls of this)
"""
if ( ! requestUnderway ) {
requestUnderway = true;
delayed( new Runnable() {
@Override
public void run() {
... | java | protected void sendRequests() {
if ( ! requestUnderway ) {
requestUnderway = true;
delayed( new Runnable() {
@Override
public void run() {
synchronized (requests) {
Object req[];
if ( open... | [
"protected",
"void",
"sendRequests",
"(",
")",
"{",
"if",
"(",
"!",
"requestUnderway",
")",
"{",
"requestUnderway",
"=",
"true",
";",
"delayed",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"synchronized... | sends pending requests async. needs be executed inside lock (see calls of this) | [
"sends",
"pending",
"requests",
"async",
".",
"needs",
"be",
"executed",
"inside",
"lock",
"(",
"see",
"calls",
"of",
"this",
")"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/kontraktor-bare/src/main/java/org/nustaq/kontraktor/barebone/RemoteActorConnection.java#L437-L476 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setValue | public Parameters setValue(@NonNull String name, Object value) {
"""
Set a value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The value.
@return The self object.
"... | java | public Parameters setValue(@NonNull String name, Object value) {
if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
if (readonly) { throw new IllegalStateException("Parameters is readonly mode."); }
map.put(name, value);
return this;
} | [
"public",
"Parameters",
"setValue",
"(",
"@",
"NonNull",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name cannot be null.\"",
")",
";",
"}",
"if",
"(",
"... | Set a value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The value.
@return The self object. | [
"Set",
"a",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L64-L69 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPost | protected <T> T doPost(String path, MultivaluedMap<String, String> formParams, GenericType<T> genericType) throws ClientException {
"""
Submits a form and gets back a JSON object. Adds appropriate Accepts and
Content Type headers.
@param <T> the type of object that is expected in the response.
@param path the... | java | protected <T> T doPost(String path, MultivaluedMap<String, String> formParams, GenericType<T> genericType) throws ClientException {
return doPost(path, formParams, genericType, null);
} | [
"protected",
"<",
"T",
">",
"T",
"doPost",
"(",
"String",
"path",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"formParams",
",",
"GenericType",
"<",
"T",
">",
"genericType",
")",
"throws",
"ClientException",
"{",
"return",
"doPost",
"(",
"pat... | Submits a form and gets back a JSON object. Adds appropriate Accepts and
Content Type headers.
@param <T> the type of object that is expected in the response.
@param path the API to call.
@param formParams the form parameters to send.
@param genericType the type of object that is expected in the response.
@return the ... | [
"Submits",
"a",
"form",
"and",
"gets",
"back",
"a",
"JSON",
"object",
".",
"Adds",
"appropriate",
"Accepts",
"and",
"Content",
"Type",
"headers",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L487-L489 |
sporniket/core | sporniket-core-strings/src/main/java/com/sporniket/strings/QuickDiff.java | QuickDiff.outputReportLine | private void outputReportLine(List<String> report, MessageFormat template, String[] textLines, int currentLine) {
"""
Add a report line the designated line.
@param report
The report buffer.
@param template
The template to use (to distinguish between text on left and text on right).
@param textLines
The sou... | java | private void outputReportLine(List<String> report, MessageFormat template, String[] textLines, int currentLine)
{
Object[] _args =
{
currentLine, textLines[currentLine]
};
report.add(template.format(_args));
} | [
"private",
"void",
"outputReportLine",
"(",
"List",
"<",
"String",
">",
"report",
",",
"MessageFormat",
"template",
",",
"String",
"[",
"]",
"textLines",
",",
"int",
"currentLine",
")",
"{",
"Object",
"[",
"]",
"_args",
"=",
"{",
"currentLine",
",",
"textL... | Add a report line the designated line.
@param report
The report buffer.
@param template
The template to use (to distinguish between text on left and text on right).
@param textLines
The source text as an array of lines.
@param currentLine
The line to output. | [
"Add",
"a",
"report",
"line",
"the",
"designated",
"line",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-strings/src/main/java/com/sporniket/strings/QuickDiff.java#L253-L260 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.writeObjectToTempFileNoExceptions | public static File writeObjectToTempFileNoExceptions(Object o, String filename) {
"""
Write object to a temp file and ignore exceptions.
@param o
object to be written to file
@param filename
name of the temp file
@return File containing the object
"""
try {
return writeObjectToTempFile(o, fi... | java | public static File writeObjectToTempFileNoExceptions(Object o, String filename) {
try {
return writeObjectToTempFile(o, filename);
} catch (Exception e) {
System.err.println("Error writing object to file " + filename);
e.printStackTrace();
return null;
}
} | [
"public",
"static",
"File",
"writeObjectToTempFileNoExceptions",
"(",
"Object",
"o",
",",
"String",
"filename",
")",
"{",
"try",
"{",
"return",
"writeObjectToTempFile",
"(",
"o",
",",
"filename",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"Syst... | Write object to a temp file and ignore exceptions.
@param o
object to be written to file
@param filename
name of the temp file
@return File containing the object | [
"Write",
"object",
"to",
"a",
"temp",
"file",
"and",
"ignore",
"exceptions",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L144-L152 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSegment.java | IPv6AddressSegment.getSplitSegments | public <S extends AddressSegment> void getSplitSegments(S segs[], int index, AddressSegmentCreator<S> creator) {
"""
Converts this IPv6 address segment into smaller segments,
copying them into the given array starting at the given index.
If a segment does not fit into the array because the segment index in the... | java | public <S extends AddressSegment> void getSplitSegments(S segs[], int index, AddressSegmentCreator<S> creator) {
if(!isMultiple()) {
int bitSizeSplit = IPv6Address.BITS_PER_SEGMENT >>> 1;
Integer myPrefix = getSegmentPrefixLength();
Integer highPrefixBits = getSplitSegmentPrefix(bitSizeSplit, myPrefix, 0... | [
"public",
"<",
"S",
"extends",
"AddressSegment",
">",
"void",
"getSplitSegments",
"(",
"S",
"segs",
"[",
"]",
",",
"int",
"index",
",",
"AddressSegmentCreator",
"<",
"S",
">",
"creator",
")",
"{",
"if",
"(",
"!",
"isMultiple",
"(",
")",
")",
"{",
"int"... | Converts this IPv6 address segment into smaller segments,
copying them into the given array starting at the given index.
If a segment does not fit into the array because the segment index in the array is out of bounds of the array,
then it is not copied.
@param segs
@param index | [
"Converts",
"this",
"IPv6",
"address",
"segment",
"into",
"smaller",
"segments",
"copying",
"them",
"into",
"the",
"given",
"array",
"starting",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSegment.java#L302-L317 |
att/AAF | cadi/aaf/src/main/java/com/att/cadi/aaf/client/ErrMessage.java | ErrMessage.toMsg | public StringBuilder toMsg(StringBuilder sb, String attErrJson) throws APIException {
"""
AT&T Requires a specific Error Format for RESTful Services, which AAF complies with.
This code will create a meaningful string from this format.
@param sb
@param df
@param r
@throws APIException
"""
return toM... | java | public StringBuilder toMsg(StringBuilder sb, String attErrJson) throws APIException {
return toMsg(sb,errDF.newData().in(TYPE.JSON).load(attErrJson).asObject());
} | [
"public",
"StringBuilder",
"toMsg",
"(",
"StringBuilder",
"sb",
",",
"String",
"attErrJson",
")",
"throws",
"APIException",
"{",
"return",
"toMsg",
"(",
"sb",
",",
"errDF",
".",
"newData",
"(",
")",
".",
"in",
"(",
"TYPE",
".",
"JSON",
")",
".",
"load",
... | AT&T Requires a specific Error Format for RESTful Services, which AAF complies with.
This code will create a meaningful string from this format.
@param sb
@param df
@param r
@throws APIException | [
"AT&T",
"Requires",
"a",
"specific",
"Error",
"Format",
"for",
"RESTful",
"Services",
"which",
"AAF",
"complies",
"with",
"."
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/aaf/src/main/java/com/att/cadi/aaf/client/ErrMessage.java#L50-L52 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestAttributeChange | protected void requestAttributeChange (String name, Object value, Object oldValue) {
"""
Called by derived instances when an attribute setter method was called.
"""
requestAttributeChange(name, value, oldValue, Transport.DEFAULT);
} | java | protected void requestAttributeChange (String name, Object value, Object oldValue)
{
requestAttributeChange(name, value, oldValue, Transport.DEFAULT);
} | [
"protected",
"void",
"requestAttributeChange",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"Object",
"oldValue",
")",
"{",
"requestAttributeChange",
"(",
"name",
",",
"value",
",",
"oldValue",
",",
"Transport",
".",
"DEFAULT",
")",
";",
"}"
] | Called by derived instances when an attribute setter method was called. | [
"Called",
"by",
"derived",
"instances",
"when",
"an",
"attribute",
"setter",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L813-L816 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.opacify | public RgbaColor opacify(float amount) {
"""
Returns a new color that has the alpha adjusted by the
specified amount.
"""
return new RgbaColor(r, g, b, alphaCheck(a + amount));
} | java | public RgbaColor opacify(float amount) {
return new RgbaColor(r, g, b, alphaCheck(a + amount));
} | [
"public",
"RgbaColor",
"opacify",
"(",
"float",
"amount",
")",
"{",
"return",
"new",
"RgbaColor",
"(",
"r",
",",
"g",
",",
"b",
",",
"alphaCheck",
"(",
"a",
"+",
"amount",
")",
")",
";",
"}"
] | Returns a new color that has the alpha adjusted by the
specified amount. | [
"Returns",
"a",
"new",
"color",
"that",
"has",
"the",
"alpha",
"adjusted",
"by",
"the",
"specified",
"amount",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L439-L441 |
craftercms/core | src/main/java/org/craftercms/core/processors/impl/TextMetaDataExtractingProcessor.java | TextMetaDataExtractingProcessor.process | @Override
public Item process(Context context, CachingOptions cachingOptions, Item item) {
"""
For every XPath query provided in {@code metaDataNodesXPathQueries}, a single node is selected and its text
value is extracted and put in the item's properties.
"""
for (String xpathQuery : metaDataNodes... | java | @Override
public Item process(Context context, CachingOptions cachingOptions, Item item) {
for (String xpathQuery : metaDataNodesXPathQueries) {
String metaDataValue = item.queryDescriptorValue(xpathQuery);
if (StringUtils.isNotEmpty(metaDataValue)) {
item.setProperty... | [
"@",
"Override",
"public",
"Item",
"process",
"(",
"Context",
"context",
",",
"CachingOptions",
"cachingOptions",
",",
"Item",
"item",
")",
"{",
"for",
"(",
"String",
"xpathQuery",
":",
"metaDataNodesXPathQueries",
")",
"{",
"String",
"metaDataValue",
"=",
"item... | For every XPath query provided in {@code metaDataNodesXPathQueries}, a single node is selected and its text
value is extracted and put in the item's properties. | [
"For",
"every",
"XPath",
"query",
"provided",
"in",
"{"
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/processors/impl/TextMetaDataExtractingProcessor.java#L53-L63 |
morimekta/utils | diff-util/src/main/java/net/morimekta/diff/DiffBase.java | DiffBase.linesToChars | LinesToCharsResult linesToChars(String text1, String text2) {
"""
Split two texts into a list of strings. Reduce the texts to a string of
hashes where each Unicode character represents one line.
@param text1 First string.
@param text2 Second string.
@return An object containing the encoded text1, the encoded ... | java | LinesToCharsResult linesToChars(String text1, String text2) {
List<String> lineArray = new ArrayList<>();
Map<String, Integer> lineHash = new HashMap<>();
// e.g. linearray[4] == "Hello\n"
// e.g. linehash.get("Hello\n") == 4
// "\x00" is a valid character, but various debuggers... | [
"LinesToCharsResult",
"linesToChars",
"(",
"String",
"text1",
",",
"String",
"text2",
")",
"{",
"List",
"<",
"String",
">",
"lineArray",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Integer",
">",
"lineHash",
"=",
"new",
"Has... | Split two texts into a list of strings. Reduce the texts to a string of
hashes where each Unicode character represents one line.
@param text1 First string.
@param text2 Second string.
@return An object containing the encoded text1, the encoded text2 and
the List of unique strings. The zeroth element of the List of
un... | [
"Split",
"two",
"texts",
"into",
"a",
"list",
"of",
"strings",
".",
"Reduce",
"the",
"texts",
"to",
"a",
"string",
"of",
"hashes",
"where",
"each",
"Unicode",
"character",
"represents",
"one",
"line",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/diff-util/src/main/java/net/morimekta/diff/DiffBase.java#L657-L670 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/TriggerDefinition.java | TriggerDefinition.deleteFromSchema | public void deleteFromSchema(Mutation mutation, String cfName, long timestamp) {
"""
Drop specified trigger from the schema using given mutation.
@param mutation The schema mutation
@param cfName The name of the parent ColumnFamily
@param timestamp The timestamp to use for the tombstone
"""
Co... | java | public void deleteFromSchema(Mutation mutation, String cfName, long timestamp)
{
ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
int ldt = (int) (System.currentTimeMillis() / 1000);
Composite prefix = CFMetaData.SchemaTriggersCf.comparator.make(cfName, name);
... | [
"public",
"void",
"deleteFromSchema",
"(",
"Mutation",
"mutation",
",",
"String",
"cfName",
",",
"long",
"timestamp",
")",
"{",
"ColumnFamily",
"cf",
"=",
"mutation",
".",
"addOrGet",
"(",
"SystemKeyspace",
".",
"SCHEMA_TRIGGERS_CF",
")",
";",
"int",
"ldt",
"=... | Drop specified trigger from the schema using given mutation.
@param mutation The schema mutation
@param cfName The name of the parent ColumnFamily
@param timestamp The timestamp to use for the tombstone | [
"Drop",
"specified",
"trigger",
"from",
"the",
"schema",
"using",
"given",
"mutation",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/TriggerDefinition.java#L99-L106 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/ProtoNodeTable.java | ProtoNodeTable.addNode | public Integer addNode(final int termIndex, final String label) {
"""
Adds a proto node {@link String label} for a specific {@link Integer term
index}. If the {@link Integer term index} has already been added then its
{@link Integer proto node index} will be returned.
<p>
This operation maintains the {@link Ma... | java | public Integer addNode(final int termIndex, final String label) {
if (label == null) {
throw new InvalidArgument("label", label);
}
// if we have already seen this term index, return
Integer visitedIndex = termNodeIndex.get(termIndex);
if (visitedIndex != null) {
... | [
"public",
"Integer",
"addNode",
"(",
"final",
"int",
"termIndex",
",",
"final",
"String",
"label",
")",
"{",
"if",
"(",
"label",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"label\"",
",",
"label",
")",
";",
"}",
"// if we have alread... | Adds a proto node {@link String label} for a specific {@link Integer term
index}. If the {@link Integer term index} has already been added then its
{@link Integer proto node index} will be returned.
<p>
This operation maintains the {@link Map map} of term index to node index.
</p>
@param termIndex {@link Integer} the ... | [
"Adds",
"a",
"proto",
"node",
"{",
"@link",
"String",
"label",
"}",
"for",
"a",
"specific",
"{",
"@link",
"Integer",
"term",
"index",
"}",
".",
"If",
"the",
"{",
"@link",
"Integer",
"term",
"index",
"}",
"has",
"already",
"been",
"added",
"then",
"its"... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/ProtoNodeTable.java#L112-L133 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleWebhooks.java | ModuleWebhooks.fetchOne | public CMAWebhook fetchOne(String spaceId, String webhookId) {
"""
Retrieve exactly one webhook, whose id you know.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceI... | java | public CMAWebhook fetchOne(String spaceId, String webhookId) {
assertNotNull(spaceId, "spaceId");
assertNotNull(webhookId, "webhookId");
return service.fetchOne(spaceId, webhookId).blockingFirst();
} | [
"public",
"CMAWebhook",
"fetchOne",
"(",
"String",
"spaceId",
",",
"String",
"webhookId",
")",
"{",
"assertNotNull",
"(",
"spaceId",
",",
"\"spaceId\"",
")",
";",
"assertNotNull",
"(",
"webhookId",
",",
"\"webhookId\"",
")",
";",
"return",
"service",
".",
"fet... | Retrieve exactly one webhook, whose id you know.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId The id of the space to be hosting this webhook.
@param webhookId The id of... | [
"Retrieve",
"exactly",
"one",
"webhook",
"whose",
"id",
"you",
"know",
".",
"<p",
">",
"This",
"method",
"will",
"override",
"the",
"configuration",
"specified",
"through",
"{",
"@link",
"CMAClient",
".",
"Builder#setSpaceId",
"(",
"String",
")",
"}",
"and",
... | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleWebhooks.java#L244-L249 |
redkale/redkale | src/org/redkale/net/http/HttpResponse.java | HttpResponse.finishMapJson | public void finishMapJson(final JsonConvert convert, final Object... objs) {
"""
将对象数组用Map的形式以JSON格式输出 <br>
例如: finishMap("a",2,"b",3) 输出结果为 {"a":2,"b":3}
@param convert 指定的JsonConvert
@param objs 输出对象
"""
this.contentType = this.jsonContentType;
if (this.recycleListener != null) this... | java | public void finishMapJson(final JsonConvert convert, final Object... objs) {
this.contentType = this.jsonContentType;
if (this.recycleListener != null) this.output = objs;
finish(convert.convertMapTo(getBodyBufferSupplier(), objs));
} | [
"public",
"void",
"finishMapJson",
"(",
"final",
"JsonConvert",
"convert",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"this",
".",
"contentType",
"=",
"this",
".",
"jsonContentType",
";",
"if",
"(",
"this",
".",
"recycleListener",
"!=",
"null",
")",
... | 将对象数组用Map的形式以JSON格式输出 <br>
例如: finishMap("a",2,"b",3) 输出结果为 {"a":2,"b":3}
@param convert 指定的JsonConvert
@param objs 输出对象 | [
"将对象数组用Map的形式以JSON格式输出",
"<br",
">",
"例如",
":",
"finishMap",
"(",
"a",
"2",
"b",
"3",
")",
"输出结果为",
"{",
"a",
":",
"2",
"b",
":",
"3",
"}"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpResponse.java#L334-L338 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java | UnsignedUtils.forDigit | public static char forDigit(int digit, int radix) {
"""
Determines the character representation for a specific digit in the
specified radix.
Note: If the value of radix is not a valid radix, or the value of digit
is not a valid digit in the specified radix, the null character
('\u0000') is returned.
@para... | java | public static char forDigit(int digit, int radix) {
if (digit >= 0 && digit < radix && radix >= Character.MIN_RADIX && radix <= MAX_RADIX) {
return digits[digit];
}
return '\u0000';
} | [
"public",
"static",
"char",
"forDigit",
"(",
"int",
"digit",
",",
"int",
"radix",
")",
"{",
"if",
"(",
"digit",
">=",
"0",
"&&",
"digit",
"<",
"radix",
"&&",
"radix",
">=",
"Character",
".",
"MIN_RADIX",
"&&",
"radix",
"<=",
"MAX_RADIX",
")",
"{",
"r... | Determines the character representation for a specific digit in the
specified radix.
Note: If the value of radix is not a valid radix, or the value of digit
is not a valid digit in the specified radix, the null character
('\u0000') is returned.
@param digit
@param radix
@return | [
"Determines",
"the",
"character",
"representation",
"for",
"a",
"specific",
"digit",
"in",
"the",
"specified",
"radix",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java#L76-L81 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Variable.java | Variable.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_fixUpWasCalled = true;
int sz = vars.size();
for (int i = vars.size()-1; i >= 0; i--)
{
QName qn = (QName)vars.elementAt(i);
// System.out.println("qn: "+qn);
if(qn.equals(m_qname))
{
if(i... | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"m_fixUpWasCalled",
"=",
"true",
";",
"int",
"sz",
"=",
"vars",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"vars",... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Variable.java#L117-L150 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.validateProtocol | private void validateProtocol(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException {
"""
Validate the value of {@code Sec-WebSocket-Protocol} header.
<blockquote>
<p>From RFC 6455, p20.</p>
<p><i>
If the response includes a {@code Sec-WebSocket-Protocol} header field
and this ... | java | private void validateProtocol(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException
{
// Get the values of Sec-WebSocket-Protocol.
List<String> values = headers.get("Sec-WebSocket-Protocol");
if (values == null)
{
// Nothing to check.
... | [
"private",
"void",
"validateProtocol",
"(",
"StatusLine",
"statusLine",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"throws",
"WebSocketException",
"{",
"// Get the values of Sec-WebSocket-Protocol.",
"List",
"<",
"String",
">",
... | Validate the value of {@code Sec-WebSocket-Protocol} header.
<blockquote>
<p>From RFC 6455, p20.</p>
<p><i>
If the response includes a {@code Sec-WebSocket-Protocol} header field
and this header field indicates the use of a subprotocol that was
not present in the client's handshake (the server has indicated a
subproto... | [
"Validate",
"the",
"value",
"of",
"{",
"@code",
"Sec",
"-",
"WebSocket",
"-",
"Protocol",
"}",
"header",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L579-L612 |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/LeetEncoder.java | LeetEncoder.leetConvert | public static void leetConvert(LeetLevel level, SecureCharArray message)
throws Exception {
"""
Converts a SecureCharArray into a new SecureCharArray with any applicable
characters converted to leet-speak.
@param level What level of leet to use. Each leet corresponds to a different
leet lookup t... | java | public static void leetConvert(LeetLevel level, SecureCharArray message)
throws Exception {
// pre-allocate an array that is 4 times the size of the message. I don't
// see anything in the leet-table that is larger than 3 characters, but I'm
// using 4-characters to calcualte the si... | [
"public",
"static",
"void",
"leetConvert",
"(",
"LeetLevel",
"level",
",",
"SecureCharArray",
"message",
")",
"throws",
"Exception",
"{",
"// pre-allocate an array that is 4 times the size of the message. I don't",
"// see anything in the leet-table that is larger than 3 characters, b... | Converts a SecureCharArray into a new SecureCharArray with any applicable
characters converted to leet-speak.
@param level What level of leet to use. Each leet corresponds to a different
leet lookup table.
@param message The array to convert.
@throws Exception upon sizing error. | [
"Converts",
"a",
"SecureCharArray",
"into",
"a",
"new",
"SecureCharArray",
"with",
"any",
"applicable",
"characters",
"converted",
"to",
"leet",
"-",
"speak",
"."
] | train | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/LeetEncoder.java#L67-L95 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/validation/SubnetValidator.java | SubnetValidator.rangeCheck | private int rangeCheck(int value, int begin, int end) {
"""
/*
Convenience function to check integer boundaries. Checks if a value x is in the range [begin,end]. Returns x if it is in
range, throws an exception otherwise.
"""
if (value >= begin && value <= end) { // (begin,end]
return val... | java | private int rangeCheck(int value, int begin, int end) {
if (value >= begin && value <= end) { // (begin,end]
return value;
}
throw new IllegalArgumentException("Value [" + value + "] not in range [" + begin + "," + end + "]");
} | [
"private",
"int",
"rangeCheck",
"(",
"int",
"value",
",",
"int",
"begin",
",",
"int",
"end",
")",
"{",
"if",
"(",
"value",
">=",
"begin",
"&&",
"value",
"<=",
"end",
")",
"{",
"// (begin,end]",
"return",
"value",
";",
"}",
"throw",
"new",
"IllegalArgum... | /*
Convenience function to check integer boundaries. Checks if a value x is in the range [begin,end]. Returns x if it is in
range, throws an exception otherwise. | [
"/",
"*",
"Convenience",
"function",
"to",
"check",
"integer",
"boundaries",
".",
"Checks",
"if",
"a",
"value",
"x",
"is",
"in",
"the",
"range",
"[",
"begin",
"end",
"]",
".",
"Returns",
"x",
"if",
"it",
"is",
"in",
"range",
"throws",
"an",
"exception"... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/validation/SubnetValidator.java#L92-L98 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java | ListFixture.setValueAtIn | public void setValueAtIn(Object value, int index, List aList) {
"""
Sets value of element at index (0-based). If the current list has less elements it is extended to
have exactly index elements.
@param value value to store.
@param index 0-based index to add element.
@param aList list to set element in.
"""... | java | public void setValueAtIn(Object value, int index, List aList) {
Object cleanValue = cleanupValue(value);
while (aList.size() <= index) {
aList.add(null);
}
aList.set(index, cleanValue);
} | [
"public",
"void",
"setValueAtIn",
"(",
"Object",
"value",
",",
"int",
"index",
",",
"List",
"aList",
")",
"{",
"Object",
"cleanValue",
"=",
"cleanupValue",
"(",
"value",
")",
";",
"while",
"(",
"aList",
".",
"size",
"(",
")",
"<=",
"index",
")",
"{",
... | Sets value of element at index (0-based). If the current list has less elements it is extended to
have exactly index elements.
@param value value to store.
@param index 0-based index to add element.
@param aList list to set element in. | [
"Sets",
"value",
"of",
"element",
"at",
"index",
"(",
"0",
"-",
"based",
")",
".",
"If",
"the",
"current",
"list",
"has",
"less",
"elements",
"it",
"is",
"extended",
"to",
"have",
"exactly",
"index",
"elements",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java#L118-L124 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java | ExposeLinearLayoutManagerEx.recycleChildren | protected void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
"""
Recycles children between given indices.
@param startIndex inclusive
@param endIndex exclusive
"""
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(... | java | protected void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(TAG, "Recycling " + Math.abs(startIndex - endIndex) + " items");
}
if (endIndex > startIndex) {
... | [
"protected",
"void",
"recycleChildren",
"(",
"RecyclerView",
".",
"Recycler",
"recycler",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"if",
"(",
"startIndex",
"==",
"endIndex",
")",
"{",
"return",
";",
"}",
"if",
"(",
"DEBUG",
")",
"{",
"... | Recycles children between given indices.
@param startIndex inclusive
@param endIndex exclusive | [
"Recycles",
"children",
"between",
"given",
"indices",
"."
] | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java#L1015-L1031 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WEditableImageRenderer.java | WEditableImageRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given {@link WEditableImage}.
@param component the WEditableImage to paint.
@param renderContext the RenderContext to paint to.
"""
WEditableImage editableImage = (WEditableImage) compone... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WEditableImage editableImage = (WEditableImage) component;
XmlStringBuilder xml = renderContext.getWriter();
// No image set
if (editableImage.getImage() == null && editableImage.getImageUrl() == null) {
r... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WEditableImage",
"editableImage",
"=",
"(",
"WEditableImage",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"... | Paints the given {@link WEditableImage}.
@param component the WEditableImage to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"{",
"@link",
"WEditableImage",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WEditableImageRenderer.java#L23-L39 |
apache/reef | lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/utils/DefinedRuntimesSerializer.java | DefinedRuntimesSerializer.toBytes | public byte[] toBytes(final DefinedRuntimes definedRuntimes) {
"""
Serializes DefinedRuntimes.
@param definedRuntimes the Avro object to toString
@return Serialized avro string
"""
final DatumWriter<DefinedRuntimes> configurationWriter =
new SpecificDatumWriter<>(DefinedRuntimes.class);
t... | java | public byte[] toBytes(final DefinedRuntimes definedRuntimes){
final DatumWriter<DefinedRuntimes> configurationWriter =
new SpecificDatumWriter<>(DefinedRuntimes.class);
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder binaryEncoder = EncoderFactory.get(... | [
"public",
"byte",
"[",
"]",
"toBytes",
"(",
"final",
"DefinedRuntimes",
"definedRuntimes",
")",
"{",
"final",
"DatumWriter",
"<",
"DefinedRuntimes",
">",
"configurationWriter",
"=",
"new",
"SpecificDatumWriter",
"<>",
"(",
"DefinedRuntimes",
".",
"class",
")",
";"... | Serializes DefinedRuntimes.
@param definedRuntimes the Avro object to toString
@return Serialized avro string | [
"Serializes",
"DefinedRuntimes",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/utils/DefinedRuntimesSerializer.java#L44-L56 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings.java | lbmonbindings.count_filtered | public static long count_filtered(nitro_service service, lbmonbindings obj, String filter) throws Exception {
"""
Use this API to count filtered the set of lbmonbindings resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
options option = new options();
option.set_count(t... | java | public static long count_filtered(nitro_service service, lbmonbindings obj, String filter) throws Exception{
options option = new options();
option.set_count(true);
option.set_filter(filter);
option.set_args(nitro_util.object_to_string_withoutquotes(obj));
lbmonbindings[] response = (lbmonbindings[]) obj.getf... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"lbmonbindings",
"obj",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"options",
"option",
"=",
"new",
"options",
"(",
")",
";",
"option",
".",
"set_count",
"(",
... | Use this API to count filtered the set of lbmonbindings resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"filtered",
"the",
"set",
"of",
"lbmonbindings",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings.java#L181-L191 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/MetadataClient.java | MetadataClient.unregisterWorkflowDef | public void unregisterWorkflowDef(String name, Integer version) {
"""
Removes the workflow definition of a workflow from the conductor server.
It does not remove associated workflows. Use with caution.
@param name Name of the workflow to be unregistered.
@param version Version of the workflow definition to... | java | public void unregisterWorkflowDef(String name, Integer version) {
Preconditions.checkArgument(StringUtils.isNotBlank(name), "Workflow name cannot be blank");
Preconditions.checkNotNull(version, "Version cannot be null");
delete("metadata/workflow/{name}/{version}", name, version);
} | [
"public",
"void",
"unregisterWorkflowDef",
"(",
"String",
"name",
",",
"Integer",
"version",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"name",
")",
",",
"\"Workflow name cannot be blank\"",
")",
";",
"Preconditions"... | Removes the workflow definition of a workflow from the conductor server.
It does not remove associated workflows. Use with caution.
@param name Name of the workflow to be unregistered.
@param version Version of the workflow definition to be unregistered. | [
"Removes",
"the",
"workflow",
"definition",
"of",
"a",
"workflow",
"from",
"the",
"conductor",
"server",
".",
"It",
"does",
"not",
"remove",
"associated",
"workflows",
".",
"Use",
"with",
"caution",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/MetadataClient.java#L127-L131 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java | Extern.readPackageListFromFile | private void readPackageListFromFile(String path, DocFile pkgListPath)
throws Fault {
"""
Read the "package-list" file which is available locally.
@param path URL or directory path to the packages.
@param pkgListPath Path to the local "package-list" file.
"""
DocFile file = pkgListPath.... | java | private void readPackageListFromFile(String path, DocFile pkgListPath)
throws Fault {
DocFile file = pkgListPath.resolve(DocPaths.PACKAGE_LIST);
if (! (file.isAbsolute() || linkoffline)){
file = file.resolveAgainst(DocumentationTool.Location.DOCUMENTATION_OUTPUT);
}
... | [
"private",
"void",
"readPackageListFromFile",
"(",
"String",
"path",
",",
"DocFile",
"pkgListPath",
")",
"throws",
"Fault",
"{",
"DocFile",
"file",
"=",
"pkgListPath",
".",
"resolve",
"(",
"DocPaths",
".",
"PACKAGE_LIST",
")",
";",
"if",
"(",
"!",
"(",
"file... | Read the "package-list" file which is available locally.
@param path URL or directory path to the packages.
@param pkgListPath Path to the local "package-list" file. | [
"Read",
"the",
"package",
"-",
"list",
"file",
"which",
"is",
"available",
"locally",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java#L252-L270 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriFragmentId | public static void unescapeUriFragmentId(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This me... | java | public static void unescapeUriFragmentId(final Reader reader, final Writer writer)
throws IOException {
unescapeUriFragmentId(reader, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"unescapeUriFragmentId",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"unescapeUriFragmentId",
"(",
"reader",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to ... | [
"<p",
">",
"Perform",
"am",
"URI",
"fragment",
"identifier",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encodi... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L2338-L2341 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.getVolume | public GetVolumeResponse getVolume(GetVolumeRequest request) {
"""
Get the detail information of specified volume.
@param request The request containing all options for getting the detail information of specified volume.
@return The response containing the detail information of specified volume.
"""
... | java | public GetVolumeResponse getVolume(GetVolumeRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getVolumeId(), "request volumeId should not be empty.");
InternalRequest internalRequest =
this.createRequest(request, HttpMethodName.G... | [
"public",
"GetVolumeResponse",
"getVolume",
"(",
"GetVolumeRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getVolumeId",
"(",
")",
",",
"\"request volumeId shou... | Get the detail information of specified volume.
@param request The request containing all options for getting the detail information of specified volume.
@return The response containing the detail information of specified volume. | [
"Get",
"the",
"detail",
"information",
"of",
"specified",
"volume",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L944-L950 |
pryzach/midao | midao-jdbc-dbcp-1-4/src/main/java/org/midao/jdbc/core/pool/MjdbcPoolBinder.java | MjdbcPoolBinder.createDataSource | public static DataSource createDataSource(String driverClassName, String url, String userName, String password, int initialSize, int maxActive) throws SQLException {
"""
Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)... | java | public static DataSource createDataSource(String driverClassName, String url, String userName, String password, int initialSize, int maxActive) throws SQLException {
assertNotNull(driverClassName);
assertNotNull(url);
assertNotNull(userName);
assertNotNull(password);
BasicDataSo... | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"driverClassName",
",",
"String",
"url",
",",
"String",
"userName",
",",
"String",
"password",
",",
"int",
"initialSize",
",",
"int",
"maxActive",
")",
"throws",
"SQLException",
"{",
"assertNotNu... | Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)}
@param driverClassName Driver Class name
@param url Database connection url
@param userName Database user name
@param password Database user passwor... | [
"Returns",
"new",
"Pooled",
"{",
"@link",
"DataSource",
"}",
"implementation",
"<p",
"/",
">",
"In",
"case",
"this",
"function",
"won",
"t",
"work",
"-",
"use",
"{",
"@link",
"#createDataSource",
"(",
"java",
".",
"util",
".",
"Properties",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-dbcp-1-4/src/main/java/org/midao/jdbc/core/pool/MjdbcPoolBinder.java#L121-L137 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/executor/ConfigurationService.java | ConfigurationService.getDefault | @Override
public Configuration getDefault() {
"""
<p>The <i>out-of-the-box</i> configuration for an instance of {@link HttpClient} which will be used
for executing all endpoint requests. Below is a detailed description of all configured properties.</p>
<br>
<ul>
<li>
<p><b>HttpClient</b></p>
<br>
<p>It reg... | java | @Override
public Configuration getDefault() {
return new Configuration() {
@Override
public HttpClient httpClient() {
try {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
schemeRegist... | [
"@",
"Override",
"public",
"Configuration",
"getDefault",
"(",
")",
"{",
"return",
"new",
"Configuration",
"(",
")",
"{",
"@",
"Override",
"public",
"HttpClient",
"httpClient",
"(",
")",
"{",
"try",
"{",
"SchemeRegistry",
"schemeRegistry",
"=",
"new",
"SchemeR... | <p>The <i>out-of-the-box</i> configuration for an instance of {@link HttpClient} which will be used
for executing all endpoint requests. Below is a detailed description of all configured properties.</p>
<br>
<ul>
<li>
<p><b>HttpClient</b></p>
<br>
<p>It registers two {@link Scheme}s:</p>
<br>
<ol>
<li><b>HTTP</b> on po... | [
"<p",
">",
"The",
"<i",
">",
"out",
"-",
"of",
"-",
"the",
"-",
"box<",
"/",
"i",
">",
"configuration",
"for",
"an",
"instance",
"of",
"{",
"@link",
"HttpClient",
"}",
"which",
"will",
"be",
"used",
"for",
"executing",
"all",
"endpoint",
"requests",
... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/executor/ConfigurationService.java#L71-L97 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.expint | static double expint(int p, final double result[]) {
"""
Compute exp(p) for a integer p in extended precision.
@param p integer whose exponential is requested
@param result placeholder where to put the result in extended precision
@return exp(p) in standard precision (equal to result[0] + result[1])
"""
... | java | static double expint(int p, final double result[]) {
//double x = M_E;
final double xs[] = new double[2];
final double as[] = new double[2];
final double ys[] = new double[2];
//split(x, xs);
//xs[1] = (double)(2.7182818284590452353602874713526625L - xs[0]);
//xs[... | [
"static",
"double",
"expint",
"(",
"int",
"p",
",",
"final",
"double",
"result",
"[",
"]",
")",
"{",
"//double x = M_E;",
"final",
"double",
"xs",
"[",
"]",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"final",
"double",
"as",
"[",
"]",
"=",
"new",
"d... | Compute exp(p) for a integer p in extended precision.
@param p integer whose exponential is requested
@param result placeholder where to put the result in extended precision
@return exp(p) in standard precision (equal to result[0] + result[1]) | [
"Compute",
"exp",
"(",
"p",
")",
"for",
"a",
"integer",
"p",
"in",
"extended",
"precision",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L490-L528 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java | TEBeanLifeCycleInfo.traceBeanState | public static void traceBeanState(int oldState, String oldString, int newState, String newString) // d167264 {
"""
This is called by the EJB container server code to write a
ejb bean state record to the trace log, if enabled.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
... | java | public static void traceBeanState(int oldState, String oldString, int newState, String newString) // d167264
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_St... | [
"public",
"static",
"void",
"traceBeanState",
"(",
"int",
"oldState",
",",
"String",
"oldString",
",",
"int",
"newState",
",",
"String",
"newString",
")",
"// d167264",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
... | This is called by the EJB container server code to write a
ejb bean state record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"ejb",
"bean",
"state",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java#L68-L85 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java | BaseMessagingEngineImpl.alterLocalizationPoint | final void alterLocalizationPoint(BaseDestination dest,LWMConfig lp) {
"""
Pass the request to alter a localization point onto the localizer object.
@param lp
localization point definition
"""
String thisMethodName = "alterLocalizationPoint";
if (TraceComponent.isAnyTracingEnabled() && tc... | java | final void alterLocalizationPoint(BaseDestination dest,LWMConfig lp) {
String thisMethodName = "alterLocalizationPoint";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, lp);
}
try {
_localizer.alterLocalization... | [
"final",
"void",
"alterLocalizationPoint",
"(",
"BaseDestination",
"dest",
",",
"LWMConfig",
"lp",
")",
"{",
"String",
"thisMethodName",
"=",
"\"alterLocalizationPoint\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"is... | Pass the request to alter a localization point onto the localizer object.
@param lp
localization point definition | [
"Pass",
"the",
"request",
"to",
"alter",
"a",
"localization",
"point",
"onto",
"the",
"localizer",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java#L1495-L1512 |
JOML-CI/JOML | src/org/joml/Matrix3d.java | Matrix3d.rotateTowards | public Matrix3d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ) {
"""
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>direction</code>.
<p>
If <code>M</code> is <code>this</code> matr... | java | public Matrix3d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ) {
return rotateTowards(dirX, dirY, dirZ, upX, upY, upZ, this);
} | [
"public",
"Matrix3d",
"rotateTowards",
"(",
"double",
"dirX",
",",
"double",
"dirY",
",",
"double",
"dirZ",
",",
"double",
"upX",
",",
"double",
"upY",
",",
"double",
"upZ",
")",
"{",
"return",
"rotateTowards",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",... | Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>direction</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix,
then the new matrix will be <code>M * L</code>. So when transforming a
vector ... | [
"Apply",
"a",
"model",
"transformation",
"to",
"this",
"matrix",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"+",
"Z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"direction<",
"/",
"co... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3d.java#L4452-L4454 |
bazaarvoice/emodb | queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java | AbstractQueueClient.sendAll | public void sendAll(String apiKey, String queue, Collection<?> messages) {
"""
Any server can handle sending messages, no need for @PartitionKey
"""
checkNotNull(queue, "queue");
checkNotNull(messages, "messages");
if (messages.isEmpty()) {
return;
}
try {
... | java | public void sendAll(String apiKey, String queue, Collection<?> messages) {
checkNotNull(queue, "queue");
checkNotNull(messages, "messages");
if (messages.isEmpty()) {
return;
}
try {
URI uri = _queueService.clone()
.segment(queue, "send... | [
"public",
"void",
"sendAll",
"(",
"String",
"apiKey",
",",
"String",
"queue",
",",
"Collection",
"<",
"?",
">",
"messages",
")",
"{",
"checkNotNull",
"(",
"queue",
",",
"\"queue\"",
")",
";",
"checkNotNull",
"(",
"messages",
",",
"\"messages\"",
")",
";",
... | Any server can handle sending messages, no need for @PartitionKey | [
"Any",
"server",
"can",
"handle",
"sending",
"messages",
"no",
"need",
"for"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java#L59-L76 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getMethodIndex | int getMethodIndex(ExecutableElement method) {
"""
Returns the constant map index to method
@param method
@return
"""
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
return getRefIndex(M... | java | int getMethodIndex(ExecutableElement method)
{
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
return getRefIndex(Methodref.class, fullyQualifiedname, method.getSimpleName().toString(), Descrip... | [
"int",
"getMethodIndex",
"(",
"ExecutableElement",
"method",
")",
"{",
"TypeElement",
"declaringClass",
"=",
"(",
"TypeElement",
")",
"method",
".",
"getEnclosingElement",
"(",
")",
";",
"String",
"fullyQualifiedname",
"=",
"declaringClass",
".",
"getQualifiedName",
... | Returns the constant map index to method
@param method
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"method"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L234-L239 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupFactoryBean.java | CommandGroupFactoryBean.addCommandMember | private void addCommandMember(String commandId, CommandGroup group) {
"""
Adds the command object with the given id to the given command group. If
a command registry has not yet been provided to this factory, the command
id will be passed as a 'lazy placeholder' to the group instead.
@param commandId The id o... | java | private void addCommandMember(String commandId, CommandGroup group) {
Assert.notNull(commandId, "commandId");
Assert.notNull(group, "group");
if (logger.isDebugEnabled()) {
logger.debug("adding command group member with id [" + commandId + "] to group [" + group.getId() + "]");
}
AbstractCommand command... | [
"private",
"void",
"addCommandMember",
"(",
"String",
"commandId",
",",
"CommandGroup",
"group",
")",
"{",
"Assert",
".",
"notNull",
"(",
"commandId",
",",
"\"commandId\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"group",
",",
"\"group\"",
")",
";",
"if",
... | Adds the command object with the given id to the given command group. If
a command registry has not yet been provided to this factory, the command
id will be passed as a 'lazy placeholder' to the group instead.
@param commandId The id of the command to be added to the group. This is
expected to be in decoded form, i.e... | [
"Adds",
"the",
"command",
"object",
"with",
"the",
"given",
"id",
"to",
"the",
"given",
"command",
"group",
".",
"If",
"a",
"command",
"registry",
"has",
"not",
"yet",
"been",
"provided",
"to",
"this",
"factory",
"the",
"command",
"id",
"will",
"be",
"pa... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupFactoryBean.java#L403-L425 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base64Encoder.java | Base64Encoder.encodeUrlSafe | public static String encodeUrlSafe(String source, String charset) {
"""
base64编码,URL安全
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6
"""
return encodeUrlSafe(StrUtil.bytes(source, charset), charset);
} | java | public static String encodeUrlSafe(String source, String charset) {
return encodeUrlSafe(StrUtil.bytes(source, charset), charset);
} | [
"public",
"static",
"String",
"encodeUrlSafe",
"(",
"String",
"source",
",",
"String",
"charset",
")",
"{",
"return",
"encodeUrlSafe",
"(",
"StrUtil",
".",
"bytes",
"(",
"source",
",",
"charset",
")",
",",
"charset",
")",
";",
"}"
] | base64编码,URL安全
@param source 被编码的base64字符串
@param charset 字符集
@return 被加密后的字符串
@since 3.0.6 | [
"base64编码",
"URL安全"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64Encoder.java#L87-L89 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/OperationsApi.java | OperationsApi.getUsersAsync | public void getUsersAsync(UserSearchParams searchParams, AsyncCallback callback) throws ProvisioningApiException {
"""
Get users.
Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters.
@param searchParams an object containing the searc... | java | public void getUsersAsync(UserSearchParams searchParams, AsyncCallback callback) throws ProvisioningApiException {
getUsersAsync(
searchParams.getLimit(),
searchParams.getOffset(),
searchParams.getOrder(),
searchParams.getSortBy(),
searchParams.getFilterName(),
searchParams.getFilterParameter... | [
"public",
"void",
"getUsersAsync",
"(",
"UserSearchParams",
"searchParams",
",",
"AsyncCallback",
"callback",
")",
"throws",
"ProvisioningApiException",
"{",
"getUsersAsync",
"(",
"searchParams",
".",
"getLimit",
"(",
")",
",",
"searchParams",
".",
"getOffset",
"(",
... | Get users.
Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters.
@param searchParams an object containing the search parameters. Parameters include (limit, offset, order, sortBy, filterName, filterParameters, roles, skills, userEnabled, user... | [
"Get",
"users",
".",
"Get",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
")",
"objects",
"based",
"on",
"the",
"specified",
... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OperationsApi.java#L96-L110 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java | DwgFile.addDwgObjectOffset | public void addDwgObjectOffset( int handle, int offset ) {
"""
Add a DWG object offset to the dwgObjectOffsets vector
@param handle Object handle
@param offset Offset of the object data in the DWG file
"""
DwgObjectOffset doo = new DwgObjectOffset(handle, offset);
dwgObjectOffsets.add(doo);... | java | public void addDwgObjectOffset( int handle, int offset ) {
DwgObjectOffset doo = new DwgObjectOffset(handle, offset);
dwgObjectOffsets.add(doo);
} | [
"public",
"void",
"addDwgObjectOffset",
"(",
"int",
"handle",
",",
"int",
"offset",
")",
"{",
"DwgObjectOffset",
"doo",
"=",
"new",
"DwgObjectOffset",
"(",
"handle",
",",
"offset",
")",
";",
"dwgObjectOffsets",
".",
"add",
"(",
"doo",
")",
";",
"}"
] | Add a DWG object offset to the dwgObjectOffsets vector
@param handle Object handle
@param offset Offset of the object data in the DWG file | [
"Add",
"a",
"DWG",
"object",
"offset",
"to",
"the",
"dwgObjectOffsets",
"vector"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgFile.java#L1152-L1155 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.distanceSegmentPoint | public static double distanceSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY) {
"""
Returns the distance between the given segment and point.
<p>
libGDX (Apache 2.0)
"""
Point nearest = nearestSegmentPoint(startX, startY, endX, endY, pointX, pointY);
... | java | public static double distanceSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY) {
Point nearest = nearestSegmentPoint(startX, startY, endX, endY, pointX, pointY);
return Math.hypot(nearest.x - pointX, nearest.y - pointY);
} | [
"public",
"static",
"double",
"distanceSegmentPoint",
"(",
"double",
"startX",
",",
"double",
"startY",
",",
"double",
"endX",
",",
"double",
"endY",
",",
"double",
"pointX",
",",
"double",
"pointY",
")",
"{",
"Point",
"nearest",
"=",
"nearestSegmentPoint",
"(... | Returns the distance between the given segment and point.
<p>
libGDX (Apache 2.0) | [
"Returns",
"the",
"distance",
"between",
"the",
"given",
"segment",
"and",
"point",
".",
"<p",
">",
"libGDX",
"(",
"Apache",
"2",
".",
"0",
")"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L167-L170 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/QueryRecord.java | QueryRecord.addRelationship | public void addRelationship(int linkType, Record recLeft, Record recRight, String fldLeft1, String fldRight1, String fldLeft2, String fldRight2, String fldLeft3, String fldRight3) {
"""
Add this table link to this query.
Creates a new tablelink and adds it to the link list.
"""
new TableLink(this, lin... | java | public void addRelationship(int linkType, Record recLeft, Record recRight, String fldLeft1, String fldRight1, String fldLeft2, String fldRight2, String fldLeft3, String fldRight3)
{
new TableLink(this, linkType, recLeft, recRight, fldLeft1, fldRight1, fldLeft2, fldRight2, fldLeft3, fldRight3);
} | [
"public",
"void",
"addRelationship",
"(",
"int",
"linkType",
",",
"Record",
"recLeft",
",",
"Record",
"recRight",
",",
"String",
"fldLeft1",
",",
"String",
"fldRight1",
",",
"String",
"fldLeft2",
",",
"String",
"fldRight2",
",",
"String",
"fldLeft3",
",",
"Str... | Add this table link to this query.
Creates a new tablelink and adds it to the link list. | [
"Add",
"this",
"table",
"link",
"to",
"this",
"query",
".",
"Creates",
"a",
"new",
"tablelink",
"and",
"adds",
"it",
"to",
"the",
"link",
"list",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/QueryRecord.java#L176-L179 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/path/PathBuilder.java | PathBuilder.cubicTo | public PathBuilder cubicTo(Point2d cp1, Point2d cp2, Point2d ep) {
"""
Make a cubic curve in the path, with two control points.
@param cp1 the first control point
@param cp2 the second control point
@param ep the end point of the curve
@return a reference to this builder
"""
add(new CubicTo(cp1,... | java | public PathBuilder cubicTo(Point2d cp1, Point2d cp2, Point2d ep) {
add(new CubicTo(cp1, cp2, ep));
return this;
} | [
"public",
"PathBuilder",
"cubicTo",
"(",
"Point2d",
"cp1",
",",
"Point2d",
"cp2",
",",
"Point2d",
"ep",
")",
"{",
"add",
"(",
"new",
"CubicTo",
"(",
"cp1",
",",
"cp2",
",",
"ep",
")",
")",
";",
"return",
"this",
";",
"}"
] | Make a cubic curve in the path, with two control points.
@param cp1 the first control point
@param cp2 the second control point
@param ep the end point of the curve
@return a reference to this builder | [
"Make",
"a",
"cubic",
"curve",
"in",
"the",
"path",
"with",
"two",
"control",
"points",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/path/PathBuilder.java#L124-L127 |
aws/aws-sdk-java | aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ResultByTime.java | ResultByTime.withTotal | public ResultByTime withTotal(java.util.Map<String, MetricValue> total) {
"""
<p>
The total amount of cost or usage accrued during the time period.
</p>
@param total
The total amount of cost or usage accrued during the time period.
@return Returns a reference to this object so that method calls can be chain... | java | public ResultByTime withTotal(java.util.Map<String, MetricValue> total) {
setTotal(total);
return this;
} | [
"public",
"ResultByTime",
"withTotal",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MetricValue",
">",
"total",
")",
"{",
"setTotal",
"(",
"total",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The total amount of cost or usage accrued during the time period.
</p>
@param total
The total amount of cost or usage accrued during the time period.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"total",
"amount",
"of",
"cost",
"or",
"usage",
"accrued",
"during",
"the",
"time",
"period",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-costexplorer/src/main/java/com/amazonaws/services/costexplorer/model/ResultByTime.java#L131-L134 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/ts/copy/TSCopy.java | TSCopy.copy | public static <S1, I1, T1, SP, TP, S2, I2, T2> Mapping<S1, S2> copy(TSTraversalMethod method,
UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP, ? extends TP> in,
int ... | java | public static <S1, I1, T1, SP, TP, S2, I2, T2> Mapping<S1, S2> copy(TSTraversalMethod method,
UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP, ? extends TP> in,
int ... | [
"public",
"static",
"<",
"S1",
",",
"I1",
",",
"T1",
",",
"SP",
",",
"TP",
",",
"S2",
",",
"I2",
",",
"T2",
">",
"Mapping",
"<",
"S1",
",",
"S2",
">",
"copy",
"(",
"TSTraversalMethod",
"method",
",",
"UniversalTransitionSystem",
"<",
"S1",
",",
"?"... | Copies a {@link UniversalAutomaton} with possibly heterogeneous input alphabets, but compatible properties.
States and transitions will not be filtered
@param method
the traversal method to use
@param in
the input transition system
@param limit
the traversal limit, a value less than 0 means no limit
@param inputs
the ... | [
"Copies",
"a",
"{",
"@link",
"UniversalAutomaton",
"}",
"with",
"possibly",
"heterogeneous",
"input",
"alphabets",
"but",
"compatible",
"properties",
".",
"States",
"and",
"transitions",
"will",
"not",
"be",
"filtered"
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/ts/copy/TSCopy.java#L415-L422 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/net/BlockingClient.java | BlockingClient.runReadLoop | public static void runReadLoop(InputStream stream, StreamConnection connection) throws Exception {
"""
A blocking call that never returns, except by throwing an exception. It reads bytes from the input stream
and feeds them to the provided {@link StreamConnection}, for example, a {@link Peer}.
"""
Byt... | java | public static void runReadLoop(InputStream stream, StreamConnection connection) throws Exception {
ByteBuffer dbuf = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND));
byte[] readBuff = new byte[dbuf.capacity()];
while... | [
"public",
"static",
"void",
"runReadLoop",
"(",
"InputStream",
"stream",
",",
"StreamConnection",
"connection",
")",
"throws",
"Exception",
"{",
"ByteBuffer",
"dbuf",
"=",
"ByteBuffer",
".",
"allocateDirect",
"(",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"... | A blocking call that never returns, except by throwing an exception. It reads bytes from the input stream
and feeds them to the provided {@link StreamConnection}, for example, a {@link Peer}. | [
"A",
"blocking",
"call",
"that",
"never",
"returns",
"except",
"by",
"throwing",
"an",
"exception",
".",
"It",
"reads",
"bytes",
"from",
"the",
"input",
"stream",
"and",
"feeds",
"them",
"to",
"the",
"provided",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/net/BlockingClient.java#L108-L128 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java | DefaultInputFile.newRange | public TextRange newRange(int startOffset, int endOffset) {
"""
Create Range from global offsets. Used for backward compatibility with older API.
"""
checkMetadata();
return newRangeValidPointers(newPointer(startOffset), newPointer(endOffset), false);
} | java | public TextRange newRange(int startOffset, int endOffset) {
checkMetadata();
return newRangeValidPointers(newPointer(startOffset), newPointer(endOffset), false);
} | [
"public",
"TextRange",
"newRange",
"(",
"int",
"startOffset",
",",
"int",
"endOffset",
")",
"{",
"checkMetadata",
"(",
")",
";",
"return",
"newRangeValidPointers",
"(",
"newPointer",
"(",
"startOffset",
")",
",",
"newPointer",
"(",
"endOffset",
")",
",",
"fals... | Create Range from global offsets. Used for backward compatibility with older API. | [
"Create",
"Range",
"from",
"global",
"offsets",
".",
"Used",
"for",
"backward",
"compatibility",
"with",
"older",
"API",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java#L309-L312 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/BAMInputFormat.java | BAMInputFormat.convertSimpleIntervalToQueryInterval | private static QueryInterval convertSimpleIntervalToQueryInterval( final Interval interval, final SAMSequenceDictionary sequenceDictionary ) {
"""
Converts an interval in SimpleInterval format into an htsjdk QueryInterval.
In doing so, a header lookup is performed to convert from contig name to index
@param ... | java | private static QueryInterval convertSimpleIntervalToQueryInterval( final Interval interval, final SAMSequenceDictionary sequenceDictionary ) {
if (interval == null) {
throw new IllegalArgumentException("interval may not be null");
}
if (sequenceDictionary == null) {
throw new IllegalArgumentException("seque... | [
"private",
"static",
"QueryInterval",
"convertSimpleIntervalToQueryInterval",
"(",
"final",
"Interval",
"interval",
",",
"final",
"SAMSequenceDictionary",
"sequenceDictionary",
")",
"{",
"if",
"(",
"interval",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExce... | Converts an interval in SimpleInterval format into an htsjdk QueryInterval.
In doing so, a header lookup is performed to convert from contig name to index
@param interval interval to convert
@param sequenceDictionary sequence dictionary used to perform the conversion
@return an equivalent interval in QueryInterval fo... | [
"Converts",
"an",
"interval",
"in",
"SimpleInterval",
"format",
"into",
"an",
"htsjdk",
"QueryInterval",
"."
] | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/BAMInputFormat.java#L675-L690 |
zxing/zxing | android/src/com/google/zxing/client/android/camera/CameraManager.java | CameraManager.requestPreviewFrame | public synchronized void requestPreviewFrame(Handler handler, int message) {
"""
A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
respectively.
@param handler The handler to... | java | public synchronized void requestPreviewFrame(Handler handler, int message) {
OpenCamera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.getCamera().setOneShotPreviewCallback(previewCallback);
}
} | [
"public",
"synchronized",
"void",
"requestPreviewFrame",
"(",
"Handler",
"handler",
",",
"int",
"message",
")",
"{",
"OpenCamera",
"theCamera",
"=",
"camera",
";",
"if",
"(",
"theCamera",
"!=",
"null",
"&&",
"previewing",
")",
"{",
"previewCallback",
".",
"set... | A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
respectively.
@param handler The handler to send the message to.
@param message The what field of the message to be sent. | [
"A",
"single",
"preview",
"frame",
"will",
"be",
"returned",
"to",
"the",
"handler",
"supplied",
".",
"The",
"data",
"will",
"arrive",
"as",
"byte",
"[]",
"in",
"the",
"message",
".",
"obj",
"field",
"with",
"width",
"and",
"height",
"encoded",
"as",
"me... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/camera/CameraManager.java#L198-L204 |
bootique/bootique-jersey | bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java | JerseyModuleExtender.setProperty | public JerseyModuleExtender setProperty(String name, Object value) {
"""
Sets Jersey container property. This allows setting ResourceConfig properties that can not be set via JAX RS features.
@param name property name
@param value property value
@return
@see org.glassfish.jersey.server.ServerProperties
@sin... | java | public JerseyModuleExtender setProperty(String name, Object value) {
contributeProperties().addBinding(name).toInstance(value);
return this;
} | [
"public",
"JerseyModuleExtender",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"contributeProperties",
"(",
")",
".",
"addBinding",
"(",
"name",
")",
".",
"toInstance",
"(",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets Jersey container property. This allows setting ResourceConfig properties that can not be set via JAX RS features.
@param name property name
@param value property value
@return
@see org.glassfish.jersey.server.ServerProperties
@since 0.22 | [
"Sets",
"Jersey",
"container",
"property",
".",
"This",
"allows",
"setting",
"ResourceConfig",
"properties",
"that",
"can",
"not",
"be",
"set",
"via",
"JAX",
"RS",
"features",
"."
] | train | https://github.com/bootique/bootique-jersey/blob/8def056158f0ad1914e975625eb5ed3e4712648c/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java#L104-L107 |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java | ClassLocator.isSubclass | public static boolean isSubclass(String superclass, String otherclass) {
"""
Checks whether the "otherclass" is a subclass of the given "superclass".
@param superclass the superclass to check against
@param otherclass this class is checked whether it is a subclass
of the the superclass
@return ... | java | public static boolean isSubclass(String superclass, String otherclass) {
String key;
key = superclass + "-" + otherclass;
if (m_CheckSubClass.containsKey(key))
return m_CheckSubClass.get(key);
try {
return isSubclass(Class.forName(superclass), Class.forName(otherclass));
}
catch (T... | [
"public",
"static",
"boolean",
"isSubclass",
"(",
"String",
"superclass",
",",
"String",
"otherclass",
")",
"{",
"String",
"key",
";",
"key",
"=",
"superclass",
"+",
"\"-\"",
"+",
"otherclass",
";",
"if",
"(",
"m_CheckSubClass",
".",
"containsKey",
"(",
"key... | Checks whether the "otherclass" is a subclass of the given "superclass".
@param superclass the superclass to check against
@param otherclass this class is checked whether it is a subclass
of the the superclass
@return TRUE if "otherclass" is a true subclass | [
"Checks",
"whether",
"the",
"otherclass",
"is",
"a",
"subclass",
"of",
"the",
"given",
"superclass",
"."
] | train | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java#L588-L601 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.getAgentHistory | public AgentChatHistory getAgentHistory(EntityBareJid jid, int maxSessions, Date startDate) throws XMPPException, NotConnectedException, InterruptedException {
"""
Retrieves the AgentChatHistory associated with a particular agent jid.
@param jid the jid of the agent.
@param maxSessions the max number of sessio... | java | public AgentChatHistory getAgentHistory(EntityBareJid jid, int maxSessions, Date startDate) throws XMPPException, NotConnectedException, InterruptedException {
AgentChatHistory request;
if (startDate != null) {
request = new AgentChatHistory(jid, maxSessions, startDate);
}
el... | [
"public",
"AgentChatHistory",
"getAgentHistory",
"(",
"EntityBareJid",
"jid",
",",
"int",
"maxSessions",
",",
"Date",
"startDate",
")",
"throws",
"XMPPException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"AgentChatHistory",
"request",
";",
"if",
... | Retrieves the AgentChatHistory associated with a particular agent jid.
@param jid the jid of the agent.
@param maxSessions the max number of sessions to retrieve.
@param startDate point in time from which on history should get retrieved.
@return the chat history associated with a given jid.
@throws XMPPException if an... | [
"Retrieves",
"the",
"AgentChatHistory",
"associated",
"with",
"a",
"particular",
"agent",
"jid",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L896-L912 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateUUID | public static <T extends CharSequence> T validateUUID(T value, String errorMsg) throws ValidateException {
"""
验证是否为UUID<br>
包括带横线标准格式和不带横线的简单模式
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isUUID(value)) {
throw new Valida... | java | public static <T extends CharSequence> T validateUUID(T value, String errorMsg) throws ValidateException {
if (false == isUUID(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateUUID",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isUUID",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Va... | 验证是否为UUID<br>
包括带横线标准格式和不带横线的简单模式
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为UUID<br",
">",
"包括带横线标准格式和不带横线的简单模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L1002-L1007 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java | AlertResources.deleteNotificationsById | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Deletes the notification.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null and must be a positive non-zero number.
@param notificationId The notification id. Cannot b... | java | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/{alertId}/notifications/{notificationId}")
@Description(
"Deletes a notification having the given ID if it is associated with the given alert ID. Associated triggers are not deleted from the alert."
)
public Response deleteNotificationsById(@Context HttpS... | [
"@",
"DELETE",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{alertId}/notifications/{notificationId}\"",
")",
"@",
"Description",
"(",
"\"Deletes a notification having the given ID if it is associated with the given alert ID. Associated tr... | Deletes the notification.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null and must be a positive non-zero number.
@param notificationId The notification id. Cannot be null and must be a positive non-zero number.
@return Updated alert o... | [
"Deletes",
"the",
"notification",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java#L1043-L1081 |
haifengl/smile | nlp/src/main/java/smile/nlp/Trie.java | Trie.put | public void put(K[] key, V value) {
"""
Add a key with associated value to the trie.
@param key the key.
@param value the value.
"""
Node child = root.get(key[0]);
if (child == null) {
child = new Node(key[0]);
root.put(key[0], child);
}
child.add... | java | public void put(K[] key, V value) {
Node child = root.get(key[0]);
if (child == null) {
child = new Node(key[0]);
root.put(key[0], child);
}
child.addChild(key, value, 1);
} | [
"public",
"void",
"put",
"(",
"K",
"[",
"]",
"key",
",",
"V",
"value",
")",
"{",
"Node",
"child",
"=",
"root",
".",
"get",
"(",
"key",
"[",
"0",
"]",
")",
";",
"if",
"(",
"child",
"==",
"null",
")",
"{",
"child",
"=",
"new",
"Node",
"(",
"k... | Add a key with associated value to the trie.
@param key the key.
@param value the value. | [
"Add",
"a",
"key",
"with",
"associated",
"value",
"to",
"the",
"trie",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/nlp/src/main/java/smile/nlp/Trie.java#L136-L143 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.runDerivator | private LinearEquationSystem runDerivator(Relation<ParameterizationFunction> relation, int dimensionality, DBIDs ids) {
"""
Runs the derivator on the specified interval and assigns all points having
a distance less then the standard deviation of the derivator model to the
model to this model.
@param relation ... | java | private LinearEquationSystem runDerivator(Relation<ParameterizationFunction> relation, int dimensionality, DBIDs ids) {
try {
// build database for derivator
Database derivatorDB = buildDerivatorDB(relation, ids);
PCARunner pca = new PCARunner(new StandardCovarianceMatrixBuilder());
EigenPa... | [
"private",
"LinearEquationSystem",
"runDerivator",
"(",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
",",
"int",
"dimensionality",
",",
"DBIDs",
"ids",
")",
"{",
"try",
"{",
"// build database for derivator",
"Database",
"derivatorDB",
"=",
"buildDeriva... | Runs the derivator on the specified interval and assigns all points having
a distance less then the standard deviation of the derivator model to the
model to this model.
@param relation the database containing the parameterization functions
@param ids the ids to build the model
@param dimensionality the dimensionality... | [
"Runs",
"the",
"derivator",
"on",
"the",
"specified",
"interval",
"and",
"assigns",
"all",
"points",
"having",
"a",
"distance",
"less",
"then",
"the",
"standard",
"deviation",
"of",
"the",
"derivator",
"model",
"to",
"the",
"model",
"to",
"this",
"model",
".... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L692-L708 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java | CachingCodecRegistry.createCodec | protected TypeCodec<?> createCodec(GenericType<?> javaType, boolean isJavaCovariant) {
"""
Variant where the CQL type is unknown. Can be covariant if we come from a lookup by Java value.
"""
TypeToken<?> token = javaType.__getToken();
if (List.class.isAssignableFrom(token.getRawType())
&& token... | java | protected TypeCodec<?> createCodec(GenericType<?> javaType, boolean isJavaCovariant) {
TypeToken<?> token = javaType.__getToken();
if (List.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).get... | [
"protected",
"TypeCodec",
"<",
"?",
">",
"createCodec",
"(",
"GenericType",
"<",
"?",
">",
"javaType",
",",
"boolean",
"isJavaCovariant",
")",
"{",
"TypeToken",
"<",
"?",
">",
"token",
"=",
"javaType",
".",
"__getToken",
"(",
")",
";",
"if",
"(",
"List",... | Variant where the CQL type is unknown. Can be covariant if we come from a lookup by Java value. | [
"Variant",
"where",
"the",
"CQL",
"type",
"is",
"unknown",
".",
"Can",
"be",
"covariant",
"if",
"we",
"come",
"from",
"a",
"lookup",
"by",
"Java",
"value",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java#L348-L372 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java | NamespaceRegistryImpl.registerNamespace | private synchronized void registerNamespace(String prefix, String uri, boolean persist) throws NamespaceException, RepositoryException {
"""
Registers the namespace and persists it if <code>persist</code> has been set to <code>true</code> and a persister has been configured
"""
if (namespaces.containsKey... | java | private synchronized void registerNamespace(String prefix, String uri, boolean persist) throws NamespaceException, RepositoryException
{
if (namespaces.containsKey(prefix))
{
unregisterNamespace(prefix);
}
else if (prefixes.containsKey(uri))
{
unregisterNamespace(prefi... | [
"private",
"synchronized",
"void",
"registerNamespace",
"(",
"String",
"prefix",
",",
"String",
"uri",
",",
"boolean",
"persist",
")",
"throws",
"NamespaceException",
",",
"RepositoryException",
"{",
"if",
"(",
"namespaces",
".",
"containsKey",
"(",
"prefix",
")",... | Registers the namespace and persists it if <code>persist</code> has been set to <code>true</code> and a persister has been configured | [
"Registers",
"the",
"namespace",
"and",
"persists",
"it",
"if",
"<code",
">",
"persist<",
"/",
"code",
">",
"has",
"been",
"set",
"to",
"<code",
">",
"true<",
"/",
"code",
">",
"and",
"a",
"persister",
"has",
"been",
"configured"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java#L360-L379 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java | BindingFactory.toBinding | public Binding toBinding(BindingElement element) {
"""
Convert a binding element to a Guive binding.
@param element the element to convert.
@return the Guice binding.
"""
final TypeReference typeReference = typeRef(element.getBind());
final String annotatedWith = element.getAnnotatedWith();
final Str... | java | public Binding toBinding(BindingElement element) {
final TypeReference typeReference = typeRef(element.getBind());
final String annotatedWith = element.getAnnotatedWith();
final String annotatedWithName = element.getAnnotatedWithName();
if (!Strings.isEmpty(annotatedWith)) {
final TypeReference annotationTyp... | [
"public",
"Binding",
"toBinding",
"(",
"BindingElement",
"element",
")",
"{",
"final",
"TypeReference",
"typeReference",
"=",
"typeRef",
"(",
"element",
".",
"getBind",
"(",
")",
")",
";",
"final",
"String",
"annotatedWith",
"=",
"element",
".",
"getAnnotatedWit... | Convert a binding element to a Guive binding.
@param element the element to convert.
@return the Guice binding. | [
"Convert",
"a",
"binding",
"element",
"to",
"a",
"Guive",
"binding",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/binding/BindingFactory.java#L405-L444 |
lucee/Lucee | core/src/main/java/lucee/runtime/ComponentImpl.java | ComponentImpl.get | protected Object get(int access, String name, Object defaultValue) {
"""
return element that has at least given access or null
@param access
@param name
@return matching value
"""
return get(access, KeyImpl.init(name), defaultValue);
} | java | protected Object get(int access, String name, Object defaultValue) {
return get(access, KeyImpl.init(name), defaultValue);
} | [
"protected",
"Object",
"get",
"(",
"int",
"access",
",",
"String",
"name",
",",
"Object",
"defaultValue",
")",
"{",
"return",
"get",
"(",
"access",
",",
"KeyImpl",
".",
"init",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | return element that has at least given access or null
@param access
@param name
@return matching value | [
"return",
"element",
"that",
"has",
"at",
"least",
"given",
"access",
"or",
"null"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ComponentImpl.java#L1879-L1881 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/reflect/AbstractFixture.java | AbstractFixture.getField | protected Field getField(Class type, String name) {
"""
<p>getField.</p>
@param type a {@link java.lang.Class} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.reflect.Field} object.
"""
return introspector(type).getField( toJavaIdentifierForm(name));
} | java | protected Field getField(Class type, String name)
{
return introspector(type).getField( toJavaIdentifierForm(name));
} | [
"protected",
"Field",
"getField",
"(",
"Class",
"type",
",",
"String",
"name",
")",
"{",
"return",
"introspector",
"(",
"type",
")",
".",
"getField",
"(",
"toJavaIdentifierForm",
"(",
"name",
")",
")",
";",
"}"
] | <p>getField.</p>
@param type a {@link java.lang.Class} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.reflect.Field} object. | [
"<p",
">",
"getField",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/reflect/AbstractFixture.java#L106-L109 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getRequiredCheck | public static String getRequiredCheck(int order, Field field) {
"""
get required field check java expression.
@param order field order
@param field java field
@return full java expression
"""
String fieldName = getFieldName(order);
String code = "if (" + fieldName + "== null) {\n";
... | java | public static String getRequiredCheck(int order, Field field) {
String fieldName = getFieldName(order);
String code = "if (" + fieldName + "== null) {\n";
code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"))"
+ ClassCode.JAVA_LINE_BR... | [
"public",
"static",
"String",
"getRequiredCheck",
"(",
"int",
"order",
",",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"getFieldName",
"(",
"order",
")",
";",
"String",
"code",
"=",
"\"if (\"",
"+",
"fieldName",
"+",
"\"== null) {\\n\"",
";",
"c... | get required field check java expression.
@param order field order
@param field java field
@return full java expression | [
"get",
"required",
"field",
"check",
"java",
"expression",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L477-L485 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.getConcatenated | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> ELEMENTTYPE [] getConcatenated (@Nullable final ELEMENTTYPE [] aHeadArray,
@Nullable final ELEMENTTYPE aTail,
@Nonnull final Class <ELE... | java | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> ELEMENTTYPE [] getConcatenated (@Nullable final ELEMENTTYPE [] aHeadArray,
@Nullable final ELEMENTTYPE aTail,
@Nonnull final Class <ELE... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"ELEMENTTYPE",
"[",
"]",
"getConcatenated",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"[",
"]",
"aHeadArray",
",",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"aTail",
",",
... | Get a new array that combines the passed array and the tail element. The
tail element will be the last element of the created array.
@param <ELEMENTTYPE>
Array element type
@param aHeadArray
The head array. May be <code>null</code>.
@param aTail
The last element of the result array. If this element is
<code>null</code... | [
"Get",
"a",
"new",
"array",
"that",
"combines",
"the",
"passed",
"array",
"and",
"the",
"tail",
"element",
".",
"The",
"tail",
"element",
"will",
"be",
"the",
"last",
"element",
"of",
"the",
"created",
"array",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L1996-L2010 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java | Document.setRelations | public void setRelations(int i, Relation v) {
"""
indexed setter for relations - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_relations == null)
jcasType.jcas.throwFe... | java | public void setRelations(int i, Relation v) {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_relations == null)
jcasType.jcas.throwFeatMissing("relations", "de.julielab.jules.types.ace.Document");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasTy... | [
"public",
"void",
"setRelations",
"(",
"int",
"i",
",",
"Relation",
"v",
")",
"{",
"if",
"(",
"Document_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Document_Type",
")",
"jcasType",
")",
".",
"casFeat_relations",
"==",
"null",
")",
"jcasType",
".",
"jcas",
... | indexed setter for relations - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"relations",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java#L270-L274 |
pravega/pravega | common/src/main/java/io/pravega/common/util/CollectionHelpers.java | CollectionHelpers.binarySearch | public static <T> int binarySearch(List<? extends T> list, Function<? super T, Integer> comparator) {
"""
Performs a binary search on the given sorted list using the given comparator.
This method has undefined behavior if the list is not sorted.
<p>
This method is different than that in java.util.Collections in... | java | public static <T> int binarySearch(List<? extends T> list, Function<? super T, Integer> comparator) {
return binarySearch(list, comparator, false);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"binarySearch",
"(",
"List",
"<",
"?",
"extends",
"T",
">",
"list",
",",
"Function",
"<",
"?",
"super",
"T",
",",
"Integer",
">",
"comparator",
")",
"{",
"return",
"binarySearch",
"(",
"list",
",",
"comparator"... | Performs a binary search on the given sorted list using the given comparator.
This method has undefined behavior if the list is not sorted.
<p>
This method is different than that in java.util.Collections in the following ways:
1. This one searches by a simple comparator, vs the ones in the Collections class which searc... | [
"Performs",
"a",
"binary",
"search",
"on",
"the",
"given",
"sorted",
"list",
"using",
"the",
"given",
"comparator",
".",
"This",
"method",
"has",
"undefined",
"behavior",
"if",
"the",
"list",
"is",
"not",
"sorted",
".",
"<p",
">",
"This",
"method",
"is",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/CollectionHelpers.java#L44-L46 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.substituteSymbols | protected void substituteSymbols(Map<String, String> initProps) {
"""
Perform substitution of symbols used in config
@param initProps
"""
for (Entry<String, String> entry : initProps.entrySet()) {
Object value = entry.getValue();
if (value instanceof String) {
... | java | protected void substituteSymbols(Map<String, String> initProps) {
for (Entry<String, String> entry : initProps.entrySet()) {
Object value = entry.getValue();
if (value instanceof String) {
String strValue = (String) value;
Matcher m = SYMBOL_DEF.matcher(st... | [
"protected",
"void",
"substituteSymbols",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"initProps",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"initProps",
".",
"entrySet",
"(",
")",
")",
"{",
"Object",
"value",
"... | Perform substitution of symbols used in config
@param initProps | [
"Perform",
"substitution",
"of",
"symbols",
"used",
"in",
"config"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L748-L765 |
netty/netty | common/src/main/java/io/netty/util/ConstantPool.java | ConstantPool.createOrThrow | private T createOrThrow(String name) {
"""
Creates constant by name or throws exception. Threadsafe
@param name the name of the {@link Constant}
"""
T constant = constants.get(name);
if (constant == null) {
final T tempConstant = newConstant(nextId(), name);
constant ... | java | private T createOrThrow(String name) {
T constant = constants.get(name);
if (constant == null) {
final T tempConstant = newConstant(nextId(), name);
constant = constants.putIfAbsent(name, tempConstant);
if (constant == null) {
return tempConstant;
... | [
"private",
"T",
"createOrThrow",
"(",
"String",
"name",
")",
"{",
"T",
"constant",
"=",
"constants",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"constant",
"==",
"null",
")",
"{",
"final",
"T",
"tempConstant",
"=",
"newConstant",
"(",
"nextId",
"(",... | Creates constant by name or throws exception. Threadsafe
@param name the name of the {@link Constant} | [
"Creates",
"constant",
"by",
"name",
"or",
"throws",
"exception",
".",
"Threadsafe"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ConstantPool.java#L103-L114 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetFunctionDefinitionResult.java | GetFunctionDefinitionResult.withTags | public GetFunctionDefinitionResult withTags(java.util.Map<String, String> tags) {
"""
The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public GetFunctionDefinitionResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"GetFunctionDefinitionResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"tags",
"for",
"the",
"definition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetFunctionDefinitionResult.java#L310-L313 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/util/ReflectUtil.java | ReflectUtil.createInstance | public static <T> T createInstance(Class<T> type, Object... parameters) {
"""
Create a new instance of the provided type
@param type the class to create a new instance of
@param parameters the parameters to pass to the constructor
@return the created instance
"""
// get types for parameters
Class... | java | public static <T> T createInstance(Class<T> type, Object... parameters) {
// get types for parameters
Class<?>[] parameterTypes = new Class<?>[parameters.length];
for (int i = 0; i < parameters.length; i++) {
Object parameter = parameters[i];
parameterTypes[i] = parameter.getClass();
}
... | [
"public",
"static",
"<",
"T",
">",
"T",
"createInstance",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"parameters",
")",
"{",
"// get types for parameters",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
"new",
"Class",
"<",
"?",... | Create a new instance of the provided type
@param type the class to create a new instance of
@param parameters the parameters to pass to the constructor
@return the created instance | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"provided",
"type"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/ReflectUtil.java#L81-L98 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final PreparedStatement stmt) throws UncheckedSQLException {
"""
Imports the data from <code>DataSet</code> to database.
@param dataset
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@return
@throws Unchecke... | java | public static int importData(final DataSet dataset, final PreparedStatement stmt) throws UncheckedSQLException {
return importData(dataset, dataset.columnNameList(), stmt);
} | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"PreparedStatement",
"stmt",
")",
"throws",
"UncheckedSQLException",
"{",
"return",
"importData",
"(",
"dataset",
",",
"dataset",
".",
"columnNameList",
"(",
")",
",",
"st... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2176-L2178 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/iterable/S3Objects.java | S3Objects.withPrefix | public static S3Objects withPrefix(AmazonS3 s3, String bucketName, String prefix) {
"""
Constructs an iterable that covers the objects in an Amazon S3 bucket
where the key begins with the given prefix.
@param s3
The Amazon S3 client.
@param bucketName
The bucket name.
@param prefix
The prefix.
@return An... | java | public static S3Objects withPrefix(AmazonS3 s3, String bucketName, String prefix) {
S3Objects objects = new S3Objects(s3, bucketName);
objects.prefix = prefix;
return objects;
} | [
"public",
"static",
"S3Objects",
"withPrefix",
"(",
"AmazonS3",
"s3",
",",
"String",
"bucketName",
",",
"String",
"prefix",
")",
"{",
"S3Objects",
"objects",
"=",
"new",
"S3Objects",
"(",
"s3",
",",
"bucketName",
")",
";",
"objects",
".",
"prefix",
"=",
"p... | Constructs an iterable that covers the objects in an Amazon S3 bucket
where the key begins with the given prefix.
@param s3
The Amazon S3 client.
@param bucketName
The bucket name.
@param prefix
The prefix.
@return An iterator for object summaries. | [
"Constructs",
"an",
"iterable",
"that",
"covers",
"the",
"objects",
"in",
"an",
"Amazon",
"S3",
"bucket",
"where",
"the",
"key",
"begins",
"with",
"the",
"given",
"prefix",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/iterable/S3Objects.java#L76-L80 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java | ExampleFeatureSurf.harder | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
"""
Configured exactly the same as the easy example above, but require a lot more code and a more in depth
understanding of how SURF works and is configured. Instead of TupleDesc_F64, SurfFeature are computed in
this case. They are almost t... | java | public static <II extends ImageGray<II>> void harder(GrayF32 image ) {
// SURF works off of integral images
Class<II> integralType = GIntegralImageOps.getIntegralType(GrayF32.class);
// define the feature detection algorithm
NonMaxSuppression extractor =
FactoryFeatureExtractor.nonmax(new ConfigExtract(2... | [
"public",
"static",
"<",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"void",
"harder",
"(",
"GrayF32",
"image",
")",
"{",
"// SURF works off of integral images",
"Class",
"<",
"II",
">",
"integralType",
"=",
"GIntegralImageOps",
".",
"getIntegralType",
"(... | Configured exactly the same as the easy example above, but require a lot more code and a more in depth
understanding of how SURF works and is configured. Instead of TupleDesc_F64, SurfFeature are computed in
this case. They are almost the same as TupleDesc_F64, but contain the Laplacian's sign which can be used
to sp... | [
"Configured",
"exactly",
"the",
"same",
"as",
"the",
"easy",
"example",
"above",
"but",
"require",
"a",
"lot",
"more",
"code",
"and",
"a",
"more",
"in",
"depth",
"understanding",
"of",
"how",
"SURF",
"works",
"and",
"is",
"configured",
".",
"Instead",
"of"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L79-L124 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/CertificatesInner.java | CertificatesInner.createOrUpdateAsync | public Observable<IntegrationAccountCertificateInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String certificateName, IntegrationAccountCertificateInner certificate) {
"""
Creates or updates an integration account certificate.
@param resourceGroupName The resource group name... | java | public Observable<IntegrationAccountCertificateInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String certificateName, IntegrationAccountCertificateInner certificate) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, certificateName, c... | [
"public",
"Observable",
"<",
"IntegrationAccountCertificateInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"certificateName",
",",
"IntegrationAccountCertificateInner",
"certificate",
")",
"{",
"r... | Creates or updates an integration account certificate.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param certificateName The integration account certificate name.
@param certificate The integration account certificate.
@throws IllegalArgumentException ... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/CertificatesInner.java#L465-L472 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/DynamicFactory.java | DynamicFactory.ofClass | public <T extends ICDKObject> T ofClass(Class<T> intf, Object... objects) {
"""
Construct an implementation using a constructor whose parameters match
that of the provided objects.
@param intf the interface to construct an instance of
@param <T> the type of the class
@return an implementation of provided in... | java | public <T extends ICDKObject> T ofClass(Class<T> intf, Object... objects) {
try {
if (!intf.isInterface()) throw new IllegalArgumentException("expected interface, got " + intf.getClass());
Creator<T> constructor = get(new ObjectBasedKey(intf, objects));
return constructor.... | [
"public",
"<",
"T",
"extends",
"ICDKObject",
">",
"T",
"ofClass",
"(",
"Class",
"<",
"T",
">",
"intf",
",",
"Object",
"...",
"objects",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"intf",
".",
"isInterface",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentE... | Construct an implementation using a constructor whose parameters match
that of the provided objects.
@param intf the interface to construct an instance of
@param <T> the type of the class
@return an implementation of provided interface
@throws IllegalArgumentException thrown if the implementation can not be
construct... | [
"Construct",
"an",
"implementation",
"using",
"a",
"constructor",
"whose",
"parameters",
"match",
"that",
"of",
"the",
"provided",
"objects",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/DynamicFactory.java#L512-L529 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/IntCounter.java | IntCounter.incrementCounts | public void incrementCounts(Collection<E> keys, int count) {
"""
Adds the given count to the current counts for each of the given keys.
If any of the keys haven't been seen before, they are assumed to have
count 0, and thus this method will set their counts to the given
amount. Negative increments are equivalen... | java | public void incrementCounts(Collection<E> keys, int count) {
for (E key : keys) {
incrementCount(key, count);
}
} | [
"public",
"void",
"incrementCounts",
"(",
"Collection",
"<",
"E",
">",
"keys",
",",
"int",
"count",
")",
"{",
"for",
"(",
"E",
"key",
":",
"keys",
")",
"{",
"incrementCount",
"(",
"key",
",",
"count",
")",
";",
"}",
"}"
] | Adds the given count to the current counts for each of the given keys.
If any of the keys haven't been seen before, they are assumed to have
count 0, and thus this method will set their counts to the given
amount. Negative increments are equivalent to calling <tt>decrementCounts</tt>.
<p/>
To more conveniently incremen... | [
"Adds",
"the",
"given",
"count",
"to",
"the",
"current",
"counts",
"for",
"each",
"of",
"the",
"given",
"keys",
".",
"If",
"any",
"of",
"the",
"keys",
"haven",
"t",
"been",
"seen",
"before",
"they",
"are",
"assumed",
"to",
"have",
"count",
"0",
"and",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L280-L284 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/CollectionLens.java | CollectionLens.asCopy | public static <X, CX extends Collection<X>> Lens.Simple<CX, CX> asCopy(Function<? super CX, ? extends CX> copyFn) {
"""
Convenience static factory method for creating a lens that focuses on a copy of a <code>Collection</code>, given
a function that creates the copy. Useful for composition to avoid mutating a <cod... | java | public static <X, CX extends Collection<X>> Lens.Simple<CX, CX> asCopy(Function<? super CX, ? extends CX> copyFn) {
return simpleLens(copyFn, (__, copy) -> copy);
} | [
"public",
"static",
"<",
"X",
",",
"CX",
"extends",
"Collection",
"<",
"X",
">",
">",
"Lens",
".",
"Simple",
"<",
"CX",
",",
"CX",
">",
"asCopy",
"(",
"Function",
"<",
"?",
"super",
"CX",
",",
"?",
"extends",
"CX",
">",
"copyFn",
")",
"{",
"retur... | Convenience static factory method for creating a lens that focuses on a copy of a <code>Collection</code>, given
a function that creates the copy. Useful for composition to avoid mutating a <code>Collection</code> reference.
@param copyFn the copying function
@param <X> the collection element type
@param <CX> the... | [
"Convenience",
"static",
"factory",
"method",
"for",
"creating",
"a",
"lens",
"that",
"focuses",
"on",
"a",
"copy",
"of",
"a",
"<code",
">",
"Collection<",
"/",
"code",
">",
"given",
"a",
"function",
"that",
"creates",
"the",
"copy",
".",
"Useful",
"for",
... | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/CollectionLens.java#L30-L32 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addLink | public void addLink( final String path, final String target) throws NoSuchAlgorithmException, IOException {
"""
Adds a symbolic link to the repository.
@param path the absolute path at which this link will be installed.
@param target the path of the file this link will point to.
@throws NoSuchAlgorithmExcepti... | java | public void addLink( final String path, final String target) throws NoSuchAlgorithmException, IOException {
contents.addLink( path, target);
} | [
"public",
"void",
"addLink",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"target",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"contents",
".",
"addLink",
"(",
"path",
",",
"target",
")",
";",
"}"
] | Adds a symbolic link to the repository.
@param path the absolute path at which this link will be installed.
@param target the path of the file this link will point to.
@throws NoSuchAlgorithmException the algorithm isn't supported
@throws IOException there was an IO error | [
"Adds",
"a",
"symbolic",
"link",
"to",
"the",
"repository",
"."
] | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1134-L1136 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java | AMRulesRegressorProcessor.isAnomaly | private boolean isAnomaly(Instance instance, ActiveRule rule) {
"""
Method to verify if the instance is an anomaly.
@param instance
@param rule
@return
"""
//AMRUles is equipped with anomaly detection. If on, compute the anomaly value.
boolean isAnomaly = false;
if (this.noAnomalyDetection == fal... | java | private boolean isAnomaly(Instance instance, ActiveRule rule) {
//AMRUles is equipped with anomaly detection. If on, compute the anomaly value.
boolean isAnomaly = false;
if (this.noAnomalyDetection == false){
if (rule.getInstancesSeen() >= this.anomalyNumInstThreshold) {
isAnomaly = rule.isAnomaly(in... | [
"private",
"boolean",
"isAnomaly",
"(",
"Instance",
"instance",
",",
"ActiveRule",
"rule",
")",
"{",
"//AMRUles is equipped with anomaly detection. If on, compute the anomaly value. \t\t\t",
"boolean",
"isAnomaly",
"=",
"false",
";",
"if",
"(",
"this",
".",
"noAnomalyDetect... | Method to verify if the instance is an anomaly.
@param instance
@param rule
@return | [
"Method",
"to",
"verify",
"if",
"the",
"instance",
"is",
"an",
"anomaly",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java#L270-L282 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/MaxAbsScaler.java | MaxAbsScaler.scale | private Double scale(Double value, Double maxAbsolute) {
"""
Performs the actual rescaling handling corner cases.
@param value
@param maxAbsolute
@return
"""
if(maxAbsolute.equals(0.0)) {
return Math.signum(value);
}
else {
return value/maxAbsolute;
... | java | private Double scale(Double value, Double maxAbsolute) {
if(maxAbsolute.equals(0.0)) {
return Math.signum(value);
}
else {
return value/maxAbsolute;
}
} | [
"private",
"Double",
"scale",
"(",
"Double",
"value",
",",
"Double",
"maxAbsolute",
")",
"{",
"if",
"(",
"maxAbsolute",
".",
"equals",
"(",
"0.0",
")",
")",
"{",
"return",
"Math",
".",
"signum",
"(",
"value",
")",
";",
"}",
"else",
"{",
"return",
"va... | Performs the actual rescaling handling corner cases.
@param value
@param maxAbsolute
@return | [
"Performs",
"the",
"actual",
"rescaling",
"handling",
"corner",
"cases",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/MaxAbsScaler.java#L177-L184 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityLockService.java | EntityLockService.newReadLock | public IEntityLock newReadLock(Class entityType, String entityKey, String owner)
throws LockingException {
"""
Returns a read lock for the entity type, entity key and owner.
@return org.apereo.portal.concurrency.locking.IEntityLock
@param entityType Class
@param entityKey String
@param owner Stri... | java | public IEntityLock newReadLock(Class entityType, String entityKey, String owner)
throws LockingException {
return lockService.newLock(entityType, entityKey, IEntityLockService.READ_LOCK, owner);
} | [
"public",
"IEntityLock",
"newReadLock",
"(",
"Class",
"entityType",
",",
"String",
"entityKey",
",",
"String",
"owner",
")",
"throws",
"LockingException",
"{",
"return",
"lockService",
".",
"newLock",
"(",
"entityType",
",",
"entityKey",
",",
"IEntityLockService",
... | Returns a read lock for the entity type, entity key and owner.
@return org.apereo.portal.concurrency.locking.IEntityLock
@param entityType Class
@param entityKey String
@param owner String
@exception LockingException | [
"Returns",
"a",
"read",
"lock",
"for",
"the",
"entity",
"type",
"entity",
"key",
"and",
"owner",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/EntityLockService.java#L118-L121 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/UserAPI.java | UserAPI.userInfoUpdateremark | public static BaseResult userInfoUpdateremark(String access_token,String openid,String remark) {
"""
设置备注名
@param access_token access_token
@param openid openid
@param remark remark
@return BaseResult
"""
String postJson = String.format("{\"openid\":\"%1$s\",\"remark\":\"%2$s\"}", openid,remark);
HttpU... | java | public static BaseResult userInfoUpdateremark(String access_token,String openid,String remark){
String postJson = String.format("{\"openid\":\"%1$s\",\"remark\":\"%2$s\"}", openid,remark);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/use... | [
"public",
"static",
"BaseResult",
"userInfoUpdateremark",
"(",
"String",
"access_token",
",",
"String",
"openid",
",",
"String",
"remark",
")",
"{",
"String",
"postJson",
"=",
"String",
".",
"format",
"(",
"\"{\\\"openid\\\":\\\"%1$s\\\",\\\"remark\\\":\\\"%2$s\\\"}\"",
... | 设置备注名
@param access_token access_token
@param openid openid
@param remark remark
@return BaseResult | [
"设置备注名"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/UserAPI.java#L144-L153 |
google/closure-compiler | src/com/google/javascript/rhino/TypeDeclarationsIR.java | TypeDeclarationsIR.functionType | public static TypeDeclarationNode functionType(
Node returnType, LinkedHashMap<String, TypeDeclarationNode> requiredParams,
LinkedHashMap<String, TypeDeclarationNode> optionalParams,
String restName, TypeDeclarationNode restType) {
"""
Represents a function type.
Closure has syntax like {@code {... | java | public static TypeDeclarationNode functionType(
Node returnType, LinkedHashMap<String, TypeDeclarationNode> requiredParams,
LinkedHashMap<String, TypeDeclarationNode> optionalParams,
String restName, TypeDeclarationNode restType) {
TypeDeclarationNode node = new TypeDeclarationNode(Token.FUNCTION_... | [
"public",
"static",
"TypeDeclarationNode",
"functionType",
"(",
"Node",
"returnType",
",",
"LinkedHashMap",
"<",
"String",
",",
"TypeDeclarationNode",
">",
"requiredParams",
",",
"LinkedHashMap",
"<",
"String",
",",
"TypeDeclarationNode",
">",
"optionalParams",
",",
"... | Represents a function type.
Closure has syntax like {@code {function(string, boolean):number}}
Closure doesn't include parameter names. If the parameter types are unnamed,
arbitrary names can be substituted, eg. p1, p2, etc.
<p>Example:
<pre>
FUNCTION_TYPE
NUMBER_TYPE
STRING_KEY p1 [declared_type_expr: STRING_TYPE]
ST... | [
"Represents",
"a",
"function",
"type",
".",
"Closure",
"has",
"syntax",
"like",
"{",
"@code",
"{",
"function",
"(",
"string",
"boolean",
")",
":",
"number",
"}}",
"Closure",
"doesn",
"t",
"include",
"parameter",
"names",
".",
"If",
"the",
"parameter",
"typ... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/TypeDeclarationsIR.java#L188-L212 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/MBeanServerExecutorLocal.java | MBeanServerExecutorLocal.handleRequest | public <R extends JmxRequest> Object handleRequest(JsonRequestHandler<R> pRequestHandler, R pJmxReq)
throws MBeanException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, NotChangedException {
"""
Handle a single request
@param pRequestHandler the handler which can deal ... | java | public <R extends JmxRequest> Object handleRequest(JsonRequestHandler<R> pRequestHandler, R pJmxReq)
throws MBeanException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, NotChangedException {
AttributeNotFoundException attrException = null;
InstanceNotFoundExcep... | [
"public",
"<",
"R",
"extends",
"JmxRequest",
">",
"Object",
"handleRequest",
"(",
"JsonRequestHandler",
"<",
"R",
">",
"pRequestHandler",
",",
"R",
"pJmxReq",
")",
"throws",
"MBeanException",
",",
"ReflectionException",
",",
"AttributeNotFoundException",
",",
"Insta... | Handle a single request
@param pRequestHandler the handler which can deal with this request
@param pJmxReq the request to execute
@return the return value
@throws MBeanException
@throws ReflectionException
@throws AttributeNotFoundException
@throws InstanceNotFoundException | [
"Handle",
"a",
"single",
"request"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/MBeanServerExecutorLocal.java#L102-L124 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.localSeo_emailAvailability_GET | public OvhEmailAvailability localSeo_emailAvailability_GET(String email) throws IOException {
"""
Check email availability for a local SEO order
REST: GET /hosting/web/localSeo/emailAvailability
@param email [required] The email address to check
"""
String qPath = "/hosting/web/localSeo/emailAvailability... | java | public OvhEmailAvailability localSeo_emailAvailability_GET(String email) throws IOException {
String qPath = "/hosting/web/localSeo/emailAvailability";
StringBuilder sb = path(qPath);
query(sb, "email", email);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhEmailAvailability... | [
"public",
"OvhEmailAvailability",
"localSeo_emailAvailability_GET",
"(",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/localSeo/emailAvailability\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query"... | Check email availability for a local SEO order
REST: GET /hosting/web/localSeo/emailAvailability
@param email [required] The email address to check | [
"Check",
"email",
"availability",
"for",
"a",
"local",
"SEO",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2264-L2270 |
ixa-ehu/ixa-pipe-pos | src/main/java/eus/ixa/ixa/pipe/pos/Resources.java | Resources.getBinaryDict | public final URL getBinaryDict(final String lang, final String resourcesDirectory) {
"""
The the dictionary for the {@code MorfologikLemmatizer}.
@param lang
the language
@param resourcesDirectory
the directory where the dictionary can be found.
If {@code null}, load from package resources.
@return the URL... | java | public final URL getBinaryDict(final String lang, final String resourcesDirectory) {
return resourcesDirectory == null
? getBinaryDictFromResources(lang)
: getBinaryDictFromDirectory(lang, resourcesDirectory);
} | [
"public",
"final",
"URL",
"getBinaryDict",
"(",
"final",
"String",
"lang",
",",
"final",
"String",
"resourcesDirectory",
")",
"{",
"return",
"resourcesDirectory",
"==",
"null",
"?",
"getBinaryDictFromResources",
"(",
"lang",
")",
":",
"getBinaryDictFromDirectory",
"... | The the dictionary for the {@code MorfologikLemmatizer}.
@param lang
the language
@param resourcesDirectory
the directory where the dictionary can be found.
If {@code null}, load from package resources.
@return the URL of the dictonary | [
"The",
"the",
"dictionary",
"for",
"the",
"{",
"@code",
"MorfologikLemmatizer",
"}",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/Resources.java#L67-L71 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.notifyParentMoved | @UiThread
public void notifyParentMoved(int fromParentPosition, int toParentPosition) {
"""
Notify any registered observers that the parent and its children reflected at
{@code fromParentPosition} has been moved to {@code toParentPosition}.
<p>
<p>This is a structural change event. Representations of other ... | java | @UiThread
public void notifyParentMoved(int fromParentPosition, int toParentPosition) {
int fromFlatParentPosition = getFlatParentPosition(fromParentPosition);
ExpandableWrapper<P, C> fromParentWrapper = mFlatItemList.get(fromFlatParentPosition);
// If the parent is collapsed we can take ad... | [
"@",
"UiThread",
"public",
"void",
"notifyParentMoved",
"(",
"int",
"fromParentPosition",
",",
"int",
"toParentPosition",
")",
"{",
"int",
"fromFlatParentPosition",
"=",
"getFlatParentPosition",
"(",
"fromParentPosition",
")",
";",
"ExpandableWrapper",
"<",
"P",
",",
... | Notify any registered observers that the parent and its children reflected at
{@code fromParentPosition} has been moved to {@code toParentPosition}.
<p>
<p>This is a structural change event. Representations of other existing items in the
data set are still considered up to date and will not be rebound, though their
pos... | [
"Notify",
"any",
"registered",
"observers",
"that",
"the",
"parent",
"and",
"its",
"children",
"reflected",
"at",
"{",
"@code",
"fromParentPosition",
"}",
"has",
"been",
"moved",
"to",
"{",
"@code",
"toParentPosition",
"}",
".",
"<p",
">",
"<p",
">",
"This",... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L1057-L1109 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java | CmsGalleriesTab.updateTreeContent | public void updateTreeContent(List<CmsGalleryTreeEntry> galleryTreeEntries, List<String> selectedGalleries) {
"""
Update the galleries tree.<p>
@param galleryTreeEntries the new gallery tree list
@param selectedGalleries the list of galleries to select
"""
clearList();
m_selectedGalleries ... | java | public void updateTreeContent(List<CmsGalleryTreeEntry> galleryTreeEntries, List<String> selectedGalleries) {
clearList();
m_selectedGalleries = selectedGalleries;
if (!galleryTreeEntries.isEmpty()) {
m_itemIterator = new TreeItemGenerator(galleryTreeEntries);
loadMoreIt... | [
"public",
"void",
"updateTreeContent",
"(",
"List",
"<",
"CmsGalleryTreeEntry",
">",
"galleryTreeEntries",
",",
"List",
"<",
"String",
">",
"selectedGalleries",
")",
"{",
"clearList",
"(",
")",
";",
"m_selectedGalleries",
"=",
"selectedGalleries",
";",
"if",
"(",
... | Update the galleries tree.<p>
@param galleryTreeEntries the new gallery tree list
@param selectedGalleries the list of galleries to select | [
"Update",
"the",
"galleries",
"tree",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleriesTab.java#L428-L439 |
qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/profiler/SpacePadder.java | SpacePadder.spacePad | @Deprecated
final static public void spacePad(StringBuffer sbuf, int length) {
"""
Fast space padding method.
@param sbuf the buffer to pad
@param length the target size of the buffer after padding
"""
while (length >= 32) {
sbuf.append(SPACES[5]);
length -= 32;
... | java | @Deprecated
final static public void spacePad(StringBuffer sbuf, int length) {
while (length >= 32) {
sbuf.append(SPACES[5]);
length -= 32;
}
for (int i = 4; i >= 0; i--) {
if ((length & (1 << i)) != 0) {
sbuf.append(SPACES[i]);
... | [
"@",
"Deprecated",
"final",
"static",
"public",
"void",
"spacePad",
"(",
"StringBuffer",
"sbuf",
",",
"int",
"length",
")",
"{",
"while",
"(",
"length",
">=",
"32",
")",
"{",
"sbuf",
".",
"append",
"(",
"SPACES",
"[",
"5",
"]",
")",
";",
"length",
"-... | Fast space padding method.
@param sbuf the buffer to pad
@param length the target size of the buffer after padding | [
"Fast",
"space",
"padding",
"method",
"."
] | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/profiler/SpacePadder.java#L95-L107 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobsInner.java | DscCompilationJobsInner.getAsync | public Observable<DscCompilationJobInner> getAsync(String resourceGroupName, String automationAccountName, UUID compilationJobId) {
"""
Retrieve the Dsc configuration compilation job identified by job id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the aut... | java | public Observable<DscCompilationJobInner> getAsync(String resourceGroupName, String automationAccountName, UUID compilationJobId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, compilationJobId).map(new Func1<ServiceResponse<DscCompilationJobInner>, DscCompilationJobInner>() {
... | [
"public",
"Observable",
"<",
"DscCompilationJobInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"compilationJobId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automati... | Retrieve the Dsc configuration compilation job identified by job id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param compilationJobId The Dsc configuration compilation job id.
@throws IllegalArgumentException thrown if parameters fail th... | [
"Retrieve",
"the",
"Dsc",
"configuration",
"compilation",
"job",
"identified",
"by",
"job",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobsInner.java#L224-L231 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.