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 |
|---|---|---|---|---|---|---|---|---|---|---|
maddingo/sojo | src/main/java/net/sf/sojo/util/Util.java | Util.clearDateFormats | public static void clearDateFormats(Map<String, DateFormat> copy) {
"""
Removes all registered {@link DateFormat DateFormats}.
@param copy if not null, the old values are copied to this map
@return an unmodifiable version of the original registrations.
"""
synchronized(dateFormats) {
if (copy != ... | java | public static void clearDateFormats(Map<String, DateFormat> copy) {
synchronized(dateFormats) {
if (copy != null) {
copy.putAll(dateFormats);
}
dateFormats.clear();
}
} | [
"public",
"static",
"void",
"clearDateFormats",
"(",
"Map",
"<",
"String",
",",
"DateFormat",
">",
"copy",
")",
"{",
"synchronized",
"(",
"dateFormats",
")",
"{",
"if",
"(",
"copy",
"!=",
"null",
")",
"{",
"copy",
".",
"putAll",
"(",
"dateFormats",
")",
... | Removes all registered {@link DateFormat DateFormats}.
@param copy if not null, the old values are copied to this map
@return an unmodifiable version of the original registrations. | [
"Removes",
"all",
"registered",
"{",
"@link",
"DateFormat",
"DateFormats",
"}",
"."
] | train | https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/util/Util.java#L95-L102 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseGridScreen.java | HBaseGridScreen.printEndRecordGridData | public void printEndRecordGridData(PrintWriter out, int iPrintOptions) {
"""
Display the end grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
out.println("</table>");
if ((iPrintOption... | java | public void printEndRecordGridData(PrintWriter out, int iPrintOptions)
{
out.println("</table>");
if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) == HtmlConstants.DETAIL_SCREEN)
{
out.println("</td>\n</tr>");
}
} | [
"public",
"void",
"printEndRecordGridData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"out",
".",
"println",
"(",
"\"</table>\"",
")",
";",
"if",
"(",
"(",
"iPrintOptions",
"&",
"HtmlConstants",
".",
"DETAIL_SCREEN",
")",
"==",
"HtmlCon... | Display the end grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"the",
"end",
"grid",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseGridScreen.java#L175-L182 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java | FieldAnnotation.fromBCELField | public static FieldAnnotation fromBCELField(@DottedClassName String className, Field field) {
"""
Factory method. Construct from class name and BCEL Field object.
@param className
the name of the class which defines the field
@param field
the BCEL Field object
@return the FieldAnnotation
"""
ret... | java | public static FieldAnnotation fromBCELField(@DottedClassName String className, Field field) {
return new FieldAnnotation(className, field.getName(), field.getSignature(), field.isStatic());
} | [
"public",
"static",
"FieldAnnotation",
"fromBCELField",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"Field",
"field",
")",
"{",
"return",
"new",
"FieldAnnotation",
"(",
"className",
",",
"field",
".",
"getName",
"(",
")",
",",
"field",
".",
"getSi... | Factory method. Construct from class name and BCEL Field object.
@param className
the name of the class which defines the field
@param field
the BCEL Field object
@return the FieldAnnotation | [
"Factory",
"method",
".",
"Construct",
"from",
"class",
"name",
"and",
"BCEL",
"Field",
"object",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java#L159-L161 |
buschmais/jqa-core-framework | shared/src/main/java/com/buschmais/jqassistant/core/shared/option/OptionHelper.java | OptionHelper.selectValue | public static <T> T selectValue(T defaultValue, T... overrides) {
"""
Determine a value from given options.
@param defaultValue
The default (i.e. fallback) value.
@param overrides
The option that override the default value, the first non-null value will be accepted.
@param <T>
The value type.
@return The ... | java | public static <T> T selectValue(T defaultValue, T... overrides) {
for (T override : overrides) {
if (override != null) {
return override;
}
}
return defaultValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"selectValue",
"(",
"T",
"defaultValue",
",",
"T",
"...",
"overrides",
")",
"{",
"for",
"(",
"T",
"override",
":",
"overrides",
")",
"{",
"if",
"(",
"override",
"!=",
"null",
")",
"{",
"return",
"override",
";"... | Determine a value from given options.
@param defaultValue
The default (i.e. fallback) value.
@param overrides
The option that override the default value, the first non-null value will be accepted.
@param <T>
The value type.
@return The value. | [
"Determine",
"a",
"value",
"from",
"given",
"options",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/shared/src/main/java/com/buschmais/jqassistant/core/shared/option/OptionHelper.java#L25-L32 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java | GenericUtils.getBytes | static public int getBytes(WsByteBuffer wsbb, byte[] dst, int offset) {
"""
This method reads data from the WsByteBuffer and writes it
to the byte array. The number of the bytes read is the length
of the passed byte array. if the data in the WsByteBuffer is not
sufficient then it reads the max. no. of bytes pos... | java | static public int getBytes(WsByteBuffer wsbb, byte[] dst, int offset) {
try {
// Use the buffers bulk get method
wsbb.get(dst, offset, dst.length - offset);
return dst.length;
} catch (BufferUnderflowException bue) {
// no FFDC required
int num... | [
"static",
"public",
"int",
"getBytes",
"(",
"WsByteBuffer",
"wsbb",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"offset",
")",
"{",
"try",
"{",
"// Use the buffers bulk get method",
"wsbb",
".",
"get",
"(",
"dst",
",",
"offset",
",",
"dst",
".",
"length",
... | This method reads data from the WsByteBuffer and writes it
to the byte array. The number of the bytes read is the length
of the passed byte array. if the data in the WsByteBuffer is not
sufficient then it reads the max. no. of bytes possible.
It returns the <b>total</b> number of bytes read into the byte
array.
@param... | [
"This",
"method",
"reads",
"data",
"from",
"the",
"WsByteBuffer",
"and",
"writes",
"it",
"to",
"the",
"byte",
"array",
".",
"The",
"number",
"of",
"the",
"bytes",
"read",
"is",
"the",
"length",
"of",
"the",
"passed",
"byte",
"array",
".",
"if",
"the",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java#L299-L310 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationPropertyImpl_CustomFieldSerializer.java | OWLAnnotationPropertyImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationPropertyImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationPropertyImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLAnnotationPropertyImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationPropertyImpl_CustomFieldSerializer.java#L83-L86 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/bzip/BlockSort.java | BlockSort.vswap | private static void vswap(int[] fmap, int p1, int p2, int n) {
"""
/*--
LBZ2: The following is an implementation of
an elegant 3-way quicksort for strings,
described in a paper "Fast Algorithms for
Sorting and Searching Strings", by Robert
Sedgewick and Jon L. Bentley.
--
"""
n += p1;
whi... | java | private static void vswap(int[] fmap, int p1, int p2, int n) {
n += p1;
while (p1 < n) {
int t = fmap[p1];
fmap[p1++] = fmap[p2];
fmap[p2++] = t;
}
} | [
"private",
"static",
"void",
"vswap",
"(",
"int",
"[",
"]",
"fmap",
",",
"int",
"p1",
",",
"int",
"p2",
",",
"int",
"n",
")",
"{",
"n",
"+=",
"p1",
";",
"while",
"(",
"p1",
"<",
"n",
")",
"{",
"int",
"t",
"=",
"fmap",
"[",
"p1",
"]",
";",
... | /*--
LBZ2: The following is an implementation of
an elegant 3-way quicksort for strings,
described in a paper "Fast Algorithms for
Sorting and Searching Strings", by Robert
Sedgewick and Jon L. Bentley.
-- | [
"/",
"*",
"--",
"LBZ2",
":",
"The",
"following",
"is",
"an",
"implementation",
"of",
"an",
"elegant",
"3",
"-",
"way",
"quicksort",
"for",
"strings",
"described",
"in",
"a",
"paper",
"Fast",
"Algorithms",
"for",
"Sorting",
"and",
"Searching",
"Strings",
"b... | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/bzip/BlockSort.java#L790-L797 |
Red5/red5-io | src/main/java/org/red5/io/object/Serializer.java | Serializer.writeCustomType | protected static boolean writeCustomType(Output out, Object obj) {
"""
Writes a custom data to the output
@param out
Output writer
@param obj
Custom data
@return <tt>true</tt> if the object has been written, otherwise <tt>false</tt>
"""
if (out.isCustom(obj)) {
// Write custom data
... | java | protected static boolean writeCustomType(Output out, Object obj) {
if (out.isCustom(obj)) {
// Write custom data
out.writeCustom(obj);
return true;
} else {
return false;
}
} | [
"protected",
"static",
"boolean",
"writeCustomType",
"(",
"Output",
"out",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"out",
".",
"isCustom",
"(",
"obj",
")",
")",
"{",
"// Write custom data",
"out",
".",
"writeCustom",
"(",
"obj",
")",
";",
"return",
"t... | Writes a custom data to the output
@param out
Output writer
@param obj
Custom data
@return <tt>true</tt> if the object has been written, otherwise <tt>false</tt> | [
"Writes",
"a",
"custom",
"data",
"to",
"the",
"output"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/object/Serializer.java#L353-L361 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/ClientOptions.java | ClientOptions.of | public static ClientOptions of(ClientOptionValue<?>... options) {
"""
Returns the {@link ClientOptions} with the specified {@link ClientOptionValue}s.
"""
requireNonNull(options, "options");
if (options.length == 0) {
return DEFAULT;
}
return new ClientOptions(DEFAUL... | java | public static ClientOptions of(ClientOptionValue<?>... options) {
requireNonNull(options, "options");
if (options.length == 0) {
return DEFAULT;
}
return new ClientOptions(DEFAULT, options);
} | [
"public",
"static",
"ClientOptions",
"of",
"(",
"ClientOptionValue",
"<",
"?",
">",
"...",
"options",
")",
"{",
"requireNonNull",
"(",
"options",
",",
"\"options\"",
")",
";",
"if",
"(",
"options",
".",
"length",
"==",
"0",
")",
"{",
"return",
"DEFAULT",
... | Returns the {@link ClientOptions} with the specified {@link ClientOptionValue}s. | [
"Returns",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/ClientOptions.java#L90-L96 |
morfologik/morfologik-stemming | morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java | BufferUtils.clearAndEnsureCapacity | public static ByteBuffer clearAndEnsureCapacity(ByteBuffer buffer, int elements) {
"""
Ensure the buffer's capacity is large enough to hold a given number
of elements. If the input buffer is not large enough, a new buffer is allocated
and returned.
@param elements The required number of elements to be appende... | java | public static ByteBuffer clearAndEnsureCapacity(ByteBuffer buffer, int elements) {
if (buffer == null || buffer.capacity() < elements) {
buffer = ByteBuffer.allocate(elements);
} else {
buffer.clear();
}
return buffer;
} | [
"public",
"static",
"ByteBuffer",
"clearAndEnsureCapacity",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"elements",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
"||",
"buffer",
".",
"capacity",
"(",
")",
"<",
"elements",
")",
"{",
"buffer",
"=",
"ByteBuffer",
... | Ensure the buffer's capacity is large enough to hold a given number
of elements. If the input buffer is not large enough, a new buffer is allocated
and returned.
@param elements The required number of elements to be appended to the buffer.
@param buffer
The buffer to check or <code>null</code> if a new buffer should ... | [
"Ensure",
"the",
"buffer",
"s",
"capacity",
"is",
"large",
"enough",
"to",
"hold",
"a",
"given",
"number",
"of",
"elements",
".",
"If",
"the",
"input",
"buffer",
"is",
"not",
"large",
"enough",
"a",
"new",
"buffer",
"is",
"allocated",
"and",
"returned",
... | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-stemming/src/main/java/morfologik/stemming/BufferUtils.java#L34-L41 |
selendroid/selendroid | selendroid-server/src/main/java/io/selendroid/server/util/Intents.java | Intents.createStartActivityIntent | public static Intent createStartActivityIntent(Context context, String mainActivityName) {
"""
Create an intent to start an activity, for both ServerInstrumentation and LightweightInstrumentation
"""
Intent intent = new Intent();
intent.setClassName(context, mainActivityName);
intent.ad... | java | public static Intent createStartActivityIntent(Context context, String mainActivityName) {
Intent intent = new Intent();
intent.setClassName(context, mainActivityName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
| Intent.FLAG_ACTIVITY_SI... | [
"public",
"static",
"Intent",
"createStartActivityIntent",
"(",
"Context",
"context",
",",
"String",
"mainActivityName",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
")",
";",
"intent",
".",
"setClassName",
"(",
"context",
",",
"mainActivityName",
")... | Create an intent to start an activity, for both ServerInstrumentation and LightweightInstrumentation | [
"Create",
"an",
"intent",
"to",
"start",
"an",
"activity",
"for",
"both",
"ServerInstrumentation",
"and",
"LightweightInstrumentation"
] | train | https://github.com/selendroid/selendroid/blob/a32c1a96c973b80c14a588b1075f084201f7fe94/selendroid-server/src/main/java/io/selendroid/server/util/Intents.java#L14-L22 |
soulgalore/crawler | src/main/java/com/soulgalore/crawler/util/AuthUtil.java | AuthUtil.createAuthsFromString | public Set<Auth> createAuthsFromString(String authInfo) {
"""
Create a auth object from a String looking like.
@param authInfo the authinfo in the form of
@return a Set of auth
"""
if ("".equals(authInfo) || authInfo == null) return Collections.emptySet();
String[] parts = authInfo.split(",");
... | java | public Set<Auth> createAuthsFromString(String authInfo) {
if ("".equals(authInfo) || authInfo == null) return Collections.emptySet();
String[] parts = authInfo.split(",");
final Set<Auth> auths = new HashSet<Auth>();
try {
for (String auth : parts) {
StringTokenizer tokenizer = new St... | [
"public",
"Set",
"<",
"Auth",
">",
"createAuthsFromString",
"(",
"String",
"authInfo",
")",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"authInfo",
")",
"||",
"authInfo",
"==",
"null",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"String... | Create a auth object from a String looking like.
@param authInfo the authinfo in the form of
@return a Set of auth | [
"Create",
"a",
"auth",
"object",
"from",
"a",
"String",
"looking",
"like",
"."
] | train | https://github.com/soulgalore/crawler/blob/715ee7f1454eec14bebcb6d12563dfc32d9bbf48/src/main/java/com/soulgalore/crawler/util/AuthUtil.java#L36-L65 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/AmountFormats.java | AmountFormats.wordBased | public static String wordBased(Period period, Locale locale) {
"""
Formats a period to a string in a localized word-based format.
<p>
This returns a word-based format for the period.
The year and month are printed as supplied unless the signs differ, in which case they are normalized.
The words are configured ... | java | public static String wordBased(Period period, Locale locale) {
Objects.requireNonNull(period, "period must not be null");
Objects.requireNonNull(locale, "locale must not be null");
ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_NAME, locale);
UnitFormat[] formats = {
... | [
"public",
"static",
"String",
"wordBased",
"(",
"Period",
"period",
",",
"Locale",
"locale",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"period",
",",
"\"period must not be null\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"locale",
",",
"\"locale ... | Formats a period to a string in a localized word-based format.
<p>
This returns a word-based format for the period.
The year and month are printed as supplied unless the signs differ, in which case they are normalized.
The words are configured in a resource bundle text file -
{@code org.threeten.extra.wordbased.propert... | [
"Formats",
"a",
"period",
"to",
"a",
"string",
"in",
"a",
"localized",
"word",
"-",
"based",
"format",
".",
"<p",
">",
"This",
"returns",
"a",
"word",
"-",
"based",
"format",
"for",
"the",
"period",
".",
"The",
"year",
"and",
"month",
"are",
"printed",... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/AmountFormats.java#L174-L194 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/AlignmentUtils.java | AlignmentUtils.calculateScore | public static <S extends Sequence<S>> int calculateScore(S seq1, Range seq1Range, Mutations<S> mutations,
AlignmentScoring<S> scoring) {
"""
Calculates score of alignment
@param seq1 target sequence
@param seq1Range aligned range
@param mutatio... | java | public static <S extends Sequence<S>> int calculateScore(S seq1, Range seq1Range, Mutations<S> mutations,
AlignmentScoring<S> scoring) {
if (scoring instanceof LinearGapAlignmentScoring)
return calculateScore(seq1, seq1Range, mutations, (L... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"S",
">",
">",
"int",
"calculateScore",
"(",
"S",
"seq1",
",",
"Range",
"seq1Range",
",",
"Mutations",
"<",
"S",
">",
"mutations",
",",
"AlignmentScoring",
"<",
"S",
">",
"scoring",
")",
"{",
"i... | Calculates score of alignment
@param seq1 target sequence
@param seq1Range aligned range
@param mutations mutations (alignment)
@param scoring scoring
@param <S> sequence type
@return score | [
"Calculates",
"score",
"of",
"alignment"
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/AlignmentUtils.java#L59-L67 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java | HttpClientMockBuilder.withParameter | public HttpClientMockBuilder withParameter(String name, Matcher<String> matcher) {
"""
Adds parameter condition. Parameter value must match.
@param name parameter name
@param matcher parameter value matcher
@return condition builder
"""
ruleBuilder.addParameterCondition(name, matcher);
... | java | public HttpClientMockBuilder withParameter(String name, Matcher<String> matcher) {
ruleBuilder.addParameterCondition(name, matcher);
return this;
} | [
"public",
"HttpClientMockBuilder",
"withParameter",
"(",
"String",
"name",
",",
"Matcher",
"<",
"String",
">",
"matcher",
")",
"{",
"ruleBuilder",
".",
"addParameterCondition",
"(",
"name",
",",
"matcher",
")",
";",
"return",
"this",
";",
"}"
] | Adds parameter condition. Parameter value must match.
@param name parameter name
@param matcher parameter value matcher
@return condition builder | [
"Adds",
"parameter",
"condition",
".",
"Parameter",
"value",
"must",
"match",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientMockBuilder.java#L86-L89 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager.wab/src/com/ibm/ws/app/manager/wab/internal/WAB.java | WAB.setState | private boolean setState(State newState) {
"""
state should only transition while the terminated lock is held.
@param newState
@return
"""
switch (newState) {
case DEPLOYED:
return changeState(State.DEPLOYING, State.DEPLOYED);
case DEPLOYING:
... | java | private boolean setState(State newState) {
switch (newState) {
case DEPLOYED:
return changeState(State.DEPLOYING, State.DEPLOYED);
case DEPLOYING:
//can move from either UNDEPLOYED or FAILED into DEPLOYING state
return (changeState(State.UN... | [
"private",
"boolean",
"setState",
"(",
"State",
"newState",
")",
"{",
"switch",
"(",
"newState",
")",
"{",
"case",
"DEPLOYED",
":",
"return",
"changeState",
"(",
"State",
".",
"DEPLOYING",
",",
"State",
".",
"DEPLOYED",
")",
";",
"case",
"DEPLOYING",
":",
... | state should only transition while the terminated lock is held.
@param newState
@return | [
"state",
"should",
"only",
"transition",
"while",
"the",
"terminated",
"lock",
"is",
"held",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager.wab/src/com/ibm/ws/app/manager/wab/internal/WAB.java#L262-L278 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_dynHost_record_id_GET | public OvhDynHostRecord zone_zoneName_dynHost_record_id_GET(String zoneName, Long id) throws IOException {
"""
Get this object properties
REST: GET /domain/zone/{zoneName}/dynHost/record/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object
"""
String qPath... | java | public OvhDynHostRecord zone_zoneName_dynHost_record_id_GET(String zoneName, Long id) throws IOException {
String qPath = "/domain/zone/{zoneName}/dynHost/record/{id}";
StringBuilder sb = path(qPath, zoneName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDynHostRecord.cl... | [
"public",
"OvhDynHostRecord",
"zone_zoneName_dynHost_record_id_GET",
"(",
"String",
"zoneName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/dynHost/record/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Get this object properties
REST: GET /domain/zone/{zoneName}/dynHost/record/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L397-L402 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/ListTagsForStreamResult.java | ListTagsForStreamResult.withTags | public ListTagsForStreamResult withTags(java.util.Map<String, String> tags) {
"""
<p>
A map of tag keys and values associated with the specified stream.
</p>
@param tags
A map of tag keys and values associated with the specified stream.
@return Returns a reference to this object so that method calls can be ... | java | public ListTagsForStreamResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"ListTagsForStreamResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of tag keys and values associated with the specified stream.
</p>
@param tags
A map of tag keys and values associated with the specified stream.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"tag",
"keys",
"and",
"values",
"associated",
"with",
"the",
"specified",
"stream",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/ListTagsForStreamResult.java#L121-L124 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.findFirst | public Record findFirst(String sql, Object... paras) {
"""
Find first record. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return the Record object
"""
List<Record> result = find(sql, para... | java | public Record findFirst(String sql, Object... paras) {
List<Record> result = find(sql, paras);
return result.size() > 0 ? result.get(0) : null;
} | [
"public",
"Record",
"findFirst",
"(",
"String",
"sql",
",",
"Object",
"...",
"paras",
")",
"{",
"List",
"<",
"Record",
">",
"result",
"=",
"find",
"(",
"sql",
",",
"paras",
")",
";",
"return",
"result",
".",
"size",
"(",
")",
">",
"0",
"?",
"result... | Find first record. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return the Record object | [
"Find",
"first",
"record",
".",
"I",
"recommend",
"add",
"limit",
"1",
"in",
"your",
"sql",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L354-L357 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java | ClasspathScanDescriptorProvider.scanPackage | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader, final boolean strictClassLoader) {
"""
Scans a package in the classpath (of a particular classloader) for annotated components.
@param packageName the package name to ... | java | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader, final boolean strictClassLoader) {
return scanPackage(packageName, recursive, classLoader, strictClassLoader, null);
} | [
"public",
"ClasspathScanDescriptorProvider",
"scanPackage",
"(",
"final",
"String",
"packageName",
",",
"final",
"boolean",
"recursive",
",",
"final",
"ClassLoader",
"classLoader",
",",
"final",
"boolean",
"strictClassLoader",
")",
"{",
"return",
"scanPackage",
"(",
"... | Scans a package in the classpath (of a particular classloader) for annotated components.
@param packageName the package name to scan
@param recursive whether or not to scan subpackages recursively
@param classLoader the classloader to use for discovering resources in the classpath
@param strictClassLoader whether or n... | [
"Scans",
"a",
"package",
"in",
"the",
"classpath",
"(",
"of",
"a",
"particular",
"classloader",
")",
"for",
"annotated",
"components",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java#L207-L210 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/R.java | R.renderChild | public static void renderChild(FacesContext fc, UIComponent child) throws IOException {
"""
Renders the Child of a Component
@param fc
@param child
@throws IOException
"""
if (!child.isRendered()) {
return;
}
child.encodeBegin(fc);
if (child.getRendersChildren()) {
child.encodeChildren(fc)... | java | public static void renderChild(FacesContext fc, UIComponent child) throws IOException {
if (!child.isRendered()) {
return;
}
child.encodeBegin(fc);
if (child.getRendersChildren()) {
child.encodeChildren(fc);
} else {
renderChildren(fc, child);
}
child.encodeEnd(fc);
} | [
"public",
"static",
"void",
"renderChild",
"(",
"FacesContext",
"fc",
",",
"UIComponent",
"child",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"child",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"child",
".",
"encodeBegin",
"(",
"f... | Renders the Child of a Component
@param fc
@param child
@throws IOException | [
"Renders",
"the",
"Child",
"of",
"a",
"Component"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/R.java#L346-L359 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/btree/NodeBuilder.java | NodeBuilder.addExtraChild | private void addExtraChild(Object[] child, Object upperBound) {
"""
adds a new and unexpected child to the builder - called by children that overflow
"""
ensureRoom(buildKeyPosition + 1);
buildKeys[buildKeyPosition++] = upperBound;
buildChildren[buildChildPosition++] = child;
} | java | private void addExtraChild(Object[] child, Object upperBound)
{
ensureRoom(buildKeyPosition + 1);
buildKeys[buildKeyPosition++] = upperBound;
buildChildren[buildChildPosition++] = child;
} | [
"private",
"void",
"addExtraChild",
"(",
"Object",
"[",
"]",
"child",
",",
"Object",
"upperBound",
")",
"{",
"ensureRoom",
"(",
"buildKeyPosition",
"+",
"1",
")",
";",
"buildKeys",
"[",
"buildKeyPosition",
"++",
"]",
"=",
"upperBound",
";",
"buildChildren",
... | adds a new and unexpected child to the builder - called by children that overflow | [
"adds",
"a",
"new",
"and",
"unexpected",
"child",
"to",
"the",
"builder",
"-",
"called",
"by",
"children",
"that",
"overflow"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/NodeBuilder.java#L341-L346 |
h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/Rapids.java | Rapids.parseFunctionDefinition | private AstFunction parseFunctionDefinition() {
"""
Parse and return a user defined function of the form "{arg1 arg2 . (expr)}"
"""
eatChar('{');
// Parse the list of ids
ArrayList<String> ids = new ArrayList<>();
ids.add(""); // 1-based ID list
while (skipWS() != '.') {
String id =... | java | private AstFunction parseFunctionDefinition() {
eatChar('{');
// Parse the list of ids
ArrayList<String> ids = new ArrayList<>();
ids.add(""); // 1-based ID list
while (skipWS() != '.') {
String id = token();
if (!Character.isJavaIdentifierStart(id.charAt(0)))
throw new Illegal... | [
"private",
"AstFunction",
"parseFunctionDefinition",
"(",
")",
"{",
"eatChar",
"(",
"'",
"'",
")",
";",
"// Parse the list of ids",
"ArrayList",
"<",
"String",
">",
"ids",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ids",
".",
"add",
"(",
"\"\"",
")",
... | Parse and return a user defined function of the form "{arg1 arg2 . (expr)}" | [
"Parse",
"and",
"return",
"a",
"user",
"defined",
"function",
"of",
"the",
"form",
"{",
"arg1",
"arg2",
".",
"(",
"expr",
")",
"}"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Rapids.java#L183-L209 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.setXMLType | private void setXMLType(String typeName, String element, String nameElement, String typeElement) // F743-32443
throws InjectionConfigurationException {
"""
Sets the injection type as specified in XML.
@param typeName the type name specified in XML
@param element the XML ref element
@param nameElement the ... | java | private void setXMLType(String typeName, String element, String nameElement, String typeElement) // F743-32443
throws InjectionConfigurationException
{
if (ivNameSpaceConfig.getClassLoader() == null)
{
setInjectionClassTypeName(typeName);
}
else
{
... | [
"private",
"void",
"setXMLType",
"(",
"String",
"typeName",
",",
"String",
"element",
",",
"String",
"nameElement",
",",
"String",
"typeElement",
")",
"// F743-32443",
"throws",
"InjectionConfigurationException",
"{",
"if",
"(",
"ivNameSpaceConfig",
".",
"getClassLoad... | Sets the injection type as specified in XML.
@param typeName the type name specified in XML
@param element the XML ref element
@param nameElement the XML name element in the ref element
@param typeElement the XML type element in the ref element
@throws InjectionConfigurationException | [
"Sets",
"the",
"injection",
"type",
"as",
"specified",
"in",
"XML",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1641-L1693 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.getDoubleBondedNitrogenCount | private int getDoubleBondedNitrogenCount(IAtomContainer ac, IAtom atom) {
"""
Gets the doubleBondedNitrogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The doubleBondedNitrogenCount value
"""
List... | java | private int getDoubleBondedNitrogenCount(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
IBond bond;
int ndbcounter = 0;
for (IAtom neighbour : neighbours) {
if (neighbour.getSymbol().equals("N")) {
bond = ac.getBond(n... | [
"private",
"int",
"getDoubleBondedNitrogenCount",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"IBond",
"bond",
";",
"int",
"ndbcounter",
... | Gets the doubleBondedNitrogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The doubleBondedNitrogenCount value | [
"Gets",
"the",
"doubleBondedNitrogenCount",
"attribute",
"of",
"the",
"XLogPDescriptor",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L1212-L1227 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java | BookKeeperJournalMetadataManager.deleteLedgerMetadata | public boolean deleteLedgerMetadata(EditLogLedgerMetadata ledger, int version)
throws IOException {
"""
Removes ledger-related Metadata from BookKeeper. Does not delete
the ledger itself.
@param ledger The object for the ledger metadata that we want to delete
from BookKeeper
@param version The version of... | java | public boolean deleteLedgerMetadata(EditLogLedgerMetadata ledger, int version)
throws IOException {
String ledgerPath = fullyQualifiedPathForLedger(ledger);
try {
zooKeeper.delete(ledgerPath, version);
return true;
} catch (KeeperException.NoNodeException e) {
LOG.warn(ledgerPath + "... | [
"public",
"boolean",
"deleteLedgerMetadata",
"(",
"EditLogLedgerMetadata",
"ledger",
",",
"int",
"version",
")",
"throws",
"IOException",
"{",
"String",
"ledgerPath",
"=",
"fullyQualifiedPathForLedger",
"(",
"ledger",
")",
";",
"try",
"{",
"zooKeeper",
".",
"delete"... | Removes ledger-related Metadata from BookKeeper. Does not delete
the ledger itself.
@param ledger The object for the ledger metadata that we want to delete
from BookKeeper
@param version The version of the ledger metadata (or -1 to delete any
version). Used as a way to guard against deleting a ledger
metadata that is b... | [
"Removes",
"ledger",
"-",
"related",
"Metadata",
"from",
"BookKeeper",
".",
"Does",
"not",
"delete",
"the",
"ledger",
"itself",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/metadata/BookKeeperJournalMetadataManager.java#L218-L237 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/ObjectAnimator.java | ObjectAnimator.ofFloat | public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> property,
float... values) {
"""
Constructs and returns an ObjectAnimator that animates between float values. A single
value implies that that value is the one being animated to. Two values imply a starting
and ending values. More ... | java | public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> property,
float... values) {
ObjectAnimator anim = new ObjectAnimator(target, property);
anim.setFloatValues(values);
return anim;
} | [
"public",
"static",
"<",
"T",
">",
"ObjectAnimator",
"ofFloat",
"(",
"T",
"target",
",",
"Property",
"<",
"T",
",",
"Float",
">",
"property",
",",
"float",
"...",
"values",
")",
"{",
"ObjectAnimator",
"anim",
"=",
"new",
"ObjectAnimator",
"(",
"target",
... | Constructs and returns an ObjectAnimator that animates between float values. A single
value implies that that value is the one being animated to. Two values imply a starting
and ending values. More than two values imply a starting value, values to animate through
along the way, and an ending value (these values will be... | [
"Constructs",
"and",
"returns",
"an",
"ObjectAnimator",
"that",
"animates",
"between",
"float",
"values",
".",
"A",
"single",
"value",
"implies",
"that",
"that",
"value",
"is",
"the",
"one",
"being",
"animated",
"to",
".",
"Two",
"values",
"imply",
"a",
"sta... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/ObjectAnimator.java#L248-L253 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F32_1D.java | GeneralPurposeFFT_F32_1D.realForward | public void realForward(float[] a, int offa) {
"""
Computes 1D forward DFT of real data leaving the result in <code>a</code>
. The physical layout of the output data is as follows:<br>
if n is even then
<pre>
a[offa+2*k] = Re[k], 0<=k<n/2
a[offa+2*k+1] = Im[k], 0<k<n/2
a[offa+1] = Re[n/2]
</... | java | public void realForward(float[] a, int offa) {
if (n == 1)
return;
switch (plan) {
case SPLIT_RADIX:
float xi;
if (n > 4) {
cftfsub(n, a, offa, ip, nw, w);
rftfsub(n, a, offa, nc, w, nw);
} else if (n == 4) {
cftx020(a, offa);
}
xi = a[offa] - a[offa + 1];
a[offa] += a... | [
"public",
"void",
"realForward",
"(",
"float",
"[",
"]",
"a",
",",
"int",
"offa",
")",
"{",
"if",
"(",
"n",
"==",
"1",
")",
"return",
";",
"switch",
"(",
"plan",
")",
"{",
"case",
"SPLIT_RADIX",
":",
"float",
"xi",
";",
"if",
"(",
"n",
">",
"4"... | Computes 1D forward DFT of real data leaving the result in <code>a</code>
. The physical layout of the output data is as follows:<br>
if n is even then
<pre>
a[offa+2*k] = Re[k], 0<=k<n/2
a[offa+2*k+1] = Im[k], 0<k<n/2
a[offa+1] = Re[n/2]
</pre>
if n is odd then
<pre>
a[offa+2*k] = Re[k], 0<=k<(n+... | [
"Computes",
"1D",
"forward",
"DFT",
"of",
"real",
"data",
"leaving",
"the",
"result",
"in",
"<code",
">",
"a<",
"/",
"code",
">",
".",
"The",
"physical",
"layout",
"of",
"the",
"output",
"data",
"is",
"as",
"follows",
":",
"<br",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F32_1D.java#L320-L351 |
zhegexiaohuozi/SeimiCrawler | seimicrawler/src/main/java/cn/wanghaomiao/seimi/core/Seimi.java | Seimi.goRun | public void goRun(boolean ifBlock, String... crawlerNames) {
"""
主启动
start master
@param ifBlock 是否要开始等待线程池结束
@param crawlerNames ~~
"""
if (crawlerNames == null || crawlerNames.length == 0) {
logger.info("start all crawler as workers.");
} else {
SeimiContext.... | java | public void goRun(boolean ifBlock, String... crawlerNames) {
if (crawlerNames == null || crawlerNames.length == 0) {
logger.info("start all crawler as workers.");
} else {
SeimiContext.init(config);
for (String name : crawlerNames) {
CrawlerModel crawl... | [
"public",
"void",
"goRun",
"(",
"boolean",
"ifBlock",
",",
"String",
"...",
"crawlerNames",
")",
"{",
"if",
"(",
"crawlerNames",
"==",
"null",
"||",
"crawlerNames",
".",
"length",
"==",
"0",
")",
"{",
"logger",
".",
"info",
"(",
"\"start all crawler as worke... | 主启动
start master
@param ifBlock 是否要开始等待线程池结束
@param crawlerNames ~~ | [
"主启动",
"start",
"master"
] | train | https://github.com/zhegexiaohuozi/SeimiCrawler/blob/c9069490616c38c6de059ddc86b79febd6d17641/seimicrawler/src/main/java/cn/wanghaomiao/seimi/core/Seimi.java#L54-L72 |
SonarSource/sonarqube | sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java | ContextPropertiesCache.put | public ContextPropertiesCache put(String key, String value) {
"""
Value is overridden if the key was already stored.
@throws IllegalArgumentException if key is null
@throws IllegalArgumentException if value is null
@since 6.1
"""
checkArgument(key != null, "Key of context property must not be null");
... | java | public ContextPropertiesCache put(String key, String value) {
checkArgument(key != null, "Key of context property must not be null");
checkArgument(value != null, "Value of context property must not be null");
props.put(key, value);
return this;
} | [
"public",
"ContextPropertiesCache",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkArgument",
"(",
"key",
"!=",
"null",
",",
"\"Key of context property must not be null\"",
")",
";",
"checkArgument",
"(",
"value",
"!=",
"null",
",",
"\"Value ... | Value is overridden if the key was already stored.
@throws IllegalArgumentException if key is null
@throws IllegalArgumentException if value is null
@since 6.1 | [
"Value",
"is",
"overridden",
"if",
"the",
"key",
"was",
"already",
"stored",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java#L37-L42 |
apereo/cas | core/cas-server-core-logout-api/src/main/java/org/apereo/cas/logout/slo/BaseSingleLogoutServiceMessageHandler.java | BaseSingleLogoutServiceMessageHandler.sendMessageToEndpoint | protected boolean sendMessageToEndpoint(final LogoutHttpMessage msg, final SingleLogoutRequest request, final SingleLogoutMessage logoutMessage) {
"""
Send message to endpoint.
@param msg the msg
@param request the request
@param logoutMessage the logout message
@return the boolean
"""
... | java | protected boolean sendMessageToEndpoint(final LogoutHttpMessage msg, final SingleLogoutRequest request, final SingleLogoutMessage logoutMessage) {
return this.httpClient.sendMessageToEndPoint(msg);
} | [
"protected",
"boolean",
"sendMessageToEndpoint",
"(",
"final",
"LogoutHttpMessage",
"msg",
",",
"final",
"SingleLogoutRequest",
"request",
",",
"final",
"SingleLogoutMessage",
"logoutMessage",
")",
"{",
"return",
"this",
".",
"httpClient",
".",
"sendMessageToEndPoint",
... | Send message to endpoint.
@param msg the msg
@param request the request
@param logoutMessage the logout message
@return the boolean | [
"Send",
"message",
"to",
"endpoint",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-logout-api/src/main/java/org/apereo/cas/logout/slo/BaseSingleLogoutServiceMessageHandler.java#L193-L195 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.extractBuffered | public static BufferedImage extractBuffered(GrayU8 img) {
"""
<p>
Creates a new BufferedImage that internally uses the same data as the provided
GrayU8. The returned BufferedImage will be of type TYPE_BYTE_GRAY.
</p>
<p/>
<p>
NOTE: This only works on images which are not subimages!
</p>
@param img Input... | java | public static BufferedImage extractBuffered(GrayU8 img) {
if (img.isSubimage())
throw new IllegalArgumentException("Sub-images are not supported for this operation");
final int width = img.width;
final int height = img.height;
// wrap the byte array
DataBuffer bufferByte = new DataBufferByte(img.data, wi... | [
"public",
"static",
"BufferedImage",
"extractBuffered",
"(",
"GrayU8",
"img",
")",
"{",
"if",
"(",
"img",
".",
"isSubimage",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Sub-images are not supported for this operation\"",
")",
";",
"final",
"in... | <p>
Creates a new BufferedImage that internally uses the same data as the provided
GrayU8. The returned BufferedImage will be of type TYPE_BYTE_GRAY.
</p>
<p/>
<p>
NOTE: This only works on images which are not subimages!
</p>
@param img Input image who's data will be wrapped by the returned BufferedImage.
@return Buf... | [
"<p",
">",
"Creates",
"a",
"new",
"BufferedImage",
"that",
"internally",
"uses",
"the",
"same",
"data",
"as",
"the",
"provided",
"GrayU8",
".",
"The",
"returned",
"BufferedImage",
"will",
"be",
"of",
"type",
"TYPE_BYTE_GRAY",
".",
"<",
"/",
"p",
">",
"<p",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L235-L260 |
duraspace/fcrepo-cloudsync | fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/util/StringUtil.java | StringUtil.validate | public static String validate(String name, String value, int maxLen)
throws IllegalArgumentException {
"""
Checks that the given value's normalized length is in the allowed range.
@param name the name of the property being checked, for error reporting.
@param value the value.
@param maxLen the max... | java | public static String validate(String name, String value, int maxLen)
throws IllegalArgumentException {
String normVal = normalize(value);
if (normVal == null) {
throw new IllegalArgumentException("A value must be specified for"
+ " '" + name + "'");
} ... | [
"public",
"static",
"String",
"validate",
"(",
"String",
"name",
",",
"String",
"value",
",",
"int",
"maxLen",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"normVal",
"=",
"normalize",
"(",
"value",
")",
";",
"if",
"(",
"normVal",
"==",
"null",
... | Checks that the given value's normalized length is in the allowed range.
@param name the name of the property being checked, for error reporting.
@param value the value.
@param maxLen the maximum length allowed.
@return the normalized value.
@throws IllegalArgumentException if the normalized value is null,
zero-length... | [
"Checks",
"that",
"the",
"given",
"value",
"s",
"normalized",
"length",
"is",
"in",
"the",
"allowed",
"range",
"."
] | train | https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/util/StringUtil.java#L29-L41 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getLeagues | public Future<List<LeagueList>> getLeagues(String teamId) {
"""
Get a listing of leagues for the specified team
@param teamId The id of the team
@return A list of leagues
@see <a href=https://developer.riotgames.com/api/methods#!/593/1860>Official API documentation</a>
"""
return new ApiFuture<>(() ... | java | public Future<List<LeagueList>> getLeagues(String teamId) {
return new ApiFuture<>(() -> handler.getLeagues(teamId));
} | [
"public",
"Future",
"<",
"List",
"<",
"LeagueList",
">",
">",
"getLeagues",
"(",
"String",
"teamId",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getLeagues",
"(",
"teamId",
")",
")",
";",
"}"
] | Get a listing of leagues for the specified team
@param teamId The id of the team
@return A list of leagues
@see <a href=https://developer.riotgames.com/api/methods#!/593/1860>Official API documentation</a> | [
"Get",
"a",
"listing",
"of",
"leagues",
"for",
"the",
"specified",
"team"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L265-L267 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java | AttributedString.valuesMatch | private final static boolean valuesMatch(Object value1, Object value2) {
"""
returns whether the two objects are either both null or equal
"""
if (value1 == null) {
return value2 == null;
} else {
return value1.equals(value2);
}
} | java | private final static boolean valuesMatch(Object value1, Object value2) {
if (value1 == null) {
return value2 == null;
} else {
return value1.equals(value2);
}
} | [
"private",
"final",
"static",
"boolean",
"valuesMatch",
"(",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"if",
"(",
"value1",
"==",
"null",
")",
"{",
"return",
"value2",
"==",
"null",
";",
"}",
"else",
"{",
"return",
"value1",
".",
"equals",
... | returns whether the two objects are either both null or equal | [
"returns",
"whether",
"the",
"two",
"objects",
"are",
"either",
"both",
"null",
"or",
"equal"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java#L665-L671 |
rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java | JolokiaMBeanServerUtil.getJolokiaMBeanServer | public static MBeanServer getJolokiaMBeanServer() {
"""
Lookup the JolokiaMBean server via a JMX lookup to the Jolokia-internal MBean exposing this MBeanServer
@return the Jolokia MBeanServer or null if not yet available present
"""
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
... | java | public static MBeanServer getJolokiaMBeanServer() {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
MBeanServer jolokiaMBeanServer;
try {
jolokiaMBeanServer =
(MBeanServer) server.getAttribute(createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_... | [
"public",
"static",
"MBeanServer",
"getJolokiaMBeanServer",
"(",
")",
"{",
"MBeanServer",
"server",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"MBeanServer",
"jolokiaMBeanServer",
";",
"try",
"{",
"jolokiaMBeanServer",
"=",
"(",
"MBeanServ... | Lookup the JolokiaMBean server via a JMX lookup to the Jolokia-internal MBean exposing this MBeanServer
@return the Jolokia MBeanServer or null if not yet available present | [
"Lookup",
"the",
"JolokiaMBean",
"server",
"via",
"a",
"JMX",
"lookup",
"to",
"the",
"Jolokia",
"-",
"internal",
"MBean",
"exposing",
"this",
"MBeanServer"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java#L42-L58 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java | SupportVectorLearner.setCacheSize | public void setCacheSize(long N, long bytes) {
"""
Sets the {@link #setCacheValue(int) cache value} to one that will use the
specified amount of memory. If the amount of memory specified is great
enough, this method will automatically set the
{@link #setCacheMode(jsat.classifiers.svm.SupportVectorLearner.CacheM... | java | public void setCacheSize(long N, long bytes)
{
int DS = Double.SIZE/8;
bytes /= DS;//Gets the total number of doubles we can store
if(bytes > N*N/2)
setCacheMode(CacheMode.FULL);
else//How many rows can we handle?
{
//guessing 2 work overhead for objec... | [
"public",
"void",
"setCacheSize",
"(",
"long",
"N",
",",
"long",
"bytes",
")",
"{",
"int",
"DS",
"=",
"Double",
".",
"SIZE",
"/",
"8",
";",
"bytes",
"/=",
"DS",
";",
"//Gets the total number of doubles we can store",
"if",
"(",
"bytes",
">",
"N",
"*",
"N... | Sets the {@link #setCacheValue(int) cache value} to one that will use the
specified amount of memory. If the amount of memory specified is great
enough, this method will automatically set the
{@link #setCacheMode(jsat.classifiers.svm.SupportVectorLearner.CacheMode)
cache mode} to {@link CacheMode#FULL}.
@param N the n... | [
"Sets",
"the",
"{",
"@link",
"#setCacheValue",
"(",
"int",
")",
"cache",
"value",
"}",
"to",
"one",
"that",
"will",
"use",
"the",
"specified",
"amount",
"of",
"memory",
".",
"If",
"the",
"amount",
"of",
"memory",
"specified",
"is",
"great",
"enough",
"th... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java#L219-L235 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/stats/StatsInterface.java | StatsInterface.getCollectionDomains | public DomainList getCollectionDomains(Date date, String collectionId, int perPage, int page) throws FlickrException {
"""
Get a list of referring domains for a collection.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and tim... | java | public DomainList getCollectionDomains(Date date, String collectionId, int perPage, int page) throws FlickrException {
return getDomains(METHOD_GET_COLLECTION_DOMAINS, "collection_id", collectionId, date, perPage, page);
} | [
"public",
"DomainList",
"getCollectionDomains",
"(",
"Date",
"date",
",",
"String",
"collectionId",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getDomains",
"(",
"METHOD_GET_COLLECTION_DOMAINS",
",",
"\"collection_id\""... | Get a list of referring domains for a collection.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param collectionId
(Optional) The id of the collection to get ... | [
"Get",
"a",
"list",
"of",
"referring",
"domains",
"for",
"a",
"collection",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java#L95-L97 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginPowerOff | public OperationStatusResponseInner beginPowerOff(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
"""
Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to releas... | java | public OperationStatusResponseInner beginPowerOff(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body();
} | [
"public",
"OperationStatusResponseInner",
"beginPowerOff",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
")",
"{",
"return",
"beginPowerOffWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmS... | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale ... | [
"Power",
"off",
"(",
"stop",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Note",
"that",
"resources",
"are",
"still",
"attached",
"and",
"you",
"are",
"getting",
"charged",
"for",
"the",
"resources",
".",
"Inste... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1959-L1961 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/TypeUtil.java | TypeUtil.visitTypeHierarchy | public boolean visitTypeHierarchy(TypeMirror type, TypeVisitor visitor) {
"""
Visit all declared types in the hierarchy using a depth-first traversal, visiting classes
before interfaces.
"""
boolean result = true;
if (type == null) {
return result;
}
if (type.getKind() == TypeKind.DECLAR... | java | public boolean visitTypeHierarchy(TypeMirror type, TypeVisitor visitor) {
boolean result = true;
if (type == null) {
return result;
}
if (type.getKind() == TypeKind.DECLARED) {
result = visitor.accept((DeclaredType) type);
}
for (TypeMirror superType : directSupertypes(type)) {
... | [
"public",
"boolean",
"visitTypeHierarchy",
"(",
"TypeMirror",
"type",
",",
"TypeVisitor",
"visitor",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"result",
";",
"}",
"if",
"(",
"type",
".",
"getKin... | Visit all declared types in the hierarchy using a depth-first traversal, visiting classes
before interfaces. | [
"Visit",
"all",
"declared",
"types",
"in",
"the",
"hierarchy",
"using",
"a",
"depth",
"-",
"first",
"traversal",
"visiting",
"classes",
"before",
"interfaces",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/TypeUtil.java#L505-L520 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/algos/tree/SharedTreeMojoModel.java | SharedTreeMojoModel.scoreTreeRange | public final void scoreTreeRange(double[] row, int fromIndex, int toIndex, double[] preds) {
"""
Generates (partial, per-class) predictions using only trees from a given range.
@param row input row
@param fromIndex low endpoint (inclusive) of the tree range
@param toIndex high endpoint (exclusive) of the tree r... | java | public final void scoreTreeRange(double[] row, int fromIndex, int toIndex, double[] preds) {
final int clOffset = _nclasses == 1 ? 0 : 1;
for (int classIndex = 0; classIndex < _ntrees_per_group; classIndex++) {
int k = clOffset + classIndex;
int itree = treeIndex(fromIndex, class... | [
"public",
"final",
"void",
"scoreTreeRange",
"(",
"double",
"[",
"]",
"row",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"double",
"[",
"]",
"preds",
")",
"{",
"final",
"int",
"clOffset",
"=",
"_nclasses",
"==",
"1",
"?",
"0",
":",
"1",
";",... | Generates (partial, per-class) predictions using only trees from a given range.
@param row input row
@param fromIndex low endpoint (inclusive) of the tree range
@param toIndex high endpoint (exclusive) of the tree range
@param preds array of partial predictions.
To get final predictions pass the result to {@link Shared... | [
"Generates",
"(",
"partial",
"per",
"-",
"class",
")",
"predictions",
"using",
"only",
"trees",
"from",
"a",
"given",
"range",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/tree/SharedTreeMojoModel.java#L698-L710 |
apache/incubator-druid | core/src/main/java/org/apache/druid/math/expr/ExprMacroTable.java | ExprMacroTable.get | @Nullable
public Expr get(final String functionName, final List<Expr> args) {
"""
Returns an expr corresponding to a function call if this table has an entry for {@code functionName}.
Otherwise, returns null.
@param functionName function name
@param args function arguments
@return expr for this f... | java | @Nullable
public Expr get(final String functionName, final List<Expr> args)
{
final ExprMacro exprMacro = macroMap.get(StringUtils.toLowerCase(functionName));
if (exprMacro == null) {
return null;
}
return exprMacro.apply(args);
} | [
"@",
"Nullable",
"public",
"Expr",
"get",
"(",
"final",
"String",
"functionName",
",",
"final",
"List",
"<",
"Expr",
">",
"args",
")",
"{",
"final",
"ExprMacro",
"exprMacro",
"=",
"macroMap",
".",
"get",
"(",
"StringUtils",
".",
"toLowerCase",
"(",
"functi... | Returns an expr corresponding to a function call if this table has an entry for {@code functionName}.
Otherwise, returns null.
@param functionName function name
@param args function arguments
@return expr for this function call, or null | [
"Returns",
"an",
"expr",
"corresponding",
"to",
"a",
"function",
"call",
"if",
"this",
"table",
"has",
"an",
"entry",
"for",
"{",
"@code",
"functionName",
"}",
".",
"Otherwise",
"returns",
"null",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/math/expr/ExprMacroTable.java#L66-L75 |
wcm-io-caravan/caravan-hal | docs/src/main/java/io/wcm/caravan/hal/docs/impl/TemplateRenderer.java | TemplateRenderer.renderServiceHtml | public String renderServiceHtml(io.wcm.caravan.hal.docs.impl.model.Service service) throws IOException {
"""
Generate HTML file for service.
@param service Service
@return Rendered markup
@throws IOException
"""
Map<String, Object> model = ImmutableMap.<String, Object>builder()
.put("service", s... | java | public String renderServiceHtml(io.wcm.caravan.hal.docs.impl.model.Service service) throws IOException {
Map<String, Object> model = ImmutableMap.<String, Object>builder()
.put("service", service)
.build();
return render(service, model, serviceTemplate);
} | [
"public",
"String",
"renderServiceHtml",
"(",
"io",
".",
"wcm",
".",
"caravan",
".",
"hal",
".",
"docs",
".",
"impl",
".",
"model",
".",
"Service",
"service",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
"=",
"I... | Generate HTML file for service.
@param service Service
@return Rendered markup
@throws IOException | [
"Generate",
"HTML",
"file",
"for",
"service",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs/src/main/java/io/wcm/caravan/hal/docs/impl/TemplateRenderer.java#L69-L74 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java | WidgetUtil.getWidgetBanner | public static String getWidgetBanner(Guild guild, BannerType type) {
"""
Gets the banner image for the specified guild of the specified type.
<br>This banner will only be available if the guild in question has the
Widget enabled.
@param guild
The guild
@param type
The type (visual style) of the banner
... | java | public static String getWidgetBanner(Guild guild, BannerType type)
{
Checks.notNull(guild, "Guild");
return getWidgetBanner(guild.getId(), type);
} | [
"public",
"static",
"String",
"getWidgetBanner",
"(",
"Guild",
"guild",
",",
"BannerType",
"type",
")",
"{",
"Checks",
".",
"notNull",
"(",
"guild",
",",
"\"Guild\"",
")",
";",
"return",
"getWidgetBanner",
"(",
"guild",
".",
"getId",
"(",
")",
",",
"type",... | Gets the banner image for the specified guild of the specified type.
<br>This banner will only be available if the guild in question has the
Widget enabled.
@param guild
The guild
@param type
The type (visual style) of the banner
@return A String containing the URL of the banner image | [
"Gets",
"the",
"banner",
"image",
"for",
"the",
"specified",
"guild",
"of",
"the",
"specified",
"type",
".",
"<br",
">",
"This",
"banner",
"will",
"only",
"be",
"available",
"if",
"the",
"guild",
"in",
"question",
"has",
"the",
"Widget",
"enabled",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java#L64-L68 |
apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java | QueryableStateClient.getKvState | private <K, N, S extends State, V> CompletableFuture<S> getKvState(
final JobID jobId,
final String queryableStateName,
final K key,
final N namespace,
final TypeInformation<K> keyTypeInfo,
final TypeInformation<N> namespaceTypeInfo,
final StateDescriptor<S, V> stateDescriptor) {
"""
Returns a... | java | private <K, N, S extends State, V> CompletableFuture<S> getKvState(
final JobID jobId,
final String queryableStateName,
final K key,
final N namespace,
final TypeInformation<K> keyTypeInfo,
final TypeInformation<N> namespaceTypeInfo,
final StateDescriptor<S, V> stateDescriptor) {
Preconditions.c... | [
"private",
"<",
"K",
",",
"N",
",",
"S",
"extends",
"State",
",",
"V",
">",
"CompletableFuture",
"<",
"S",
">",
"getKvState",
"(",
"final",
"JobID",
"jobId",
",",
"final",
"String",
"queryableStateName",
",",
"final",
"K",
"key",
",",
"final",
"N",
"na... | Returns a future holding the request result.
@param jobId JobID of the job the queryable state belongs to.
@param queryableStateName Name under which the state is queryable.
@param key The key that the state we request is associated with.
@param namespace The namespace of th... | [
"Returns",
"a",
"future",
"holding",
"the",
"request",
"result",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java#L242-L275 |
haifengl/smile | core/src/main/java/smile/association/FPGrowth.java | FPGrowth.grow | private long grow(PrintStream out, List<ItemSet> list, TotalSupportTree ttree, HeaderTableItem header, int[] itemset, int[] localItemSupport, int[] prefixItemset) {
"""
Mines FP-tree with respect to a single element in the header table.
@param header the header table item of interest.
@param itemset the item set... | java | private long grow(PrintStream out, List<ItemSet> list, TotalSupportTree ttree, HeaderTableItem header, int[] itemset, int[] localItemSupport, int[] prefixItemset) {
long n = 1;
int support = header.count;
int item = header.id;
itemset = insert(itemset, item);
collect(out, list, ... | [
"private",
"long",
"grow",
"(",
"PrintStream",
"out",
",",
"List",
"<",
"ItemSet",
">",
"list",
",",
"TotalSupportTree",
"ttree",
",",
"HeaderTableItem",
"header",
",",
"int",
"[",
"]",
"itemset",
",",
"int",
"[",
"]",
"localItemSupport",
",",
"int",
"[",
... | Mines FP-tree with respect to a single element in the header table.
@param header the header table item of interest.
@param itemset the item set represented by the current FP-tree. | [
"Mines",
"FP",
"-",
"tree",
"with",
"respect",
"to",
"a",
"single",
"element",
"in",
"the",
"header",
"table",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/FPGrowth.java#L393-L415 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupJComponentBuilder.java | CommandGroupJComponentBuilder.buildChildModel | protected final Object buildChildModel(Object parentModel, AbstractCommand command, int level) {
"""
Implementation wrapping around the
{@link #buildChildComponent(JComponent, AbstractCommand, int)}
"""
return buildChildComponent((JComponent) parentModel, command, level);
} | java | protected final Object buildChildModel(Object parentModel, AbstractCommand command, int level)
{
return buildChildComponent((JComponent) parentModel, command, level);
} | [
"protected",
"final",
"Object",
"buildChildModel",
"(",
"Object",
"parentModel",
",",
"AbstractCommand",
"command",
",",
"int",
"level",
")",
"{",
"return",
"buildChildComponent",
"(",
"(",
"JComponent",
")",
"parentModel",
",",
"command",
",",
"level",
")",
";"... | Implementation wrapping around the
{@link #buildChildComponent(JComponent, AbstractCommand, int)} | [
"Implementation",
"wrapping",
"around",
"the",
"{"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupJComponentBuilder.java#L87-L90 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java | AbstractLexicalAnalyzer.combineWords | private static void combineWords(String[] wordNet, int start, int end, CoreDictionary.Attribute[] attributeArray, CoreDictionary.Attribute value) {
"""
将连续的词语合并为一个
@param wordNet 词图
@param start 起始下标(包含)
@param end 结束下标(不包含)
@param value 新的属性
"""
if (start + 1 != end) // 小优化,如果只有一个词,那就不... | java | private static void combineWords(String[] wordNet, int start, int end, CoreDictionary.Attribute[] attributeArray, CoreDictionary.Attribute value)
{
if (start + 1 != end) // 小优化,如果只有一个词,那就不需要合并,直接应用新属性
{
StringBuilder sbTerm = new StringBuilder();
for (int j = start; j < end... | [
"private",
"static",
"void",
"combineWords",
"(",
"String",
"[",
"]",
"wordNet",
",",
"int",
"start",
",",
"int",
"end",
",",
"CoreDictionary",
".",
"Attribute",
"[",
"]",
"attributeArray",
",",
"CoreDictionary",
".",
"Attribute",
"value",
")",
"{",
"if",
... | 将连续的词语合并为一个
@param wordNet 词图
@param start 起始下标(包含)
@param end 结束下标(不包含)
@param value 新的属性 | [
"将连续的词语合并为一个"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L710-L724 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/audit/auditnslogpolicy_binding.java | auditnslogpolicy_binding.get | public static auditnslogpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch auditnslogpolicy_binding resource of given name .
"""
auditnslogpolicy_binding obj = new auditnslogpolicy_binding();
obj.set_name(name);
auditnslogpolicy_binding response = (auditns... | java | public static auditnslogpolicy_binding get(nitro_service service, String name) throws Exception{
auditnslogpolicy_binding obj = new auditnslogpolicy_binding();
obj.set_name(name);
auditnslogpolicy_binding response = (auditnslogpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"auditnslogpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"auditnslogpolicy_binding",
"obj",
"=",
"new",
"auditnslogpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"... | Use this API to fetch auditnslogpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"auditnslogpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/audit/auditnslogpolicy_binding.java#L202-L207 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getBindHost | public static String getBindHost(ServiceType service, AlluxioConfiguration conf) {
"""
Helper method to get the {@link InetSocketAddress} bind address on a given service.
<p>
Host bind information searching order:
<ol>
<li>System properties or environment variables via alluxio-env.sh
<li>Default properties vi... | java | public static String getBindHost(ServiceType service, AlluxioConfiguration conf) {
if (conf.isSet(service.mBindHostKey) && !conf.get(service.mBindHostKey)
.isEmpty()) {
return conf.get(service.mBindHostKey);
} else {
return getLocalHostName((int) conf.getMs(PropertyKey.NETWORK_HOST_RESOLUTIO... | [
"public",
"static",
"String",
"getBindHost",
"(",
"ServiceType",
"service",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"if",
"(",
"conf",
".",
"isSet",
"(",
"service",
".",
"mBindHostKey",
")",
"&&",
"!",
"conf",
".",
"get",
"(",
"service",
".",
"mBind... | Helper method to get the {@link InetSocketAddress} bind address on a given service.
<p>
Host bind information searching order:
<ol>
<li>System properties or environment variables via alluxio-env.sh
<li>Default properties via alluxio-default.properties file
<li>A externally resolvable local hostname for the host this JV... | [
"Helper",
"method",
"to",
"get",
"the",
"{",
"@link",
"InetSocketAddress",
"}",
"bind",
"address",
"on",
"a",
"given",
"service",
".",
"<p",
">",
"Host",
"bind",
"information",
"searching",
"order",
":",
"<ol",
">",
"<li",
">",
"System",
"properties",
"or"... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L339-L346 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.makeEnvelopes | private static void makeEnvelopes(Statement st, double tolerance, boolean isH2, int srid) throws SQLException {
"""
Make a big table of all points in the coords table with an envelope around each point.
We will use this table to remove duplicate points.
"""
st.execute("DROP TABLE IF EXISTS"+ PTS_TABLE... | java | private static void makeEnvelopes(Statement st, double tolerance, boolean isH2, int srid) throws SQLException {
st.execute("DROP TABLE IF EXISTS"+ PTS_TABLE + ";");
if (tolerance > 0) {
LOGGER.info("Calculating envelopes around coordinates...");
if (isH2) {
... | [
"private",
"static",
"void",
"makeEnvelopes",
"(",
"Statement",
"st",
",",
"double",
"tolerance",
",",
"boolean",
"isH2",
",",
"int",
"srid",
")",
"throws",
"SQLException",
"{",
"st",
".",
"execute",
"(",
"\"DROP TABLE IF EXISTS\"",
"+",
"PTS_TABLE",
"+",
"\";... | Make a big table of all points in the coords table with an envelope around each point.
We will use this table to remove duplicate points. | [
"Make",
"a",
"big",
"table",
"of",
"all",
"points",
"in",
"the",
"coords",
"table",
"with",
"an",
"envelope",
"around",
"each",
"point",
".",
"We",
"will",
"use",
"this",
"table",
"to",
"remove",
"duplicate",
"points",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L390-L446 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getTransformation | public static Matrix4d getTransformation(Matrix rot, Atom trans) {
"""
Convert JAMA rotation and translation to a Vecmath transformation matrix.
Because the JAMA matrix is a pre-multiplication matrix and the Vecmath
matrix is a post-multiplication one, the rotation matrix is transposed to
ensure that the transf... | java | public static Matrix4d getTransformation(Matrix rot, Atom trans) {
return new Matrix4d(new Matrix3d(rot.getColumnPackedCopy()),
new Vector3d(trans.getCoordsAsPoint3d()), 1.0);
} | [
"public",
"static",
"Matrix4d",
"getTransformation",
"(",
"Matrix",
"rot",
",",
"Atom",
"trans",
")",
"{",
"return",
"new",
"Matrix4d",
"(",
"new",
"Matrix3d",
"(",
"rot",
".",
"getColumnPackedCopy",
"(",
")",
")",
",",
"new",
"Vector3d",
"(",
"trans",
"."... | Convert JAMA rotation and translation to a Vecmath transformation matrix.
Because the JAMA matrix is a pre-multiplication matrix and the Vecmath
matrix is a post-multiplication one, the rotation matrix is transposed to
ensure that the transformation they produce is the same.
@param rot
3x3 Rotation matrix
@param trans... | [
"Convert",
"JAMA",
"rotation",
"and",
"translation",
"to",
"a",
"Vecmath",
"transformation",
"matrix",
".",
"Because",
"the",
"JAMA",
"matrix",
"is",
"a",
"pre",
"-",
"multiplication",
"matrix",
"and",
"the",
"Vecmath",
"matrix",
"is",
"a",
"post",
"-",
"mul... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1199-L1202 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphicsGLRegisterBuffer | public static int cuGraphicsGLRegisterBuffer(CUgraphicsResource pCudaResource, int buffer, int Flags) {
"""
Registers an OpenGL buffer object.
<pre>
CUresult cuGraphicsGLRegisterBuffer (
CUgraphicsResource* pCudaResource,
GLuint buffer,
unsigned int Flags )
</pre>
<div>
<p>Registers an OpenGL buffer obj... | java | public static int cuGraphicsGLRegisterBuffer(CUgraphicsResource pCudaResource, int buffer, int Flags)
{
return checkResult(cuGraphicsGLRegisterBufferNative(pCudaResource, buffer, Flags));
} | [
"public",
"static",
"int",
"cuGraphicsGLRegisterBuffer",
"(",
"CUgraphicsResource",
"pCudaResource",
",",
"int",
"buffer",
",",
"int",
"Flags",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphicsGLRegisterBufferNative",
"(",
"pCudaResource",
",",
"buffer",
",",
"Flags... | Registers an OpenGL buffer object.
<pre>
CUresult cuGraphicsGLRegisterBuffer (
CUgraphicsResource* pCudaResource,
GLuint buffer,
unsigned int Flags )
</pre>
<div>
<p>Registers an OpenGL buffer object.
Registers the buffer object specified by <tt>buffer</tt> for access
by CUDA. A handle to the registered object is ret... | [
"Registers",
"an",
"OpenGL",
"buffer",
"object",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L15252-L15255 |
tracee/tracee | api/src/main/java/io/tracee/BackendProviderResolver.java | BackendProviderResolver.getBackendProviders | public Set<TraceeBackendProvider> getBackendProviders() {
"""
Find correct backend provider for the current context classloader. If no context classloader is available, a
fallback with the classloader of this resolver class is taken
@return A bunch of TraceeBackendProvider registered and available in the curre... | java | public Set<TraceeBackendProvider> getBackendProviders() {
// Create a working copy of Cache. Reference is updated upon cache update.
final Map<ClassLoader, Set<TraceeBackendProvider>> cacheCopy = providersPerClassloader;
// Try to determine TraceeBackendProvider by context classloader. Fallback: use classloader ... | [
"public",
"Set",
"<",
"TraceeBackendProvider",
">",
"getBackendProviders",
"(",
")",
"{",
"// Create a working copy of Cache. Reference is updated upon cache update.",
"final",
"Map",
"<",
"ClassLoader",
",",
"Set",
"<",
"TraceeBackendProvider",
">",
">",
"cacheCopy",
"=",
... | Find correct backend provider for the current context classloader. If no context classloader is available, a
fallback with the classloader of this resolver class is taken
@return A bunch of TraceeBackendProvider registered and available in the current classloader | [
"Find",
"correct",
"backend",
"provider",
"for",
"the",
"current",
"context",
"classloader",
".",
"If",
"no",
"context",
"classloader",
"is",
"available",
"a",
"fallback",
"with",
"the",
"classloader",
"of",
"this",
"resolver",
"class",
"is",
"taken"
] | train | https://github.com/tracee/tracee/blob/15a68e435248f57757beb8ceac6db5b7f6035bb3/api/src/main/java/io/tracee/BackendProviderResolver.java#L29-L41 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.LTE | public static void LTE(long parameter, long value, String name) throws IllegalArgumentException {
"""
Test if numeric parameter is less than or equal to given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws Il... | java | public static void LTE(long parameter, long value, String name) throws IllegalArgumentException {
if (parameter > value) {
throw new IllegalArgumentException(String.format("%s is not less than or equal %d.", name, value));
}
} | [
"public",
"static",
"void",
"LTE",
"(",
"long",
"parameter",
",",
"long",
"value",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
">",
"value",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",... | Test if numeric parameter is less than or equal to given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is not less than or equal to threshold value. | [
"Test",
"if",
"numeric",
"parameter",
"is",
"less",
"than",
"or",
"equal",
"to",
"given",
"threshold",
"value",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L471-L475 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/MemberSelectorManager.java | MemberSelectorManager.resetAll | public void resetAll(MemberId leader, Collection<MemberId> members) {
"""
Resets all child selectors.
@param leader The current cluster leader.
@param members The collection of all active members.
"""
MemberId oldLeader = this.leader;
this.leader = leader;
this.members = Lists.newLinkedList(me... | java | public void resetAll(MemberId leader, Collection<MemberId> members) {
MemberId oldLeader = this.leader;
this.leader = leader;
this.members = Lists.newLinkedList(members);
selectors.forEach(s -> s.reset(leader, this.members));
if (!Objects.equals(oldLeader, leader)) {
leaderChangeListeners.forE... | [
"public",
"void",
"resetAll",
"(",
"MemberId",
"leader",
",",
"Collection",
"<",
"MemberId",
">",
"members",
")",
"{",
"MemberId",
"oldLeader",
"=",
"this",
".",
"leader",
";",
"this",
".",
"leader",
"=",
"leader",
";",
"this",
".",
"members",
"=",
"List... | Resets all child selectors.
@param leader The current cluster leader.
@param members The collection of all active members. | [
"Resets",
"all",
"child",
"selectors",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/MemberSelectorManager.java#L99-L107 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/BloomFilter.java | BloomFilter.getFalsePositiveRate | public double getFalsePositiveRate(int elements) {
"""
Returns the theoretical false positive rate of this filter if were to contain the given number of elements.
"""
return pow(1 - pow(E, -1.0 * (hashFuncs * elements) / (data.length * 8)), hashFuncs);
} | java | public double getFalsePositiveRate(int elements) {
return pow(1 - pow(E, -1.0 * (hashFuncs * elements) / (data.length * 8)), hashFuncs);
} | [
"public",
"double",
"getFalsePositiveRate",
"(",
"int",
"elements",
")",
"{",
"return",
"pow",
"(",
"1",
"-",
"pow",
"(",
"E",
",",
"-",
"1.0",
"*",
"(",
"hashFuncs",
"*",
"elements",
")",
"/",
"(",
"data",
".",
"length",
"*",
"8",
")",
")",
",",
... | Returns the theoretical false positive rate of this filter if were to contain the given number of elements. | [
"Returns",
"the",
"theoretical",
"false",
"positive",
"rate",
"of",
"this",
"filter",
"if",
"were",
"to",
"contain",
"the",
"given",
"number",
"of",
"elements",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/BloomFilter.java#L129-L131 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java | MSwingUtilities.showConfirmation | public static boolean showConfirmation(Component component, String message) {
"""
Affiche une boîte de dialogue de confirmation.
@param component Component
@param message String
@return boolean
"""
return JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(component), message,
UIManager.g... | java | public static boolean showConfirmation(Component component, String message) {
return JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(component), message,
UIManager.getString("OptionPane.titleText"),
JOptionPane.OK_OPTION | JOptionPane.CANCEL_OPTION) == JOptionPane.OK_OPTION;
} | [
"public",
"static",
"boolean",
"showConfirmation",
"(",
"Component",
"component",
",",
"String",
"message",
")",
"{",
"return",
"JOptionPane",
".",
"showConfirmDialog",
"(",
"SwingUtilities",
".",
"getWindowAncestor",
"(",
"component",
")",
",",
"message",
",",
"U... | Affiche une boîte de dialogue de confirmation.
@param component Component
@param message String
@return boolean | [
"Affiche",
"une",
"boîte",
"de",
"dialogue",
"de",
"confirmation",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java#L68-L72 |
HotelsDotCom/corc | corc-cascading/src/main/java/com/hotels/corc/cascading/OrcFile.java | OrcFile.sink | @SuppressWarnings("unchecked")
@Override
public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<Corc, OutputCollector> sinkCall)
throws IOException {
"""
Copies the values from the outgoing {@link TupleEntry} to the {@link Corc}.
"""
Corc corc = sinkCall.getContext();
Tup... | java | @SuppressWarnings("unchecked")
@Override
public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<Corc, OutputCollector> sinkCall)
throws IOException {
Corc corc = sinkCall.getContext();
TupleEntry tupleEntry = sinkCall.getOutgoingEntry();
for (Comparable<?> fieldName : tupleEnt... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"void",
"sink",
"(",
"FlowProcess",
"<",
"?",
"extends",
"Configuration",
">",
"flowProcess",
",",
"SinkCall",
"<",
"Corc",
",",
"OutputCollector",
">",
"sinkCall",
")",
"throws",
"... | Copies the values from the outgoing {@link TupleEntry} to the {@link Corc}. | [
"Copies",
"the",
"values",
"from",
"the",
"outgoing",
"{"
] | train | https://github.com/HotelsDotCom/corc/blob/37ecb5966315e4cf630a878ffcbada61c50bdcd3/corc-cascading/src/main/java/com/hotels/corc/cascading/OrcFile.java#L215-L225 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/xtext/XtextLinker.java | XtextLinker.clearReference | @Override
protected void clearReference(EObject obj, EReference ref) {
"""
We add typeRefs without Nodes on the fly, so we should remove them before relinking.
"""
super.clearReference(obj, ref);
if (obj.eIsSet(ref) && ref.getEType().equals(XtextPackage.Literals.TYPE_REF)) {
INode node = NodeModelUtils... | java | @Override
protected void clearReference(EObject obj, EReference ref) {
super.clearReference(obj, ref);
if (obj.eIsSet(ref) && ref.getEType().equals(XtextPackage.Literals.TYPE_REF)) {
INode node = NodeModelUtils.getNode((EObject) obj.eGet(ref));
if (node == null)
obj.eUnset(ref);
}
if (obj.eIsSet(ref)... | [
"@",
"Override",
"protected",
"void",
"clearReference",
"(",
"EObject",
"obj",
",",
"EReference",
"ref",
")",
"{",
"super",
".",
"clearReference",
"(",
"obj",
",",
"ref",
")",
";",
"if",
"(",
"obj",
".",
"eIsSet",
"(",
"ref",
")",
"&&",
"ref",
".",
"... | We add typeRefs without Nodes on the fly, so we should remove them before relinking. | [
"We",
"add",
"typeRefs",
"without",
"Nodes",
"on",
"the",
"fly",
"so",
"we",
"should",
"remove",
"them",
"before",
"relinking",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/xtext/XtextLinker.java#L466-L482 |
canoo/dolphin-platform | platform/dolphin-platform-remoting-common/src/main/java/com/canoo/dp/impl/remoting/legacy/core/ModelStoreConfig.java | ModelStoreConfig.ensurePowerOfTwo | private void ensurePowerOfTwo(String parameter, int number) {
"""
all the capacities will be used to initialize HashMaps so they should be powers of two
"""
if (Integer.bitCount(number) > 1) {
LOG.warn("Parameter {} should be power of two but was {}", parameter, number);
}
} | java | private void ensurePowerOfTwo(String parameter, int number) {
if (Integer.bitCount(number) > 1) {
LOG.warn("Parameter {} should be power of two but was {}", parameter, number);
}
} | [
"private",
"void",
"ensurePowerOfTwo",
"(",
"String",
"parameter",
",",
"int",
"number",
")",
"{",
"if",
"(",
"Integer",
".",
"bitCount",
"(",
"number",
")",
">",
"1",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Parameter {} should be power of two but was {}\"",
","... | all the capacities will be used to initialize HashMaps so they should be powers of two | [
"all",
"the",
"capacities",
"will",
"be",
"used",
"to",
"initialize",
"HashMaps",
"so",
"they",
"should",
"be",
"powers",
"of",
"two"
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-common/src/main/java/com/canoo/dp/impl/remoting/legacy/core/ModelStoreConfig.java#L87-L91 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/BasePrepareStatement.java | BasePrepareStatement.setBlob | public void setBlob(final int parameterIndex, final Blob blob) throws SQLException {
"""
Sets the designated parameter to the given <code>java.sql.Blob</code> object. The driver
converts this to an SQL
<code>BLOB</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, th... | java | public void setBlob(final int parameterIndex, final Blob blob) throws SQLException {
if (blob == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
setParameter(parameterIndex,
new StreamParameter(blob.getBinaryStream(), blob.length(), noBackslashEscapes));
hasLongData = true;
... | [
"public",
"void",
"setBlob",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Blob",
"blob",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"blob",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"Types",
".",
"BLOB",
")",
";",
"retur... | Sets the designated parameter to the given <code>java.sql.Blob</code> object. The driver
converts this to an SQL
<code>BLOB</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param blob a <code>Blob</code> object that maps an SQL <code>BLOB</c... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"sql",
".",
"Blob<",
"/",
"code",
">",
"object",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"BLOB<",
"/",
"code",
">",
"value",
... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/BasePrepareStatement.java#L305-L313 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java | JAltGridScreen.addGridHeading | public void addGridHeading() {
"""
Add the column <quantity> <description> headings to the grid panel.
"""
JPanel panel = new JPanel();
panel.setOpaque(false);
panel.setAlignmentX(LEFT_ALIGNMENT);
panel.setAlignmentY(TOP_ALIGNMENT);
this.add(panel);
panel.setLayo... | java | public void addGridHeading()
{
JPanel panel = new JPanel();
panel.setOpaque(false);
panel.setAlignmentX(LEFT_ALIGNMENT);
panel.setAlignmentY(TOP_ALIGNMENT);
this.add(panel);
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
m_rgcompHeadings = n... | [
"public",
"void",
"addGridHeading",
"(",
")",
"{",
"JPanel",
"panel",
"=",
"new",
"JPanel",
"(",
")",
";",
"panel",
".",
"setOpaque",
"(",
"false",
")",
";",
"panel",
".",
"setAlignmentX",
"(",
"LEFT_ALIGNMENT",
")",
";",
"panel",
".",
"setAlignmentY",
"... | Add the column <quantity> <description> headings to the grid panel. | [
"Add",
"the",
"column",
"<quantity",
">",
"<description",
">",
"headings",
"to",
"the",
"grid",
"panel",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java#L171-L185 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/converter/OIdentifiableConverter.java | OIdentifiableConverter.convertToOIdentifiable | public OIdentifiable convertToOIdentifiable(String value, Locale locale) {
"""
Converts string to {@link ORecordId}
@param value string representation of a {@link ORID}
@param locale locale
@return {@link ORecordId} for a specified rid
"""
try
{
return new ORecordId(value);
} catch (Exception e)
... | java | public OIdentifiable convertToOIdentifiable(String value, Locale locale)
{
try
{
return new ORecordId(value);
} catch (Exception e)
{
throw newConversionException("Cannot convert '" + value + "' to "+getTargetType().getSimpleName(), value, locale);
}
} | [
"public",
"OIdentifiable",
"convertToOIdentifiable",
"(",
"String",
"value",
",",
"Locale",
"locale",
")",
"{",
"try",
"{",
"return",
"new",
"ORecordId",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"newConversionException",
... | Converts string to {@link ORecordId}
@param value string representation of a {@link ORID}
@param locale locale
@return {@link ORecordId} for a specified rid | [
"Converts",
"string",
"to",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/converter/OIdentifiableConverter.java#L35-L44 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/StoredBlock.java | StoredBlock.build | public StoredBlock build(Block block) throws VerificationException {
"""
Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
"""
// Stored blocks track total work done in this chain, because the canonical chain is the one that represents
// the la... | java | public StoredBlock build(Block block) throws VerificationException {
// Stored blocks track total work done in this chain, because the canonical chain is the one that represents
// the largest amount of work done not the tallest.
BigInteger chainWork = this.chainWork.add(block.getWork());
... | [
"public",
"StoredBlock",
"build",
"(",
"Block",
"block",
")",
"throws",
"VerificationException",
"{",
"// Stored blocks track total work done in this chain, because the canonical chain is the one that represents",
"// the largest amount of work done not the tallest.",
"BigInteger",
"chainW... | Creates a new StoredBlock, calculating the additional fields by adding to the values in this block. | [
"Creates",
"a",
"new",
"StoredBlock",
"calculating",
"the",
"additional",
"fields",
"by",
"adding",
"to",
"the",
"values",
"in",
"this",
"block",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/StoredBlock.java#L100-L106 |
bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/dedup/DefaultDedupEventStore.java | DefaultDedupEventStore.getQueueReadWrite | @Nullable
private DedupQueue getQueueReadWrite(String queue, Duration waitDuration) {
"""
Returns the mutable persistent sorted queue if managed by this JVM, {@code null} otherwise.
"""
return _ownerGroup.startIfOwner(queue, waitDuration);
} | java | @Nullable
private DedupQueue getQueueReadWrite(String queue, Duration waitDuration) {
return _ownerGroup.startIfOwner(queue, waitDuration);
} | [
"@",
"Nullable",
"private",
"DedupQueue",
"getQueueReadWrite",
"(",
"String",
"queue",
",",
"Duration",
"waitDuration",
")",
"{",
"return",
"_ownerGroup",
".",
"startIfOwner",
"(",
"queue",
",",
"waitDuration",
")",
";",
"}"
] | Returns the mutable persistent sorted queue if managed by this JVM, {@code null} otherwise. | [
"Returns",
"the",
"mutable",
"persistent",
"sorted",
"queue",
"if",
"managed",
"by",
"this",
"JVM",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/dedup/DefaultDedupEventStore.java#L162-L165 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/res/XSLMessages.java | XSLMessages.createMessage | public static final String createMessage(String msgKey, Object args[]) //throws Exception {
"""
Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
in t... | java | public static final String createMessage(String msgKey, Object args[]) //throws Exception
{
// BEGIN android-changed
// don't localize resources
return createMsg(XSLTBundle, msgKey, args);
// END android-changed
} | [
"public",
"static",
"final",
"String",
"createMessage",
"(",
"String",
"msgKey",
",",
"Object",
"args",
"[",
"]",
")",
"//throws Exception",
"{",
"// BEGIN android-changed",
"// don't localize resources",
"return",
"createMsg",
"(",
"XSLTBundle",
",",
"msgKey",
",... | Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
in the message created.
@return The formatted message string. | [
"Creates",
"a",
"message",
"from",
"the",
"specified",
"key",
"and",
"replacement",
"arguments",
"localized",
"to",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/res/XSLMessages.java#L48-L54 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-log/src/main/java/org/soitoolkit/commons/log/Log4jUtils.java | Log4jUtils.reloadAndWatch | public static void reloadAndWatch(final String configFile, final long delay) {
"""
(Re)Loads the config file using {@link DOMConfigurator} for {@code .xml} files and {@link PropertyConfigurator} for {@code .proeprties} files.
Reloads the file automatically when changed.
@param configFile log4j configuration fi... | java | public static void reloadAndWatch(final String configFile, final long delay) {
long watchDelay = delay == 0 ? Log4jUtils.DEFAULT_WATCH_DELAY : delay;
if (configFile != null) {
if (configFile.endsWith(XML_FILE_EXENSION)) {
DOMConfigurator.configureAndWatch(configFile, watchDe... | [
"public",
"static",
"void",
"reloadAndWatch",
"(",
"final",
"String",
"configFile",
",",
"final",
"long",
"delay",
")",
"{",
"long",
"watchDelay",
"=",
"delay",
"==",
"0",
"?",
"Log4jUtils",
".",
"DEFAULT_WATCH_DELAY",
":",
"delay",
";",
"if",
"(",
"configFi... | (Re)Loads the config file using {@link DOMConfigurator} for {@code .xml} files and {@link PropertyConfigurator} for {@code .proeprties} files.
Reloads the file automatically when changed.
@param configFile log4j configuration file, {@code .properties} or {@code .xml}
@param delay number of milliseconds between checks ... | [
"(",
"Re",
")",
"Loads",
"the",
"config",
"file",
"using",
"{",
"@link",
"DOMConfigurator",
"}",
"for",
"{",
"@code",
".",
"xml",
"}",
"files",
"and",
"{",
"@link",
"PropertyConfigurator",
"}",
"for",
"{",
"@code",
".",
"proeprties",
"}",
"files",
".",
... | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-log/src/main/java/org/soitoolkit/commons/log/Log4jUtils.java#L82-L95 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java | SpoiledChildInterfaceImplementor.filterSuperInterfaceMethods | private void filterSuperInterfaceMethods(JavaClass inf, Set<QMethod> infMethods, JavaClass cls) {
"""
removes methods found in an interface when a super interface having the same methods is implemented in a parent. While this is somewhat hinky, we'll
allow it.
@param inf
the interface to look for super interf... | java | private void filterSuperInterfaceMethods(JavaClass inf, Set<QMethod> infMethods, JavaClass cls) {
try {
if (infMethods.isEmpty()) {
return;
}
JavaClass[] superInfs = inf.getInterfaces();
for (JavaClass superInf : superInfs) {
if (c... | [
"private",
"void",
"filterSuperInterfaceMethods",
"(",
"JavaClass",
"inf",
",",
"Set",
"<",
"QMethod",
">",
"infMethods",
",",
"JavaClass",
"cls",
")",
"{",
"try",
"{",
"if",
"(",
"infMethods",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"Jav... | removes methods found in an interface when a super interface having the same methods is implemented in a parent. While this is somewhat hinky, we'll
allow it.
@param inf
the interface to look for super interfaces for
@param infMethods
the remaining methods that are needed to be found
@param cls
the super class to look... | [
"removes",
"methods",
"found",
"in",
"an",
"interface",
"when",
"a",
"super",
"interface",
"having",
"the",
"same",
"methods",
"is",
"implemented",
"in",
"a",
"parent",
".",
"While",
"this",
"is",
"somewhat",
"hinky",
"we",
"ll",
"allow",
"it",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SpoiledChildInterfaceImplementor.java#L182-L203 |
rterp/GMapsFX | GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/object/DirectionsPane.java | DirectionsPane.addUIEventHandler | public void addUIEventHandler(JavascriptObject obj, UIEventType type, UIEventHandler h) {
"""
Adds a handler for a mouse type event on the map.
@param obj The object that the event should be registered on.
@param type Type of the event to register against.
@param h Handler that will be called when the event o... | java | public void addUIEventHandler(JavascriptObject obj, UIEventType type, UIEventHandler h) {
String key = registerEventHandler(h);
String mcall = "google.maps.event.addListener(" + obj.getVariableName() + ", '" + type.name() + "', "
+ "function(event) {document.jsHandlers.handleUIEvent('" +... | [
"public",
"void",
"addUIEventHandler",
"(",
"JavascriptObject",
"obj",
",",
"UIEventType",
"type",
",",
"UIEventHandler",
"h",
")",
"{",
"String",
"key",
"=",
"registerEventHandler",
"(",
"h",
")",
";",
"String",
"mcall",
"=",
"\"google.maps.event.addListener(\"",
... | Adds a handler for a mouse type event on the map.
@param obj The object that the event should be registered on.
@param type Type of the event to register against.
@param h Handler that will be called when the event occurs. | [
"Adds",
"a",
"handler",
"for",
"a",
"mouse",
"type",
"event",
"on",
"the",
"map",
"."
] | train | https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/object/DirectionsPane.java#L238-L244 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, T5, T6, T7, T8> Func8<T1, T2, T3, T4, T5, T6, T7, T8, Observable<Void>> toAsync(Action8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8> action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observ... | java | public static <T1, T2, T3, T4, T5, T6, T7, T8> Func8<T1, T2, T3, T4, T5, T6, T7, T8, Observable<Void>> toAsync(Action8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"T8",
">",
"Func8",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"T8",
",",
"Observable",
"<",
"Voi... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L590-L592 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/collection/FastHashMap.java | FastHashMap.removeEntry | private void removeEntry(EntryImpl<K, V> entry) {
"""
Removes the specified entry from the map.
@param entry the entry to be removed.
"""
// Removes from bucket.
EntryImpl<K, V> previous = entry._previous;
EntryImpl<K, V> next = entry._next;
if (previous != null) {
previous._next = ne... | java | private void removeEntry(EntryImpl<K, V> entry) {
// Removes from bucket.
EntryImpl<K, V> previous = entry._previous;
EntryImpl<K, V> next = entry._next;
if (previous != null) {
previous._next = next;
entry._previous = null;
} else { // First in bucket.
_entries[entry._index] = ne... | [
"private",
"void",
"removeEntry",
"(",
"EntryImpl",
"<",
"K",
",",
"V",
">",
"entry",
")",
"{",
"// Removes from bucket.",
"EntryImpl",
"<",
"K",
",",
"V",
">",
"previous",
"=",
"entry",
".",
"_previous",
";",
"EntryImpl",
"<",
"K",
",",
"V",
">",
"nex... | Removes the specified entry from the map.
@param entry the entry to be removed. | [
"Removes",
"the",
"specified",
"entry",
"from",
"the",
"map",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/collection/FastHashMap.java#L690-L732 |
canoo/open-dolphin | subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java | DolphinServlet.createServerConnector | protected ServerConnector createServerConnector(ServerModelStore modelStore, Codec codec) {
"""
Creates a new {@code ServerConnector}.
Subclasses may override this method to customize how this instance should be created.
@param modelStore - the {@code ServerModelStore} to be attached to the {@code ServerConnec... | java | protected ServerConnector createServerConnector(ServerModelStore modelStore, Codec codec) {
ServerConnector connector = new ServerConnector();
connector.setServerModelStore(modelStore);
connector.setCodec(codec);
return connector;
} | [
"protected",
"ServerConnector",
"createServerConnector",
"(",
"ServerModelStore",
"modelStore",
",",
"Codec",
"codec",
")",
"{",
"ServerConnector",
"connector",
"=",
"new",
"ServerConnector",
"(",
")",
";",
"connector",
".",
"setServerModelStore",
"(",
"modelStore",
"... | Creates a new {@code ServerConnector}.
Subclasses may override this method to customize how this instance should be created.
@param modelStore - the {@code ServerModelStore} to be attached to the {@code ServerConnector}.
@param codec - the {@code Codec} to be attached to the {@code ServerConnector}.
@return a fr... | [
"Creates",
"a",
"new",
"{",
"@code",
"ServerConnector",
"}",
".",
"Subclasses",
"may",
"override",
"this",
"method",
"to",
"customize",
"how",
"this",
"instance",
"should",
"be",
"created",
"."
] | train | https://github.com/canoo/open-dolphin/blob/50166defc3ef2de473d7a7246c32dc04304d80ef/subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java#L281-L286 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/OmsHoughCirclesRaster.java | OmsHoughCirclesRaster.getCenterPoints | private Coordinate[] getCenterPoints( double[][][] houghValues, int maxCircles ) {
"""
Search for a fixed number of circles.
@param houghValues the hough values.
@param maxCircles The number of circles that should be found.
@return the center coordinates.
"""
Coordinate[] centerPoints = new Coord... | java | private Coordinate[] getCenterPoints( double[][][] houghValues, int maxCircles ) {
Coordinate[] centerPoints = new Coordinate[maxCircles];
int xMax = 0;
int yMax = 0;
int rMax = 0;
pm.beginTask("Search for circles...", maxCircles);
for( int c = 0; c < maxCircles; c++ ) ... | [
"private",
"Coordinate",
"[",
"]",
"getCenterPoints",
"(",
"double",
"[",
"]",
"[",
"]",
"[",
"]",
"houghValues",
",",
"int",
"maxCircles",
")",
"{",
"Coordinate",
"[",
"]",
"centerPoints",
"=",
"new",
"Coordinate",
"[",
"maxCircles",
"]",
";",
"int",
"x... | Search for a fixed number of circles.
@param houghValues the hough values.
@param maxCircles The number of circles that should be found.
@return the center coordinates. | [
"Search",
"for",
"a",
"fixed",
"number",
"of",
"circles",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/houghes/OmsHoughCirclesRaster.java#L285-L316 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.mulsubLong | private int mulsubLong(int[] q, int dh, int dl, int x, int offset) {
"""
This method is used for division by long.
Specialized version of the method sulsub.
dh is a high part of the divisor, dl is a low part
"""
long xLong = x & LONG_MASK;
offset += 2;
long product = (dl & LONG_MASK) ... | java | private int mulsubLong(int[] q, int dh, int dl, int x, int offset) {
long xLong = x & LONG_MASK;
offset += 2;
long product = (dl & LONG_MASK) * xLong;
long difference = q[offset] - product;
q[offset--] = (int)difference;
long carry = (product >>> 32)
+ ((... | [
"private",
"int",
"mulsubLong",
"(",
"int",
"[",
"]",
"q",
",",
"int",
"dh",
",",
"int",
"dl",
",",
"int",
"x",
",",
"int",
"offset",
")",
"{",
"long",
"xLong",
"=",
"x",
"&",
"LONG_MASK",
";",
"offset",
"+=",
"2",
";",
"long",
"product",
"=",
... | This method is used for division by long.
Specialized version of the method sulsub.
dh is a high part of the divisor, dl is a low part | [
"This",
"method",
"is",
"used",
"for",
"division",
"by",
"long",
".",
"Specialized",
"version",
"of",
"the",
"method",
"sulsub",
".",
"dh",
"is",
"a",
"high",
"part",
"of",
"the",
"divisor",
"dl",
"is",
"a",
"low",
"part"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L1808-L1824 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/FutureManagementChannel.java | FutureManagementChannel.openChannel | final Channel openChannel(final Connection connection, final String serviceType, final OptionMap options, final Long deadline) throws IOException {
"""
Open a channel.
@param connection the connection
@param serviceType the service type
@param options the channel options
@param deadline time, in ms since the... | java | final Channel openChannel(final Connection connection, final String serviceType, final OptionMap options, final Long deadline) throws IOException {
final IoFuture<Channel> futureChannel = connection.openChannel(serviceType, options);
long waitTime = deadline == null ? 10000 : Math.max(10000, deadline - ... | [
"final",
"Channel",
"openChannel",
"(",
"final",
"Connection",
"connection",
",",
"final",
"String",
"serviceType",
",",
"final",
"OptionMap",
"options",
",",
"final",
"Long",
"deadline",
")",
"throws",
"IOException",
"{",
"final",
"IoFuture",
"<",
"Channel",
">... | Open a channel.
@param connection the connection
@param serviceType the service type
@param options the channel options
@param deadline time, in ms since the epoch, by which the channel must be created,
or {@code null} if the caller is not imposing a specific deadline.
Ignored if less than 10s from the current time, w... | [
"Open",
"a",
"channel",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/FutureManagementChannel.java#L169-L178 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/conventions/DocumentConventions.java | DocumentConventions.generateDocumentId | @SuppressWarnings("unchecked")
public String generateDocumentId(String databaseName, Object entity) {
"""
Generates the document id.
@param databaseName Database name
@param entity Entity
@return document id
"""
Class<?> clazz = entity.getClass();
for (Tuple<Class, BiFunction<String, Ob... | java | @SuppressWarnings("unchecked")
public String generateDocumentId(String databaseName, Object entity) {
Class<?> clazz = entity.getClass();
for (Tuple<Class, BiFunction<String, Object, String>> listOfRegisteredIdConvention : _listOfRegisteredIdConventions) {
if (listOfRegisteredIdConventi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"String",
"generateDocumentId",
"(",
"String",
"databaseName",
",",
"Object",
"entity",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"entity",
".",
"getClass",
"(",
")",
";",
"for",
"(",
"Tup... | Generates the document id.
@param databaseName Database name
@param entity Entity
@return document id | [
"Generates",
"the",
"document",
"id",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/conventions/DocumentConventions.java#L354-L365 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.width_interpolate | public static double width_interpolate( double[][] data, double x, int nx, int ny ) {
"""
Linear interpolation between two values
@param data
- matrix of values to interpolate
@param x
- value to interpolate
@param nx
- column of data in which you find the x values
@param ny
- column of data in which you... | java | public static double width_interpolate( double[][] data, double x, int nx, int ny ) {
int rows = data.length;
double xuno = 0, xdue = 0, yuno = 0, ydue = 0, y = 0;
// if 0, interpolate between 0 and the first value of data
if (x >= 0 && x < data[0][nx]) {
xuno = 0;
... | [
"public",
"static",
"double",
"width_interpolate",
"(",
"double",
"[",
"]",
"[",
"]",
"data",
",",
"double",
"x",
",",
"int",
"nx",
",",
"int",
"ny",
")",
"{",
"int",
"rows",
"=",
"data",
".",
"length",
";",
"double",
"xuno",
"=",
"0",
",",
"xdue",... | Linear interpolation between two values
@param data
- matrix of values to interpolate
@param x
- value to interpolate
@param nx
- column of data in which you find the x values
@param ny
- column of data in which you find the y values
@return | [
"Linear",
"interpolation",
"between",
"two",
"values"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L998-L1032 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java | BlobServicesInner.getServiceProperties | public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) {
"""
Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@param resourceGroupName The name of the resource group w... | java | public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) {
return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body();
} | [
"public",
"BlobServicePropertiesInner",
"getServiceProperties",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"getServicePropertiesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"toBlocking",
"(",
"... | Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account wi... | [
"Gets",
"the",
"properties",
"of",
"a",
"storage",
"account’s",
"Blob",
"service",
"including",
"properties",
"for",
"Storage",
"Analytics",
"and",
"CORS",
"(",
"Cross",
"-",
"Origin",
"Resource",
"Sharing",
")",
"rules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java#L172-L174 |
adyliu/jafka | src/main/java/io/jafka/admin/AdminOperation.java | AdminOperation.createPartitions | public int createPartitions(String topic, int partitionNum, boolean enlarge) throws IOException {
"""
create partitions in the broker
@param topic topic name
@param partitionNum partition numbers
@param enlarge enlarge partition number if broker configuration has
setted
@return partition number in the broke... | java | public int createPartitions(String topic, int partitionNum, boolean enlarge) throws IOException {
KV<Receive, ErrorMapping> response = send(new CreaterRequest(topic, partitionNum, enlarge));
return Utils.deserializeIntArray(response.k.buffer())[0];
} | [
"public",
"int",
"createPartitions",
"(",
"String",
"topic",
",",
"int",
"partitionNum",
",",
"boolean",
"enlarge",
")",
"throws",
"IOException",
"{",
"KV",
"<",
"Receive",
",",
"ErrorMapping",
">",
"response",
"=",
"send",
"(",
"new",
"CreaterRequest",
"(",
... | create partitions in the broker
@param topic topic name
@param partitionNum partition numbers
@param enlarge enlarge partition number if broker configuration has
setted
@return partition number in the broker
@throws IOException if an I/O error occurs | [
"create",
"partitions",
"in",
"the",
"broker"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/admin/AdminOperation.java#L51-L54 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.objLongConsumer | public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedObjLongConsumer} in a {@link ObjLongConsumer} with a custom handler for checked exceptions.
"""
return (t, u) -> {
try {
consumer.... | java | public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer, Consumer<Throwable> handler) {
return (t, u) -> {
try {
consumer.accept(t, u);
}
catch (Throwable e) {
handler.accept(e);
throw new Illega... | [
"public",
"static",
"<",
"T",
">",
"ObjLongConsumer",
"<",
"T",
">",
"objLongConsumer",
"(",
"CheckedObjLongConsumer",
"<",
"T",
">",
"consumer",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
"t",
",",
"u",
")",
"->",
"{",
... | Wrap a {@link CheckedObjLongConsumer} in a {@link ObjLongConsumer} with a custom handler for checked exceptions. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L276-L287 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java | WebSiteManagementClientImpl.moveAsync | public Observable<Void> moveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) {
"""
Move resources between resource groups.
Move resources between resource groups.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param moveResourceEnvelope Object ... | java | public Observable<Void> moveAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope) {
return moveWithServiceResponseAsync(resourceGroupName, moveResourceEnvelope).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> respons... | [
"public",
"Observable",
"<",
"Void",
">",
"moveAsync",
"(",
"String",
"resourceGroupName",
",",
"CsmMoveResourceEnvelope",
"moveResourceEnvelope",
")",
"{",
"return",
"moveWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"moveResourceEnvelope",
")",
".",
"map",
... | Move resources between resource groups.
Move resources between resource groups.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param moveResourceEnvelope Object that represents the resource to move.
@throws IllegalArgumentException thrown if parameters fail the validation
@return t... | [
"Move",
"resources",
"between",
"resource",
"groups",
".",
"Move",
"resources",
"between",
"resource",
"groups",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java#L2176-L2183 |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsGalleryService.java | CmsGalleryService.convertNavigationTreeToBean | private CmsSitemapEntryBean convertNavigationTreeToBean(CmsObject cms, NavigationNode node, boolean isRoot) {
"""
Helper method to construct a sitemap entry bean for the sitemap tab filter functionality.<p>
@param cms the CMS context
@param node the root node of the filtered tree
@param isRoot true if this is... | java | private CmsSitemapEntryBean convertNavigationTreeToBean(CmsObject cms, NavigationNode node, boolean isRoot) {
CmsSitemapEntryBean bean = null;
try {
bean = prepareSitemapEntry(cms, node.getNavElement(), isRoot, false);
bean.setSearchMatch(node.isMatch());
List<Naviga... | [
"private",
"CmsSitemapEntryBean",
"convertNavigationTreeToBean",
"(",
"CmsObject",
"cms",
",",
"NavigationNode",
"node",
",",
"boolean",
"isRoot",
")",
"{",
"CmsSitemapEntryBean",
"bean",
"=",
"null",
";",
"try",
"{",
"bean",
"=",
"prepareSitemapEntry",
"(",
"cms",
... | Helper method to construct a sitemap entry bean for the sitemap tab filter functionality.<p>
@param cms the CMS context
@param node the root node of the filtered tree
@param isRoot true if this is the root node
@return the sitemap entry bean | [
"Helper",
"method",
"to",
"construct",
"a",
"sitemap",
"entry",
"bean",
"for",
"the",
"sitemap",
"tab",
"filter",
"functionality",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L1940-L1964 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java | ConversationHsmLocalizableParameter.dateTime | public static ConversationHsmLocalizableParameter dateTime(final String defaultValue, final Date dateTime) {
"""
Gets a parameter that localizes a date/time.
@param defaultValue Default for when localization fails.
@param dateTime Localizable date/time.
"""
ConversationHsmLocalizableParameter param... | java | public static ConversationHsmLocalizableParameter dateTime(final String defaultValue, final Date dateTime) {
ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter();
parameter.defaultValue = defaultValue;
parameter.dateTime = dateTime;
return parameter;... | [
"public",
"static",
"ConversationHsmLocalizableParameter",
"dateTime",
"(",
"final",
"String",
"defaultValue",
",",
"final",
"Date",
"dateTime",
")",
"{",
"ConversationHsmLocalizableParameter",
"parameter",
"=",
"new",
"ConversationHsmLocalizableParameter",
"(",
")",
";",
... | Gets a parameter that localizes a date/time.
@param defaultValue Default for when localization fails.
@param dateTime Localizable date/time. | [
"Gets",
"a",
"parameter",
"that",
"localizes",
"a",
"date",
"/",
"time",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java#L57-L63 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toDate | public static Date toDate(final String pString, final DateFormat pFormat) {
"""
Converts the string to a date, using the given format.
@param pString the string to convert
@param pFormat the date format
@return the date
@see SimpleDateFormat
@see SimpleDateFormat#SimpleDateFormat(String)
@see DateFormat
... | java | public static Date toDate(final String pString, final DateFormat pFormat) {
try {
synchronized (pFormat) {
// Parse date using given format
return pFormat.parse(pString);
}
}
catch (ParseException pe) {
// Wrap in Runtim... | [
"public",
"static",
"Date",
"toDate",
"(",
"final",
"String",
"pString",
",",
"final",
"DateFormat",
"pFormat",
")",
"{",
"try",
"{",
"synchronized",
"(",
"pFormat",
")",
"{",
"// Parse date using given format\r",
"return",
"pFormat",
".",
"parse",
"(",
"pString... | Converts the string to a date, using the given format.
@param pString the string to convert
@param pFormat the date format
@return the date
@see SimpleDateFormat
@see SimpleDateFormat#SimpleDateFormat(String)
@see DateFormat | [
"Converts",
"the",
"string",
"to",
"a",
"date",
"using",
"the",
"given",
"format",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L896-L907 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readComment | private String readComment(boolean returnText) throws IOException, KriptonRuntimeException {
"""
Read comment.
@param returnText the return text
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception
"""
read(STAR... | java | private String readComment(boolean returnText) throws IOException, KriptonRuntimeException {
read(START_COMMENT);
if (relaxed) {
return readUntil(END_COMMENT, returnText);
}
String commentText = readUntil(COMMENT_DOUBLE_DASH, returnText);
if (peekCharacter() != '>') {
throw new KriptonRuntimeException... | [
"private",
"String",
"readComment",
"(",
"boolean",
"returnText",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"START_COMMENT",
")",
";",
"if",
"(",
"relaxed",
")",
"{",
"return",
"readUntil",
"(",
"END_COMMENT",
",",
"returnTe... | Read comment.
@param returnText the return text
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"comment",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L717-L730 |
nats-io/java-nats | src/main/java/io/nats/client/impl/NatsDispatcher.java | NatsDispatcher.subscribeImpl | Dispatcher subscribeImpl(String subject, String queueName) {
"""
Assumes the subj/queuename checks are done, does check for closed status
"""
if (!this.running.get()) {
throw new IllegalStateException("Dispatcher is closed");
}
if (this.isDraining()) {
t... | java | Dispatcher subscribeImpl(String subject, String queueName) {
if (!this.running.get()) {
throw new IllegalStateException("Dispatcher is closed");
}
if (this.isDraining()) {
throw new IllegalStateException("Dispatcher is draining");
}
NatsSubscript... | [
"Dispatcher",
"subscribeImpl",
"(",
"String",
"subject",
",",
"String",
"queueName",
")",
"{",
"if",
"(",
"!",
"this",
".",
"running",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Dispatcher is closed\"",
")",
";",
"}",
... | Assumes the subj/queuename checks are done, does check for closed status | [
"Assumes",
"the",
"subj",
"/",
"queuename",
"checks",
"are",
"done",
"does",
"check",
"for",
"closed",
"status"
] | train | https://github.com/nats-io/java-nats/blob/5f291048fd30192ba39b3fe2925ecd60aaad6b48/src/main/java/io/nats/client/impl/NatsDispatcher.java#L172-L192 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java | XPathParser.lookbehind | private final boolean lookbehind(char c, int n) {
"""
Look behind the first character of the current token in order to
make a branching decision.
@param c the character to compare it to.
@param n number of tokens to look behind. Must be
greater than 1. Note that the look behind terminates
at either the be... | java | private final boolean lookbehind(char c, int n)
{
boolean isToken;
int lookBehindPos = m_queueMark - (n + 1);
if (lookBehindPos >= 0)
{
String lookbehind = (String) m_ops.m_tokenQueue.elementAt(lookBehindPos);
if (lookbehind.length() == 1)
{
char c0 = (lookbehind == null) ... | [
"private",
"final",
"boolean",
"lookbehind",
"(",
"char",
"c",
",",
"int",
"n",
")",
"{",
"boolean",
"isToken",
";",
"int",
"lookBehindPos",
"=",
"m_queueMark",
"-",
"(",
"n",
"+",
"1",
")",
";",
"if",
"(",
"lookBehindPos",
">=",
"0",
")",
"{",
"Stri... | Look behind the first character of the current token in order to
make a branching decision.
@param c the character to compare it to.
@param n number of tokens to look behind. Must be
greater than 1. Note that the look behind terminates
at either the beginning of the string or on a '|'
character. Because of this, th... | [
"Look",
"behind",
"the",
"first",
"character",
"of",
"the",
"current",
"token",
"in",
"order",
"to",
"make",
"a",
"branching",
"decision",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L325-L352 |
jenkinsci/jenkins | core/src/main/java/hudson/Plugin.java | Plugin.configure | public void configure(StaplerRequest req, JSONObject formData) throws IOException, ServletException, FormException {
"""
Handles the submission for the system configuration.
<p>
If this class defines {@code config.jelly} view, be sure to
override this method and persists the submitted values accordingly.
<... | java | public void configure(StaplerRequest req, JSONObject formData) throws IOException, ServletException, FormException {
configure(formData);
} | [
"public",
"void",
"configure",
"(",
"StaplerRequest",
"req",
",",
"JSONObject",
"formData",
")",
"throws",
"IOException",
",",
"ServletException",
",",
"FormException",
"{",
"configure",
"(",
"formData",
")",
";",
"}"
] | Handles the submission for the system configuration.
<p>
If this class defines {@code config.jelly} view, be sure to
override this method and persists the submitted values accordingly.
<p>
The following is a sample {@code config.jelly} that you can start yours with:
<pre>{@code <xmp>
<j:jelly xmlns:j="jelly:core" xml... | [
"Handles",
"the",
"submission",
"for",
"the",
"system",
"configuration",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Plugin.java#L220-L222 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.listNext | public PagedList<CloudPool> listNext(final String nextPageLink, final PoolListNextOptions poolListNextOptions) {
"""
Lists all of the pools in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param poolListNextOptions Additional parameters for the op... | java | public PagedList<CloudPool> listNext(final String nextPageLink, final PoolListNextOptions poolListNextOptions) {
ServiceResponseWithHeaders<Page<CloudPool>, PoolListHeaders> response = listNextSinglePageAsync(nextPageLink, poolListNextOptions).toBlocking().single();
return new PagedList<CloudPool>(respo... | [
"public",
"PagedList",
"<",
"CloudPool",
">",
"listNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"PoolListNextOptions",
"poolListNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudPool",
">",
",",
"PoolListHeaders",
">",
"re... | Lists all of the pools in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param poolListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the r... | [
"Lists",
"all",
"of",
"the",
"pools",
"in",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L4016-L4024 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.translationRotateMul | public Matrix4x3f translationRotateMul(float tx, float ty, float tz, float qx, float qy, float qz, float qw, Matrix4x3fc mat) {
"""
Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scal... | java | public Matrix4x3f translationRotateMul(float tx, float ty, float tz, float qx, float qy, float qz, float qw, Matrix4x3fc mat) {
float w2 = qw * qw;
float x2 = qx * qx;
float y2 = qy * qy;
float z2 = qz * qz;
float zw = qz * qw;
float xy = qx * qy;
float xz = qx * ... | [
"public",
"Matrix4x3f",
"translationRotateMul",
"(",
"float",
"tx",
",",
"float",
"ty",
",",
"float",
"tz",
",",
"float",
"qx",
",",
"float",
"qy",
",",
"float",
"qz",
",",
"float",
"qw",
",",
"Matrix4x3fc",
"mat",
")",
"{",
"float",
"w2",
"=",
"qw",
... | Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scaling - transformation specified by the quaternion <code>(qx, qy, qz, qw)</code> and <code>M</code> is the given matrix <code>mat</code>
<p>... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"<code",
">",
"T",
"*",
"R",
"*",
"M<",
"/",
"code",
">",
"where",
"<code",
">",
"T<",
"/",
"code",
">",
"is",
"a",
"translation",
"by",
"the",
"given",
"<code",
">",
"(",
"tx",
"t... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L2997-L3031 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toTimeString | public static String toTimeString(int hour, int minute, int second) {
"""
Makes a time String in the format HH:MM:SS from a separate ints for hour,
minute, and second. If the seconds are 0, then the output is in HH:MM.
@param hour
The hour int
@param minute
The minute int
@param second
The second int
@re... | java | public static String toTimeString(int hour, int minute, int second) {
String hourStr;
String minuteStr;
String secondStr;
if (hour < 10) {
hourStr = "0" + hour;
} else {
hourStr = "" + hour;
}
if (minute < 10) {
minuteStr = "0" + minute;
} else {
minuteStr = "" + minute;
}
... | [
"public",
"static",
"String",
"toTimeString",
"(",
"int",
"hour",
",",
"int",
"minute",
",",
"int",
"second",
")",
"{",
"String",
"hourStr",
";",
"String",
"minuteStr",
";",
"String",
"secondStr",
";",
"if",
"(",
"hour",
"<",
"10",
")",
"{",
"hourStr",
... | Makes a time String in the format HH:MM:SS from a separate ints for hour,
minute, and second. If the seconds are 0, then the output is in HH:MM.
@param hour
The hour int
@param minute
The minute int
@param second
The second int
@return A time String in the format HH:MM:SS or HH:MM | [
"Makes",
"a",
"time",
"String",
"in",
"the",
"format",
"HH",
":",
"MM",
":",
"SS",
"from",
"a",
"separate",
"ints",
"for",
"hour",
"minute",
"and",
"second",
".",
"If",
"the",
"seconds",
"are",
"0",
"then",
"the",
"output",
"is",
"in",
"HH",
":",
"... | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L484-L508 |
twilio/twilio-java | src/main/java/com/twilio/rest/api/v2010/account/AvailablePhoneNumberCountryReader.java | AvailablePhoneNumberCountryReader.nextPage | @Override
public Page<AvailablePhoneNumberCountry> nextPage(final Page<AvailablePhoneNumberCountry> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with whic... | java | @Override
public Page<AvailablePhoneNumberCountry> nextPage(final Page<AvailablePhoneNumberCountry> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domain... | [
"@",
"Override",
"public",
"Page",
"<",
"AvailablePhoneNumberCountry",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"AvailablePhoneNumberCountry",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/api/v2010/account/AvailablePhoneNumberCountryReader.java#L99-L110 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.setErrorListener | public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException {
"""
Set the error event listener.
@param listener The new error listener.
@throws IllegalArgumentException if
"""
synchronized (m_reentryGuard)
{
if (listener == null)
throw new IllegalAr... | java | public void setErrorListener(ErrorListener listener)
throws IllegalArgumentException
{
synchronized (m_reentryGuard)
{
if (listener == null)
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler");
m... | [
"public",
"void",
"setErrorListener",
"(",
"ErrorListener",
"listener",
")",
"throws",
"IllegalArgumentException",
"{",
"synchronized",
"(",
"m_reentryGuard",
")",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"XSLMe... | Set the error event listener.
@param listener The new error listener.
@throws IllegalArgumentException if | [
"Set",
"the",
"error",
"event",
"listener",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2819-L2830 |
app55/app55-java | src/support/java/com/googlecode/openbeans/PersistenceDelegate.java | PersistenceDelegate.mutatesTo | protected boolean mutatesTo(Object o1, Object o2) {
"""
Determines whether one object mutates to the other object. One object is considered able to mutate to another object if they are indistinguishable in
terms of behaviors of all public APIs. The default implementation here is to return true only if the two obj... | java | protected boolean mutatesTo(Object o1, Object o2)
{
return null != o1 && null != o2 && o1.getClass() == o2.getClass();
} | [
"protected",
"boolean",
"mutatesTo",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"return",
"null",
"!=",
"o1",
"&&",
"null",
"!=",
"o2",
"&&",
"o1",
".",
"getClass",
"(",
")",
"==",
"o2",
".",
"getClass",
"(",
")",
";",
"}"
] | Determines whether one object mutates to the other object. One object is considered able to mutate to another object if they are indistinguishable in
terms of behaviors of all public APIs. The default implementation here is to return true only if the two objects are instances of the same class.
@param o1
one object
@p... | [
"Determines",
"whether",
"one",
"object",
"mutates",
"to",
"the",
"other",
"object",
".",
"One",
"object",
"is",
"considered",
"able",
"to",
"mutate",
"to",
"another",
"object",
"if",
"they",
"are",
"indistinguishable",
"in",
"terms",
"of",
"behaviors",
"of",
... | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/PersistenceDelegate.java#L84-L87 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <R> FuncN<Observable<R>> toAsync(FuncN<? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the result type... | java | public static <R> FuncN<Observable<R>> toAsync(FuncN<? extends R> func) {
return toAsync(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"R",
">",
"FuncN",
"<",
"Observable",
"<",
"R",
">",
">",
"toAsync",
"(",
"FuncN",
"<",
"?",
"extends",
"R",
">",
"func",
")",
"{",
"return",
"toAsync",
"(",
"func",
",",
"Schedulers",
".",
"computation",
"(",
")",
")",
";"... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the result type
@param func the function to convert
@return a function that returns an Observable that... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L734-L736 |
CloudSlang/cs-actions | cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java | DateTimeUtils.isDateValid | public static boolean isDateValid(String date, Locale locale) {
"""
Because the date passed as argument can be in java format, and because not all formats are compatible
with joda-time, this method checks if the date string is valid with java. In this way we can use the
proper DateTime without changing the outpu... | java | public static boolean isDateValid(String date, Locale locale) {
try {
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale);
format.parse(date);
return true;
} catch (ParseException e) {
return false;
... | [
"public",
"static",
"boolean",
"isDateValid",
"(",
"String",
"date",
",",
"Locale",
"locale",
")",
"{",
"try",
"{",
"DateFormat",
"format",
"=",
"DateFormat",
".",
"getDateTimeInstance",
"(",
"DateFormat",
".",
"DEFAULT",
",",
"DateFormat",
".",
"DEFAULT",
","... | Because the date passed as argument can be in java format, and because not all formats are compatible
with joda-time, this method checks if the date string is valid with java. In this way we can use the
proper DateTime without changing the output.
@param date date passed as argument
@return true if is a java date | [
"Because",
"the",
"date",
"passed",
"as",
"argument",
"can",
"be",
"in",
"java",
"format",
"and",
"because",
"not",
"all",
"formats",
"are",
"compatible",
"with",
"joda",
"-",
"time",
"this",
"method",
"checks",
"if",
"the",
"date",
"string",
"is",
"valid"... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java#L51-L59 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.listAuthorizationRulesWithServiceResponseAsync | public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) {
"""
Gets the authorization rules for a NotificationHub.
@param resourceGroupName The... | java | public Observable<ServiceResponse<Page<SharedAccessAuthorizationRuleResourceInner>>> listAuthorizationRulesWithServiceResponseAsync(final String resourceGroupName, final String namespaceName, final String notificationHubName) {
return listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notif... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SharedAccessAuthorizationRuleResourceInner",
">",
">",
">",
"listAuthorizationRulesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"namespaceName",
",",
"final... | Gets the authorization rules for a NotificationHub.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<... | [
"Gets",
"the",
"authorization",
"rules",
"for",
"a",
"NotificationHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L1392-L1404 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java | AtomicLongFieldUpdater.getAndUpdate | public final long getAndUpdate(T obj, LongUnaryOperator updateFunction) {
"""
Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the previous
value. The function should be side-effect-free, since it may be
re-applied when attempted... | java | public final long getAndUpdate(T obj, LongUnaryOperator updateFunction) {
long prev, next;
do {
prev = get(obj);
next = updateFunction.applyAsLong(prev);
} while (!compareAndSet(obj, prev, next));
return prev;
} | [
"public",
"final",
"long",
"getAndUpdate",
"(",
"T",
"obj",
",",
"LongUnaryOperator",
"updateFunction",
")",
"{",
"long",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"next",
"=",
"updateFunction",
".",
"applyAsLong",
"(... | Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the previous
value. The function should be side-effect-free, since it may be
re-applied when attempted updates fail due to contention among threads.
@param obj An object whose field to ge... | [
"Atomically",
"updates",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"with",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"returning",
"the",
"previous",
"value",
".",
"The",
"function",
"should",
"be"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java#L285-L292 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.appendOffsetDigits | private void appendOffsetDigits(StringBuilder buf, int n, int minDigits) {
"""
Appends localized digits to the buffer.
<p>
Note: This code assumes that the input number is 0 - 59
@param buf the target buffer
@param n the integer number
@param minDigits the minimum digits width
"""
assert(n >= 0 ... | java | private void appendOffsetDigits(StringBuilder buf, int n, int minDigits) {
assert(n >= 0 && n < 60);
int numDigits = n >= 10 ? 2 : 1;
for (int i = 0; i < minDigits - numDigits; i++) {
buf.append(_gmtOffsetDigits[0]);
}
if (numDigits == 2) {
buf.append(_gmt... | [
"private",
"void",
"appendOffsetDigits",
"(",
"StringBuilder",
"buf",
",",
"int",
"n",
",",
"int",
"minDigits",
")",
"{",
"assert",
"(",
"n",
">=",
"0",
"&&",
"n",
"<",
"60",
")",
";",
"int",
"numDigits",
"=",
"n",
">=",
"10",
"?",
"2",
":",
"1",
... | Appends localized digits to the buffer.
<p>
Note: This code assumes that the input number is 0 - 59
@param buf the target buffer
@param n the integer number
@param minDigits the minimum digits width | [
"Appends",
"localized",
"digits",
"to",
"the",
"buffer",
".",
"<p",
">",
"Note",
":",
"This",
"code",
"assumes",
"that",
"the",
"input",
"number",
"is",
"0",
"-",
"59"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L2093-L2103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.