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 |
|---|---|---|---|---|---|---|---|---|---|---|
KyoriPowered/text | api/src/main/java/net/kyori/text/event/ClickEvent.java | ClickEvent.openUrl | public static @NonNull ClickEvent openUrl(final @NonNull String url) {
"""
Creates a click event that opens a url.
@param url the url to open
@return a click event
"""
return new ClickEvent(Action.OPEN_URL, url);
} | java | public static @NonNull ClickEvent openUrl(final @NonNull String url) {
return new ClickEvent(Action.OPEN_URL, url);
} | [
"public",
"static",
"@",
"NonNull",
"ClickEvent",
"openUrl",
"(",
"final",
"@",
"NonNull",
"String",
"url",
")",
"{",
"return",
"new",
"ClickEvent",
"(",
"Action",
".",
"OPEN_URL",
",",
"url",
")",
";",
"}"
] | Creates a click event that opens a url.
@param url the url to open
@return a click event | [
"Creates",
"a",
"click",
"event",
"that",
"opens",
"a",
"url",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/event/ClickEvent.java#L54-L56 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMinCardinalityImpl_CustomFieldSerializer.java | OWLDataMinCardinalityImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMinCardinalityImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goog... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMinCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataMinCardinalityImpl",
"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... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMinCardinalityImpl_CustomFieldSerializer.java#L96-L99 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorker | public <T> SubscriptionWorker<T> getSubscriptionWorker(Class<T> clazz, String subscriptionName) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a time... | java | public <T> SubscriptionWorker<T> getSubscriptionWorker(Class<T> clazz, String subscriptionName) {
return getSubscriptionWorker(clazz, subscriptionName, null);
} | [
"public",
"<",
"T",
">",
"SubscriptionWorker",
"<",
"T",
">",
"getSubscriptionWorker",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"subscriptionName",
")",
"{",
"return",
"getSubscriptionWorker",
"(",
"clazz",
",",
"subscriptionName",
",",
"null",
")"... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L250-L252 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java | ReflectionUtils.invokeMethod | public static Object invokeMethod(final Object obj, final String methodName, final boolean throwException)
throws IllegalArgumentException {
"""
Invoke the named method in the given object or its superclasses. If an exception is thrown while trying to
call the method, and throwException is true, then ... | java | public static Object invokeMethod(final Object obj, final String methodName, final boolean throwException)
throws IllegalArgumentException {
if (obj == null || methodName == null) {
if (throwException) {
throw new NullPointerException();
} else {
... | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"methodName",
",",
"final",
"boolean",
"throwException",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"methodName",
"=="... | Invoke the named method in the given object or its superclasses. If an exception is thrown while trying to
call the method, and throwException is true, then IllegalArgumentException is thrown wrapping the cause,
otherwise this will return null. If passed a null object, returns null unless throwException is true, then
t... | [
"Invoke",
"the",
"named",
"method",
"in",
"the",
"given",
"object",
"or",
"its",
"superclasses",
".",
"If",
"an",
"exception",
"is",
"thrown",
"while",
"trying",
"to",
"call",
"the",
"method",
"and",
"throwException",
"is",
"true",
"then",
"IllegalArgumentExce... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java#L292-L302 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java | CollectionUtil.mergeArrays | public static Object mergeArrays(Object pArray1, Object pArray2) {
"""
Merges two arrays into a new array. Elements from array1 and array2 will
be copied into a new array, that has array1.length + array2.length
elements.
@param pArray1 First array
@param pArray2 Second array, must be compatible with (assigna... | java | public static Object mergeArrays(Object pArray1, Object pArray2) {
return mergeArrays(pArray1, 0, Array.getLength(pArray1), pArray2, 0, Array.getLength(pArray2));
} | [
"public",
"static",
"Object",
"mergeArrays",
"(",
"Object",
"pArray1",
",",
"Object",
"pArray2",
")",
"{",
"return",
"mergeArrays",
"(",
"pArray1",
",",
"0",
",",
"Array",
".",
"getLength",
"(",
"pArray1",
")",
",",
"pArray2",
",",
"0",
",",
"Array",
"."... | Merges two arrays into a new array. Elements from array1 and array2 will
be copied into a new array, that has array1.length + array2.length
elements.
@param pArray1 First array
@param pArray2 Second array, must be compatible with (assignable from)
the first array
@return A new array, containing the values of array1 an... | [
"Merges",
"two",
"arrays",
"into",
"a",
"new",
"array",
".",
"Elements",
"from",
"array1",
"and",
"array2",
"will",
"be",
"copied",
"into",
"a",
"new",
"array",
"that",
"has",
"array1",
".",
"length",
"+",
"array2",
".",
"length",
"elements",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java#L225-L227 |
VoltDB/voltdb | src/frontend/org/voltdb/client/ReconnectStatusListener.java | ReconnectStatusListener.connectToOneServerWithRetry | private void connectToOneServerWithRetry(String hostname, int port) {
"""
Connect to a single server with retry. Limited exponential backoff.
No timeout. This will run until the process is killed or interrupted/closed
if it's not able to connect.
@param hostname host name
@param port port
"""
... | java | private void connectToOneServerWithRetry(String hostname, int port) {
long sleep = m_initialRetryIntervalMS;
while (m_shouldContinue.get()) {
try {
m_client.createConnection(hostname, port);
LOG.info(String.format("Connected to VoltDB node at %s:%d.", hostname... | [
"private",
"void",
"connectToOneServerWithRetry",
"(",
"String",
"hostname",
",",
"int",
"port",
")",
"{",
"long",
"sleep",
"=",
"m_initialRetryIntervalMS",
";",
"while",
"(",
"m_shouldContinue",
".",
"get",
"(",
")",
")",
"{",
"try",
"{",
"m_client",
".",
"... | Connect to a single server with retry. Limited exponential backoff.
No timeout. This will run until the process is killed or interrupted/closed
if it's not able to connect.
@param hostname host name
@param port port | [
"Connect",
"to",
"a",
"single",
"server",
"with",
"retry",
".",
"Limited",
"exponential",
"backoff",
".",
"No",
"timeout",
".",
"This",
"will",
"run",
"until",
"the",
"process",
"is",
"killed",
"or",
"interrupted",
"/",
"closed",
"if",
"it",
"s",
"not",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/ReconnectStatusListener.java#L98-L117 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassNameRewriterUtil.java | ClassNameRewriterUtil.rewriteMethodSignature | public static String rewriteMethodSignature(ClassNameRewriter classNameRewriter, String methodSignature) {
"""
Rewrite a method signature.
@param classNameRewriter
a ClassNameRewriter
@param methodSignature
a method signature
@return the rewritten method signature
"""
if (classNameRewriter != Id... | java | public static String rewriteMethodSignature(ClassNameRewriter classNameRewriter, String methodSignature) {
if (classNameRewriter != IdentityClassNameRewriter.instance()) {
SignatureParser parser = new SignatureParser(methodSignature);
StringBuilder buf = new StringBuilder();
... | [
"public",
"static",
"String",
"rewriteMethodSignature",
"(",
"ClassNameRewriter",
"classNameRewriter",
",",
"String",
"methodSignature",
")",
"{",
"if",
"(",
"classNameRewriter",
"!=",
"IdentityClassNameRewriter",
".",
"instance",
"(",
")",
")",
"{",
"SignatureParser",
... | Rewrite a method signature.
@param classNameRewriter
a ClassNameRewriter
@param methodSignature
a method signature
@return the rewritten method signature | [
"Rewrite",
"a",
"method",
"signature",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/model/ClassNameRewriterUtil.java#L44-L62 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.fieldDifference | public static Period fieldDifference(ReadablePartial start, ReadablePartial end) {
"""
Creates a period from two partially specified times, calculating
by field difference.
<p>
The two partials must contain the same fields, thus you can specify
two <code>LocalDate</code> objects, or two <code>LocalTime</code> ... | java | public static Period fieldDifference(ReadablePartial start, ReadablePartial end) {
if (start == null || end == null) {
throw new IllegalArgumentException("ReadablePartial objects must not be null");
}
if (start.size() != end.size()) {
throw new IllegalArgumentException("R... | [
"public",
"static",
"Period",
"fieldDifference",
"(",
"ReadablePartial",
"start",
",",
"ReadablePartial",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"null",
"||",
"end",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"ReadablePartial ... | Creates a period from two partially specified times, calculating
by field difference.
<p>
The two partials must contain the same fields, thus you can specify
two <code>LocalDate</code> objects, or two <code>LocalTime</code> objects,
but not one of each. Also, the partial may not contain overlapping
fields, such as dayO... | [
"Creates",
"a",
"period",
"from",
"two",
"partially",
"specified",
"times",
"calculating",
"by",
"field",
"difference",
".",
"<p",
">",
"The",
"two",
"partials",
"must",
"contain",
"the",
"same",
"fields",
"thus",
"you",
"can",
"specify",
"two",
"<code",
">"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L256-L276 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/BasePrepareStatement.java | BasePrepareStatement.setNCharacterStream | public void setNCharacterStream(final int parameterIndex, final Reader value, final long length)
throws SQLException {
"""
Sets the designated parameter to a <code>Reader</code> object. The <code>Reader</code> reads
the data till end-of-file is reached. The driver does the necessary conversion from Java
ch... | java | public void setNCharacterStream(final int parameterIndex, final Reader value, final long length)
throws SQLException {
setCharacterStream(parameterIndex, value, length);
} | [
"public",
"void",
"setNCharacterStream",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Reader",
"value",
",",
"final",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"setCharacterStream",
"(",
"parameterIndex",
",",
"value",
",",
"length",
")",
";... | Sets the designated parameter to a <code>Reader</code> object. The <code>Reader</code> reads
the data till end-of-file is reached. The driver does the necessary conversion from Java
character format to the national character set in the database.
@param parameterIndex of the first parameter is 1, the second is 2, ...
@... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"a",
"<code",
">",
"Reader<",
"/",
"code",
">",
"object",
".",
"The",
"<code",
">",
"Reader<",
"/",
"code",
">",
"reads",
"the",
"data",
"till",
"end",
"-",
"of",
"-",
"file",
"is",
"reached",
".",
"The... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/BasePrepareStatement.java#L775-L778 |
awslabs/amazon-sqs-java-extended-client-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSExtendedClient.java | AmazonSQSExtendedClient.changeMessageVisibility | public ChangeMessageVisibilityResult changeMessageVisibility(String queueUrl,
String receiptHandle,
Integer visibilityTimeout) {
"""
Simplified method form for invoking the ChangeMessageVisib... | java | public ChangeMessageVisibilityResult changeMessageVisibility(String queueUrl,
String receiptHandle,
Integer visibilityTimeout) {
ChangeMessageVisibilityRequest changeMessageVisibilityRequest =
... | [
"public",
"ChangeMessageVisibilityResult",
"changeMessageVisibility",
"(",
"String",
"queueUrl",
",",
"String",
"receiptHandle",
",",
"Integer",
"visibilityTimeout",
")",
"{",
"ChangeMessageVisibilityRequest",
"changeMessageVisibilityRequest",
"=",
"new",
"ChangeMessageVisibility... | Simplified method form for invoking the ChangeMessageVisibility
operation.
@see #changeMessageVisibility(ChangeMessageVisibilityRequest) | [
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ChangeMessageVisibility",
"operation",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-extended-client-lib/blob/df0c6251b99e682d6179938fe784590e662b84ea/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSExtendedClient.java#L623-L629 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java | MCEDependenceMeasure.intersectionMatrix | private void intersectionMatrix(int[][] res, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int gridsize) {
"""
Intersect the two 1d grid decompositions, to obtain a 2d matrix.
@param res Output matrix to fill
@param partsx Partitions in first component
@param partsy Partitions in second component.
@param... | java | private void intersectionMatrix(int[][] res, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int gridsize) {
for(int x = 0; x < gridsize; x++) {
final int[] px = partsx.get(x);
final int[] rowx = res[x];
for(int y = 0; y < gridsize; y++) {
int[] py = partsy.get(y);
rowx[y] = inte... | [
"private",
"void",
"intersectionMatrix",
"(",
"int",
"[",
"]",
"[",
"]",
"res",
",",
"ArrayList",
"<",
"int",
"[",
"]",
">",
"partsx",
",",
"ArrayList",
"<",
"int",
"[",
"]",
">",
"partsy",
",",
"int",
"gridsize",
")",
"{",
"for",
"(",
"int",
"x",
... | Intersect the two 1d grid decompositions, to obtain a 2d matrix.
@param res Output matrix to fill
@param partsx Partitions in first component
@param partsy Partitions in second component.
@param gridsize Size of partition decomposition | [
"Intersect",
"the",
"two",
"1d",
"grid",
"decompositions",
"to",
"obtain",
"a",
"2d",
"matrix",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L173-L182 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java | MD5FileUtils.readStoredMd5ForFile | public static MD5Hash readStoredMd5ForFile(File dataFile) throws IOException {
"""
Read the md5 checksum stored alongside the given file, or null
if no md5 is stored.
@param dataFile the file containing data
@return the checksum stored in dataFile.md5
"""
File md5File = getDigestFileForFile(dataFile);
... | java | public static MD5Hash readStoredMd5ForFile(File dataFile) throws IOException {
File md5File = getDigestFileForFile(dataFile);
String md5Line;
if (!md5File.exists()) {
return null;
}
BufferedReader reader =
new BufferedReader(new FileReader(md5File));
try {
md5Line = ... | [
"public",
"static",
"MD5Hash",
"readStoredMd5ForFile",
"(",
"File",
"dataFile",
")",
"throws",
"IOException",
"{",
"File",
"md5File",
"=",
"getDigestFileForFile",
"(",
"dataFile",
")",
";",
"String",
"md5Line",
";",
"if",
"(",
"!",
"md5File",
".",
"exists",
"(... | Read the md5 checksum stored alongside the given file, or null
if no md5 is stored.
@param dataFile the file containing data
@return the checksum stored in dataFile.md5 | [
"Read",
"the",
"md5",
"checksum",
"stored",
"alongside",
"the",
"given",
"file",
"or",
"null",
"if",
"no",
"md5",
"is",
"stored",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java#L71-L109 |
seedstack/seed | security/core/src/main/java/org/seedstack/seed/security/internal/securityexpr/SecurityExpressionUtils.java | SecurityExpressionUtils.hasRoleOn | public static boolean hasRoleOn(String role, String simpleScope) {
"""
Checks the current user role in the given scopes.
@param role the role to check
@param simpleScope the simple scope to check this role on.
@return true if the user has the role for the given simple scope.
"""
return secu... | java | public static boolean hasRoleOn(String role, String simpleScope) {
return securitySupport.hasRole(role, new SimpleScope(simpleScope));
} | [
"public",
"static",
"boolean",
"hasRoleOn",
"(",
"String",
"role",
",",
"String",
"simpleScope",
")",
"{",
"return",
"securitySupport",
".",
"hasRole",
"(",
"role",
",",
"new",
"SimpleScope",
"(",
"simpleScope",
")",
")",
";",
"}"
] | Checks the current user role in the given scopes.
@param role the role to check
@param simpleScope the simple scope to check this role on.
@return true if the user has the role for the given simple scope. | [
"Checks",
"the",
"current",
"user",
"role",
"in",
"the",
"given",
"scopes",
"."
] | train | https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/security/core/src/main/java/org/seedstack/seed/security/internal/securityexpr/SecurityExpressionUtils.java#L45-L47 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java | URLRewriterService.getNamePrefix | public static String getNamePrefix( ServletContext servletContext, ServletRequest request, String name ) {
"""
Get the prefix to use when rewriting a query parameter name.
Loops through the list of registered URLRewriters to build up a the prefix.
@param servletContext the current ServletContext.
@param reque... | java | public static String getNamePrefix( ServletContext servletContext, ServletRequest request, String name )
{
ArrayList/*< URLRewriter >*/ rewriters = getRewriters( request );
InternalStringBuilder prefix = new InternalStringBuilder();
if ( rewriters != null )
{
for ( Iter... | [
"public",
"static",
"String",
"getNamePrefix",
"(",
"ServletContext",
"servletContext",
",",
"ServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"ArrayList",
"/*< URLRewriter >*/",
"rewriters",
"=",
"getRewriters",
"(",
"request",
")",
";",
"InternalStringBu... | Get the prefix to use when rewriting a query parameter name.
Loops through the list of registered URLRewriters to build up a the prefix.
@param servletContext the current ServletContext.
@param request the current ServletRequest.
@param name the name of the query parameter.
@return a prefix to use to ... | [
"Get",
"the",
"prefix",
"to",
"use",
"when",
"rewriting",
"a",
"query",
"parameter",
"name",
".",
"Loops",
"through",
"the",
"list",
"of",
"registered",
"URLRewriters",
"to",
"build",
"up",
"a",
"the",
"prefix",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/URLRewriterService.java#L69-L86 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/spi/support/AbstractPaxWicketInjector.java | AbstractPaxWicketInjector.setField | protected void setField(Object component, Field field, Object proxy) {
"""
<p>setField.</p>
@param component a {@link java.lang.Object} object.
@param field a {@link java.lang.reflect.Field} object.
@param proxy a {@link java.lang.Object} object.
"""
try {
checkAccessabilityOfField(fie... | java | protected void setField(Object component, Field field, Object proxy) {
try {
checkAccessabilityOfField(field);
field.set(component, proxy);
} catch (Exception e) {
throw new RuntimeException("Bumm", e);
}
} | [
"protected",
"void",
"setField",
"(",
"Object",
"component",
",",
"Field",
"field",
",",
"Object",
"proxy",
")",
"{",
"try",
"{",
"checkAccessabilityOfField",
"(",
"field",
")",
";",
"field",
".",
"set",
"(",
"component",
",",
"proxy",
")",
";",
"}",
"ca... | <p>setField.</p>
@param component a {@link java.lang.Object} object.
@param field a {@link java.lang.reflect.Field} object.
@param proxy a {@link java.lang.Object} object. | [
"<p",
">",
"setField",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/spi/support/AbstractPaxWicketInjector.java#L102-L109 |
beangle/beangle3 | ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java | BeanDefinitionParser.parseMetaElements | public void parseMetaElements(Element ele, BeanMetadataAttributeAccessor attributeAccessor) {
"""
<p>
parseMetaElements.
</p>
@param ele a {@link org.w3c.dom.Element} object.
@param attributeAccessor a {@link org.springframework.beans.BeanMetadataAttributeAccessor}
object.
"""
NodeList nl = ele.getC... | java | public void parseMetaElements(Element ele, BeanMetadataAttributeAccessor attributeAccessor) {
NodeList nl = ele.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {
Node node = nl.item(i);
if (node instanceof Element && nodeNameEquals(node, META_ELEMENT)) {
Element metaElement = (Elem... | [
"public",
"void",
"parseMetaElements",
"(",
"Element",
"ele",
",",
"BeanMetadataAttributeAccessor",
"attributeAccessor",
")",
"{",
"NodeList",
"nl",
"=",
"ele",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nl",
"."... | <p>
parseMetaElements.
</p>
@param ele a {@link org.w3c.dom.Element} object.
@param attributeAccessor a {@link org.springframework.beans.BeanMetadataAttributeAccessor}
object. | [
"<p",
">",
"parseMetaElements",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java#L334-L347 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java | SortOperationFactory.createSort | public TableOperation createSort(List<Expression> orders, TableOperation child) {
"""
Creates a valid {@link SortTableOperation} operation.
<p><b>NOTE:</b> if the collation is not explicitly specified for any expression, it is wrapped in a
default ascending order
@param orders expressions describing order,
... | java | public TableOperation createSort(List<Expression> orders, TableOperation child) {
failIfStreaming();
List<Expression> convertedOrders = orders.stream()
.map(f -> f.accept(orderWrapper))
.collect(Collectors.toList());
return new SortTableOperation(convertedOrders, child);
} | [
"public",
"TableOperation",
"createSort",
"(",
"List",
"<",
"Expression",
">",
"orders",
",",
"TableOperation",
"child",
")",
"{",
"failIfStreaming",
"(",
")",
";",
"List",
"<",
"Expression",
">",
"convertedOrders",
"=",
"orders",
".",
"stream",
"(",
")",
".... | Creates a valid {@link SortTableOperation} operation.
<p><b>NOTE:</b> if the collation is not explicitly specified for any expression, it is wrapped in a
default ascending order
@param orders expressions describing order,
@param child relational expression on top of which to apply the sort operation
@return valid sor... | [
"Creates",
"a",
"valid",
"{",
"@link",
"SortTableOperation",
"}",
"operation",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/SortOperationFactory.java#L57-L64 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/wrapper/AssertionWrapper.java | AssertionWrapper.addQuotedIsa | @Override
public Assertion addQuotedIsa(KbCollection collection, Context context)
throws KbTypeException, CreateException {
"""
/*
@Override
public Fact addComment(String comment, String ctx) throws KbTypeException, CreateException {
return wrapped().addComment(comment, ctx);
}
"""
return w... | java | @Override
public Assertion addQuotedIsa(KbCollection collection, Context context)
throws KbTypeException, CreateException {
return wrapped().addQuotedIsa(collection, context);
} | [
"@",
"Override",
"public",
"Assertion",
"addQuotedIsa",
"(",
"KbCollection",
"collection",
",",
"Context",
"context",
")",
"throws",
"KbTypeException",
",",
"CreateException",
"{",
"return",
"wrapped",
"(",
")",
".",
"addQuotedIsa",
"(",
"collection",
",",
"contex... | /*
@Override
public Fact addComment(String comment, String ctx) throws KbTypeException, CreateException {
return wrapped().addComment(comment, ctx);
} | [
"/",
"*"
] | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/wrapper/AssertionWrapper.java#L135-L139 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.analyzeImageInStreamAsync | public Observable<ImageAnalysis> analyzeImageInStreamAsync(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter) {
"""
This operation extracts a rich set of visual features based on the image content.
@param image An image stream.
@param analyzeImageInStreamOptionalParamete... | java | public Observable<ImageAnalysis> analyzeImageInStreamAsync(byte[] image, AnalyzeImageInStreamOptionalParameter analyzeImageInStreamOptionalParameter) {
return analyzeImageInStreamWithServiceResponseAsync(image, analyzeImageInStreamOptionalParameter).map(new Func1<ServiceResponse<ImageAnalysis>, ImageAnalysis>()... | [
"public",
"Observable",
"<",
"ImageAnalysis",
">",
"analyzeImageInStreamAsync",
"(",
"byte",
"[",
"]",
"image",
",",
"AnalyzeImageInStreamOptionalParameter",
"analyzeImageInStreamOptionalParameter",
")",
"{",
"return",
"analyzeImageInStreamWithServiceResponseAsync",
"(",
"image... | This operation extracts a rich set of visual features based on the image content.
@param image An image stream.
@param analyzeImageInStreamOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@retur... | [
"This",
"operation",
"extracts",
"a",
"rich",
"set",
"of",
"visual",
"features",
"based",
"on",
"the",
"image",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1104-L1111 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java | DefaultEntityManager.executeGlobalListeners | private void executeGlobalListeners(CallbackType callbackType, Object entity) {
"""
Executes the global listeners for the given event type for the given entity.
@param callbackType
the event type
@param entity
the entity
"""
if (globalCallbacks == null) {
return;
}
List<CallbackMetadata... | java | private void executeGlobalListeners(CallbackType callbackType, Object entity) {
if (globalCallbacks == null) {
return;
}
List<CallbackMetadata> callbacks = globalCallbacks.get(callbackType);
if (callbacks == null) {
return;
}
for (CallbackMetadata callback : callbacks) {
Object... | [
"private",
"void",
"executeGlobalListeners",
"(",
"CallbackType",
"callbackType",
",",
"Object",
"entity",
")",
"{",
"if",
"(",
"globalCallbacks",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List",
"<",
"CallbackMetadata",
">",
"callbacks",
"=",
"globalCallback... | Executes the global listeners for the given event type for the given entity.
@param callbackType
the event type
@param entity
the entity | [
"Executes",
"the",
"global",
"listeners",
"for",
"the",
"given",
"event",
"type",
"for",
"the",
"given",
"entity",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java#L494-L506 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAdvisorsInner.java | ServerAdvisorsInner.listByServerAsync | public Observable<AdvisorListResultInner> listByServerAsync(String resourceGroupName, String serverName) {
"""
Gets a list of server advisors.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param ... | java | public Observable<AdvisorListResultInner> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<AdvisorListResultInner>, AdvisorListResultInner>() {
@Override
public Adviso... | [
"public",
"Observable",
"<",
"AdvisorListResultInner",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(... | Gets a list of server advisors.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return th... | [
"Gets",
"a",
"list",
"of",
"server",
"advisors",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAdvisorsInner.java#L111-L118 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java | CommonHelper.addParameter | public static String addParameter(final String url, final String name, final String value) {
"""
Add a new parameter to an url.
@param url url
@param name name of the parameter
@param value value of the parameter
@return the new url with the parameter appended
"""
if (url != null) {
... | java | public static String addParameter(final String url, final String name, final String value) {
if (url != null) {
final StringBuilder sb = new StringBuilder();
sb.append(url);
if (name != null) {
if (url.indexOf("?") >= 0) {
sb.append("&");
... | [
"public",
"static",
"String",
"addParameter",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
... | Add a new parameter to an url.
@param url url
@param name name of the parameter
@param value value of the parameter
@return the new url with the parameter appended | [
"Add",
"a",
"new",
"parameter",
"to",
"an",
"url",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java#L165-L184 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_wifi_wifiName_GET | public OvhWLAN serviceName_modem_wifi_wifiName_GET(String serviceName, String wifiName) throws IOException {
"""
Get this object properties
REST: GET /xdsl/{serviceName}/modem/wifi/{wifiName}
@param serviceName [required] The internal name of your XDSL offer
@param wifiName [required] Name of the Wifi
"""... | java | public OvhWLAN serviceName_modem_wifi_wifiName_GET(String serviceName, String wifiName) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/wifi/{wifiName}";
StringBuilder sb = path(qPath, serviceName, wifiName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhWLAN.cl... | [
"public",
"OvhWLAN",
"serviceName_modem_wifi_wifiName_GET",
"(",
"String",
"serviceName",
",",
"String",
"wifiName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/modem/wifi/{wifiName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Get this object properties
REST: GET /xdsl/{serviceName}/modem/wifi/{wifiName}
@param serviceName [required] The internal name of your XDSL offer
@param wifiName [required] Name of the Wifi | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1161-L1166 |
HubSpot/jinjava | src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java | JinjavaInterpreter.resolveELExpression | public Object resolveELExpression(String expression, int lineNumber) {
"""
Resolve expression against current context.
@param expression
Jinja expression.
@param lineNumber
Line number of expression.
@return Value of expression.
"""
this.lineNumber = lineNumber;
return expressionResolver.resolve... | java | public Object resolveELExpression(String expression, int lineNumber) {
this.lineNumber = lineNumber;
return expressionResolver.resolveExpression(expression);
} | [
"public",
"Object",
"resolveELExpression",
"(",
"String",
"expression",
",",
"int",
"lineNumber",
")",
"{",
"this",
".",
"lineNumber",
"=",
"lineNumber",
";",
"return",
"expressionResolver",
".",
"resolveExpression",
"(",
"expression",
")",
";",
"}"
] | Resolve expression against current context.
@param expression
Jinja expression.
@param lineNumber
Line number of expression.
@return Value of expression. | [
"Resolve",
"expression",
"against",
"current",
"context",
"."
] | train | https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java#L419-L422 |
OpenLiberty/open-liberty | dev/com.ibm.ws.mongo_fat/fat/src/com/ibm/ws/mongo/fat/MongoServerSelector.java | MongoServerSelector.validateMongoConnection | private static boolean validateMongoConnection(ExternalTestService mongoService) {
"""
Creates a connection to the mongo server at the given location using the mongo java client.
@param location
@param auth
@param encrypted
@return
@throws Exception
"""
String method = "validateMongoConnection";... | java | private static boolean validateMongoConnection(ExternalTestService mongoService) {
String method = "validateMongoConnection";
MongoClient mongoClient = null;
String host = mongoService.getAddress();
int port = mongoService.getPort();
File trustStore = null;
MongoClient... | [
"private",
"static",
"boolean",
"validateMongoConnection",
"(",
"ExternalTestService",
"mongoService",
")",
"{",
"String",
"method",
"=",
"\"validateMongoConnection\"",
";",
"MongoClient",
"mongoClient",
"=",
"null",
";",
"String",
"host",
"=",
"mongoService",
".",
"g... | Creates a connection to the mongo server at the given location using the mongo java client.
@param location
@param auth
@param encrypted
@return
@throws Exception | [
"Creates",
"a",
"connection",
"to",
"the",
"mongo",
"server",
"at",
"the",
"given",
"location",
"using",
"the",
"mongo",
"java",
"client",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.mongo_fat/fat/src/com/ibm/ws/mongo/fat/MongoServerSelector.java#L190-L242 |
prestodb/presto-hadoop-apache2 | src/main/java/org/apache/hadoop/util/LineReader.java | LineReader.readLine | public int readLine(Text str, int maxLineLength,
int maxBytesToConsume)
throws IOException {
"""
Read one line from the InputStream into the given Text.
@param str the object to store the given line (without newline)
@param maxLineLength the maximum number of bytes to store into str;
t... | java | public int readLine(Text str, int maxLineLength,
int maxBytesToConsume)
throws IOException
{
maxLineLength = Math.min(maxLineLength, MAX_ARRAY_SIZE);
maxBytesToConsume = Math.min(maxBytesToConsume, MAX_ARRAY_SIZE);
if (this.recordDelimiterBytes != null) {
... | [
"public",
"int",
"readLine",
"(",
"Text",
"str",
",",
"int",
"maxLineLength",
",",
"int",
"maxBytesToConsume",
")",
"throws",
"IOException",
"{",
"maxLineLength",
"=",
"Math",
".",
"min",
"(",
"maxLineLength",
",",
"MAX_ARRAY_SIZE",
")",
";",
"maxBytesToConsume"... | Read one line from the InputStream into the given Text.
@param str the object to store the given line (without newline)
@param maxLineLength the maximum number of bytes to store into str;
the rest of the line is silently discarded.
@param maxBytesToConsume the maximum number of bytes to consume
in this call. This is ... | [
"Read",
"one",
"line",
"from",
"the",
"InputStream",
"into",
"the",
"given",
"Text",
"."
] | train | https://github.com/prestodb/presto-hadoop-apache2/blob/6c848073a47b777f47561255e467c954ec24e2f9/src/main/java/org/apache/hadoop/util/LineReader.java#L183-L195 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.memberType | public Type memberType(Type t, Symbol sym) {
"""
The type of given symbol, seen as a member of t.
@param t a type
@param sym a symbol
"""
return (sym.flags() & STATIC) != 0
? sym.type
: memberType.visit(t, sym);
} | java | public Type memberType(Type t, Symbol sym) {
return (sym.flags() & STATIC) != 0
? sym.type
: memberType.visit(t, sym);
} | [
"public",
"Type",
"memberType",
"(",
"Type",
"t",
",",
"Symbol",
"sym",
")",
"{",
"return",
"(",
"sym",
".",
"flags",
"(",
")",
"&",
"STATIC",
")",
"!=",
"0",
"?",
"sym",
".",
"type",
":",
"memberType",
".",
"visit",
"(",
"t",
",",
"sym",
")",
... | The type of given symbol, seen as a member of t.
@param t a type
@param sym a symbol | [
"The",
"type",
"of",
"given",
"symbol",
"seen",
"as",
"a",
"member",
"of",
"t",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L1981-L1985 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/reconfigurables/ReconfigurableClient.java | ReconfigurableClient.terminateClient | static void terminateClient( IMessagingClient client, String errorMessage, Logger logger ) {
"""
Closes the connection of a messaging client and terminates it properly.
@param client the client (never null)
@param errorMessage the error message to log in case of problem
@param logger a logger
"""
try {
... | java | static void terminateClient( IMessagingClient client, String errorMessage, Logger logger ) {
try {
logger.fine( "The reconfigurable client is requesting its internal connection to be closed." );
if( client != null )
client.closeConnection();
} catch( Exception e ) {
logger.warning( errorMessage + " "... | [
"static",
"void",
"terminateClient",
"(",
"IMessagingClient",
"client",
",",
"String",
"errorMessage",
",",
"Logger",
"logger",
")",
"{",
"try",
"{",
"logger",
".",
"fine",
"(",
"\"The reconfigurable client is requesting its internal connection to be closed.\"",
")",
";",... | Closes the connection of a messaging client and terminates it properly.
@param client the client (never null)
@param errorMessage the error message to log in case of problem
@param logger a logger | [
"Closes",
"the",
"connection",
"of",
"a",
"messaging",
"client",
"and",
"terminates",
"it",
"properly",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/reconfigurables/ReconfigurableClient.java#L370-L389 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java | KafkaUtils.setPartitionAvgRecordSize | public static void setPartitionAvgRecordSize(State state, KafkaPartition partition, long size) {
"""
Set the average record size of a partition, which will be stored in property
"[topicname].[partitionid].avg.record.size".
"""
state.setProp(getPartitionPropName(partition.getTopicName(), partition.getId())... | java | public static void setPartitionAvgRecordSize(State state, KafkaPartition partition, long size) {
state.setProp(getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_SIZE,
size);
} | [
"public",
"static",
"void",
"setPartitionAvgRecordSize",
"(",
"State",
"state",
",",
"KafkaPartition",
"partition",
",",
"long",
"size",
")",
"{",
"state",
".",
"setProp",
"(",
"getPartitionPropName",
"(",
"partition",
".",
"getTopicName",
"(",
")",
",",
"partit... | Set the average record size of a partition, which will be stored in property
"[topicname].[partitionid].avg.record.size". | [
"Set",
"the",
"average",
"record",
"size",
"of",
"a",
"partition",
"which",
"will",
"be",
"stored",
"in",
"property",
"[",
"topicname",
"]",
".",
"[",
"partitionid",
"]",
".",
"avg",
".",
"record",
".",
"size",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java#L129-L132 |
cdapio/tephra | tephra-core/src/main/java/co/cask/tephra/persist/TransactionEditCodecs.java | TransactionEditCodecs.decode | public static void decode(TransactionEdit dest, DataInput in) throws IOException {
"""
Deserializes the encoded data from the given input stream, setting the values as fields
on the given {@code TransactionEdit} instances. This method expects first value in the
{code DataInput} to be a byte representing the cod... | java | public static void decode(TransactionEdit dest, DataInput in) throws IOException {
byte version = in.readByte();
TransactionEditCodec codec = CODECS.get(version);
if (codec == null) {
throw new IOException("TransactionEdit was serialized with an unknown codec version " + version +
". Was it ... | [
"public",
"static",
"void",
"decode",
"(",
"TransactionEdit",
"dest",
",",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"version",
"=",
"in",
".",
"readByte",
"(",
")",
";",
"TransactionEditCodec",
"codec",
"=",
"CODECS",
".",
"get",
"(",
... | Deserializes the encoded data from the given input stream, setting the values as fields
on the given {@code TransactionEdit} instances. This method expects first value in the
{code DataInput} to be a byte representing the codec version used to serialize the instance.
@param dest the transaction edit to populate with ... | [
"Deserializes",
"the",
"encoded",
"data",
"from",
"the",
"given",
"input",
"stream",
"setting",
"the",
"values",
"as",
"fields",
"on",
"the",
"given",
"{",
"@code",
"TransactionEdit",
"}",
"instances",
".",
"This",
"method",
"expects",
"first",
"value",
"in",
... | train | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/persist/TransactionEditCodecs.java#L60-L68 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.completeValueForList | protected FieldValueInfo completeValueForList(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Object result) {
"""
Called to complete a list of value for a field based on a list type. This iterates the values and calls
{@link #completeValue(ExecutionContext, ExecutionStrategyParameters... | java | protected FieldValueInfo completeValueForList(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Object result) {
Iterable<Object> resultIterable = toIterable(executionContext, parameters, result);
try {
resultIterable = parameters.getNonNullFieldValidator().validate(... | [
"protected",
"FieldValueInfo",
"completeValueForList",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
",",
"Object",
"result",
")",
"{",
"Iterable",
"<",
"Object",
">",
"resultIterable",
"=",
"toIterable",
"(",
"executionCon... | Called to complete a list of value for a field based on a list type. This iterates the values and calls
{@link #completeValue(ExecutionContext, ExecutionStrategyParameters)} for each value.
@param executionContext contains the top level execution parameters
@param parameters contains the parameters holding the ... | [
"Called",
"to",
"complete",
"a",
"list",
"of",
"value",
"for",
"a",
"field",
"based",
"on",
"a",
"list",
"type",
".",
"This",
"iterates",
"the",
"values",
"and",
"calls",
"{",
"@link",
"#completeValue",
"(",
"ExecutionContext",
"ExecutionStrategyParameters",
"... | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L462-L473 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.executeJavascript | public Object executeJavascript(String statementPattern, Object... parameters) {
"""
Executes Javascript in browser. If statementPattern contains the magic variable 'arguments'
the parameters will also be passed to the statement. In the latter case the parameters
must be a number, a boolean, a String, WebElement... | java | public Object executeJavascript(String statementPattern, Object... parameters) {
Object result;
String script = String.format(statementPattern, parameters);
if (statementPattern.contains("arguments")) {
result = executeScript(script, parameters);
} else {
result =... | [
"public",
"Object",
"executeJavascript",
"(",
"String",
"statementPattern",
",",
"Object",
"...",
"parameters",
")",
"{",
"Object",
"result",
";",
"String",
"script",
"=",
"String",
".",
"format",
"(",
"statementPattern",
",",
"parameters",
")",
";",
"if",
"("... | Executes Javascript in browser. If statementPattern contains the magic variable 'arguments'
the parameters will also be passed to the statement. In the latter case the parameters
must be a number, a boolean, a String, WebElement, or a List of any combination of the above.
@link http://selenium.googlecode.com/git/docs/a... | [
"Executes",
"Javascript",
"in",
"browser",
".",
"If",
"statementPattern",
"contains",
"the",
"magic",
"variable",
"arguments",
"the",
"parameters",
"will",
"also",
"be",
"passed",
"to",
"the",
"statement",
".",
"In",
"the",
"latter",
"case",
"the",
"parameters",... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L435-L444 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitTuple | public T visitTuple(Tuple elm, C context) {
"""
Visit a Tuple. This method will be called for
every node in the tree that is a Tuple.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
for (TupleElement element : elm.getElement()) {
... | java | public T visitTuple(Tuple elm, C context) {
for (TupleElement element : elm.getElement()) {
visitTupleElement(element, context);
}
return null;
} | [
"public",
"T",
"visitTuple",
"(",
"Tuple",
"elm",
",",
"C",
"context",
")",
"{",
"for",
"(",
"TupleElement",
"element",
":",
"elm",
".",
"getElement",
"(",
")",
")",
"{",
"visitTupleElement",
"(",
"element",
",",
"context",
")",
";",
"}",
"return",
"nu... | Visit a Tuple. This method will be called for
every node in the tree that is a Tuple.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"Tuple",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"Tuple",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L468-L473 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java | FlatFileUtils.trim | public static String
trim( String string, int pos ) {
"""
Removes all whitespace characters from the beginning and
end of the string starting from the given position.
"""
int len = string.length();
int leftPos = pos;
int rightPos = len;
for( ; rightPos > 0; --rightPos )
... | java | public static String
trim( String string, int pos )
{
int len = string.length();
int leftPos = pos;
int rightPos = len;
for( ; rightPos > 0; --rightPos )
{
char ch = string.charAt( rightPos - 1 );
if( ch != ' '
&& ch != '\t'
&& ch != '... | [
"public",
"static",
"String",
"trim",
"(",
"String",
"string",
",",
"int",
"pos",
")",
"{",
"int",
"len",
"=",
"string",
".",
"length",
"(",
")",
";",
"int",
"leftPos",
"=",
"pos",
";",
"int",
"rightPos",
"=",
"len",
";",
"for",
"(",
";",
"rightPos... | Removes all whitespace characters from the beginning and
end of the string starting from the given position. | [
"Removes",
"all",
"whitespace",
"characters",
"from",
"the",
"beginning",
"and",
"end",
"of",
"the",
"string",
"starting",
"from",
"the",
"given",
"position",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java#L32-L71 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPut | public void doHttpPut(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
"""
Performs PUT to supplied url of result's request.
@param url url to put to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType conte... | java | public void doHttpPut(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.put(url, result, headers, contentType);
} | [
"public",
"void",
"doHttpPut",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"contentType",
")",
"{",
"httpClient",
".",
"put",
"(",
"url",
",",
"result",
",",
"headers",
","... | Performs PUT to supplied url of result's request.
@param url url to put to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType contentType for request. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"result",
"s",
"request",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L344-L346 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeDuplicateCoordinates | public static GeometryCollection removeDuplicateCoordinates(GeometryCollection geometryCollection, double tolerance) throws SQLException {
"""
Removes duplicated coordinates within a GeometryCollection
@param geometryCollection
@param tolerance to delete the coordinates
@return
@throws java.sql.SQLException
... | java | public static GeometryCollection removeDuplicateCoordinates(GeometryCollection geometryCollection, double tolerance) throws SQLException {
ArrayList<Geometry> geoms = new ArrayList<>();
for (int i = 0; i < geometryCollection.getNumGeometries(); i++) {
Geometry geom = geometryCollection.getGe... | [
"public",
"static",
"GeometryCollection",
"removeDuplicateCoordinates",
"(",
"GeometryCollection",
"geometryCollection",
",",
"double",
"tolerance",
")",
"throws",
"SQLException",
"{",
"ArrayList",
"<",
"Geometry",
">",
"geoms",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | Removes duplicated coordinates within a GeometryCollection
@param geometryCollection
@param tolerance to delete the coordinates
@return
@throws java.sql.SQLException | [
"Removes",
"duplicated",
"coordinates",
"within",
"a",
"GeometryCollection"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L196-L203 |
alexvasilkov/Events | library/src/main/java/com/alexvasilkov/events/internal/Dispatcher.java | Dispatcher.scheduleStatusUpdates | @MainThread
private void scheduleStatusUpdates(Event event, EventStatus status) {
"""
Schedules status update of given event for all registered targets.
"""
for (EventTarget target : targets) {
for (EventMethod method : target.methods) {
if (event.getKey().equals(method.... | java | @MainThread
private void scheduleStatusUpdates(Event event, EventStatus status) {
for (EventTarget target : targets) {
for (EventMethod method : target.methods) {
if (event.getKey().equals(method.eventKey)
&& method.type == EventMethod.Type.STATUS) {
... | [
"@",
"MainThread",
"private",
"void",
"scheduleStatusUpdates",
"(",
"Event",
"event",
",",
"EventStatus",
"status",
")",
"{",
"for",
"(",
"EventTarget",
"target",
":",
"targets",
")",
"{",
"for",
"(",
"EventMethod",
"method",
":",
"target",
".",
"methods",
"... | Schedules status update of given event for all registered targets. | [
"Schedules",
"status",
"update",
"of",
"given",
"event",
"for",
"all",
"registered",
"targets",
"."
] | train | https://github.com/alexvasilkov/Events/blob/4208e11fab35d99229fe6c3b3d434ca1948f3fc5/library/src/main/java/com/alexvasilkov/events/internal/Dispatcher.java#L94-L105 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optBooleanArray | @Nullable
public static boolean[] optBooleanArray(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional boolean array value. In other words, returns the value mapped by key if it exists and is a boolean array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this met... | java | @Nullable
public static boolean[] optBooleanArray(@Nullable Bundle bundle, @Nullable String key) {
return optBooleanArray(bundle, key, new boolean[0]);
} | [
"@",
"Nullable",
"public",
"static",
"boolean",
"[",
"]",
"optBooleanArray",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optBooleanArray",
"(",
"bundle",
",",
"key",
",",
"new",
"boolean",
"[",
"0",... | Returns a optional boolean array value. In other words, returns the value mapped by key if it exists and is a boolean array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return a fallback value.
@param... | [
"Returns",
"a",
"optional",
"boolean",
"array",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"boolean",
"array",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"... | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L153-L156 |
alkacon/opencms-core | src/org/opencms/util/CmsRequestUtil.java | CmsRequestUtil.getSessionValue | public static Object getSessionValue(HttpServletRequest request, String key) {
"""
Reads an object from the session of the given HTTP request.<p>
A session will be initialized if the request does not currently have a session.
As a result, the request will always have a session after this method has been called... | java | public static Object getSessionValue(HttpServletRequest request, String key) {
HttpSession session = request.getSession(true);
return session.getAttribute(key);
} | [
"public",
"static",
"Object",
"getSessionValue",
"(",
"HttpServletRequest",
"request",
",",
"String",
"key",
")",
"{",
"HttpSession",
"session",
"=",
"request",
".",
"getSession",
"(",
"true",
")",
";",
"return",
"session",
".",
"getAttribute",
"(",
"key",
")"... | Reads an object from the session of the given HTTP request.<p>
A session will be initialized if the request does not currently have a session.
As a result, the request will always have a session after this method has been called.<p>
Will return <code>null</code> if no corresponding object is found in the session.<p>
... | [
"Reads",
"an",
"object",
"from",
"the",
"session",
"of",
"the",
"given",
"HTTP",
"request",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsRequestUtil.java#L729-L733 |
oboehm/jfachwert | src/main/java/de/jfachwert/post/PLZ.java | PLZ.getLand | public Locale getLand() {
"""
Liefert das Land, die der Landeskennung entspricht.
@return z.B. "de_CH" (fuer die Schweiz)
"""
String kennung = this.getLandeskennung();
switch (kennung) {
case "D": return new Locale("de", "DE");
case "A": return new Locale("de", "A... | java | public Locale getLand() {
String kennung = this.getLandeskennung();
switch (kennung) {
case "D": return new Locale("de", "DE");
case "A": return new Locale("de", "AT");
case "CH": return new Locale("de", "CH");
default: throw new UnsupportedOperati... | [
"public",
"Locale",
"getLand",
"(",
")",
"{",
"String",
"kennung",
"=",
"this",
".",
"getLandeskennung",
"(",
")",
";",
"switch",
"(",
"kennung",
")",
"{",
"case",
"\"D\"",
":",
"return",
"new",
"Locale",
"(",
"\"de\"",
",",
"\"DE\"",
")",
";",
"case",... | Liefert das Land, die der Landeskennung entspricht.
@return z.B. "de_CH" (fuer die Schweiz) | [
"Liefert",
"das",
"Land",
"die",
"der",
"Landeskennung",
"entspricht",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/post/PLZ.java#L188-L196 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/impl/LifecycleManager.java | LifecycleManager.unregisterQueryMBeans | private void unregisterQueryMBeans(ComponentRegistry cr, String cacheName) {
"""
Unregister query related MBeans for a cache, primarily the statistics, but also all other MBeans from the same
related group.
"""
if (mbeanServer != null) {
try {
InfinispanQueryStatisticsInfo stats = c... | java | private void unregisterQueryMBeans(ComponentRegistry cr, String cacheName) {
if (mbeanServer != null) {
try {
InfinispanQueryStatisticsInfo stats = cr.getComponent(InfinispanQueryStatisticsInfo.class);
if (stats != null) {
GlobalJmxStatisticsConfiguration jmxConfig ... | [
"private",
"void",
"unregisterQueryMBeans",
"(",
"ComponentRegistry",
"cr",
",",
"String",
"cacheName",
")",
"{",
"if",
"(",
"mbeanServer",
"!=",
"null",
")",
"{",
"try",
"{",
"InfinispanQueryStatisticsInfo",
"stats",
"=",
"cr",
".",
"getComponent",
"(",
"Infini... | Unregister query related MBeans for a cache, primarily the statistics, but also all other MBeans from the same
related group. | [
"Unregister",
"query",
"related",
"MBeans",
"for",
"a",
"cache",
"primarily",
"the",
"statistics",
"but",
"also",
"all",
"other",
"MBeans",
"from",
"the",
"same",
"related",
"group",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/impl/LifecycleManager.java#L426-L440 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java | FastDateFormat.getTimeInstance | public static FastDateFormat getTimeInstance(final int style, final Locale locale) {
"""
获得 {@link FastDateFormat} 实例<br>
支持缓存
@param style time style: FULL, LONG, MEDIUM, or SHORT
@param locale {@link Locale} 日期地理位置
@return 本地化 {@link FastDateFormat}
"""
return cache.getTimeInstance(style, null, local... | java | public static FastDateFormat getTimeInstance(final int style, final Locale locale) {
return cache.getTimeInstance(style, null, locale);
} | [
"public",
"static",
"FastDateFormat",
"getTimeInstance",
"(",
"final",
"int",
"style",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"cache",
".",
"getTimeInstance",
"(",
"style",
",",
"null",
",",
"locale",
")",
";",
"}"
] | 获得 {@link FastDateFormat} 实例<br>
支持缓存
@param style time style: FULL, LONG, MEDIUM, or SHORT
@param locale {@link Locale} 日期地理位置
@return 本地化 {@link FastDateFormat} | [
"获得",
"{",
"@link",
"FastDateFormat",
"}",
"实例<br",
">",
"支持缓存"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L182-L184 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/BingEntitiesImpl.java | BingEntitiesImpl.searchWithServiceResponseAsync | public Observable<ServiceResponse<SearchResponse>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
"""
The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, o... | java | public Observable<ServiceResponse<SearchResponse>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) {
if (query == null) {
throw new IllegalArgumentException("Parameter query is required and cannot be null.");
}
final String acceptLanguage... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"SearchResponse",
">",
">",
"searchWithServiceResponseAsync",
"(",
"String",
"query",
",",
"SearchOptionalParameter",
"searchOptionalParameter",
")",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"throw",
"new"... | The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Enti... | [
"The",
"Entity",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"search",
"results",
"that",
"include",
"entities",
"and",
"places",
".",
"Place",
"results",
"include",
"restaurants",
"hotel",
"or",
"other... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/BingEntitiesImpl.java#L121-L139 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_TITLE_Image | protected BufferedImage create_TITLE_Image(final int WIDTH, final int HEIGHT,
final boolean UNIT_STRING_VISIBLE) {
"""
Returns the image of the title.
@param WIDTH
@param HEIGHT
@param UNIT_STRING_VISIBLE
@return a buffered image of the title and un... | java | protected BufferedImage create_TITLE_Image(final int WIDTH, final int HEIGHT,
final boolean UNIT_STRING_VISIBLE) {
return create_TITLE_Image(WIDTH, HEIGHT, UNIT_STRING_VISIBLE, null);
} | [
"protected",
"BufferedImage",
"create_TITLE_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"boolean",
"UNIT_STRING_VISIBLE",
")",
"{",
"return",
"create_TITLE_Image",
"(",
"WIDTH",
",",
"HEIGHT",
",",
"UNIT_STRING_VISIBLE",
",",
... | Returns the image of the title.
@param WIDTH
@param HEIGHT
@param UNIT_STRING_VISIBLE
@return a buffered image of the title and unit string | [
"Returns",
"the",
"image",
"of",
"the",
"title",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L1085-L1088 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java | LowLevelMultiViewOps.computeNormalizationLL | public static void computeNormalizationLL(List<List<Point2D_F64>> points, NormalizationPoint2D normalize ) {
"""
Computes normalization when points are contained in a list of lists
@param points Input: List of observed points. Not modified.
@param normalize Output: 3x3 normalization matrix for first set of point... | java | public static void computeNormalizationLL(List<List<Point2D_F64>> points, NormalizationPoint2D normalize )
{
double meanX = 0;
double meanY = 0;
int count = 0;
for (int i = 0; i < points.size(); i++) {
List<Point2D_F64> l = points.get(i);
for (int j = 0; j < l.size(); j++) {
Point2D_F64 p = l.get(j... | [
"public",
"static",
"void",
"computeNormalizationLL",
"(",
"List",
"<",
"List",
"<",
"Point2D_F64",
">",
">",
"points",
",",
"NormalizationPoint2D",
"normalize",
")",
"{",
"double",
"meanX",
"=",
"0",
";",
"double",
"meanY",
"=",
"0",
";",
"int",
"count",
... | Computes normalization when points are contained in a list of lists
@param points Input: List of observed points. Not modified.
@param normalize Output: 3x3 normalization matrix for first set of points. Modified. | [
"Computes",
"normalization",
"when",
"points",
"are",
"contained",
"in",
"a",
"list",
"of",
"lists"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java#L82-L121 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java | ChecksumExtensions.getChecksum | public static String getChecksum(final File file, final Algorithm algorithm)
throws NoSuchAlgorithmException, IOException {
"""
Gets the checksum from the given file with an instance of the given algorithm.
@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance... | java | public static String getChecksum(final File file, final Algorithm algorithm)
throws NoSuchAlgorithmException, IOException
{
return getChecksum(file, algorithm.getAlgorithm());
} | [
"public",
"static",
"String",
"getChecksum",
"(",
"final",
"File",
"file",
",",
"final",
"Algorithm",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"return",
"getChecksum",
"(",
"file",
",",
"algorithm",
".",
"getAlgorithm",
"(",... | Gets the checksum from the given file with an instance of the given algorithm.
@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "MD5",
"SHA-1", "SHA-256", "SHA-384" or "SHA-512".
@return The checksum from the file as a String object.
@throws NoSuchAlgorithmExc... | [
"Gets",
"the",
"checksum",
"from",
"the",
"given",
"file",
"with",
"an",
"instance",
"of",
"the",
"given",
"algorithm",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L196-L200 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.initializeRoot | public void initializeRoot(String owner, String group, Mode mode, JournalContext context)
throws UnavailableException {
"""
Initializes the root of the inode tree.
@param owner the root owner
@param group the root group
@param mode the root mode
@param context the journal context to journal the initial... | java | public void initializeRoot(String owner, String group, Mode mode, JournalContext context)
throws UnavailableException {
if (mState.getRoot() == null) {
MutableInodeDirectory root = MutableInodeDirectory.create(
mDirectoryIdGenerator.getNewDirectoryId(context), NO_PARENT, ROOT_INODE_NAME,
... | [
"public",
"void",
"initializeRoot",
"(",
"String",
"owner",
",",
"String",
"group",
",",
"Mode",
"mode",
",",
"JournalContext",
"context",
")",
"throws",
"UnavailableException",
"{",
"if",
"(",
"mState",
".",
"getRoot",
"(",
")",
"==",
"null",
")",
"{",
"M... | Initializes the root of the inode tree.
@param owner the root owner
@param group the root group
@param mode the root mode
@param context the journal context to journal the initialization to | [
"Initializes",
"the",
"root",
"of",
"the",
"inode",
"tree",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L224-L235 |
JOML-CI/JOML | src/org/joml/Vector3f.java | Vector3f.set | public Vector3f set(int index, ByteBuffer buffer) {
"""
Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buff... | java | public Vector3f set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector3f",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3f.java#L356-L359 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java | WorkflowClient.getWorkflow | public Workflow getWorkflow(String workflowId, boolean includeTasks) {
"""
Retrieve a workflow by workflow id
@param workflowId the id of the workflow
@param includeTasks specify if the tasks in the workflow need to be returned
@return the requested workflow
"""
Preconditions.checkArgument(Strin... | java | public Workflow getWorkflow(String workflowId, boolean includeTasks) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
Workflow workflow = getForEntity("workflow/{workflowId}", new Object[]{"includeTasks", includeTasks}, Workflow.class, workflowId);
... | [
"public",
"Workflow",
"getWorkflow",
"(",
"String",
"workflowId",
",",
"boolean",
"includeTasks",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"workflow id cannot be blank\"",
")",
";",
"Workf... | Retrieve a workflow by workflow id
@param workflowId the id of the workflow
@param includeTasks specify if the tasks in the workflow need to be returned
@return the requested workflow | [
"Retrieve",
"a",
"workflow",
"by",
"workflow",
"id"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java#L144-L149 |
netty/netty | buffer/src/main/java/io/netty/buffer/PoolThreadCache.java | PoolThreadCache.allocateSmall | boolean allocateSmall(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) {
"""
Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise
"""
return allocate(cacheForSmall(area, normCapacity), buf, reqCapacity);
} | java | boolean allocateSmall(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) {
return allocate(cacheForSmall(area, normCapacity), buf, reqCapacity);
} | [
"boolean",
"allocateSmall",
"(",
"PoolArena",
"<",
"?",
">",
"area",
",",
"PooledByteBuf",
"<",
"?",
">",
"buf",
",",
"int",
"reqCapacity",
",",
"int",
"normCapacity",
")",
"{",
"return",
"allocate",
"(",
"cacheForSmall",
"(",
"area",
",",
"normCapacity",
... | Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise | [
"Try",
"to",
"allocate",
"a",
"small",
"buffer",
"out",
"of",
"the",
"cache",
".",
"Returns",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L172-L174 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/DispatcherServlet.java | DispatcherServlet.selectTemplate | protected Template selectTemplate (int siteId, InvocationContext ctx)
throws ResourceNotFoundException, ParseErrorException, Exception {
"""
This method is called to select the appropriate template for this request. The default
implementation simply loads the template using Velocity's default template loa... | java | protected Template selectTemplate (int siteId, InvocationContext ctx)
throws ResourceNotFoundException, ParseErrorException, Exception
{
String path = ctx.getRequest().getServletPath();
if (_usingSiteLoading) {
// if we're using site resource loading, we need to prefix the path w... | [
"protected",
"Template",
"selectTemplate",
"(",
"int",
"siteId",
",",
"InvocationContext",
"ctx",
")",
"throws",
"ResourceNotFoundException",
",",
"ParseErrorException",
",",
"Exception",
"{",
"String",
"path",
"=",
"ctx",
".",
"getRequest",
"(",
")",
".",
"getSer... | This method is called to select the appropriate template for this request. The default
implementation simply loads the template using Velocity's default template loading services
based on the URI provided in the request.
@param ctx The context of this request.
@return The template to be used in generating the respons... | [
"This",
"method",
"is",
"called",
"to",
"select",
"the",
"appropriate",
"template",
"for",
"this",
"request",
".",
"The",
"default",
"implementation",
"simply",
"loads",
"the",
"template",
"using",
"Velocity",
"s",
"default",
"template",
"loading",
"services",
"... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/DispatcherServlet.java#L504-L515 |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.isParentLoader | private boolean isParentLoader(ClassLoader parent, ClassLoader child) {
"""
Returns true if 'parent' is a parent classloader of 'child'.
@param parent the classloader to test as a parent.
@param child the classloader to test as a child.
"""
for (; child != null; child = child.getParent()) {
if (c... | java | private boolean isParentLoader(ClassLoader parent, ClassLoader child)
{
for (; child != null; child = child.getParent()) {
if (child == parent)
return true;
}
return false;
} | [
"private",
"boolean",
"isParentLoader",
"(",
"ClassLoader",
"parent",
",",
"ClassLoader",
"child",
")",
"{",
"for",
"(",
";",
"child",
"!=",
"null",
";",
"child",
"=",
"child",
".",
"getParent",
"(",
")",
")",
"{",
"if",
"(",
"child",
"==",
"parent",
"... | Returns true if 'parent' is a parent classloader of 'child'.
@param parent the classloader to test as a parent.
@param child the classloader to test as a child. | [
"Returns",
"true",
"if",
"parent",
"is",
"a",
"parent",
"classloader",
"of",
"child",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L453-L461 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/view/AddSourceActivity.java | AddSourceActivity.newIntent | @NonNull
public static Intent newIntent(@NonNull Context context,
boolean requirePostalField,
boolean updatesCustomer) {
"""
Create an {@link Intent} to start a {@link AddSourceActivity}.
@param context the {@link Context} used to launch ... | java | @NonNull
public static Intent newIntent(@NonNull Context context,
boolean requirePostalField,
boolean updatesCustomer) {
return new Intent(context, AddSourceActivity.class)
.putExtra(EXTRA_SHOW_ZIP, requirePostalField)
... | [
"@",
"NonNull",
"public",
"static",
"Intent",
"newIntent",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"boolean",
"requirePostalField",
",",
"boolean",
"updatesCustomer",
")",
"{",
"return",
"new",
"Intent",
"(",
"context",
",",
"AddSourceActivity",
".",
"cl... | Create an {@link Intent} to start a {@link AddSourceActivity}.
@param context the {@link Context} used to launch the activity
@param requirePostalField {@code true} to require a postal code field
@param updatesCustomer {@code true} if the activity should update using an
already-initialized {@link CustomerSession}, or ... | [
"Create",
"an",
"{",
"@link",
"Intent",
"}",
"to",
"start",
"a",
"{",
"@link",
"AddSourceActivity",
"}",
"."
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/AddSourceActivity.java#L75-L82 |
landawn/AbacusUtil | src/com/landawn/abacus/util/StringUtil.java | StringUtil.reverseDelimited | public static String reverseDelimited(final String str, final char delimiter) {
"""
<p>
Reverses a String that is delimited by a specific character.
</p>
<p>
The Strings between the delimiters are not reversed. Thus
java.lang.String becomes String.lang.java (if the delimiter is
{@code '.'}).
</p>
<pre>... | java | public static String reverseDelimited(final String str, final char delimiter) {
if (N.isNullOrEmpty(str)) {
return str;
}
// could implement manually, but simple way is to reuse other,
// probably slower, methods.
final String[] strs = split(str, delimiter);
... | [
"public",
"static",
"String",
"reverseDelimited",
"(",
"final",
"String",
"str",
",",
"final",
"char",
"delimiter",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"// could implement manually, but simple w... | <p>
Reverses a String that is delimited by a specific character.
</p>
<p>
The Strings between the delimiters are not reversed. Thus
java.lang.String becomes String.lang.java (if the delimiter is
{@code '.'}).
</p>
<pre>
N.reverseDelimited(null, *) = null
N.reverseDelimited("", *) = ""
N.reverseDelimited("... | [
"<p",
">",
"Reverses",
"a",
"String",
"that",
"is",
"delimited",
"by",
"a",
"specific",
"character",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L219-L231 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.fromHex | public static String fromHex(String string, int minLength, Pattern separator) {
"""
Parse a list of hex numbers and return a string
@param string String of hex numbers.
@param minLength Minimal length.
@param separator Separator.
@return A string from hex numbers.
"""
StringBuilder buffer = new Str... | java | public static String fromHex(String string, int minLength, Pattern separator) {
StringBuilder buffer = new StringBuilder();
String[] parts = separator.split(string);
for (String part : parts) {
if (part.length() < minLength) {
throw new IllegalArgumentException("code ... | [
"public",
"static",
"String",
"fromHex",
"(",
"String",
"string",
",",
"int",
"minLength",
",",
"Pattern",
"separator",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"[",
"]",
"parts",
"=",
"separator",
".",
"sp... | Parse a list of hex numbers and return a string
@param string String of hex numbers.
@param minLength Minimal length.
@param separator Separator.
@return A string from hex numbers. | [
"Parse",
"a",
"list",
"of",
"hex",
"numbers",
"and",
"return",
"a",
"string"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L1802-L1813 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/RestTool.java | RestTool.addRequestHttpHeader | public void addRequestHttpHeader(Map<String, String> httpHeader) {
"""
Adds HTTP headers as name/value pairs into the request.
@param httpHeader Collection of headers name/value pairs.
"""
if (this.requestHttpHeaders == null)
this.requestHttpHeaders = new HashMap<>();
this.requ... | java | public void addRequestHttpHeader(Map<String, String> httpHeader) {
if (this.requestHttpHeaders == null)
this.requestHttpHeaders = new HashMap<>();
this.requestHttpHeaders.putAll(httpHeader);
} | [
"public",
"void",
"addRequestHttpHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"httpHeader",
")",
"{",
"if",
"(",
"this",
".",
"requestHttpHeaders",
"==",
"null",
")",
"this",
".",
"requestHttpHeaders",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",... | Adds HTTP headers as name/value pairs into the request.
@param httpHeader Collection of headers name/value pairs. | [
"Adds",
"HTTP",
"headers",
"as",
"name",
"/",
"value",
"pairs",
"into",
"the",
"request",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/RestTool.java#L74-L80 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/net/IpHelper.java | IpHelper.stoa | public static InetAddress stoa(final String ip) {
"""
Parses an IP address, returning it as an InetAddress<br />
This method exists to prevent code which is handling valid IP addresses from having to catch UnknownHostException
excessively (when there is often no choice but to totally fail out anyway)
@param i... | java | public static InetAddress stoa(final String ip)
{
if (ip == null || ip.isEmpty())
throw new IllegalArgumentException("must pass a valid ip: null or empty strings are not valid IPs!");
try
{
return InetAddress.getByName(ip);
}
catch (UnknownHostException e)
{
throw new IllegalArgumentException("mu... | [
"public",
"static",
"InetAddress",
"stoa",
"(",
"final",
"String",
"ip",
")",
"{",
"if",
"(",
"ip",
"==",
"null",
"||",
"ip",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"must pass a valid ip: null or empty strings are not val... | Parses an IP address, returning it as an InetAddress<br />
This method exists to prevent code which is handling valid IP addresses from having to catch UnknownHostException
excessively (when there is often no choice but to totally fail out anyway)
@param ip
a valid IP address (IPv4 or IPv6)
@return the resulting Inet... | [
"Parses",
"an",
"IP",
"address",
"returning",
"it",
"as",
"an",
"InetAddress<br",
"/",
">",
"This",
"method",
"exists",
"to",
"prevent",
"code",
"which",
"is",
"handling",
"valid",
"IP",
"addresses",
"from",
"having",
"to",
"catch",
"UnknownHostException",
"ex... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/net/IpHelper.java#L674-L687 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/vm_template.java | vm_template.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
vm_template_responses result = (vm_template_responses) service.get_payl... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
vm_template_responses result = (vm_template_responses) service.get_payload_formatter().string_to_resource(vm_template_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode =... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"vm_template_responses",
"result",
"=",
"(",
"vm_template_responses",
")",
"service",
".",
"get_payload_format... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/vm_template.java#L296-L313 |
js-lib-com/dom | src/main/java/js/dom/w3c/EntityResolverImpl.java | EntityResolverImpl.resolveEntity | @Override
public InputSource resolveEntity(String publicId, String systemId) {
"""
Get input source for entity definition file identified by public and system ID.
"""
String r = map.get(publicId);
return r == null ? null : new InputSource(Resources.stream(r));
} | java | @Override
public InputSource resolveEntity(String publicId, String systemId)
{
String r = map.get(publicId);
return r == null ? null : new InputSource(Resources.stream(r));
} | [
"@",
"Override",
"public",
"InputSource",
"resolveEntity",
"(",
"String",
"publicId",
",",
"String",
"systemId",
")",
"{",
"String",
"r",
"=",
"map",
".",
"get",
"(",
"publicId",
")",
";",
"return",
"r",
"==",
"null",
"?",
"null",
":",
"new",
"InputSourc... | Get input source for entity definition file identified by public and system ID. | [
"Get",
"input",
"source",
"for",
"entity",
"definition",
"file",
"identified",
"by",
"public",
"and",
"system",
"ID",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/EntityResolverImpl.java#L40-L45 |
OpenTSDB/opentsdb | src/meta/UIDMeta.java | UIDMeta.getUIDMeta | public static Deferred<UIDMeta> getUIDMeta(final TSDB tsdb,
final UniqueIdType type, final String uid) {
"""
Convenience overload of {@code getUIDMeta(TSDB, UniqueIdType, byte[])}
@param tsdb The TSDB to use for storage access
@param type The type of UID to fetch
@param uid The ID of the meta to fetch
@... | java | public static Deferred<UIDMeta> getUIDMeta(final TSDB tsdb,
final UniqueIdType type, final String uid) {
return getUIDMeta(tsdb, type, UniqueId.stringToUid(uid));
} | [
"public",
"static",
"Deferred",
"<",
"UIDMeta",
">",
"getUIDMeta",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"UniqueIdType",
"type",
",",
"final",
"String",
"uid",
")",
"{",
"return",
"getUIDMeta",
"(",
"tsdb",
",",
"type",
",",
"UniqueId",
".",
"stringT... | Convenience overload of {@code getUIDMeta(TSDB, UniqueIdType, byte[])}
@param tsdb The TSDB to use for storage access
@param type The type of UID to fetch
@param uid The ID of the meta to fetch
@return A UIDMeta from storage or a default
@throws HBaseException if there was an issue fetching
@throws NoSuchUniqueId If th... | [
"Convenience",
"overload",
"of",
"{"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/UIDMeta.java#L340-L343 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/location.java | location.getLocationByCoordinates | public static LocationModel getLocationByCoordinates(Double latitude, Double longitude ) {
"""
Gets the location by Coordinates
@param latitude
@param longitude
@return Location model
"""
try {
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(... | java | public static LocationModel getLocationByCoordinates(Double latitude, Double longitude ){
try {
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(QuickUtils.getContext());
addresses = geocoder.getFromLocation(latitude, longitude, 1);
... | [
"public",
"static",
"LocationModel",
"getLocationByCoordinates",
"(",
"Double",
"latitude",
",",
"Double",
"longitude",
")",
"{",
"try",
"{",
"Geocoder",
"geocoder",
";",
"List",
"<",
"Address",
">",
"addresses",
";",
"geocoder",
"=",
"new",
"Geocoder",
"(",
"... | Gets the location by Coordinates
@param latitude
@param longitude
@return Location model | [
"Gets",
"the",
"location",
"by",
"Coordinates"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/location.java#L24-L55 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java | BigSegmentHeader.tryUpgradeUpdateToWriteLockMillis | private static boolean tryUpgradeUpdateToWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
"""
Use a timer which is more insensitive to jumps in time like GCs and context switches.
"""
long lastTime = System.currentTimeMillis();
r... | java | private static boolean tryUpgradeUpdateToWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
long lastTime = System.currentTimeMillis();
registerWait(address);
try {
do {
if (tryUpgradeUpdateToWriteLockAnd... | [
"private",
"static",
"boolean",
"tryUpgradeUpdateToWriteLockMillis",
"(",
"long",
"address",
",",
"long",
"timeInMillis",
",",
"boolean",
"interruptible",
")",
"throws",
"InterruptedException",
"{",
"long",
"lastTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")"... | Use a timer which is more insensitive to jumps in time like GCs and context switches. | [
"Use",
"a",
"timer",
"which",
"is",
"more",
"insensitive",
"to",
"jumps",
"in",
"time",
"like",
"GCs",
"and",
"context",
"switches",
"."
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java#L315-L336 |
greatman/GreatmancodeTools | src/main/java/com/greatmancode/tools/utils/Vector.java | Vector.getMinimum | public static Vector getMinimum(Vector v1, Vector v2) {
"""
Gets the minimum components of two vectors.
@param v1 The first vector.
@param v2 The second vector.
@return minimum
"""
return new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y), Math.min(v1.z, v2.z));
} | java | public static Vector getMinimum(Vector v1, Vector v2) {
return new Vector(Math.min(v1.x, v2.x), Math.min(v1.y, v2.y), Math.min(v1.z, v2.z));
} | [
"public",
"static",
"Vector",
"getMinimum",
"(",
"Vector",
"v1",
",",
"Vector",
"v2",
")",
"{",
"return",
"new",
"Vector",
"(",
"Math",
".",
"min",
"(",
"v1",
".",
"x",
",",
"v2",
".",
"x",
")",
",",
"Math",
".",
"min",
"(",
"v1",
".",
"y",
","... | Gets the minimum components of two vectors.
@param v1 The first vector.
@param v2 The second vector.
@return minimum | [
"Gets",
"the",
"minimum",
"components",
"of",
"two",
"vectors",
"."
] | train | https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L599-L601 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTWebDateHelper.java | PDTWebDateHelper.extractDateTimeZone | @Nonnull
public static WithZoneId extractDateTimeZone (@Nonnull final String sDate) {
"""
Extract the time zone from the passed string. UTC and GMT are supported.
@param sDate
The date string.
@return A non-<code>null</code> {@link WithZoneId}, where the remaining
string to be parsed (never <code>null</cod... | java | @Nonnull
public static WithZoneId extractDateTimeZone (@Nonnull final String sDate)
{
ValueEnforcer.notNull (sDate, "Date");
final int nDateLen = sDate.length ();
for (final PDTZoneID aSupp : PDTZoneID.getDefaultZoneIDs ())
{
final String sDTZ = aSupp.getZoneIDString ();
if (sDate.endsW... | [
"@",
"Nonnull",
"public",
"static",
"WithZoneId",
"extractDateTimeZone",
"(",
"@",
"Nonnull",
"final",
"String",
"sDate",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sDate",
",",
"\"Date\"",
")",
";",
"final",
"int",
"nDateLen",
"=",
"sDate",
".",
"leng... | Extract the time zone from the passed string. UTC and GMT are supported.
@param sDate
The date string.
@return A non-<code>null</code> {@link WithZoneId}, where the remaining
string to be parsed (never <code>null</code>) and and the extracted
time zone (may be <code>null</code>) are contained. | [
"Extract",
"the",
"time",
"zone",
"from",
"the",
"passed",
"string",
".",
"UTC",
"and",
"GMT",
"are",
"supported",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTWebDateHelper.java#L239-L254 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/formatters/BitMask.java | BitMask.toBitMask | private static <T extends Number> String toBitMask(T bitmask, int length) {
"""
Parametric version of the method, which dumps any number as bitmask.
@param bitmask
the number to be formatted as a bitmask.
@param length
the length (in bits) of the type (e.g. int's are 32 bits).
@return
a bitmask (1's and 0'... | java | private static <T extends Number> String toBitMask(T bitmask, int length) {
StringBuilder buffer = new StringBuilder();
long bit = 1;
for(int i = 0; i < length; ++i) {
if(i != 0 && i % 8 == 0) {
buffer.append(" ");
} else if(i != 0 && i % 4 == 0) {
buffer.append(":");
}
if((bit & bitmask.longV... | [
"private",
"static",
"<",
"T",
"extends",
"Number",
">",
"String",
"toBitMask",
"(",
"T",
"bitmask",
",",
"int",
"length",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"long",
"bit",
"=",
"1",
";",
"for",
"(",
"int",... | Parametric version of the method, which dumps any number as bitmask.
@param bitmask
the number to be formatted as a bitmask.
@param length
the length (in bits) of the type (e.g. int's are 32 bits).
@return
a bitmask (1's and 0's) representation of the given Number. | [
"Parametric",
"version",
"of",
"the",
"method",
"which",
"dumps",
"any",
"number",
"as",
"bitmask",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/formatters/BitMask.java#L74-L91 |
thrau/jarchivelib | src/main/java/org/rauschig/jarchivelib/CommonsStreamFactory.java | CommonsStreamFactory.createCompressorOutputStream | static CompressorOutputStream createCompressorOutputStream(CommonsCompressor compressor, File destination)
throws IOException, CompressorException {
"""
Uses the {@link CompressorStreamFactory} and the name of the given compressor to create a new
{@link CompressorOutputStream} for the given destination {@... | java | static CompressorOutputStream createCompressorOutputStream(CommonsCompressor compressor, File destination)
throws IOException, CompressorException {
return createCompressorOutputStream(compressor.getCompressionType(), destination);
} | [
"static",
"CompressorOutputStream",
"createCompressorOutputStream",
"(",
"CommonsCompressor",
"compressor",
",",
"File",
"destination",
")",
"throws",
"IOException",
",",
"CompressorException",
"{",
"return",
"createCompressorOutputStream",
"(",
"compressor",
".",
"getCompres... | Uses the {@link CompressorStreamFactory} and the name of the given compressor to create a new
{@link CompressorOutputStream} for the given destination {@link File}.
@param compressor the invoking compressor
@param destination the file to create the {@link CompressorOutputStream} for
@return a new {@link CompressorOutp... | [
"Uses",
"the",
"{",
"@link",
"CompressorStreamFactory",
"}",
"and",
"the",
"name",
"of",
"the",
"given",
"compressor",
"to",
"create",
"a",
"new",
"{",
"@link",
"CompressorOutputStream",
"}",
"for",
"the",
"given",
"destination",
"{",
"@link",
"File",
"}",
"... | train | https://github.com/thrau/jarchivelib/blob/8afee5124c588f589306796985b722d63572bbfa/src/main/java/org/rauschig/jarchivelib/CommonsStreamFactory.java#L180-L183 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Partition.java | Partition.withParameters | public Partition withParameters(java.util.Map<String, String> parameters) {
"""
<p>
These key-value pairs define partition parameters.
</p>
@param parameters
These key-value pairs define partition parameters.
@return Returns a reference to this object so that method calls can be chained together.
"""
... | java | public Partition withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"Partition",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
These key-value pairs define partition parameters.
</p>
@param parameters
These key-value pairs define partition parameters.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"These",
"key",
"-",
"value",
"pairs",
"define",
"partition",
"parameters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/Partition.java#L385-L388 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/workflow/SequenceProcessor.java | SequenceProcessor.processShouldStop | private boolean processShouldStop(WorkflowContext workflowContext, Activity activity) {
"""
Determine if the process should stop
@param workflowContext
the current process context
@param activity
the current activity in the iteration
"""
if (workflowContext != null && workflowContext.stopProcess()) {
... | java | private boolean processShouldStop(WorkflowContext workflowContext, Activity activity) {
if (workflowContext != null && workflowContext.stopProcess()) {
return true;
}
return false;
} | [
"private",
"boolean",
"processShouldStop",
"(",
"WorkflowContext",
"workflowContext",
",",
"Activity",
"activity",
")",
"{",
"if",
"(",
"workflowContext",
"!=",
"null",
"&&",
"workflowContext",
".",
"stopProcess",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Determine if the process should stop
@param workflowContext
the current process context
@param activity
the current activity in the iteration | [
"Determine",
"if",
"the",
"process",
"should",
"stop"
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/workflow/SequenceProcessor.java#L105-L110 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/GenUtil.java | GenUtil.cloneArgument | public static String cloneArgument (Class<?> dsclazz, Field field, String name) {
"""
Potentially clones the supplied argument if it is the type that needs such treatment.
"""
Class<?> clazz = field.getType();
if (clazz.isArray() || dsclazz.equals(clazz)) {
return "(" + name + " == ... | java | public static String cloneArgument (Class<?> dsclazz, Field field, String name)
{
Class<?> clazz = field.getType();
if (clazz.isArray() || dsclazz.equals(clazz)) {
return "(" + name + " == null) ? null : " + name + ".clone()";
} else if (dsclazz.isAssignableFrom(clazz)) {
... | [
"public",
"static",
"String",
"cloneArgument",
"(",
"Class",
"<",
"?",
">",
"dsclazz",
",",
"Field",
"field",
",",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"field",
".",
"getType",
"(",
")",
";",
"if",
"(",
"clazz",
".",
"i... | Potentially clones the supplied argument if it is the type that needs such treatment. | [
"Potentially",
"clones",
"the",
"supplied",
"argument",
"if",
"it",
"is",
"the",
"type",
"that",
"needs",
"such",
"treatment",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenUtil.java#L189-L200 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.controlsStateChange | public static Pattern controlsStateChange() {
"""
Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change
reaction of another EntityReference.
@return the pattern
"""
Pattern p = new Pattern(SequenceEntityReference.class, "controller ER");
p.add(linkedER(true), "contr... | java | public static Pattern controlsStateChange()
{
Pattern p = new Pattern(SequenceEntityReference.class, "controller ER");
p.add(linkedER(true), "controller ER", "generic controller ER");
p.add(erToPE(), "generic controller ER", "controller simple PE");
p.add(linkToComplex(), "controller simple PE", "controller PE... | [
"public",
"static",
"Pattern",
"controlsStateChange",
"(",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"SequenceEntityReference",
".",
"class",
",",
"\"controller ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",
"true",
")",
",",
"\"controll... | Pattern for a EntityReference has a member PhysicalEntity that is controlling a state change
reaction of another EntityReference.
@return the pattern | [
"Pattern",
"for",
"a",
"EntityReference",
"has",
"a",
"member",
"PhysicalEntity",
"that",
"is",
"controlling",
"a",
"state",
"change",
"reaction",
"of",
"another",
"EntityReference",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L28-L54 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/SloppyMath.java | SloppyMath.exactBinomial | public static double exactBinomial(int k, int n, double p) {
"""
Find a one tailed exact binomial test probability. Finds the chance
of this or a higher result
@param k number of successes
@param n Number of trials
@param p Probability of a success
"""
double total = 0.0;
for (int m = k; m <= ... | java | public static double exactBinomial(int k, int n, double p) {
double total = 0.0;
for (int m = k; m <= n; m++) {
double nChooseM = 1.0;
for (int r = 1; r <= m; r++) {
nChooseM *= (n - r) + 1;
nChooseM /= r;
}
// System.out.println(n + " choose " + m + " is " + nCho... | [
"public",
"static",
"double",
"exactBinomial",
"(",
"int",
"k",
",",
"int",
"n",
",",
"double",
"p",
")",
"{",
"double",
"total",
"=",
"0.0",
";",
"for",
"(",
"int",
"m",
"=",
"k",
";",
"m",
"<=",
"n",
";",
"m",
"++",
")",
"{",
"double",
"nChoo... | Find a one tailed exact binomial test probability. Finds the chance
of this or a higher result
@param k number of successes
@param n Number of trials
@param p Probability of a success | [
"Find",
"a",
"one",
"tailed",
"exact",
"binomial",
"test",
"probability",
".",
"Finds",
"the",
"chance",
"of",
"this",
"or",
"a",
"higher",
"result"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/SloppyMath.java#L509-L523 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.keyDefault | public String keyDefault(String keyName, String defaultValue) {
"""
Returns the localized resource string for the given message key,
checking the workplace default resources and all module bundles.<p>
If the key was not found, the provided default value
is returned.<p>
@param keyName the key for the desire... | java | public String keyDefault(String keyName, String defaultValue) {
return getMessages().keyDefault(keyName, defaultValue);
} | [
"public",
"String",
"keyDefault",
"(",
"String",
"keyName",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getMessages",
"(",
")",
".",
"keyDefault",
"(",
"keyName",
",",
"defaultValue",
")",
";",
"}"
] | Returns the localized resource string for the given message key,
checking the workplace default resources and all module bundles.<p>
If the key was not found, the provided default value
is returned.<p>
@param keyName the key for the desired string
@param defaultValue the default value in case the key does not exist i... | [
"Returns",
"the",
"localized",
"resource",
"string",
"for",
"the",
"given",
"message",
"key",
"checking",
"the",
"workplace",
"default",
"resources",
"and",
"all",
"module",
"bundles",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1916-L1919 |
apache/incubator-druid | server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java | CoordinatorClient.isHandOffComplete | @Nullable
public Boolean isHandOffComplete(String dataSource, SegmentDescriptor descriptor) {
"""
Checks the given segment is handed off or not.
It can return null if the HTTP call returns 404 which can happen during rolling update.
"""
try {
FullResponseHolder response = druidLeaderClient.go(
... | java | @Nullable
public Boolean isHandOffComplete(String dataSource, SegmentDescriptor descriptor)
{
try {
FullResponseHolder response = druidLeaderClient.go(
druidLeaderClient.makeRequest(
HttpMethod.GET,
StringUtils.format(
"/druid/coordinator/v1/datasour... | [
"@",
"Nullable",
"public",
"Boolean",
"isHandOffComplete",
"(",
"String",
"dataSource",
",",
"SegmentDescriptor",
"descriptor",
")",
"{",
"try",
"{",
"FullResponseHolder",
"response",
"=",
"druidLeaderClient",
".",
"go",
"(",
"druidLeaderClient",
".",
"makeRequest",
... | Checks the given segment is handed off or not.
It can return null if the HTTP call returns 404 which can happen during rolling update. | [
"Checks",
"the",
"given",
"segment",
"is",
"handed",
"off",
"or",
"not",
".",
"It",
"can",
"return",
"null",
"if",
"the",
"HTTP",
"call",
"returns",
"404",
"which",
"can",
"happen",
"during",
"rolling",
"update",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java#L59-L94 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.foldLeft | public double foldLeft(double seed, DoubleBinaryOperator accumulator) {
"""
Folds the elements of this stream using the provided seed object and
accumulation function, going left to right. This is equivalent to:
<pre>
{@code
double result = identity;
for (double element : this stream)
result = accumulator.... | java | public double foldLeft(double seed, DoubleBinaryOperator accumulator) {
double[] box = new double[] { seed };
forEachOrdered(t -> box[0] = accumulator.applyAsDouble(box[0], t));
return box[0];
} | [
"public",
"double",
"foldLeft",
"(",
"double",
"seed",
",",
"DoubleBinaryOperator",
"accumulator",
")",
"{",
"double",
"[",
"]",
"box",
"=",
"new",
"double",
"[",
"]",
"{",
"seed",
"}",
";",
"forEachOrdered",
"(",
"t",
"->",
"box",
"[",
"0",
"]",
"=",
... | Folds the elements of this stream using the provided seed object and
accumulation function, going left to right. This is equivalent to:
<pre>
{@code
double result = identity;
for (double element : this stream)
result = accumulator.apply(result, element)
return result;
}
</pre>
<p>
This is a terminal operation.
<p>
T... | [
"Folds",
"the",
"elements",
"of",
"this",
"stream",
"using",
"the",
"provided",
"seed",
"object",
"and",
"accumulation",
"function",
"going",
"left",
"to",
"right",
".",
"This",
"is",
"equivalent",
"to",
":"
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L714-L718 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java | HtmlTableRendererBase.encodeBegin | public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {
"""
Render the necessary bits that come before any actual <i>rows</i> in the table.
@see javax.faces.render.Renderer#encodeBegin(FacesContext, UIComponent)
"""
RendererUtils.checkParamValidity(facesConte... | java | public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException
{
RendererUtils.checkParamValidity(facesContext, uiComponent, UIData.class);
Map<String, List<ClientBehavior>> behaviors = null;
if (uiComponent instanceof ClientBehaviorHolder)
{
... | [
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"facesContext",
",",
"UIComponent",
"uiComponent",
")",
"throws",
"IOException",
"{",
"RendererUtils",
".",
"checkParamValidity",
"(",
"facesContext",
",",
"uiComponent",
",",
"UIData",
".",
"class",
")",
";",
... | Render the necessary bits that come before any actual <i>rows</i> in the table.
@see javax.faces.render.Renderer#encodeBegin(FacesContext, UIComponent) | [
"Render",
"the",
"necessary",
"bits",
"that",
"come",
"before",
"any",
"actual",
"<i",
">",
"rows<",
"/",
"i",
">",
"in",
"the",
"table",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java#L111-L128 |
icode/ameba | src/main/java/ameba/core/Application.java | Application.readAppConfig | public static URL readAppConfig(Properties properties, String confFile) {
"""
<p>readAppConfig.</p>
@param properties a {@link java.util.Properties} object.
@param confFile a {@link java.lang.String} object.
@return a {@link java.net.URL} object.
"""
Enumeration<URL> urls = IOUtils.getResources(... | java | public static URL readAppConfig(Properties properties, String confFile) {
Enumeration<URL> urls = IOUtils.getResources(confFile);
URL url = null;
if (urls.hasMoreElements()) {
InputStream in = null;
Set<URL> urlSet = Sets.newHashSet(Iterators.forEnumeration(urls));
... | [
"public",
"static",
"URL",
"readAppConfig",
"(",
"Properties",
"properties",
",",
"String",
"confFile",
")",
"{",
"Enumeration",
"<",
"URL",
">",
"urls",
"=",
"IOUtils",
".",
"getResources",
"(",
"confFile",
")",
";",
"URL",
"url",
"=",
"null",
";",
"if",
... | <p>readAppConfig.</p>
@param properties a {@link java.util.Properties} object.
@param confFile a {@link java.lang.String} object.
@return a {@link java.net.URL} object. | [
"<p",
">",
"readAppConfig",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Application.java#L313-L340 |
meertensinstituut/mtas | src/main/java/mtas/analysis/util/MtasFetchData.java | MtasFetchData.getString | private String getString() throws MtasParserException {
"""
Gets the string.
@return the string
@throws MtasParserException the mtas parser exception
"""
String text = null;
BufferedReader bufferedReader = new BufferedReader(reader, 2048);
try {
text = IOUtils.toString(bufferedReader);
... | java | private String getString() throws MtasParserException {
String text = null;
BufferedReader bufferedReader = new BufferedReader(reader, 2048);
try {
text = IOUtils.toString(bufferedReader);
bufferedReader.close();
return text;
} catch (IOException e) {
log.debug(e);
throw ne... | [
"private",
"String",
"getString",
"(",
")",
"throws",
"MtasParserException",
"{",
"String",
"text",
"=",
"null",
";",
"BufferedReader",
"bufferedReader",
"=",
"new",
"BufferedReader",
"(",
"reader",
",",
"2048",
")",
";",
"try",
"{",
"text",
"=",
"IOUtils",
... | Gets the string.
@return the string
@throws MtasParserException the mtas parser exception | [
"Gets",
"the",
"string",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/util/MtasFetchData.java#L47-L58 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/Controller.java | Controller.sendPermanentCookie | public void sendPermanentCookie(String name, String value) {
"""
Sends long to live cookie to browse with response. This cookie will be asked to live for 20 years.
@param name name of cookie
@param value value of cookie.
"""
context.addCookie(Cookie.builder(name, value).setMaxAge(Cookie.ONE_YEAR * ... | java | public void sendPermanentCookie(String name, String value) {
context.addCookie(Cookie.builder(name, value).setMaxAge(Cookie.ONE_YEAR * 20).build());
} | [
"public",
"void",
"sendPermanentCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"context",
".",
"addCookie",
"(",
"Cookie",
".",
"builder",
"(",
"name",
",",
"value",
")",
".",
"setMaxAge",
"(",
"Cookie",
".",
"ONE_YEAR",
"*",
"20",
")"... | Sends long to live cookie to browse with response. This cookie will be asked to live for 20 years.
@param name name of cookie
@param value value of cookie. | [
"Sends",
"long",
"to",
"live",
"cookie",
"to",
"browse",
"with",
"response",
".",
"This",
"cookie",
"will",
"be",
"asked",
"to",
"live",
"for",
"20",
"years",
"."
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/Controller.java#L1284-L1286 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixInvalidCapacityType | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_CAPACITY_TYPE)
public void fixInvalidCapacityType(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Invalid capacity type".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
CapacityReferenceRemoveModification.acce... | java | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_CAPACITY_TYPE)
public void fixInvalidCapacityType(final Issue issue, IssueResolutionAcceptor acceptor) {
CapacityReferenceRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"INVALID_CAPACITY_TYPE",
")",
"public",
"void",
"fixInvalidCapacityType",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"CapacityR... | Quick fix for "Invalid capacity type".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Invalid",
"capacity",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L785-L788 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java | QueueContainer.remove | public long remove(Data data) {
"""
iterates all items, checks equality with data
This method does not trigger store load.
"""
Iterator<QueueItem> iterator = getItemQueue().iterator();
while (iterator.hasNext()) {
QueueItem item = iterator.next();
if (data.equals(item.g... | java | public long remove(Data data) {
Iterator<QueueItem> iterator = getItemQueue().iterator();
while (iterator.hasNext()) {
QueueItem item = iterator.next();
if (data.equals(item.getData())) {
if (store.isEnabled()) {
try {
s... | [
"public",
"long",
"remove",
"(",
"Data",
"data",
")",
"{",
"Iterator",
"<",
"QueueItem",
">",
"iterator",
"=",
"getItemQueue",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"QueueItem",
"item",
... | iterates all items, checks equality with data
This method does not trigger store load. | [
"iterates",
"all",
"items",
"checks",
"equality",
"with",
"data",
"This",
"method",
"does",
"not",
"trigger",
"store",
"load",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L688-L708 |
OSSIndex/heuristic-version | src/main/java/net/ossindex/version/impl/SemanticVersion.java | SemanticVersion.getPrevVersion | public SemanticVersion getPrevVersion() {
"""
Get the prev logical version in line. For example:
1.2.3 becomes 1.2.2
This gets ugly if we underflow, cause we don't know what the top patch version
for the lower minor version could be.
"""
int major = head.getMajorVersion();
int minor = head.getMi... | java | public SemanticVersion getPrevVersion() {
int major = head.getMajorVersion();
int minor = head.getMinorVersion();
int patch = head.getPatchVersion();
if (patch > 0) {
return new SemanticVersion(major, minor, patch - 1);
}
if (minor > 0) {
return new SemanticVersion(major, minor - 1, ... | [
"public",
"SemanticVersion",
"getPrevVersion",
"(",
")",
"{",
"int",
"major",
"=",
"head",
".",
"getMajorVersion",
"(",
")",
";",
"int",
"minor",
"=",
"head",
".",
"getMinorVersion",
"(",
")",
";",
"int",
"patch",
"=",
"head",
".",
"getPatchVersion",
"(",
... | Get the prev logical version in line. For example:
1.2.3 becomes 1.2.2
This gets ugly if we underflow, cause we don't know what the top patch version
for the lower minor version could be. | [
"Get",
"the",
"prev",
"logical",
"version",
"in",
"line",
".",
"For",
"example",
":"
] | train | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/impl/SemanticVersion.java#L293-L307 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java | BoxRetentionPolicyAssignment.createAssignmentToEnterprise | public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api,
String policyID) {
"""
Assigns retention policy with givenID to the enterprise.
@param api the API connection to be used by the creat... | java | public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api,
String policyID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_ENTERPRISE), null);
} | [
"public",
"static",
"BoxRetentionPolicyAssignment",
".",
"Info",
"createAssignmentToEnterprise",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"policyID",
")",
"{",
"return",
"createAssignment",
"(",
"api",
",",
"policyID",
",",
"new",
"JsonObject",
"(",
")",
".",
... | Assigns retention policy with givenID to the enterprise.
@param api the API connection to be used by the created assignment.
@param policyID id of the assigned retention policy.
@return info about created assignment. | [
"Assigns",
"retention",
"policy",
"with",
"givenID",
"to",
"the",
"enterprise",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java#L65-L68 |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.writeLong | private static void writeLong(byte[] buffer, int offset, long value) {
"""
Stores an {@code long} in the {@code byte[]}. The behavior is equivalent to calling
{@link RandomAccessFile#writeLong}.
"""
buffer[offset ] = (byte) (value >> 56);
buffer[offset + 1] = (byte) (value >> 48);
buffer[offset... | java | private static void writeLong(byte[] buffer, int offset, long value) {
buffer[offset ] = (byte) (value >> 56);
buffer[offset + 1] = (byte) (value >> 48);
buffer[offset + 2] = (byte) (value >> 40);
buffer[offset + 3] = (byte) (value >> 32);
buffer[offset + 4] = (byte) (value >> 24);
buffer[off... | [
"private",
"static",
"void",
"writeLong",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"long",
"value",
")",
"{",
"buffer",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>",
"56",
")",
";",
"buffer",
"[",
"offset",
"+",
... | Stores an {@code long} in the {@code byte[]}. The behavior is equivalent to calling
{@link RandomAccessFile#writeLong}. | [
"Stores",
"an",
"{"
] | train | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L236-L245 |
jblas-project/jblas | src/main/java/org/jblas/MatrixFunctions.java | MatrixFunctions.powi | public static DoubleMatrix powi(DoubleMatrix x, double d) {
"""
Element-wise power function. Replaces each element with its
power of <tt>d</tt>.Note that this is an in-place operation.
@param d the exponent
@see MatrixFunctions#pow(DoubleMatrix,double)
@return this matrix
"""
if (d == 2.0)
return x.mu... | java | public static DoubleMatrix powi(DoubleMatrix x, double d) {
if (d == 2.0)
return x.muli(x);
else {
for (int i = 0; i < x.length; i++)
x.put(i, (double) Math.pow(x.get(i), d));
return x;
}
} | [
"public",
"static",
"DoubleMatrix",
"powi",
"(",
"DoubleMatrix",
"x",
",",
"double",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"2.0",
")",
"return",
"x",
".",
"muli",
"(",
"x",
")",
";",
"else",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Element-wise power function. Replaces each element with its
power of <tt>d</tt>.Note that this is an in-place operation.
@param d the exponent
@see MatrixFunctions#pow(DoubleMatrix,double)
@return this matrix | [
"Element",
"-",
"wise",
"power",
"function",
".",
"Replaces",
"each",
"element",
"with",
"its",
"power",
"of",
"<tt",
">",
"d<",
"/",
"tt",
">",
".",
"Note",
"that",
"this",
"is",
"an",
"in",
"-",
"place",
"operation",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/MatrixFunctions.java#L259-L267 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java | TreeUtil.findComponentsByClass | public static List<ComponentWithContext> findComponentsByClass(final WComponent root, final String className,
final boolean includeRoot, final boolean visibleOnly) {
"""
Search for components implementing a particular class name.
@param root the root component to search from
@param className the class name ... | java | public static List<ComponentWithContext> findComponentsByClass(final WComponent root, final String className,
final boolean includeRoot, final boolean visibleOnly) {
FindComponentsByClassVisitor visitor = new FindComponentsByClassVisitor(root, className, includeRoot);
doTraverse(root, visibleOnly, visitor);
... | [
"public",
"static",
"List",
"<",
"ComponentWithContext",
">",
"findComponentsByClass",
"(",
"final",
"WComponent",
"root",
",",
"final",
"String",
"className",
",",
"final",
"boolean",
"includeRoot",
",",
"final",
"boolean",
"visibleOnly",
")",
"{",
"FindComponentsB... | Search for components implementing a particular class name.
@param root the root component to search from
@param className the class name to search for
@param includeRoot check the root component as well
@param visibleOnly true if process visible only
@return the list of components implementing the class name | [
"Search",
"for",
"components",
"implementing",
"a",
"particular",
"class",
"name",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java#L107-L115 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java | AvatarZooKeeperClient.getPrimaryAvatarAddress | public String getPrimaryAvatarAddress(String address, Stat stat, boolean retry)
throws IOException, KeeperException, InterruptedException {
"""
Retrieves the primary address for the cluster, this does not perform a
sync before it reads the znode.
"""
return getPrimaryAvatarAddress(address, stat, ret... | java | public String getPrimaryAvatarAddress(String address, Stat stat, boolean retry)
throws IOException, KeeperException, InterruptedException {
return getPrimaryAvatarAddress(address, stat, retry, false);
} | [
"public",
"String",
"getPrimaryAvatarAddress",
"(",
"String",
"address",
",",
"Stat",
"stat",
",",
"boolean",
"retry",
")",
"throws",
"IOException",
",",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"getPrimaryAvatarAddress",
"(",
"address",
",",
"... | Retrieves the primary address for the cluster, this does not perform a
sync before it reads the znode. | [
"Retrieves",
"the",
"primary",
"address",
"for",
"the",
"cluster",
"this",
"does",
"not",
"perform",
"a",
"sync",
"before",
"it",
"reads",
"the",
"znode",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L367-L370 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/krb5/Krb5Common.java | Krb5Common.restorePropertyAsNeeded | public static void restorePropertyAsNeeded(final String propName, final String oldPropValue, final String newPropValue) {
"""
This method restore the property value to the original value.
@param propName
@param oldPropValue
@param newPropValue
"""
java.security.AccessController.doPrivileged(new ja... | java | public static void restorePropertyAsNeeded(final String propName, final String oldPropValue, final String newPropValue) {
java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {
@Override
public Object run() {
if (oldPropValue == null) {... | [
"public",
"static",
"void",
"restorePropertyAsNeeded",
"(",
"final",
"String",
"propName",
",",
"final",
"String",
"oldPropValue",
",",
"final",
"String",
"newPropValue",
")",
"{",
"java",
".",
"security",
".",
"AccessController",
".",
"doPrivileged",
"(",
"new",
... | This method restore the property value to the original value.
@param propName
@param oldPropValue
@param newPropValue | [
"This",
"method",
"restore",
"the",
"property",
"value",
"to",
"the",
"original",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/krb5/Krb5Common.java#L104-L118 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/KeyStoreExtensions.java | KeyStoreExtensions.deleteAlias | public static void deleteAlias(final File keystoreFile, String alias, final String password)
throws NoSuchAlgorithmException, CertificateException, FileNotFoundException,
KeyStoreException, IOException {
"""
Delete the given alias from the given keystore file.
@param keystoreFile
the keystore file
@param ... | java | public static void deleteAlias(final File keystoreFile, String alias, final String password)
throws NoSuchAlgorithmException, CertificateException, FileNotFoundException,
KeyStoreException, IOException
{
KeyStore keyStore = KeyStoreFactory.newKeyStore(KeystoreType.JKS.name(), password,
keystoreFile);
keySt... | [
"public",
"static",
"void",
"deleteAlias",
"(",
"final",
"File",
"keystoreFile",
",",
"String",
"alias",
",",
"final",
"String",
"password",
")",
"throws",
"NoSuchAlgorithmException",
",",
"CertificateException",
",",
"FileNotFoundException",
",",
"KeyStoreException",
... | Delete the given alias from the given keystore file.
@param keystoreFile
the keystore file
@param alias
the alias
@param password
the password
@throws NoSuchAlgorithmException
the no such algorithm exception
@throws CertificateException
the certificate exception
@throws FileNotFoundException
the file not found excepti... | [
"Delete",
"the",
"given",
"alias",
"from",
"the",
"given",
"keystore",
"file",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/KeyStoreExtensions.java#L67-L76 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.getMethodInstance | public static MethodInstance getMethodInstance(Object obj, Class clazz, String methodName, Object[] args) throws NoSuchMethodException {
"""
gets the MethodInstance matching given Parameter
@param clazz Class Of the Method to get
@param methodName Name of the Method to get
@param args Arguments of the Method ... | java | public static MethodInstance getMethodInstance(Object obj, Class clazz, String methodName, Object[] args) throws NoSuchMethodException {
MethodInstance mi = getMethodInstanceEL(obj, clazz, KeyImpl.getInstance(methodName), args);
if (mi != null) return mi;
Class[] classes = getClasses(args);
// StringBuilder sb=nul... | [
"public",
"static",
"MethodInstance",
"getMethodInstance",
"(",
"Object",
"obj",
",",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"NoSuchMethodException",
"{",
"MethodInstance",
"mi",
"=",
"getMethodInstanceEL",
"... | gets the MethodInstance matching given Parameter
@param clazz Class Of the Method to get
@param methodName Name of the Method to get
@param args Arguments of the Method to get
@return return Matching Method
@throws NoSuchMethodException
@throws PageException | [
"gets",
"the",
"MethodInstance",
"matching",
"given",
"Parameter"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L678-L708 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.getAlert | public JsonResponse getAlert(String email) throws IOException {
"""
Retrieve a user's alert settings
@param email
@return JsonResponse
@throws IOException
"""
Map<String, Object> data = new HashMap<String, Object>();
data.put(Alert.PARAM_EMAIL, email);
return apiGet(ApiAction.alert, ... | java | public JsonResponse getAlert(String email) throws IOException {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Alert.PARAM_EMAIL, email);
return apiGet(ApiAction.alert, data);
} | [
"public",
"JsonResponse",
"getAlert",
"(",
"String",
"email",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"Alert"... | Retrieve a user's alert settings
@param email
@return JsonResponse
@throws IOException | [
"Retrieve",
"a",
"user",
"s",
"alert",
"settings"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L331-L335 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java | UrlTileGenerator.replaceBoundingBox | private String replaceBoundingBox(String url, BoundingBox boundingBox) {
"""
Replace the url parts with the bounding box
@param url
@param boundingBox
@return
"""
url = url.replaceAll(MIN_LAT_VARIABLE,
String.valueOf(boundingBox.getMinLatitude()));
url = url.replaceAll(MAX_LAT_VARIABLE,
Strin... | java | private String replaceBoundingBox(String url, BoundingBox boundingBox) {
url = url.replaceAll(MIN_LAT_VARIABLE,
String.valueOf(boundingBox.getMinLatitude()));
url = url.replaceAll(MAX_LAT_VARIABLE,
String.valueOf(boundingBox.getMaxLatitude()));
url = url.replaceAll(MIN_LON_VARIABLE,
String.valueOf(bo... | [
"private",
"String",
"replaceBoundingBox",
"(",
"String",
"url",
",",
"BoundingBox",
"boundingBox",
")",
"{",
"url",
"=",
"url",
".",
"replaceAll",
"(",
"MIN_LAT_VARIABLE",
",",
"String",
".",
"valueOf",
"(",
"boundingBox",
".",
"getMinLatitude",
"(",
")",
")"... | Replace the url parts with the bounding box
@param url
@param boundingBox
@return | [
"Replace",
"the",
"url",
"parts",
"with",
"the",
"bounding",
"box"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L276-L288 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java | JBBPUtils.ensureMinTextLength | public static String ensureMinTextLength(final String text, final int neededLen, final char ch, final int mode) {
"""
Extend text by chars to needed length.
@param text text to be extended, must not be null.
@param neededLen needed length for text
@param ch char to be used for extending
@param mo... | java | public static String ensureMinTextLength(final String text, final int neededLen, final char ch, final int mode) {
final int number = neededLen - text.length();
if (number <= 0) {
return text;
}
final StringBuilder result = new StringBuilder(neededLen);
switch (mode) {
case 0: {
... | [
"public",
"static",
"String",
"ensureMinTextLength",
"(",
"final",
"String",
"text",
",",
"final",
"int",
"neededLen",
",",
"final",
"char",
"ch",
",",
"final",
"int",
"mode",
")",
"{",
"final",
"int",
"number",
"=",
"neededLen",
"-",
"text",
".",
"length"... | Extend text by chars to needed length.
@param text text to be extended, must not be null.
@param neededLen needed length for text
@param ch char to be used for extending
@param mode 0 to extend left, 1 to extend right, otherwise extends both
sides
@return text extended by chars up to needed length, or... | [
"Extend",
"text",
"by",
"chars",
"to",
"needed",
"length",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L814-L850 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/marshal/TypeParser.java | TypeParser.stringifyAliasesParameters | public static String stringifyAliasesParameters(Map<Byte, AbstractType<?>> aliases) {
"""
Helper function to ease the writing of AbstractType.toString() methods.
"""
StringBuilder sb = new StringBuilder();
sb.append('(');
Iterator<Map.Entry<Byte, AbstractType<?>>> iter = aliases.entrySe... | java | public static String stringifyAliasesParameters(Map<Byte, AbstractType<?>> aliases)
{
StringBuilder sb = new StringBuilder();
sb.append('(');
Iterator<Map.Entry<Byte, AbstractType<?>>> iter = aliases.entrySet().iterator();
if (iter.hasNext())
{
Map.Entry<Byte, Abs... | [
"public",
"static",
"String",
"stringifyAliasesParameters",
"(",
"Map",
"<",
"Byte",
",",
"AbstractType",
"<",
"?",
">",
">",
"aliases",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",... | Helper function to ease the writing of AbstractType.toString() methods. | [
"Helper",
"function",
"to",
"ease",
"the",
"writing",
"of",
"AbstractType",
".",
"toString",
"()",
"methods",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L518-L535 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/GroupedTypedHistogram.java | GroupedTypedHistogram.iterateGroupNodes | private void iterateGroupNodes(long groupdId, NodeReader nodeReader) {
"""
used to iterate over all non-null nodes in the data structure
@param nodeReader - will be passed every non-null nodePointer
"""
// while the index can be a long, the value is always an int
int currentPointer = (int) h... | java | private void iterateGroupNodes(long groupdId, NodeReader nodeReader)
{
// while the index can be a long, the value is always an int
int currentPointer = (int) headPointers.get(groupdId);
checkArgument(currentPointer != NULL, "valid group must have non-null head pointer");
while (cur... | [
"private",
"void",
"iterateGroupNodes",
"(",
"long",
"groupdId",
",",
"NodeReader",
"nodeReader",
")",
"{",
"// while the index can be a long, the value is always an int",
"int",
"currentPointer",
"=",
"(",
"int",
")",
"headPointers",
".",
"get",
"(",
"groupdId",
")",
... | used to iterate over all non-null nodes in the data structure
@param nodeReader - will be passed every non-null nodePointer | [
"used",
"to",
"iterate",
"over",
"all",
"non",
"-",
"null",
"nodes",
"in",
"the",
"data",
"structure"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/operator/aggregation/histogram/GroupedTypedHistogram.java#L268-L279 |
kotcrab/vis-ui | usl/src/main/java/com/kotcrab/vis/usl/CollectionUtils.java | CollectionUtils.isEqualCollection | public static boolean isEqualCollection (final Collection a, final Collection b) {
"""
Returns <tt>true</tt> iff the given {@link Collection}s contain
exactly the same elements with exactly the same cardinality.
<p>
That is, iff the cardinality of <i>e</i> in <i>a</i> is
equal to the cardinality of <i>e</i> in... | java | public static boolean isEqualCollection (final Collection a, final Collection b) {
if (a.size() != b.size()) {
return false;
} else {
Map mapa = getCardinalityMap(a);
Map mapb = getCardinalityMap(b);
if (mapa.size() != mapb.size()) {
return false;
} else {
Iterator it = mapa.keySet().iterator... | [
"public",
"static",
"boolean",
"isEqualCollection",
"(",
"final",
"Collection",
"a",
",",
"final",
"Collection",
"b",
")",
"{",
"if",
"(",
"a",
".",
"size",
"(",
")",
"!=",
"b",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
... | Returns <tt>true</tt> iff the given {@link Collection}s contain
exactly the same elements with exactly the same cardinality.
<p>
That is, iff the cardinality of <i>e</i> in <i>a</i> is
equal to the cardinality of <i>e</i> in <i>b</i>,
for each element <i>e</i> in <i>a</i> or <i>b</i>. | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"iff",
"the",
"given",
"{"
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/usl/src/main/java/com/kotcrab/vis/usl/CollectionUtils.java#L32-L51 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/file/HttpFileBuilder.java | HttpFileBuilder.ofResource | public static HttpFileBuilder ofResource(ClassLoader classLoader, String path) {
"""
Returns a new {@link HttpFileBuilder} that builds an {@link HttpFile} from the classpath resource
at the specified {@code path} using the specified {@link ClassLoader}.
"""
requireNonNull(classLoader, "classLoader");
... | java | public static HttpFileBuilder ofResource(ClassLoader classLoader, String path) {
requireNonNull(classLoader, "classLoader");
requireNonNull(path, "path");
// Strip the leading slash.
if (path.startsWith("/")) {
path = path.substring(1);
}
// Retrieve the res... | [
"public",
"static",
"HttpFileBuilder",
"ofResource",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"path",
")",
"{",
"requireNonNull",
"(",
"classLoader",
",",
"\"classLoader\"",
")",
";",
"requireNonNull",
"(",
"path",
",",
"\"path\"",
")",
";",
"// Strip the... | Returns a new {@link HttpFileBuilder} that builds an {@link HttpFile} from the classpath resource
at the specified {@code path} using the specified {@link ClassLoader}. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/HttpFileBuilder.java#L111-L140 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_miniPabx_serviceName_PUT | public void billingAccount_miniPabx_serviceName_PUT(String billingAccount, String serviceName, OvhMiniPabx body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/miniPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The ... | java | public void billingAccount_miniPabx_serviceName_PUT(String billingAccount, String serviceName, OvhMiniPabx body) throws IOException {
String qPath = "/telephony/{billingAccount}/miniPabx/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_miniPabx_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhMiniPabx",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/miniPabx/{serviceName}\"",
";",
... | Alter this object properties
REST: PUT /telephony/{billingAccount}/miniPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5160-L5164 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java | AbstractMBeanServerExecutor.updateErrorMsg | private Exception updateErrorMsg(StringBuilder pErrors, Exception exp) {
"""
Helper method for adding the exception for an appropriate error message
"""
pErrors.append(exp.getClass()).append(": ").append(exp.getMessage()).append("\n");
return exp;
} | java | private Exception updateErrorMsg(StringBuilder pErrors, Exception exp) {
pErrors.append(exp.getClass()).append(": ").append(exp.getMessage()).append("\n");
return exp;
} | [
"private",
"Exception",
"updateErrorMsg",
"(",
"StringBuilder",
"pErrors",
",",
"Exception",
"exp",
")",
"{",
"pErrors",
".",
"append",
"(",
"exp",
".",
"getClass",
"(",
")",
")",
".",
"append",
"(",
"\": \"",
")",
".",
"append",
"(",
"exp",
".",
"getMes... | Helper method for adding the exception for an appropriate error message | [
"Helper",
"method",
"for",
"adding",
"the",
"exception",
"for",
"an",
"appropriate",
"error",
"message"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/executor/AbstractMBeanServerExecutor.java#L170-L173 |
cdapio/tigon | tigon-queue/src/main/java/co/cask/tigon/data/transaction/queue/QueueEntryRow.java | QueueEntryRow.isCommittedProcessed | public static boolean isCommittedProcessed(byte[] stateBytes, Transaction tx) {
"""
For a queue entry consumer state, serialized to byte array, return whether it is processed and committed.
"""
long writePointer = Bytes.toLong(stateBytes, 0, Longs.BYTES);
if (!tx.isVisible(writePointer)) {
return... | java | public static boolean isCommittedProcessed(byte[] stateBytes, Transaction tx) {
long writePointer = Bytes.toLong(stateBytes, 0, Longs.BYTES);
if (!tx.isVisible(writePointer)) {
return false;
}
byte state = stateBytes[Longs.BYTES + Ints.BYTES];
return state == ConsumerEntryState.PROCESSED.getSt... | [
"public",
"static",
"boolean",
"isCommittedProcessed",
"(",
"byte",
"[",
"]",
"stateBytes",
",",
"Transaction",
"tx",
")",
"{",
"long",
"writePointer",
"=",
"Bytes",
".",
"toLong",
"(",
"stateBytes",
",",
"0",
",",
"Longs",
".",
"BYTES",
")",
";",
"if",
... | For a queue entry consumer state, serialized to byte array, return whether it is processed and committed. | [
"For",
"a",
"queue",
"entry",
"consumer",
"state",
"serialized",
"to",
"byte",
"array",
"return",
"whether",
"it",
"is",
"processed",
"and",
"committed",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-queue/src/main/java/co/cask/tigon/data/transaction/queue/QueueEntryRow.java#L320-L327 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_udp_frontend_frontendId_GET | public OvhFrontendUdp serviceName_udp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
"""
Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId ... | java | public OvhFrontendUdp serviceName_udp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
String resp = exec(qPath, "GET", sb.toString(), null);
retur... | [
"public",
"OvhFrontendUdp",
"serviceName_udp_frontend_frontendId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"frontendId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}\"",
";",
"StringBuilder",
"sb",... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/udp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [required] Id of your frontend
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L756-L761 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.