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 |
|---|---|---|---|---|---|---|---|---|---|---|
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppUtil.java | CppUtil.formatByteOrderEncoding | public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType) {
"""
Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveType
@param byteOrder of the {@link uk.co.real_logic.sbe.ir.Token}
@param primitiveType of the {@... | java | public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType)
{
switch (primitiveType.size())
{
case 2:
return "SBE_" + byteOrder + "_ENCODE_16";
case 4:
return "SBE_" + byteOrder + "_ENCODE_32";
... | [
"public",
"static",
"String",
"formatByteOrderEncoding",
"(",
"final",
"ByteOrder",
"byteOrder",
",",
"final",
"PrimitiveType",
"primitiveType",
")",
"{",
"switch",
"(",
"primitiveType",
".",
"size",
"(",
")",
")",
"{",
"case",
"2",
":",
"return",
"\"SBE_\"",
... | Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveType
@param byteOrder of the {@link uk.co.real_logic.sbe.ir.Token}
@param primitiveType of the {@link uk.co.real_logic.sbe.ir.Token}
@return the string formatted as the byte ordering encoding | [
"Return",
"the",
"Cpp98",
"formatted",
"byte",
"order",
"encoding",
"string",
"to",
"use",
"for",
"a",
"given",
"byte",
"order",
"and",
"primitiveType"
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppUtil.java#L125-L141 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.opensIn | public static List<OpensDirective>
opensIn(Iterable<? extends Directive> directives) {
"""
Returns a list of {@code opens} directives in {@code directives}.
@return a list of {@code opens} directives in {@code directives}
@param directives the directives to filter
@since 9
"""
return lis... | java | public static List<OpensDirective>
opensIn(Iterable<? extends Directive> directives) {
return listFilter(directives, DirectiveKind.OPENS, OpensDirective.class);
} | [
"public",
"static",
"List",
"<",
"OpensDirective",
">",
"opensIn",
"(",
"Iterable",
"<",
"?",
"extends",
"Directive",
">",
"directives",
")",
"{",
"return",
"listFilter",
"(",
"directives",
",",
"DirectiveKind",
".",
"OPENS",
",",
"OpensDirective",
".",
"class... | Returns a list of {@code opens} directives in {@code directives}.
@return a list of {@code opens} directives in {@code directives}
@param directives the directives to filter
@since 9 | [
"Returns",
"a",
"list",
"of",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L254-L257 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java | StringUtils.removeStartingChars | public static String removeStartingChars(String s, char c) {
"""
Remove all consecutive chars c from the beginning of the string
@param s String to process
@param c Char to search for
@return The string stripped from the starting chars.
"""
int lastToRemove = -1;
for (int i = 0; i < s.length... | java | public static String removeStartingChars(String s, char c) {
int lastToRemove = -1;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
lastToRemove = i;
continue;
}
if (s.charAt(i) != c) {
break;
... | [
"public",
"static",
"String",
"removeStartingChars",
"(",
"String",
"s",
",",
"char",
"c",
")",
"{",
"int",
"lastToRemove",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
... | Remove all consecutive chars c from the beginning of the string
@param s String to process
@param c Char to search for
@return The string stripped from the starting chars. | [
"Remove",
"all",
"consecutive",
"chars",
"c",
"from",
"the",
"beginning",
"of",
"the",
"string"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java#L325-L340 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java | ExecutionGraph.updateJobStatus | public void updateJobStatus(final InternalJobStatus newJobStatus, String optionalMessage) {
"""
Updates the job status to given status and triggers the execution of the {@link JobStatusListener} objects.
@param newJobStatus
the new job status
@param optionalMessage
an optional message providing details on th... | java | public void updateJobStatus(final InternalJobStatus newJobStatus, String optionalMessage) {
// Check if the new job status equals the old one
if (this.jobStatus.getAndSet(newJobStatus) == newJobStatus) {
return;
}
// The task caused the entire job to fail, save the error description
if (newJobStatus == I... | [
"public",
"void",
"updateJobStatus",
"(",
"final",
"InternalJobStatus",
"newJobStatus",
",",
"String",
"optionalMessage",
")",
"{",
"// Check if the new job status equals the old one",
"if",
"(",
"this",
".",
"jobStatus",
".",
"getAndSet",
"(",
"newJobStatus",
")",
"=="... | Updates the job status to given status and triggers the execution of the {@link JobStatusListener} objects.
@param newJobStatus
the new job status
@param optionalMessage
an optional message providing details on the reasons for the state change | [
"Updates",
"the",
"job",
"status",
"to",
"given",
"status",
"and",
"triggers",
"the",
"execution",
"of",
"the",
"{",
"@link",
"JobStatusListener",
"}",
"objects",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L1221-L1242 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/GeoDist.java | GeoDist.PE_EQ | static private boolean PE_EQ(double a, double b) {
"""
Determine if two doubles are equal within a default tolerance
"""
return (a == b)
|| PE_ABS(a - b) <= PE_EPS * (1 + (PE_ABS(a) + PE_ABS(b)) / 2);
} | java | static private boolean PE_EQ(double a, double b) {
return (a == b)
|| PE_ABS(a - b) <= PE_EPS * (1 + (PE_ABS(a) + PE_ABS(b)) / 2);
} | [
"static",
"private",
"boolean",
"PE_EQ",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"return",
"(",
"a",
"==",
"b",
")",
"||",
"PE_ABS",
"(",
"a",
"-",
"b",
")",
"<=",
"PE_EPS",
"*",
"(",
"1",
"+",
"(",
"PE_ABS",
"(",
"a",
")",
"+",
"PE... | Determine if two doubles are equal within a default tolerance | [
"Determine",
"if",
"two",
"doubles",
"are",
"equal",
"within",
"a",
"default",
"tolerance"
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/GeoDist.java#L46-L49 |
icode/ameba | src/main/java/ameba/websocket/internal/EndpointMeta.java | EndpointMeta.onOpen | @SuppressWarnings("unchecked")
public void onOpen(Session session, EndpointConfig configuration) {
"""
<p>onOpen.</p>
@param session a {@link javax.websocket.Session} object.
@param configuration a {@link javax.websocket.EndpointConfig} object.
"""
for (MessageHandlerFactory f : messageHandlerF... | java | @SuppressWarnings("unchecked")
public void onOpen(Session session, EndpointConfig configuration) {
for (MessageHandlerFactory f : messageHandlerFactories) {
MessageHandler handler = f.create(session);
final Class<?> handlerClass = getHandlerType(handler);
if (handler ins... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"onOpen",
"(",
"Session",
"session",
",",
"EndpointConfig",
"configuration",
")",
"{",
"for",
"(",
"MessageHandlerFactory",
"f",
":",
"messageHandlerFactories",
")",
"{",
"MessageHandler",
"handle... | <p>onOpen.</p>
@param session a {@link javax.websocket.Session} object.
@param configuration a {@link javax.websocket.EndpointConfig} object. | [
"<p",
">",
"onOpen",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/internal/EndpointMeta.java#L171-L187 |
ops4j/org.ops4j.base | ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java | Resources.getString | public String getString( String key, Object arg1 ) {
"""
Retrieve a string from resource bundle and format it with specified args.
@param key the key for resource
@param arg1 an arg
@return the formatted string
"""
Object[] args = new Object[]{ arg1 };
return format( key, args );
} | java | public String getString( String key, Object arg1 )
{
Object[] args = new Object[]{ arg1 };
return format( key, args );
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"Object",
"arg1",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"new",
"Object",
"[",
"]",
"{",
"arg1",
"}",
";",
"return",
"format",
"(",
"key",
",",
"args",
")",
";",
"}"
] | Retrieve a string from resource bundle and format it with specified args.
@param key the key for resource
@param arg1 an arg
@return the formatted string | [
"Retrieve",
"a",
"string",
"from",
"resource",
"bundle",
"and",
"format",
"it",
"with",
"specified",
"args",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L697-L701 |
arquillian/arquillian-extension-warp | spi/src/main/java/org/jboss/arquillian/warp/spi/LifecycleManager.java | LifecycleManager.unbindFrom | public final <T> void unbindFrom(Class<T> clazz, T object) throws ObjectNotAssociatedException {
"""
Unbinds the {@link LifecycleManager} from given class and given object.
@param clazz the bound class
@param object the bound class
@throws ObjectNotAssociatedException when no object bound with {@link Lifecyc... | java | public final <T> void unbindFrom(Class<T> clazz, T object) throws ObjectNotAssociatedException {
LifecycleManagerStore.getCurrentStore().unbind(this, clazz, object);
} | [
"public",
"final",
"<",
"T",
">",
"void",
"unbindFrom",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"T",
"object",
")",
"throws",
"ObjectNotAssociatedException",
"{",
"LifecycleManagerStore",
".",
"getCurrentStore",
"(",
")",
".",
"unbind",
"(",
"this",
",",
... | Unbinds the {@link LifecycleManager} from given class and given object.
@param clazz the bound class
@param object the bound class
@throws ObjectNotAssociatedException when no object bound with {@link LifecycleManager}. | [
"Unbinds",
"the",
"{",
"@link",
"LifecycleManager",
"}",
"from",
"given",
"class",
"and",
"given",
"object",
"."
] | train | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/spi/src/main/java/org/jboss/arquillian/warp/spi/LifecycleManager.java#L148-L150 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(SarlAssertExpression assertStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param assertStatement the assert statement.
@param it the target for the generated content.
@param context the context.
@return the statement.
""... | java | protected XExpression _generate(SarlAssertExpression assertStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
final boolean haveAssert = !assertStatement.isIsStatic() && assertStatement.getCondition() != null;
if (haveAssert) {
it.append("assert (lambda:"); //$NON-NLS-1$
it.increaseIndentati... | [
"protected",
"XExpression",
"_generate",
"(",
"SarlAssertExpression",
"assertStatement",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"boolean",
"haveAssert",
"=",
"!",
"assertStatement",
".",
"isIsStatic",
"(",
")",
"... | Generate the given object.
@param assertStatement the assert statement.
@param it the target for the generated content.
@param context the context.
@return the statement. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L399-L415 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingByteArrayOutputStream.java | NonBlockingByteArrayOutputStream.getAsString | @Nonnull
public String getAsString (@Nonnull final Charset aCharset) {
"""
Converts the buffer's contents into a string by decoding the bytes using
the specified {@link java.nio.charset.Charset charsetName}. The length of
the new <tt>String</tt> is a function of the charset, and hence may not be
equal to the ... | java | @Nonnull
public String getAsString (@Nonnull final Charset aCharset)
{
return new String (m_aBuf, 0, m_nCount, aCharset);
} | [
"@",
"Nonnull",
"public",
"String",
"getAsString",
"(",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"new",
"String",
"(",
"m_aBuf",
",",
"0",
",",
"m_nCount",
",",
"aCharset",
")",
";",
"}"
] | Converts the buffer's contents into a string by decoding the bytes using
the specified {@link java.nio.charset.Charset charsetName}. The length of
the new <tt>String</tt> is a function of the charset, and hence may not be
equal to the length of the byte array.
<p>
This method always replaces malformed-input and unmappa... | [
"Converts",
"the",
"buffer",
"s",
"contents",
"into",
"a",
"string",
"by",
"decoding",
"the",
"bytes",
"using",
"the",
"specified",
"{",
"@link",
"java",
".",
"nio",
".",
"charset",
".",
"Charset",
"charsetName",
"}",
".",
"The",
"length",
"of",
"the",
"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingByteArrayOutputStream.java#L281-L285 |
facebookarchive/hadoop-20 | src/contrib/streaming/src/java/org/apache/hadoop/streaming/UTF8ByteArrayUtils.java | UTF8ByteArrayUtils.findTab | @Deprecated
public static int findTab(byte [] utf, int start, int length) {
"""
Find the first occured tab in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length no. of bytes
@return position that first tab occures otherwise -1
@depreca... | java | @Deprecated
public static int findTab(byte [] utf, int start, int length) {
return StreamKeyValUtil.findTab(utf, start, length);
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"findTab",
"(",
"byte",
"[",
"]",
"utf",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"return",
"StreamKeyValUtil",
".",
"findTab",
"(",
"utf",
",",
"start",
",",
"length",
")",
";",
"}"
] | Find the first occured tab in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length no. of bytes
@return position that first tab occures otherwise -1
@deprecated use {@link StreamKeyValUtil#findTab(byte[], int, int)} | [
"Find",
"the",
"first",
"occured",
"tab",
"in",
"a",
"UTF",
"-",
"8",
"encoded",
"string"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/UTF8ByteArrayUtils.java#L41-L44 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/model/CommerceCountryWrapper.java | CommerceCountryWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this commerce country in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to us... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceCountry.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceCountry",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this commerce country in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return th... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"commerce",
"country",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceCountryWrapper.java#L358-L361 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.copyIndex | public JSONObject copyIndex(String srcIndexName, String dstIndexName) throws AlgoliaException {
"""
Copy an existing index.
@param srcIndexName the name of index to copy.
@param dstIndexName the new index name that will contains a copy of srcIndexName (destination will be overriten if it already exist).
""... | java | public JSONObject copyIndex(String srcIndexName, String dstIndexName) throws AlgoliaException {
return operationOnIndex("copy", srcIndexName, dstIndexName, null, RequestOptions.empty);
} | [
"public",
"JSONObject",
"copyIndex",
"(",
"String",
"srcIndexName",
",",
"String",
"dstIndexName",
")",
"throws",
"AlgoliaException",
"{",
"return",
"operationOnIndex",
"(",
"\"copy\"",
",",
"srcIndexName",
",",
"dstIndexName",
",",
"null",
",",
"RequestOptions",
".... | Copy an existing index.
@param srcIndexName the name of index to copy.
@param dstIndexName the new index name that will contains a copy of srcIndexName (destination will be overriten if it already exist). | [
"Copy",
"an",
"existing",
"index",
"."
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L351-L353 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopsFlowToJobSpecCompiler.java | MultiHopsFlowToJobSpecCompiler.weightGraphGenerateHelper | private void weightGraphGenerateHelper(TopologySpec topologySpec) {
"""
Helper function for transform TopologySpecMap into a weightedDirectedGraph.
"""
try {
Map<ServiceNode, ServiceNode> capabilities = topologySpec.getSpecExecutor().getCapabilities().get();
for (Map.Entry<ServiceNode, ServiceN... | java | private void weightGraphGenerateHelper(TopologySpec topologySpec) {
try {
Map<ServiceNode, ServiceNode> capabilities = topologySpec.getSpecExecutor().getCapabilities().get();
for (Map.Entry<ServiceNode, ServiceNode> capability : capabilities.entrySet()) {
BaseServiceNodeImpl sourceNode = new Ba... | [
"private",
"void",
"weightGraphGenerateHelper",
"(",
"TopologySpec",
"topologySpec",
")",
"{",
"try",
"{",
"Map",
"<",
"ServiceNode",
",",
"ServiceNode",
">",
"capabilities",
"=",
"topologySpec",
".",
"getSpecExecutor",
"(",
")",
".",
"getCapabilities",
"(",
")",
... | Helper function for transform TopologySpecMap into a weightedDirectedGraph. | [
"Helper",
"function",
"for",
"transform",
"TopologySpecMap",
"into",
"a",
"weightedDirectedGraph",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopsFlowToJobSpecCompiler.java#L245-L272 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getOneLoginAppsBatch | public OneLoginResponse<OneLoginApp> getOneLoginAppsBatch(int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Get a batch of OneLoginApps.
@param batchSize Size of the Batch
@return OneLoginResponse of OneLoginApp (Batch)
@throws OAuthSystemException - if there is a... | java | public OneLoginResponse<OneLoginApp> getOneLoginAppsBatch(int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getOneLoginAppsBatch(batchSize, null);
} | [
"public",
"OneLoginResponse",
"<",
"OneLoginApp",
">",
"getOneLoginAppsBatch",
"(",
"int",
"batchSize",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"getOneLoginAppsBatch",
"(",
"batchSize",
",",
"null",
... | Get a batch of OneLoginApps.
@param batchSize Size of the Batch
@return OneLoginResponse of OneLoginApp (Batch)
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and... | [
"Get",
"a",
"batch",
"of",
"OneLoginApps",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1565-L1567 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.stripMargin | public static String stripMargin(CharSequence self, char marginChar) {
"""
Strip leading whitespace/control characters followed by <tt>marginChar</tt> from
every line in a CharSequence.
<pre class="groovyTestCase">
assert 'ABC\n123\n456' == '''ABC
*123
*456'''.stripMargin('*')
</pre>
@param self The... | java | public static String stripMargin(CharSequence self, char marginChar) {
String s = self.toString();
if (s.length() == 0) return s;
try {
StringBuilder builder = new StringBuilder();
for (String line : readLines((CharSequence) s)) {
builder.append(stripMargi... | [
"public",
"static",
"String",
"stripMargin",
"(",
"CharSequence",
"self",
",",
"char",
"marginChar",
")",
"{",
"String",
"s",
"=",
"self",
".",
"toString",
"(",
")",
";",
"if",
"(",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"s",
";",
... | Strip leading whitespace/control characters followed by <tt>marginChar</tt> from
every line in a CharSequence.
<pre class="groovyTestCase">
assert 'ABC\n123\n456' == '''ABC
*123
*456'''.stripMargin('*')
</pre>
@param self The CharSequence to strip the margin from
@param marginChar Any character that serves as ma... | [
"Strip",
"leading",
"whitespace",
"/",
"control",
"characters",
"followed",
"by",
"<tt",
">",
"marginChar<",
"/",
"tt",
">",
"from",
"every",
"line",
"in",
"a",
"CharSequence",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"assert",
"ABC",
"\\",
"n123",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L3054-L3072 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlUtils.java | CmsXmlUtils.unmarshalHelper | public static Document unmarshalHelper(String xmlData, EntityResolver resolver) throws CmsXmlException {
"""
Helper to unmarshal (read) xml contents from a String into a document.<p>
Using this method ensures that the OpenCms XML entitiy resolver is used.<p>
@param xmlData the xml data in a String
@param re... | java | public static Document unmarshalHelper(String xmlData, EntityResolver resolver) throws CmsXmlException {
return CmsXmlUtils.unmarshalHelper(new InputSource(new StringReader(xmlData)), resolver);
} | [
"public",
"static",
"Document",
"unmarshalHelper",
"(",
"String",
"xmlData",
",",
"EntityResolver",
"resolver",
")",
"throws",
"CmsXmlException",
"{",
"return",
"CmsXmlUtils",
".",
"unmarshalHelper",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(",
"xmlDa... | Helper to unmarshal (read) xml contents from a String into a document.<p>
Using this method ensures that the OpenCms XML entitiy resolver is used.<p>
@param xmlData the xml data in a String
@param resolver the XML entity resolver to use
@return the base object initialized with the unmarshalled XML document
@throws Cm... | [
"Helper",
"to",
"unmarshal",
"(",
"read",
")",
"xml",
"contents",
"from",
"a",
"String",
"into",
"a",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L813-L816 |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java | SourceMapGeneratorV3.setStartingPosition | @Override
public void setStartingPosition(int offsetLine, int offsetIndex) {
"""
Sets the source code that exists in the buffer for which the
generated code is being generated. This ensures that the source map
accurately reflects the fact that the source is being appended to
an existing buffer and as such, do... | java | @Override
public void setStartingPosition(int offsetLine, int offsetIndex) {
checkState(offsetLine >= 0);
checkState(offsetIndex >= 0);
offsetPosition = new FilePosition(offsetLine, offsetIndex);
} | [
"@",
"Override",
"public",
"void",
"setStartingPosition",
"(",
"int",
"offsetLine",
",",
"int",
"offsetIndex",
")",
"{",
"checkState",
"(",
"offsetLine",
">=",
"0",
")",
";",
"checkState",
"(",
"offsetIndex",
">=",
"0",
")",
";",
"offsetPosition",
"=",
"new"... | Sets the source code that exists in the buffer for which the
generated code is being generated. This ensures that the source map
accurately reflects the fact that the source is being appended to
an existing buffer and as such, does not start at line 0, position 0
but rather some other line and position.
@param offsetL... | [
"Sets",
"the",
"source",
"code",
"that",
"exists",
"in",
"the",
"buffer",
"for",
"which",
"the",
"generated",
"code",
"is",
"being",
"generated",
".",
"This",
"ensures",
"that",
"the",
"source",
"map",
"accurately",
"reflects",
"the",
"fact",
"that",
"the",
... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java#L194-L199 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listStorageAccountsAsync | public Observable<Page<StorageAccountInfoInner>> listStorageAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) {... | java | public Observable<Page<StorageAccountInfoInner>> listStorageAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final String format) {... | [
"public",
"Observable",
"<",
"Page",
"<",
"StorageAccountInfoInner",
">",
">",
"listStorageAccountsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"f... | Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake An... | [
"Gets",
"the",
"first",
"page",
"of",
"Azure",
"Storage",
"accounts",
"if",
"any",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L1422-L1430 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java | ContainerKeyIndex.validateConditionalUpdate | @SneakyThrows(ConditionalTableUpdateException.class)
private void validateConditionalUpdate(List<TableKeyBatch.Item> items, Map<UUID, Long> bucketOffsets, String segmentName) {
"""
Validates a list of UpdateBatchItems against their actual Table Bucket offsets.
@param items A list of {@link TableKeyB... | java | @SneakyThrows(ConditionalTableUpdateException.class)
private void validateConditionalUpdate(List<TableKeyBatch.Item> items, Map<UUID, Long> bucketOffsets, String segmentName) {
val badKeyVersions = new HashMap<TableKey, Long>(); // Key = Key that failed, Value = Key's bucket offset.
for (val item : ... | [
"@",
"SneakyThrows",
"(",
"ConditionalTableUpdateException",
".",
"class",
")",
"private",
"void",
"validateConditionalUpdate",
"(",
"List",
"<",
"TableKeyBatch",
".",
"Item",
">",
"items",
",",
"Map",
"<",
"UUID",
",",
"Long",
">",
"bucketOffsets",
",",
"String... | Validates a list of UpdateBatchItems against their actual Table Bucket offsets.
@param items A list of {@link TableKeyBatch.Item} instances to validate.
@param bucketOffsets A Map of Key Hashes to their corresponding offsets (versions). Each {@link TableKeyBatch.Item}
will be looked up in this Map (based on th... | [
"Validates",
"a",
"list",
"of",
"UpdateBatchItems",
"against",
"their",
"actual",
"Table",
"Bucket",
"offsets",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java#L428-L453 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ArchiveService.java | ArchiveService.createDockerBuildArchive | public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params)
throws MojoExecutionException {
"""
Create the tar file container the source for building an image. This tar can be used directly for
uploading to a Docker daemon for creating the image
@param imageConfig th... | java | public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params)
throws MojoExecutionException {
return createDockerBuildArchive(imageConfig, params, null);
} | [
"public",
"File",
"createDockerBuildArchive",
"(",
"ImageConfiguration",
"imageConfig",
",",
"MojoParameters",
"params",
")",
"throws",
"MojoExecutionException",
"{",
"return",
"createDockerBuildArchive",
"(",
"imageConfig",
",",
"params",
",",
"null",
")",
";",
"}"
] | Create the tar file container the source for building an image. This tar can be used directly for
uploading to a Docker daemon for creating the image
@param imageConfig the image configuration
@param params mojo params for the project
@return file for holding the sources
@throws MojoExecutionException if during creati... | [
"Create",
"the",
"tar",
"file",
"container",
"the",
"source",
"for",
"building",
"an",
"image",
".",
"This",
"tar",
"can",
"be",
"used",
"directly",
"for",
"uploading",
"to",
"a",
"Docker",
"daemon",
"for",
"creating",
"the",
"image"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ArchiveService.java#L58-L61 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java | MessageBatch.writeTaskMessage | private void writeTaskMessage(ChannelBufferOutputStream bout, TaskMessage message) throws Exception {
"""
write a TaskMessage into a stream
Each TaskMessage is encoded as: task ... short(2) len ... int(4) payload ... byte[] *
"""
int payload_len = 0;
if (message.message() != null)
... | java | private void writeTaskMessage(ChannelBufferOutputStream bout, TaskMessage message) throws Exception {
int payload_len = 0;
if (message.message() != null)
payload_len = message.message().length;
short type = message.get_type();
bout.writeShort(type);
int task_id = me... | [
"private",
"void",
"writeTaskMessage",
"(",
"ChannelBufferOutputStream",
"bout",
",",
"TaskMessage",
"message",
")",
"throws",
"Exception",
"{",
"int",
"payload_len",
"=",
"0",
";",
"if",
"(",
"message",
".",
"message",
"(",
")",
"!=",
"null",
")",
"payload_le... | write a TaskMessage into a stream
Each TaskMessage is encoded as: task ... short(2) len ... int(4) payload ... byte[] * | [
"write",
"a",
"TaskMessage",
"into",
"a",
"stream"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java#L205-L224 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/argparser/ClassFinder.java | ClassFinder.scanJar | protected void scanJar(final File file, final String packagePath) throws IOException {
"""
Scans the entries in a ZIP/JAR file for classes under the parent package.
@param file the jar file to be scanned
@param packagePath the top level package to start from
"""
final ZipFile zip = new ZipFile(file);... | java | protected void scanJar(final File file, final String packagePath) throws IOException {
final ZipFile zip = new ZipFile(file);
final Enumeration<? extends ZipEntry> entries = zip.entries();
while ( entries.hasMoreElements() ) {
final ZipEntry entry = entries.nextElement();
... | [
"protected",
"void",
"scanJar",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"packagePath",
")",
"throws",
"IOException",
"{",
"final",
"ZipFile",
"zip",
"=",
"new",
"ZipFile",
"(",
"file",
")",
";",
"final",
"Enumeration",
"<",
"?",
"extends",
"Z... | Scans the entries in a ZIP/JAR file for classes under the parent package.
@param file the jar file to be scanned
@param packagePath the top level package to start from | [
"Scans",
"the",
"entries",
"in",
"a",
"ZIP",
"/",
"JAR",
"file",
"for",
"classes",
"under",
"the",
"parent",
"package",
"."
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/argparser/ClassFinder.java#L107-L117 |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/WeightedLeastConnectionsRouter.java | WeightedLeastConnectionsRouter.getRecord | protected long getRecord(String record, IStatistic stats) {
"""
Return statistics record value from given {@link IStatistic}
@param record key to retrieve
@param stats statistic object
@return
"""
if (record == null || stats == null) {
return 0;
}
IStatisticRecord statsRecord = stats.ge... | java | protected long getRecord(String record, IStatistic stats) {
if (record == null || stats == null) {
return 0;
}
IStatisticRecord statsRecord = stats.getRecordByName(record);
if (statsRecord == null) {
if (logger.isDebugEnabled()) {
logger.debug("Warning: no record for {}, available: {... | [
"protected",
"long",
"getRecord",
"(",
"String",
"record",
",",
"IStatistic",
"stats",
")",
"{",
"if",
"(",
"record",
"==",
"null",
"||",
"stats",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"IStatisticRecord",
"statsRecord",
"=",
"stats",
".",
"get... | Return statistics record value from given {@link IStatistic}
@param record key to retrieve
@param stats statistic object
@return | [
"Return",
"statistics",
"record",
"value",
"from",
"given",
"{",
"@link",
"IStatistic",
"}"
] | train | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/WeightedLeastConnectionsRouter.java#L198-L210 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java | EndlessScrollHelper.onNewItems | protected void onNewItems(@NonNull List<Model> newItems, int page) {
"""
The default implementation takes care of calling the previously set
{@link OnNewItemsListener OnNewItemsListener}.
@param newItems
@param page
@see #withOnNewItemsListener(OnNewItemsListener) withOnNewItemsListener(OnNewItemsListener)
... | java | protected void onNewItems(@NonNull List<Model> newItems, int page) {
OnNewItemsListener<Model> onNewItemsListener = this.mOnNewItemsListener;
try {
onNewItemsListener.onNewItems(newItems, page);
} catch (NullPointerException npe) {
// Lazy null checking! If this was our n... | [
"protected",
"void",
"onNewItems",
"(",
"@",
"NonNull",
"List",
"<",
"Model",
">",
"newItems",
",",
"int",
"page",
")",
"{",
"OnNewItemsListener",
"<",
"Model",
">",
"onNewItemsListener",
"=",
"this",
".",
"mOnNewItemsListener",
";",
"try",
"{",
"onNewItemsLis... | The default implementation takes care of calling the previously set
{@link OnNewItemsListener OnNewItemsListener}.
@param newItems
@param page
@see #withOnNewItemsListener(OnNewItemsListener) withOnNewItemsListener(OnNewItemsListener) | [
"The",
"default",
"implementation",
"takes",
"care",
"of",
"calling",
"the",
"previously",
"set",
"{",
"@link",
"OnNewItemsListener",
"OnNewItemsListener",
"}",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java#L241-L250 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java | DefaultValueFunction.defaultValue | public static DefaultValueFunction defaultValue(Function function, Object defaultValue) {
"""
Creates new {@link DefaultValueFunction} representing {@code def(function, defaultValue))}
@param function must not be null
@param defaultValue must not be null
@return
"""
Assert.notNull(function, "Function m... | java | public static DefaultValueFunction defaultValue(Function function, Object defaultValue) {
Assert.notNull(function, "Function must not be 'null' for default value operation.");
Assert.notNull(defaultValue, "DefaultValue must not be 'null'.");
return new DefaultValueFunction(function, defaultValue);
} | [
"public",
"static",
"DefaultValueFunction",
"defaultValue",
"(",
"Function",
"function",
",",
"Object",
"defaultValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"function",
",",
"\"Function must not be 'null' for default value operation.\"",
")",
";",
"Assert",
".",
"no... | Creates new {@link DefaultValueFunction} representing {@code def(function, defaultValue))}
@param function must not be null
@param defaultValue must not be null
@return | [
"Creates",
"new",
"{",
"@link",
"DefaultValueFunction",
"}",
"representing",
"{",
"@code",
"def",
"(",
"function",
"defaultValue",
"))",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java#L72-L78 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java | FormatUtil.formatTo | public static StringBuilder formatTo(StringBuilder buf, double[] d, String sep) {
"""
Formats the double array d with the default number format.
@param buf String builder to append to
@param d the double array to be formatted
@param sep separator between the single values of the array, e.g. ','
@return Outpu... | java | public static StringBuilder formatTo(StringBuilder buf, double[] d, String sep) {
if(d == null) {
return buf.append("null");
}
if(d.length == 0) {
return buf;
}
buf.append(d[0]);
for(int i = 1; i < d.length; i++) {
buf.append(sep).append(d[i]);
}
return buf;
} | [
"public",
"static",
"StringBuilder",
"formatTo",
"(",
"StringBuilder",
"buf",
",",
"double",
"[",
"]",
"d",
",",
"String",
"sep",
")",
"{",
"if",
"(",
"d",
"==",
"null",
")",
"{",
"return",
"buf",
".",
"append",
"(",
"\"null\"",
")",
";",
"}",
"if",
... | Formats the double array d with the default number format.
@param buf String builder to append to
@param d the double array to be formatted
@param sep separator between the single values of the array, e.g. ','
@return Output buffer buf | [
"Formats",
"the",
"double",
"array",
"d",
"with",
"the",
"default",
"number",
"format",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L267-L279 |
openbase/jul | processing/default/src/main/java/org/openbase/jul/processing/QuaternionEulerTransform.java | QuaternionEulerTransform.transform | public static Quat4d transform(double roll, double pitch, double yaw) {
"""
Conversion: By combining the quaternion representations of the Euler
rotations we get for the Body 3-2-1 sequence, where the airplane first
does yaw (Body-Z) turn during taxiing on the runway, then vector3d.yes
(Body-Y) during take-off,... | java | public static Quat4d transform(double roll, double pitch, double yaw) {
return transform(new Vector3d(roll, pitch, yaw));
} | [
"public",
"static",
"Quat4d",
"transform",
"(",
"double",
"roll",
",",
"double",
"pitch",
",",
"double",
"yaw",
")",
"{",
"return",
"transform",
"(",
"new",
"Vector3d",
"(",
"roll",
",",
"pitch",
",",
"yaw",
")",
")",
";",
"}"
] | Conversion: By combining the quaternion representations of the Euler
rotations we get for the Body 3-2-1 sequence, where the airplane first
does yaw (Body-Z) turn during taxiing on the runway, then vector3d.yes
(Body-Y) during take-off, and finally rolls (Body-X) in the air. The
resulting orientation of Body 3-2-1 sequ... | [
"Conversion",
":",
"By",
"combining",
"the",
"quaternion",
"representations",
"of",
"the",
"Euler",
"rotations",
"we",
"get",
"for",
"the",
"Body",
"3",
"-",
"2",
"-",
"1",
"sequence",
"where",
"the",
"airplane",
"first",
"does",
"yaw",
"(",
"Body",
"-",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/processing/default/src/main/java/org/openbase/jul/processing/QuaternionEulerTransform.java#L54-L56 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/j/LongTuples.java | LongTuples.createSubTuple | static LongTuple createSubTuple(
LongTuple parent, int fromIndex, int toIndex) {
"""
Creates a new tuple that is a <i>view</i>
on the specified portion of the given parent. Changes in the
parent will be visible in the returned tuple.
@param parent The parent tuple
@param fromIndex The start index in... | java | static LongTuple createSubTuple(
LongTuple parent, int fromIndex, int toIndex)
{
return new SubLongTuple(parent, fromIndex, toIndex);
} | [
"static",
"LongTuple",
"createSubTuple",
"(",
"LongTuple",
"parent",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"return",
"new",
"SubLongTuple",
"(",
"parent",
",",
"fromIndex",
",",
"toIndex",
")",
";",
"}"
] | Creates a new tuple that is a <i>view</i>
on the specified portion of the given parent. Changes in the
parent will be visible in the returned tuple.
@param parent The parent tuple
@param fromIndex The start index in the parent, inclusive
@param toIndex The end index in the parent, exclusive
@throws NullPointerExceptio... | [
"Creates",
"a",
"new",
"tuple",
"that",
"is",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"specified",
"portion",
"of",
"the",
"given",
"parent",
".",
"Changes",
"in",
"the",
"parent",
"will",
"be",
"visible",
"in",
"the",
"returned",
"tuple",... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/j/LongTuples.java#L229-L233 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java | PermissionUtil.getPermissions | public static List<ContentPermission> getPermissions(String[] perms) {
"""
Get a list of ContentPermission from given string
@param perms a string of role-name,capability pais, separated by commna
@return
"""
List<ContentPermission> permissions = null;
if (perms != null && perms.length > 0) {... | java | public static List<ContentPermission> getPermissions(String[] perms) {
List<ContentPermission> permissions = null;
if (perms != null && perms.length > 0) {
int i = 0;
while (i + 1 < perms.length) {
String roleName = perms[i++];
if (roleName == null... | [
"public",
"static",
"List",
"<",
"ContentPermission",
">",
"getPermissions",
"(",
"String",
"[",
"]",
"perms",
")",
"{",
"List",
"<",
"ContentPermission",
">",
"permissions",
"=",
"null",
";",
"if",
"(",
"perms",
"!=",
"null",
"&&",
"perms",
".",
"length",... | Get a list of ContentPermission from given string
@param perms a string of role-name,capability pais, separated by commna
@return | [
"Get",
"a",
"list",
"of",
"ContentPermission",
"from",
"given",
"string"
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/utilities/PermissionUtil.java#L50-L73 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateStorageAccount | public StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags) {
"""
Updates the specified attributes associated with the given storage... | java | public StorageBundle updateStorageAccount(String vaultBaseUrl, String storageAccountName, String activeKeyName, Boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags) {
return updateStorageAccountWithServiceResponseAsync(vaultBaseUrl, s... | [
"public",
"StorageBundle",
"updateStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"activeKeyName",
",",
"Boolean",
"autoRegenerateKey",
",",
"String",
"regenerationPeriod",
",",
"StorageAccountAttributes",
"storageAccountAtt... | Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param activeKeyName The current active stor... | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"/",
"update",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10186-L10188 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setTextColor | public static void setTextColor(EfficientCacheView cacheView, int viewId, @ColorInt int color) {
"""
Equivalent to calling TextView.setTextColor
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose text color should change
@param color The new color for the vi... | java | public static void setTextColor(EfficientCacheView cacheView, int viewId, @ColorInt int color) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof TextView) {
((TextView) view).setTextColor(color);
}
} | [
"public",
"static",
"void",
"setTextColor",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"@",
"ColorInt",
"int",
"color",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"vie... | Equivalent to calling TextView.setTextColor
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose text color should change
@param color The new color for the view | [
"Equivalent",
"to",
"calling",
"TextView",
".",
"setTextColor"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L143-L148 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat
getDateTimeInstance(int dateStyle, int timeStyle, Locale aLocale) {
"""
Gets the date/time formatter with the given formatting styles
for the given locale.
@param dateStyle the given date formatting style.
@param timeStyle the given time formatting style.
@param aLocale t... | java | public final static DateFormat
getDateTimeInstance(int dateStyle, int timeStyle, Locale aLocale)
{
return get(timeStyle, dateStyle, 3, aLocale);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
",",
"Locale",
"aLocale",
")",
"{",
"return",
"get",
"(",
"timeStyle",
",",
"dateStyle",
",",
"3",
",",
"aLocale",
")",
";",
"}"
] | Gets the date/time formatter with the given formatting styles
for the given locale.
@param dateStyle the given date formatting style.
@param timeStyle the given time formatting style.
@param aLocale the given locale.
@return a date/time formatter. | [
"Gets",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"given",
"formatting",
"styles",
"for",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java#L546-L550 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java | GroovyRuntimeUtil.invokeClosure | @SuppressWarnings("unchecked")
public static <T> T invokeClosure(Closure<T> closure, Object... args) {
"""
Note: This method may throw checked exceptions although it doesn't say so.
"""
try {
return closure.call(args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.g... | java | @SuppressWarnings("unchecked")
public static <T> T invokeClosure(Closure<T> closure, Object... args) {
try {
return closure.call(args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
return null; // never reached
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"invokeClosure",
"(",
"Closure",
"<",
"T",
">",
"closure",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"return",
"closure",
".",
"call",
"(",
"args",
")... | Note: This method may throw checked exceptions although it doesn't say so. | [
"Note",
":",
"This",
"method",
"may",
"throw",
"checked",
"exceptions",
"although",
"it",
"doesn",
"t",
"say",
"so",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L198-L206 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java | GlobalInterlock.obtainLock | public static String obtainLock(EntityManager em, long expiration, long type, String note) {
"""
Obtains a global lock of a given type.
@param em The entity manager to use. Cannot be null.
@param expiration The time in milliseconds after which an existing lock may be clobbered and re-acquired.
@... | java | public static String obtainLock(EntityManager em, long expiration, long type, String note) {
EntityTransaction tx = null;
/* remove the existing lock if it's expired */
try {
long now = System.currentTimeMillis();
tx = em.getTransaction();
tx.begin();
... | [
"public",
"static",
"String",
"obtainLock",
"(",
"EntityManager",
"em",
",",
"long",
"expiration",
",",
"long",
"type",
",",
"String",
"note",
")",
"{",
"EntityTransaction",
"tx",
"=",
"null",
";",
"/* remove the existing lock if it's expired */",
"try",
"{",
"lon... | Obtains a global lock of a given type.
@param em The entity manager to use. Cannot be null.
@param expiration The time in milliseconds after which an existing lock may be clobbered and re-acquired.
@param type The application specific lock type represented as a long value.
@param note A... | [
"Obtains",
"a",
"global",
"lock",
"of",
"a",
"given",
"type",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java#L140-L182 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java | MenuLoader.requestPlaylistMenuFrom | public List<Message> requestPlaylistMenuFrom(final SlotReference slotReference, final int sortOrder)
throws Exception {
"""
Ask the specified player for a Playlist menu. This boils down to a call to
{@link MetadataFinder#requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)} aski... | java | public List<Message> requestPlaylistMenuFrom(final SlotReference slotReference, final int sortOrder)
throws Exception {
return MetadataFinder.getInstance().requestPlaylistItemsFrom(slotReference.player, slotReference.slot, sortOrder,
0, true);
} | [
"public",
"List",
"<",
"Message",
">",
"requestPlaylistMenuFrom",
"(",
"final",
"SlotReference",
"slotReference",
",",
"final",
"int",
"sortOrder",
")",
"throws",
"Exception",
"{",
"return",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"requestPlaylistItemsF... | Ask the specified player for a Playlist menu. This boils down to a call to
{@link MetadataFinder#requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)} asking for
the playlist folder with ID 0, but it is also made available here since this is likely where people will be
looking for the capability.... | [
"Ask",
"the",
"specified",
"player",
"for",
"a",
"Playlist",
"menu",
".",
"This",
"boils",
"down",
"to",
"a",
"call",
"to",
"{",
"@link",
"MetadataFinder#requestPlaylistItemsFrom",
"(",
"int",
"CdjStatus",
".",
"TrackSourceSlot",
"int",
"int",
"boolean",
")",
... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java#L87-L92 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java | Authentication.validLogin | public boolean validLogin(String identifier, String password, String hash) {
"""
Creates a hashed value of a given clear text password and checks if the
value matches a given, already hashed password
@param identifier The identifier to authenticate
@param password The clear text password
@param hash The prev... | java | public boolean validLogin(String identifier, String password, String hash) {
Objects.requireNonNull(identifier, Required.USERNAME.toString());
Objects.requireNonNull(password, Required.PASSWORD.toString());
Objects.requireNonNull(hash, Required.HASH.toString());
Cache cache = Applicatio... | [
"public",
"boolean",
"validLogin",
"(",
"String",
"identifier",
",",
"String",
"password",
",",
"String",
"hash",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"identifier",
",",
"Required",
".",
"USERNAME",
".",
"toString",
"(",
")",
")",
";",
"Objects",... | Creates a hashed value of a given clear text password and checks if the
value matches a given, already hashed password
@param identifier The identifier to authenticate
@param password The clear text password
@param hash The previously hashed password to check
@return True if the new hashed password matches the hash, f... | [
"Creates",
"a",
"hashed",
"value",
"of",
"a",
"given",
"clear",
"text",
"password",
"and",
"checks",
"if",
"the",
"value",
"matches",
"a",
"given",
"already",
"hashed",
"password"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java#L109-L123 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/KeyArea.java | KeyArea.isNull | public boolean isNull(int iAreaDesc, boolean bIncludeTempFields) {
"""
If any of the non-counter fields are null, return true.
@param iAreaDesc
@return
"""
for (int i = 0; i < this.getKeyFields(false, bIncludeTempFields); i++)
{
if (this.getField(i) != this.getRecord().getCounterF... | java | public boolean isNull(int iAreaDesc, boolean bIncludeTempFields)
{
for (int i = 0; i < this.getKeyFields(false, bIncludeTempFields); i++)
{
if (this.getField(i) != this.getRecord().getCounterField())
if (this.getKeyField(i).getField(iAreaDesc).isNull())
... | [
"public",
"boolean",
"isNull",
"(",
"int",
"iAreaDesc",
",",
"boolean",
"bIncludeTempFields",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"getKeyFields",
"(",
"false",
",",
"bIncludeTempFields",
")",
";",
"i",
"++",
")",
"{"... | If any of the non-counter fields are null, return true.
@param iAreaDesc
@return | [
"If",
"any",
"of",
"the",
"non",
"-",
"counter",
"fields",
"are",
"null",
"return",
"true",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/KeyArea.java#L664-L673 |
google/auto | common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java | GeneratedAnnotationSpecs.generatedAnnotationSpec | public static Optional<AnnotationSpec> generatedAnnotationSpec(
Elements elements, SourceVersion sourceVersion, Class<?> processorClass, String comments) {
"""
Returns {@code @Generated(value = "processorClass", comments = "comments"} for the target
{@code SourceVersion}.
<p>Returns {@code javax.annotati... | java | public static Optional<AnnotationSpec> generatedAnnotationSpec(
Elements elements, SourceVersion sourceVersion, Class<?> processorClass, String comments) {
return generatedAnnotationSpecBuilder(elements, sourceVersion, processorClass)
.map(annotation -> annotation.addMember("comments", "$S", comments)... | [
"public",
"static",
"Optional",
"<",
"AnnotationSpec",
">",
"generatedAnnotationSpec",
"(",
"Elements",
"elements",
",",
"SourceVersion",
"sourceVersion",
",",
"Class",
"<",
"?",
">",
"processorClass",
",",
"String",
"comments",
")",
"{",
"return",
"generatedAnnotat... | Returns {@code @Generated(value = "processorClass", comments = "comments"} for the target
{@code SourceVersion}.
<p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@code
javax.annotation.Generated} for earlier releases, and Optional#empty()} if the annotation is
not available. | [
"Returns",
"{",
"@code",
"@Generated",
"(",
"value",
"=",
"processorClass",
"comments",
"=",
"comments",
"}",
"for",
"the",
"target",
"{",
"@code",
"SourceVersion",
"}",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java#L87-L91 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.waitForElementPresent | public void waitForElementPresent(final By by, final int maximumSeconds) {
"""
Waits until an element will be displayed into the page.
@param by
the method of identifying the element
@param maximumSeconds
maximum number of methods to wait for the element to be
present
"""
WebDriverWait wait = new WebD... | java | public void waitForElementPresent(final By by, final int maximumSeconds) {
WebDriverWait wait = new WebDriverWait(driver, maximumSeconds);
wait.until(ExpectedConditions.presenceOfElementLocated((by)));
} | [
"public",
"void",
"waitForElementPresent",
"(",
"final",
"By",
"by",
",",
"final",
"int",
"maximumSeconds",
")",
"{",
"WebDriverWait",
"wait",
"=",
"new",
"WebDriverWait",
"(",
"driver",
",",
"maximumSeconds",
")",
";",
"wait",
".",
"until",
"(",
"ExpectedCond... | Waits until an element will be displayed into the page.
@param by
the method of identifying the element
@param maximumSeconds
maximum number of methods to wait for the element to be
present | [
"Waits",
"until",
"an",
"element",
"will",
"be",
"displayed",
"into",
"the",
"page",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L470-L473 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/ArrayMap.java | ArrayMap.setValueAt | public V setValueAt(int index, V value) {
"""
Set the value at a given index in the array.
@param index The desired index, must be between 0 and {@link #size()}-1.
@param value The new value to store at this index.
@return Returns the previous value at the given index.
"""
index = (index << 1) + 1;
... | java | public V setValueAt(int index, V value) {
index = (index << 1) + 1;
V old = (V)mArray[index];
mArray[index] = value;
return old;
} | [
"public",
"V",
"setValueAt",
"(",
"int",
"index",
",",
"V",
"value",
")",
"{",
"index",
"=",
"(",
"index",
"<<",
"1",
")",
"+",
"1",
";",
"V",
"old",
"=",
"(",
"V",
")",
"mArray",
"[",
"index",
"]",
";",
"mArray",
"[",
"index",
"]",
"=",
"val... | Set the value at a given index in the array.
@param index The desired index, must be between 0 and {@link #size()}-1.
@param value The new value to store at this index.
@return Returns the previous value at the given index. | [
"Set",
"the",
"value",
"at",
"a",
"given",
"index",
"in",
"the",
"array",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/ArrayMap.java#L396-L401 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java | ObjectUtils.shallowCopy | public static void shallowCopy(Object source, Object target) {
"""
Makes a shallow copy of the source object into the target one.
<p>
This method differs from {@link ReflectionUtils#shallowCopyFieldState(Object, Object)} this doesn't require
source and target objects to share the same class hierarchy.
@param... | java | public static void shallowCopy(Object source, Object target) {
ObjectUtils.doShallowCopy(source, target, Boolean.TRUE);
} | [
"public",
"static",
"void",
"shallowCopy",
"(",
"Object",
"source",
",",
"Object",
"target",
")",
"{",
"ObjectUtils",
".",
"doShallowCopy",
"(",
"source",
",",
"target",
",",
"Boolean",
".",
"TRUE",
")",
";",
"}"
] | Makes a shallow copy of the source object into the target one.
<p>
This method differs from {@link ReflectionUtils#shallowCopyFieldState(Object, Object)} this doesn't require
source and target objects to share the same class hierarchy.
@param source
the source object.
@param target
the target object. | [
"Makes",
"a",
"shallow",
"copy",
"of",
"the",
"source",
"object",
"into",
"the",
"target",
"one",
".",
"<p",
">",
"This",
"method",
"differs",
"from",
"{",
"@link",
"ReflectionUtils#shallowCopyFieldState",
"(",
"Object",
"Object",
")",
"}",
"this",
"doesn",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java#L116-L119 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/messaging/AtomAPIMMessage.java | AtomAPIMMessage.getParameterName | private static String getParameterName(Method m, int paramIndex) {
"""
Get the name of a method parameter via its <code>PName</code> annotation.
@param m
@param paramIndex the index of the parameter array.
@return the parameter name or an empty string if not available.
"""
PName pName = getParamet... | java | private static String getParameterName(Method m, int paramIndex) {
PName pName = getParameterAnnotation(m, paramIndex, PName.class);
if (pName != null) {
return pName.value();
} else {
return "";
}
} | [
"private",
"static",
"String",
"getParameterName",
"(",
"Method",
"m",
",",
"int",
"paramIndex",
")",
"{",
"PName",
"pName",
"=",
"getParameterAnnotation",
"(",
"m",
",",
"paramIndex",
",",
"PName",
".",
"class",
")",
";",
"if",
"(",
"pName",
"!=",
"null",... | Get the name of a method parameter via its <code>PName</code> annotation.
@param m
@param paramIndex the index of the parameter array.
@return the parameter name or an empty string if not available. | [
"Get",
"the",
"name",
"of",
"a",
"method",
"parameter",
"via",
"its",
"<code",
">",
"PName<",
"/",
"code",
">",
"annotation",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/messaging/AtomAPIMMessage.java#L380-L387 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByG_A | @Override
public List<CommerceCountry> findByG_A(long groupId, boolean active,
int start, int end, OrderByComparator<CommerceCountry> orderByComparator) {
"""
Returns an ordered range of all the commerce countries where groupId = ? and active = ?.
<p>
Useful when paginating results. Returns a maximu... | java | @Override
public List<CommerceCountry> findByG_A(long groupId, boolean active,
int start, int end, OrderByComparator<CommerceCountry> orderByComparator) {
return findByG_A(groupId, active, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCountry",
">",
"findByG_A",
"(",
"long",
"groupId",
",",
"boolean",
"active",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceCountry",
">",
"orderByComparator",
")",
"{",
"return... | Returns an ordered range of all the commerce countries where groupId = ? and active = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to ... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"commerce",
"countries",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L2524-L2528 |
tango-controls/JTango | server/src/main/java/org/tango/server/servant/DeviceImpl.java | DeviceImpl.write_attributes_4 | @Override
public void write_attributes_4(final AttributeValue_4[] values, final ClntIdent clIdent) throws MultiDevFailed,
DevFailed {
"""
Write some attributes. IDL 4 version
@param values a container for attribute values.
@param clIdent the client ID
@throws DevFailed
"""
MDC.set... | java | @Override
public void write_attributes_4(final AttributeValue_4[] values, final ClntIdent clIdent) throws MultiDevFailed,
DevFailed {
MDC.setContextMap(contextMap);
xlogger.entry();
checkInitialization();
final String[] names = new String[values.length];
for (int ... | [
"@",
"Override",
"public",
"void",
"write_attributes_4",
"(",
"final",
"AttributeValue_4",
"[",
"]",
"values",
",",
"final",
"ClntIdent",
"clIdent",
")",
"throws",
"MultiDevFailed",
",",
"DevFailed",
"{",
"MDC",
".",
"setContextMap",
"(",
"contextMap",
")",
";",... | Write some attributes. IDL 4 version
@param values a container for attribute values.
@param clIdent the client ID
@throws DevFailed | [
"Write",
"some",
"attributes",
".",
"IDL",
"4",
"version"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1290-L1322 |
centic9/commons-dost | src/main/java/org/dstadler/commons/svn/SVNCommands.java | SVNCommands.commitMergeInfo | public static void commitMergeInfo(String comment, File directory) throws IOException {
"""
Will commit the merge info on the root branch.
<p>
Attention: This will revert all changes on the working copy except the property on the
root-dir. Be careful to not run this on a working copy with other relevant changes... | java | public static void commitMergeInfo(String comment, File directory) throws IOException {
// all these additional merge-info updates on the sub-directories and items just
// clobbers the svn history, revert all those and just keep the merge-info on the root-directory
revertAllButRootDir(directory)... | [
"public",
"static",
"void",
"commitMergeInfo",
"(",
"String",
"comment",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"// all these additional merge-info updates on the sub-directories and items just",
"// clobbers the svn history, revert all those and just keep the mer... | Will commit the merge info on the root branch.
<p>
Attention: This will revert all changes on the working copy except the property on the
root-dir. Be careful to not run this on a working copy with other relevant changes!
@param comment The comment to use for the commit
@param directory The local working directory
@th... | [
"Will",
"commit",
"the",
"merge",
"info",
"on",
"the",
"root",
"branch",
".",
"<p",
">",
"Attention",
":",
"This",
"will",
"revert",
"all",
"changes",
"on",
"the",
"working",
"copy",
"except",
"the",
"property",
"on",
"the",
"root",
"-",
"dir",
".",
"B... | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L406-L444 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/network/BranchRemoteInterface.java | BranchRemoteInterface.processEntityForJSON | private ServerResponse processEntityForJSON(String responseString, int statusCode, String tag) {
"""
<p>Converts resultant output object from Branch Remote server into a {@link ServerResponse} object by
reading the content supplied in the raw server response, and creating a {@link JSONObject}
that contains the s... | java | private ServerResponse processEntityForJSON(String responseString, int statusCode, String tag) {
ServerResponse result = new ServerResponse(tag, statusCode);
PrefHelper.Debug("returned " + responseString);
if (responseString != null) {
try {
JSONObject jsonObj = new ... | [
"private",
"ServerResponse",
"processEntityForJSON",
"(",
"String",
"responseString",
",",
"int",
"statusCode",
",",
"String",
"tag",
")",
"{",
"ServerResponse",
"result",
"=",
"new",
"ServerResponse",
"(",
"tag",
",",
"statusCode",
")",
";",
"PrefHelper",
".",
... | <p>Converts resultant output object from Branch Remote server into a {@link ServerResponse} object by
reading the content supplied in the raw server response, and creating a {@link JSONObject}
that contains the same data. This data is then attached as the post data of the
{@link ServerResponse} object returned.</p>
@p... | [
"<p",
">",
"Converts",
"resultant",
"output",
"object",
"from",
"Branch",
"Remote",
"server",
"into",
"a",
"{",
"@link",
"ServerResponse",
"}",
"object",
"by",
"reading",
"the",
"content",
"supplied",
"in",
"the",
"raw",
"server",
"response",
"and",
"creating"... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/network/BranchRemoteInterface.java#L181-L199 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.createHomography | public static DMatrixRMaj createHomography(DMatrixRMaj R, Vector3D_F64 T,
double d, Vector3D_F64 N) {
"""
<p>
Computes a homography matrix from a rotation, translation, plane normal and plane distance:<br>
x[2] = H*x[1]<br>
where x[1] is the point on the first camera and x[2] the location in the s... | java | public static DMatrixRMaj createHomography(DMatrixRMaj R, Vector3D_F64 T,
double d, Vector3D_F64 N)
{
DMatrixRMaj H = new DMatrixRMaj(3,3);
GeometryMath_F64.outerProd(T,N,H);
CommonOps_DDRM.divide(H,d);
CommonOps_DDRM.addEquals(H, R);
return H;
} | [
"public",
"static",
"DMatrixRMaj",
"createHomography",
"(",
"DMatrixRMaj",
"R",
",",
"Vector3D_F64",
"T",
",",
"double",
"d",
",",
"Vector3D_F64",
"N",
")",
"{",
"DMatrixRMaj",
"H",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
")",
";",
"GeometryMath_F64",... | <p>
Computes a homography matrix from a rotation, translation, plane normal and plane distance:<br>
x[2] = H*x[1]<br>
where x[1] is the point on the first camera and x[2] the location in the second camera.<br>
H = R+(1/d)*T*N<sup>T</sup><br>
Where [R,T] is the transform from camera 1 to camera 2.
</p>
@param R Rotatio... | [
"<p",
">",
"Computes",
"a",
"homography",
"matrix",
"from",
"a",
"rotation",
"translation",
"plane",
"normal",
"and",
"plane",
"distance",
":",
"<br",
">",
"x",
"[",
"2",
"]",
"=",
"H",
"*",
"x",
"[",
"1",
"]",
"<br",
">",
"where",
"x",
"[",
"1",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L779-L789 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Configuration.java | Configuration.loadExtraFiles | private void loadExtraFiles(final String filterPrefix, final boolean preserveExisting) {
"""
If properties are present which start with {@link JFunkConstants#SYSTEM_PROPERTIES} the
corresponding values are taken as property files and loaded here.
"""
Map<String, String> view = Maps.filterKeys(this, Predicat... | java | private void loadExtraFiles(final String filterPrefix, final boolean preserveExisting) {
Map<String, String> view = Maps.filterKeys(this, Predicates.startsWith(filterPrefix));
while (true) {
if (view.isEmpty()) {
break;
}
Queue<String> fileKeys = Queues.newArrayDeque(view.values());
// we need to ... | [
"private",
"void",
"loadExtraFiles",
"(",
"final",
"String",
"filterPrefix",
",",
"final",
"boolean",
"preserveExisting",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"view",
"=",
"Maps",
".",
"filterKeys",
"(",
"this",
",",
"Predicates",
".",
"starts... | If properties are present which start with {@link JFunkConstants#SYSTEM_PROPERTIES} the
corresponding values are taken as property files and loaded here. | [
"If",
"properties",
"are",
"present",
"which",
"start",
"with",
"{"
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Configuration.java#L180-L206 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.getArray | @Override
public final PArray getArray(final String key) {
"""
Get a property as a array or throw exception.
@param key the property name
"""
PArray result = optArray(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
... | java | @Override
public final PArray getArray(final String key) {
PArray result = optArray(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
} | [
"@",
"Override",
"public",
"final",
"PArray",
"getArray",
"(",
"final",
"String",
"key",
")",
"{",
"PArray",
"result",
"=",
"optArray",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"ObjectMissingException",
"(",
"thi... | Get a property as a array or throw exception.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"array",
"or",
"throw",
"exception",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L206-L213 |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java | WsEchoServer.onGet | @RequestHandler(patterns = "/ws/echo", priority = 100)
public void onGet(Request.In.Get event, IOSubchannel channel)
throws InterruptedException {
"""
Handle `GET` requests.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception
"""
... | java | @RequestHandler(patterns = "/ws/echo", priority = 100)
public void onGet(Request.In.Get event, IOSubchannel channel)
throws InterruptedException {
final HttpRequest request = event.httpRequest();
if (!request.findField(
HttpField.UPGRADE, Converters.STRING_LIST)
.... | [
"@",
"RequestHandler",
"(",
"patterns",
"=",
"\"/ws/echo\"",
",",
"priority",
"=",
"100",
")",
"public",
"void",
"onGet",
"(",
"Request",
".",
"In",
".",
"Get",
"event",
",",
"IOSubchannel",
"channel",
")",
"throws",
"InterruptedException",
"{",
"final",
"Ht... | Handle `GET` requests.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception | [
"Handle",
"GET",
"requests",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java#L65-L78 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.createOrUpdateWorkerPoolAsync | public Observable<WorkerPoolResourceInner> createOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
"""
Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which t... | java | public Observable<WorkerPoolResourceInner> createOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return createOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(new Func1<... | [
"public",
"Observable",
"<",
"WorkerPoolResourceInner",
">",
"createOrUpdateWorkerPoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelope",
")",
"{",
"return",
"createOrUpdat... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5221-L5228 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.beginDelete | public void beginDelete(String resourceGroupName, String name, Boolean forceDelete) {
"""
Delete an App Service Environment.
Delete an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param forceDelet... | java | public void beginDelete(String resourceGroupName, String name, Boolean forceDelete) {
beginDeleteWithServiceResponseAsync(resourceGroupName, name, forceDelete).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"Boolean",
"forceDelete",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"forceDelete",
")",
".",
"toBlocking",
"(",
")",
... | Delete an App Service Environment.
Delete an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param forceDelete Specify <code>true</code> to force the deletion even if the App Service Environment co... | [
"Delete",
"an",
"App",
"Service",
"Environment",
".",
"Delete",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L1099-L1101 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java | MessageImpl.removeReaction | public void removeReaction(Emoji emoji, boolean you) {
"""
Removes an emoji from the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not.
"""
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
... | java | public void removeReaction(Emoji emoji, boolean you) {
Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny();
reaction.ifPresent(r -> ((ReactionImpl) r).decrementCount(you));
reactions.removeIf(r -> r.getCount() <= 0);
} | [
"public",
"void",
"removeReaction",
"(",
"Emoji",
"emoji",
",",
"boolean",
"you",
")",
"{",
"Optional",
"<",
"Reaction",
">",
"reaction",
"=",
"reactions",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"r",
"->",
"emoji",
".",
"equalsEmoji",
"(",
"r",
"... | Removes an emoji from the list of reactions.
@param emoji The emoji.
@param you Whether this reaction is used by you or not. | [
"Removes",
"an",
"emoji",
"from",
"the",
"list",
"of",
"reactions",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageImpl.java#L274-L278 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/IndyGuardsFiltersAndSignatures.java | IndyGuardsFiltersAndSignatures.invokeGroovyObjectInvoker | public static Object invokeGroovyObjectInvoker(MissingMethodException e, Object receiver, String name, Object[] args) {
"""
{@link GroovyObject#invokeMethod(String, Object)} path as fallback.
This method is called by the handle as exception handler in case the
selected method causes a MissingMethodExecutionFaile... | java | public static Object invokeGroovyObjectInvoker(MissingMethodException e, Object receiver, String name, Object[] args) {
if (e instanceof MissingMethodExecutionFailed) {
throw (MissingMethodException)e.getCause();
} else if (receiver.getClass() == e.getType() && e.getMethod().equals(name)) {
... | [
"public",
"static",
"Object",
"invokeGroovyObjectInvoker",
"(",
"MissingMethodException",
"e",
",",
"Object",
"receiver",
",",
"String",
"name",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"e",
"instanceof",
"MissingMethodExecutionFailed",
")",
"{",
"t... | {@link GroovyObject#invokeMethod(String, Object)} path as fallback.
This method is called by the handle as exception handler in case the
selected method causes a MissingMethodExecutionFailed, where
we will just give through the exception, and a normal
MissingMethodException where we call {@link GroovyObject#invokeMetho... | [
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/IndyGuardsFiltersAndSignatures.java#L155-L167 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/rendering/writers/DelegatingWriter.java | DelegatingWriter.mergeExceptions | private IOException mergeExceptions(String actionVerb, Collection<Exception> exceptions) {
"""
Creates a single {@link IOException} merging potentially multiple cause exceptions into it.
Having this as a separate method helps avoiding unnecessary wrapping for the 'single exception' case.
<p>
Only in case a non-... | java | private IOException mergeExceptions(String actionVerb, Collection<Exception> exceptions) {
if (exceptions.size() == 1) {
Exception singleException = exceptions.iterator().next();
if (singleException instanceof RuntimeException) {
throw (RuntimeException) singleException;
... | [
"private",
"IOException",
"mergeExceptions",
"(",
"String",
"actionVerb",
",",
"Collection",
"<",
"Exception",
">",
"exceptions",
")",
"{",
"if",
"(",
"exceptions",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"Exception",
"singleException",
"=",
"exceptions",
... | Creates a single {@link IOException} merging potentially multiple cause exceptions into it.
Having this as a separate method helps avoiding unnecessary wrapping for the 'single exception' case.
<p>
Only in case a non-<code>IO</code> checked exception or multiple exceptions occurred,
this method will create a new IOExce... | [
"Creates",
"a",
"single",
"{",
"@link",
"IOException",
"}",
"merging",
"potentially",
"multiple",
"cause",
"exceptions",
"into",
"it",
".",
"Having",
"this",
"as",
"a",
"separate",
"method",
"helps",
"avoiding",
"unnecessary",
"wrapping",
"for",
"the",
"single",... | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/rendering/writers/DelegatingWriter.java#L129-L143 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/DBObject.java | DBObject.addFieldValues | public void addFieldValues(String fieldName, Collection<String> values) {
"""
Add the value(s) in the given collection to the field with the given name. If the
given collection is null or empty, this method is a no-op.
@param fieldName Name of field.
@param values Collection of values. Ignored if null or e... | java | public void addFieldValues(String fieldName, Collection<String> values) {
Utils.require(!Utils.isEmpty(fieldName), "fieldName");
if (values != null && values.size() > 0) {
if (fieldName.charAt(0) == '_') {
Utils.require(values.size() == 1, "System fields can hav... | [
"public",
"void",
"addFieldValues",
"(",
"String",
"fieldName",
",",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"fieldName",
")",
",",
"\"fieldName\"",
")",
";",
"if",
"(",
"valu... | Add the value(s) in the given collection to the field with the given name. If the
given collection is null or empty, this method is a no-op.
@param fieldName Name of field.
@param values Collection of values. Ignored if null or empty. | [
"Add",
"the",
"value",
"(",
"s",
")",
"in",
"the",
"given",
"collection",
"to",
"the",
"field",
"with",
"the",
"given",
"name",
".",
"If",
"the",
"given",
"collection",
"is",
"null",
"or",
"empty",
"this",
"method",
"is",
"a",
"no",
"-",
"op",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/DBObject.java#L377-L393 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java | McfCodeGen.writeImport | @Override
public void writeImport(Definition def, Writer out) throws IOException {
"""
Output class import
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("package " + def.getRaPackage() + ";\n\n");
out.write("import java.io.PrintWriter;\n");
out.... | java | @Override
public void writeImport(Definition def, Writer out) throws IOException
{
out.write("package " + def.getRaPackage() + ";\n\n");
out.write("import java.io.PrintWriter;\n");
out.write("import java.util.Iterator;\n");
out.write("import java.util.Set;\n\n");
importLogging(def, o... | [
"@",
"Override",
"public",
"void",
"writeImport",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"package \"",
"+",
"def",
".",
"getRaPackage",
"(",
")",
"+",
"\";\\n\\n\"",
")",
";",
"out",
... | Output class import
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class",
"import"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java#L133-L162 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getFromFirstExcl | @Nullable
public static String getFromFirstExcl (@Nullable final String sStr, final char cSearch) {
"""
Get everything from the string from and excluding the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the... | java | @Nullable
public static String getFromFirstExcl (@Nullable final String sStr, final char cSearch)
{
return _getFromFirst (sStr, cSearch, false);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getFromFirstExcl",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"_getFromFirst",
"(",
"sStr",
",",
"cSearch",
",",
"false",
")",
";",
"}"
] | Get everything from the string from and excluding the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the passed string does not contain the search
character. | [
"Get",
"everything",
"from",
"the",
"string",
"from",
"and",
"excluding",
"the",
"first",
"passed",
"char",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4950-L4954 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getDocument | public byte[] getDocument(String accountId, String envelopeId, String documentId) throws ApiException {
"""
Gets a document from an envelope.
Retrieves the specified document from the envelope. If the account has the Highlight Data Changes feature enabled, there is an option to request that any changes in the env... | java | public byte[] getDocument(String accountId, String envelopeId, String documentId) throws ApiException {
return getDocument(accountId, envelopeId, documentId, null);
} | [
"public",
"byte",
"[",
"]",
"getDocument",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"documentId",
")",
"throws",
"ApiException",
"{",
"return",
"getDocument",
"(",
"accountId",
",",
"envelopeId",
",",
"documentId",
",",
"null",
"... | Gets a document from an envelope.
Retrieves the specified document from the envelope. If the account has the Highlight Data Changes feature enabled, there is an option to request that any changes in the envelope be highlighted. You can also use this method to retrieve a PDF containing the combined content of all docum... | [
"Gets",
"a",
"document",
"from",
"an",
"envelope",
".",
"Retrieves",
"the",
"specified",
"document",
"from",
"the",
"envelope",
".",
"If",
"the",
"account",
"has",
"the",
"Highlight",
"Data",
"Changes",
"feature",
"enabled",
"there",
"is",
"an",
"option",
"t... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L2217-L2219 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/checkouts/AppliedDiscountUrl.java | AppliedDiscountUrl.removeCouponUrl | public static MozuUrl removeCouponUrl(String checkoutId, String couponCode) {
"""
Get Resource Url for RemoveCoupon
@param checkoutId The unique identifier of the checkout.
@param couponCode Code associated with the coupon to remove from the cart.
@return String Resource Url
"""
UrlFormatter formatter ... | java | public static MozuUrl removeCouponUrl(String checkoutId, String couponCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/coupons/{couponcode}");
formatter.formatUrl("checkoutId", checkoutId);
formatter.formatUrl("couponCode", couponCode);
return new MozuUrl(formatter.g... | [
"public",
"static",
"MozuUrl",
"removeCouponUrl",
"(",
"String",
"checkoutId",
",",
"String",
"couponCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/checkouts/{checkoutId}/coupons/{couponcode}\"",
")",
";",
"formatter",
".",... | Get Resource Url for RemoveCoupon
@param checkoutId The unique identifier of the checkout.
@param couponCode Code associated with the coupon to remove from the cart.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"RemoveCoupon"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/checkouts/AppliedDiscountUrl.java#L50-L56 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java | TypeEnter.DefaultConstructor | JCTree DefaultConstructor(TreeMaker make,
ClassSymbol c,
MethodSymbol baseInit,
List<Type> typarams,
List<Type> argtypes,
List<Type> thrown,
long flags,... | java | JCTree DefaultConstructor(TreeMaker make,
ClassSymbol c,
MethodSymbol baseInit,
List<Type> typarams,
List<Type> argtypes,
List<Type> thrown,
long flags,... | [
"JCTree",
"DefaultConstructor",
"(",
"TreeMaker",
"make",
",",
"ClassSymbol",
"c",
",",
"MethodSymbol",
"baseInit",
",",
"List",
"<",
"Type",
">",
"typarams",
",",
"List",
"<",
"Type",
">",
"argtypes",
",",
"List",
"<",
"Type",
">",
"thrown",
",",
"long",
... | Generate default constructor for given class. For classes different
from java.lang.Object, this is:
c(argtype_0 x_0, ..., argtype_n x_n) throws thrown {
super(x_0, ..., x_n)
}
or, if based == true:
c(argtype_0 x_0, ..., argtype_n x_n) throws thrown {
x_0.super(x_1, ..., x_n)
}
@param make The tree factory.
@par... | [
"Generate",
"default",
"constructor",
"for",
"given",
"class",
".",
"For",
"classes",
"different",
"from",
"java",
".",
"lang",
".",
"Object",
"this",
"is",
":"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java#L1014-L1047 |
DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/MultiFieldDocument.java | MultiFieldDocument.getScore | private double getScore(int pos, Lexicon lexicon, double numdocs) {
"""
Returns the score of an attribute given the weighting scheme specified in
the lexicon or for a specific field
"""
double score = 0;
int indexTerm = this.indices[pos];
double occurences = (double) this.freqs[pos];
int fieldNum = t... | java | private double getScore(int pos, Lexicon lexicon, double numdocs) {
double score = 0;
int indexTerm = this.indices[pos];
double occurences = (double) this.freqs[pos];
int fieldNum = this.indexToField[pos];
double frequency = occurences / tokensPerField[fieldNum];
// is there a custom weight for this field... | [
"private",
"double",
"getScore",
"(",
"int",
"pos",
",",
"Lexicon",
"lexicon",
",",
"double",
"numdocs",
")",
"{",
"double",
"score",
"=",
"0",
";",
"int",
"indexTerm",
"=",
"this",
".",
"indices",
"[",
"pos",
"]",
";",
"double",
"occurences",
"=",
"("... | Returns the score of an attribute given the weighting scheme specified in
the lexicon or for a specific field | [
"Returns",
"the",
"score",
"of",
"an",
"attribute",
"given",
"the",
"weighting",
"scheme",
"specified",
"in",
"the",
"lexicon",
"or",
"for",
"a",
"specific",
"field"
] | train | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/MultiFieldDocument.java#L301-L327 |
loadimpact/loadimpact-sdk-java | src/main/java/com/loadimpact/util/StringUtils.java | StringUtils.startsWith | public static boolean startsWith(Object target, String prefix) {
"""
Returns true if the target string has a value and starts with the given prefix (null-safe).
@param target string to investigate
@param prefix substring to check for
@return true if prefix starts in target
"""
if (target==null... | java | public static boolean startsWith(Object target, String prefix) {
if (target==null || prefix==null) return false;
String targetTxt = target.toString();
return targetTxt.length() > 0 && targetTxt.startsWith(prefix);
} | [
"public",
"static",
"boolean",
"startsWith",
"(",
"Object",
"target",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"target",
"==",
"null",
"||",
"prefix",
"==",
"null",
")",
"return",
"false",
";",
"String",
"targetTxt",
"=",
"target",
".",
"toString",
... | Returns true if the target string has a value and starts with the given prefix (null-safe).
@param target string to investigate
@param prefix substring to check for
@return true if prefix starts in target | [
"Returns",
"true",
"if",
"the",
"target",
"string",
"has",
"a",
"value",
"and",
"starts",
"with",
"the",
"given",
"prefix",
"(",
"null",
"-",
"safe",
")",
"."
] | train | https://github.com/loadimpact/loadimpact-sdk-java/blob/49af80b768c5453266414108b0d30a0fc01b8cef/src/main/java/com/loadimpact/util/StringUtils.java#L44-L48 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/dom/client/DOMImplWebkit.java | DOMImplWebkit.setDraggable | @Override
public void setDraggable(Element elem, String draggable) {
"""
Webkit based browsers require that we set the webkit-user-drag style
attribute to make an element draggable.
"""
super.setDraggable(elem, draggable);
if ("true".equals(draggable)) {
elem.getStyle().setProperty("webkitUser... | java | @Override
public void setDraggable(Element elem, String draggable) {
super.setDraggable(elem, draggable);
if ("true".equals(draggable)) {
elem.getStyle().setProperty("webkitUserDrag", "element");
} else {
elem.getStyle().clearProperty("webkitUserDrag");
}
} | [
"@",
"Override",
"public",
"void",
"setDraggable",
"(",
"Element",
"elem",
",",
"String",
"draggable",
")",
"{",
"super",
".",
"setDraggable",
"(",
"elem",
",",
"draggable",
")",
";",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"draggable",
")",
")",
"{",... | Webkit based browsers require that we set the webkit-user-drag style
attribute to make an element draggable. | [
"Webkit",
"based",
"browsers",
"require",
"that",
"we",
"set",
"the",
"webkit",
"-",
"user",
"-",
"drag",
"style",
"attribute",
"to",
"make",
"an",
"element",
"draggable",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/dom/client/DOMImplWebkit.java#L58-L66 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/Record.java | Record.getClosingParenthesisPosition | private int getClosingParenthesisPosition(String text, int opening) {
"""
Look for the closing parenthesis corresponding to the one at position
represented by the opening index.
@param text input expression
@param opening opening parenthesis index
@return closing parenthesis index
"""
if (text.char... | java | private int getClosingParenthesisPosition(String text, int opening)
{
if (text.charAt(opening) != '(')
{
return -1;
}
int count = 0;
for (int i = opening; i < text.length(); i++)
{
char c = text.charAt(i);
switch (c)
{
case '(':
... | [
"private",
"int",
"getClosingParenthesisPosition",
"(",
"String",
"text",
",",
"int",
"opening",
")",
"{",
"if",
"(",
"text",
".",
"charAt",
"(",
"opening",
")",
"!=",
"'",
"'",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"count",
"=",
"0",
";",
... | Look for the closing parenthesis corresponding to the one at position
represented by the opening index.
@param text input expression
@param opening opening parenthesis index
@return closing parenthesis index | [
"Look",
"for",
"the",
"closing",
"parenthesis",
"corresponding",
"to",
"the",
"one",
"at",
"position",
"represented",
"by",
"the",
"opening",
"index",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/Record.java#L204-L236 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/algorithms/MaxSAT.java | MaxSAT.addSoftClause | public void addSoftClause(int weight, final LNGIntVector lits) {
"""
Adds a new soft clause to the soft clause database.
@param weight the weight of the soft clause
@param lits the literals of the soft clause
"""
final LNGIntVector rVars = new LNGIntVector();
this.softClauses.push(new MSSoftClause(... | java | public void addSoftClause(int weight, final LNGIntVector lits) {
final LNGIntVector rVars = new LNGIntVector();
this.softClauses.push(new MSSoftClause(lits, weight, LIT_UNDEF, rVars));
this.nbSoft++;
} | [
"public",
"void",
"addSoftClause",
"(",
"int",
"weight",
",",
"final",
"LNGIntVector",
"lits",
")",
"{",
"final",
"LNGIntVector",
"rVars",
"=",
"new",
"LNGIntVector",
"(",
")",
";",
"this",
".",
"softClauses",
".",
"push",
"(",
"new",
"MSSoftClause",
"(",
... | Adds a new soft clause to the soft clause database.
@param weight the weight of the soft clause
@param lits the literals of the soft clause | [
"Adds",
"a",
"new",
"soft",
"clause",
"to",
"the",
"soft",
"clause",
"database",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/algorithms/MaxSAT.java#L247-L251 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerDelete.java | AbstractWebPageActionHandlerDelete.createDeleteToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createDeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject) {
"""
Create toolbar for deleting an existin... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createDeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject)
{
final Locale aDisplayLocale = aWPEC.getDi... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createDeleteToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nonnull",
"final",
"DATATYPE",
"aSelectedObject",
")",
"{... | Create toolbar for deleting an existing object
@param aWPEC
The web page execution context
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObject
Selected object. Never <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"deleting",
"an",
"existing",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerDelete.java#L125-L145 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/random/RandomLong.java | RandomLong.nextLong | public static long nextLong(long minValue, long maxValue) {
"""
Generates a long in the range ['min', 'max']. If 'max' is omitted, then
the range will be set to [0, 'min'].
@param minValue minimum value of the long that will be generated. If 'max' is
omitted, then 'max' is set to 'min' and 'min' is set to 0.
... | java | public static long nextLong(long minValue, long maxValue)
{
if (maxValue - minValue <= 0)
return minValue;
return minValue + _random.nextInt((int)(maxValue - minValue));
} | [
"public",
"static",
"long",
"nextLong",
"(",
"long",
"minValue",
",",
"long",
"maxValue",
")",
"{",
"if",
"(",
"maxValue",
"-",
"minValue",
"<=",
"0",
")",
"return",
"minValue",
";",
"return",
"minValue",
"+",
"_random",
".",
"nextInt",
"(",
"(",
"int",
... | Generates a long in the range ['min', 'max']. If 'max' is omitted, then
the range will be set to [0, 'min'].
@param minValue minimum value of the long that will be generated. If 'max' is
omitted, then 'max' is set to 'min' and 'min' is set to 0.
@param maxValue (optional) maximum value of the long that will be generat... | [
"Generates",
"a",
"long",
"in",
"the",
"range",
"[",
"min",
"max",
"]",
".",
"If",
"max",
"is",
"omitted",
"then",
"the",
"range",
"will",
"be",
"set",
"to",
"[",
"0",
"min",
"]",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomLong.java#L43-L49 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/util/TokenUtils.java | TokenUtils.readPublicKey | public static PublicKey readPublicKey(String pemResName) throws Exception {
"""
Read a PEM encoded public key from the classpath
@param pemResName - key file resource name
@return PublicKey
@throws Exception on decode failure
"""
InputStream contentIS = TokenUtils.class.getResourceAsStream(pemResN... | java | public static PublicKey readPublicKey(String pemResName) throws Exception {
InputStream contentIS = TokenUtils.class.getResourceAsStream(pemResName);
byte[] tmp = new byte[4096];
int length = contentIS.read(tmp);
PublicKey publicKey = decodePublicKey(new String(tmp, 0, length));
... | [
"public",
"static",
"PublicKey",
"readPublicKey",
"(",
"String",
"pemResName",
")",
"throws",
"Exception",
"{",
"InputStream",
"contentIS",
"=",
"TokenUtils",
".",
"class",
".",
"getResourceAsStream",
"(",
"pemResName",
")",
";",
"byte",
"[",
"]",
"tmp",
"=",
... | Read a PEM encoded public key from the classpath
@param pemResName - key file resource name
@return PublicKey
@throws Exception on decode failure | [
"Read",
"a",
"PEM",
"encoded",
"public",
"key",
"from",
"the",
"classpath"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/util/TokenUtils.java#L177-L183 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java | LogViewer.createLevelByString | private Level createLevelByString(String levelString) throws IllegalArgumentException {
"""
This method creates a java.util.Level object from a string with the level name.
@param levelString
- a String representing the name of the Level.
@return a Level object
"""
try {
return Level.pa... | java | private Level createLevelByString(String levelString) throws IllegalArgumentException {
try {
return Level.parse(levelString.toUpperCase());
//return WsLevel.parse(levelString.toUpperCase());
} catch (Exception npe) {
throw new IllegalArgumentException(getLocalizedPar... | [
"private",
"Level",
"createLevelByString",
"(",
"String",
"levelString",
")",
"throws",
"IllegalArgumentException",
"{",
"try",
"{",
"return",
"Level",
".",
"parse",
"(",
"levelString",
".",
"toUpperCase",
"(",
")",
")",
";",
"//return WsLevel.parse(levelString.toUppe... | This method creates a java.util.Level object from a string with the level name.
@param levelString
- a String representing the name of the Level.
@return a Level object | [
"This",
"method",
"creates",
"a",
"java",
".",
"util",
".",
"Level",
"object",
"from",
"a",
"string",
"with",
"the",
"level",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java#L1409-L1417 |
google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.getQualifiedName | public static String getQualifiedName(Descriptors.EnumDescriptor enumType, ProtoFlavor flavor) {
"""
Returns the fully-qualified name for the enum descriptor with the given flavor (uses '.' inner
class seperator).
"""
return getClassName(enumType, flavor).replace('$', '.');
} | java | public static String getQualifiedName(Descriptors.EnumDescriptor enumType, ProtoFlavor flavor) {
return getClassName(enumType, flavor).replace('$', '.');
} | [
"public",
"static",
"String",
"getQualifiedName",
"(",
"Descriptors",
".",
"EnumDescriptor",
"enumType",
",",
"ProtoFlavor",
"flavor",
")",
"{",
"return",
"getClassName",
"(",
"enumType",
",",
"flavor",
")",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",... | Returns the fully-qualified name for the enum descriptor with the given flavor (uses '.' inner
class seperator). | [
"Returns",
"the",
"fully",
"-",
"qualified",
"name",
"for",
"the",
"enum",
"descriptor",
"with",
"the",
"given",
"flavor",
"(",
"uses",
".",
"inner",
"class",
"seperator",
")",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L78-L80 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java | Arc42DocumentationTemplate.addCrosscuttingConceptsSection | public Section addCrosscuttingConceptsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds a "Crosscutting Concepts" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@para... | java | public Section addCrosscuttingConceptsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Crosscutting Concepts", files);
} | [
"public",
"Section",
"addCrosscuttingConceptsSection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Crosscutting Concepts\"",
",",
"files",
")",
";",
"}"... | Adds a "Crosscutting Concepts" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation... | [
"Adds",
"a",
"Crosscutting",
"Concepts",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java#L217-L219 |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/extractor/PropertyExtractor.java | PropertyExtractor.findReadMethod | protected Method findReadMethod(String propertyName, Class cls) {
"""
Attempt to find a read method for the specified property name.
<p/>
This method attempts to find a read method by prepending prefixes 'get'
and 'is' to the specified property name, in that order.
@param propertyName property name
@param c... | java | protected Method findReadMethod(String propertyName, Class cls) {
String name = Character.toUpperCase(propertyName.charAt(0))
+ propertyName.substring(1);
for (String prefix : PREFIXES) {
try {
return cls.getMethod(prefix + name);
}
... | [
"protected",
"Method",
"findReadMethod",
"(",
"String",
"propertyName",
",",
"Class",
"cls",
")",
"{",
"String",
"name",
"=",
"Character",
".",
"toUpperCase",
"(",
"propertyName",
".",
"charAt",
"(",
"0",
")",
")",
"+",
"propertyName",
".",
"substring",
"(",... | Attempt to find a read method for the specified property name.
<p/>
This method attempts to find a read method by prepending prefixes 'get'
and 'is' to the specified property name, in that order.
@param propertyName property name
@param cls class containing the property
@return read method for the property, ... | [
"Attempt",
"to",
"find",
"a",
"read",
"method",
"for",
"the",
"specified",
"property",
"name",
".",
"<p",
"/",
">",
"This",
"method",
"attempts",
"to",
"find",
"a",
"read",
"method",
"by",
"prepending",
"prefixes",
"get",
"and",
"is",
"to",
"the",
"speci... | train | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/extractor/PropertyExtractor.java#L122-L135 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/mysql/CheckMysql.java | CheckMysql.checkSlave | private Metric checkSlave(final ICommandLine cl, final Mysql mysql, final Connection conn) throws MetricGatheringException {
"""
Check the status of mysql slave thread.
@param cl
The command line
@param mysql
MySQL connection mgr object
@param conn
The SQL connection
@return ReturnValue -
@throws MetricG... | java | private Metric checkSlave(final ICommandLine cl, final Mysql mysql, final Connection conn) throws MetricGatheringException {
Metric metric = null;
try {
Map<String, Integer> status = getSlaveStatus(conn);
if (status.isEmpty()) {
mysql.closeConnection(conn);
... | [
"private",
"Metric",
"checkSlave",
"(",
"final",
"ICommandLine",
"cl",
",",
"final",
"Mysql",
"mysql",
",",
"final",
"Connection",
"conn",
")",
"throws",
"MetricGatheringException",
"{",
"Metric",
"metric",
"=",
"null",
";",
"try",
"{",
"Map",
"<",
"String",
... | Check the status of mysql slave thread.
@param cl
The command line
@param mysql
MySQL connection mgr object
@param conn
The SQL connection
@return ReturnValue -
@throws MetricGatheringException
- | [
"Check",
"the",
"status",
"of",
"mysql",
"slave",
"thread",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/mysql/CheckMysql.java#L117-L146 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java | AbstractCliParser.parseArgument | protected void parseArgument(CliParserState parserState, String argument, CliArgumentContainer argumentContainer, CliParameterConsumer parameterConsumer) {
"""
This method parses the value of a {@link CliOption}.
@param parserState is the {@link CliParserState}.
@param argument is the commandline parameter.
@... | java | protected void parseArgument(CliParserState parserState, String argument, CliArgumentContainer argumentContainer, CliParameterConsumer parameterConsumer) {
CliValueContainer valueContainer = this.valueMap.getOrCreate(argumentContainer);
valueContainer.setValue(argument);
if (!valueContainer.isArrayMapOrCol... | [
"protected",
"void",
"parseArgument",
"(",
"CliParserState",
"parserState",
",",
"String",
"argument",
",",
"CliArgumentContainer",
"argumentContainer",
",",
"CliParameterConsumer",
"parameterConsumer",
")",
"{",
"CliValueContainer",
"valueContainer",
"=",
"this",
".",
"v... | This method parses the value of a {@link CliOption}.
@param parserState is the {@link CliParserState}.
@param argument is the commandline parameter.
@param argumentContainer is the {@link CliArgumentContainer} for the current argument.
@param parameterConsumer is the {@link CliParameterConsumer}. | [
"This",
"method",
"parses",
"the",
"value",
"of",
"a",
"{",
"@link",
"CliOption",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java#L211-L219 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java | IssueCategoryRegistry.loadFromGraph | public static IssueCategoryModel loadFromGraph(GraphContext graphContext, String issueCategoryID) {
"""
Loads the related graph vertex for the given {@link IssueCategory#getCategoryID()}.
"""
return loadFromGraph(graphContext.getFramed(), issueCategoryID);
} | java | public static IssueCategoryModel loadFromGraph(GraphContext graphContext, String issueCategoryID)
{
return loadFromGraph(graphContext.getFramed(), issueCategoryID);
} | [
"public",
"static",
"IssueCategoryModel",
"loadFromGraph",
"(",
"GraphContext",
"graphContext",
",",
"String",
"issueCategoryID",
")",
"{",
"return",
"loadFromGraph",
"(",
"graphContext",
".",
"getFramed",
"(",
")",
",",
"issueCategoryID",
")",
";",
"}"
] | Loads the related graph vertex for the given {@link IssueCategory#getCategoryID()}. | [
"Loads",
"the",
"related",
"graph",
"vertex",
"for",
"the",
"given",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/category/IssueCategoryRegistry.java#L81-L84 |
google/flogger | api/src/main/java/com/google/common/flogger/parser/ParseException.java | ParseException.msg | private static String msg(String errorMessage, String logMessage, int errorStart, int errorEnd) {
"""
Helper to format a human readable error message for this exception.
"""
if (errorEnd < 0) {
errorEnd = logMessage.length();
}
StringBuilder out = new StringBuilder(errorMessage).append(": ");... | java | private static String msg(String errorMessage, String logMessage, int errorStart, int errorEnd) {
if (errorEnd < 0) {
errorEnd = logMessage.length();
}
StringBuilder out = new StringBuilder(errorMessage).append(": ");
if (errorStart > SNIPPET_LENGTH + ELLIPSIS.length()) {
out.append(ELLIPSIS... | [
"private",
"static",
"String",
"msg",
"(",
"String",
"errorMessage",
",",
"String",
"logMessage",
",",
"int",
"errorStart",
",",
"int",
"errorEnd",
")",
"{",
"if",
"(",
"errorEnd",
"<",
"0",
")",
"{",
"errorEnd",
"=",
"logMessage",
".",
"length",
"(",
")... | Helper to format a human readable error message for this exception. | [
"Helper",
"to",
"format",
"a",
"human",
"readable",
"error",
"message",
"for",
"this",
"exception",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L89-L106 |
vlingo/vlingo-http | src/main/java/io/vlingo/http/Body.java | Body.bytesToUTF8 | private static String bytesToUTF8(final byte[] body) {
"""
Answer a UTF-8 {@code String} from {@code body} bytes.
@param body the byte[]
@return String
"""
final String encoded = new String(body, Charset.forName("UTF-8"));
return encoded;
} | java | private static String bytesToUTF8(final byte[] body) {
final String encoded = new String(body, Charset.forName("UTF-8"));
return encoded;
} | [
"private",
"static",
"String",
"bytesToUTF8",
"(",
"final",
"byte",
"[",
"]",
"body",
")",
"{",
"final",
"String",
"encoded",
"=",
"new",
"String",
"(",
"body",
",",
"Charset",
".",
"forName",
"(",
"\"UTF-8\"",
")",
")",
";",
"return",
"encoded",
";",
... | Answer a UTF-8 {@code String} from {@code body} bytes.
@param body the byte[]
@return String | [
"Answer",
"a",
"UTF",
"-",
"8",
"{"
] | train | https://github.com/vlingo/vlingo-http/blob/746065fb1eaf1609c550ae45e96e3dbb9bfa37a2/src/main/java/io/vlingo/http/Body.java#L123-L126 |
structurizr/java | structurizr-core/src/com/structurizr/model/HttpHealthCheck.java | HttpHealthCheck.addHeader | public void addHeader(String name, String value) {
"""
Adds a HTTP header, which will be sent with the HTTP request to the health check URL.
@param name the name of the header
@param value the value of the header
"""
if (name == null || name.trim().length() == 0) {
throw new Il... | java | public void addHeader(String name, String value) {
if (name == null || name.trim().length() == 0) {
throw new IllegalArgumentException("The header name must not be null or empty.");
}
if (value == null) {
throw new IllegalArgumentException("The header value must not be n... | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Adds a HTTP header, which will be sent with the HTTP request to the health check URL.
@param name the name of the header
@param value the value of the header | [
"Adds",
"a",
"HTTP",
"header",
"which",
"will",
"be",
"sent",
"with",
"the",
"HTTP",
"request",
"to",
"the",
"health",
"check",
"URL",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/HttpHealthCheck.java#L68-L78 |
pedrovgs/Renderers | renderers/src/main/java/com/pedrogomez/renderers/RendererBuilder.java | RendererBuilder.isRecyclable | private boolean isRecyclable(View convertView, T content) {
"""
Check if one Renderer is recyclable getting it from the convertView's tag and checking the
class used.
@param convertView to get the renderer if is not null.
@param content used to get the prototype class.
@return true if the renderer is recycla... | java | private boolean isRecyclable(View convertView, T content) {
boolean isRecyclable = false;
if (convertView != null && convertView.getTag() != null) {
Class prototypeClass = getPrototypeClass(content);
validatePrototypeClass(prototypeClass);
isRecyclable = prototypeClass.equals(convertView.getTa... | [
"private",
"boolean",
"isRecyclable",
"(",
"View",
"convertView",
",",
"T",
"content",
")",
"{",
"boolean",
"isRecyclable",
"=",
"false",
";",
"if",
"(",
"convertView",
"!=",
"null",
"&&",
"convertView",
".",
"getTag",
"(",
")",
"!=",
"null",
")",
"{",
"... | Check if one Renderer is recyclable getting it from the convertView's tag and checking the
class used.
@param convertView to get the renderer if is not null.
@param content used to get the prototype class.
@return true if the renderer is recyclable. | [
"Check",
"if",
"one",
"Renderer",
"is",
"recyclable",
"getting",
"it",
"from",
"the",
"convertView",
"s",
"tag",
"and",
"checking",
"the",
"class",
"used",
"."
] | train | https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/RendererBuilder.java#L314-L322 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobCredentialsInner.java | JobCredentialsInner.createOrUpdate | public JobCredentialInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String credentialName, JobCredentialInner parameters) {
"""
Creates or updates a job credential.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this valu... | java | public JobCredentialInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String credentialName, JobCredentialInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, credentialName, parameters).toBlocking().single().body();
... | [
"public",
"JobCredentialInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"String",
"credentialName",
",",
"JobCredentialInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponse... | Creates or updates a job credential.
@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.
@param jobAgentName The name of the job agent.
@param credentialName The name o... | [
"Creates",
"or",
"updates",
"a",
"job",
"credential",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobCredentialsInner.java#L330-L332 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java | URLUtil.decode | public static String decode(String url, String charset) throws UtilException {
"""
解码URL<br>
将%开头的16进制表示的内容解码。
@param url URL
@param charset 编码
@return 解码后的URL
@exception UtilException UnsupportedEncodingException
"""
if (StrUtil.isEmpty(url)) {
return url;
}
try {
return URLDecoder.dec... | java | public static String decode(String url, String charset) throws UtilException {
if (StrUtil.isEmpty(url)) {
return url;
}
try {
return URLDecoder.decode(url, charset);
} catch (UnsupportedEncodingException e) {
throw new UtilException(e, "Unsupported encoding: [{}]", charset);
}
} | [
"public",
"static",
"String",
"decode",
"(",
"String",
"url",
",",
"String",
"charset",
")",
"throws",
"UtilException",
"{",
"if",
"(",
"StrUtil",
".",
"isEmpty",
"(",
"url",
")",
")",
"{",
"return",
"url",
";",
"}",
"try",
"{",
"return",
"URLDecoder",
... | 解码URL<br>
将%开头的16进制表示的内容解码。
@param url URL
@param charset 编码
@return 解码后的URL
@exception UtilException UnsupportedEncodingException | [
"解码URL<br",
">",
"将%开头的16进制表示的内容解码。"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L373-L382 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java | DetectFiducialSquareGrid.lookupDetection | private Detection lookupDetection( long found , int gridIndex) {
"""
Looks up a detection given the fiducial ID number. If not seen before the gridIndex is saved and
a new instance returned.
"""
for (int i = 0; i < detections.size(); i++) {
Detection d = detections.get(i);
if( d.id == found ) {
r... | java | private Detection lookupDetection( long found , int gridIndex) {
for (int i = 0; i < detections.size(); i++) {
Detection d = detections.get(i);
if( d.id == found ) {
return d;
}
}
Detection d = detections.grow();
d.reset();
d.id = found;
d.gridIndex = gridIndex;
return d;
} | [
"private",
"Detection",
"lookupDetection",
"(",
"long",
"found",
",",
"int",
"gridIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"detections",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Detection",
"d",
"=",
"detections",
... | Looks up a detection given the fiducial ID number. If not seen before the gridIndex is saved and
a new instance returned. | [
"Looks",
"up",
"a",
"detection",
"given",
"the",
"fiducial",
"ID",
"number",
".",
"If",
"not",
"seen",
"before",
"the",
"gridIndex",
"is",
"saved",
"and",
"a",
"new",
"instance",
"returned",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/DetectFiducialSquareGrid.java#L141-L155 |
JodaOrg/joda-money | src/main/java/org/joda/money/format/MoneyFormatterBuilder.java | MoneyFormatterBuilder.appendSigned | public MoneyFormatterBuilder appendSigned(
MoneyFormatter whenPositive, MoneyFormatter whenZero, MoneyFormatter whenNegative) {
"""
Appends the specified formatters, one used when the amount is positive,
one when the amount is zero and one when the amount is negative.
<p>
When printing, the amount i... | java | public MoneyFormatterBuilder appendSigned(
MoneyFormatter whenPositive, MoneyFormatter whenZero, MoneyFormatter whenNegative) {
MoneyFormatter.checkNotNull(whenPositive, "MoneyFormatter whenPositive must not be null");
MoneyFormatter.checkNotNull(whenZero, "MoneyFormatter whenZero must not b... | [
"public",
"MoneyFormatterBuilder",
"appendSigned",
"(",
"MoneyFormatter",
"whenPositive",
",",
"MoneyFormatter",
"whenZero",
",",
"MoneyFormatter",
"whenNegative",
")",
"{",
"MoneyFormatter",
".",
"checkNotNull",
"(",
"whenPositive",
",",
"\"MoneyFormatter whenPositive must n... | Appends the specified formatters, one used when the amount is positive,
one when the amount is zero and one when the amount is negative.
<p>
When printing, the amount is queried and the appropriate formatter is used.
<p>
When parsing, each formatter is tried, with the longest successful match,
or the first match if mul... | [
"Appends",
"the",
"specified",
"formatters",
"one",
"used",
"when",
"the",
"amount",
"is",
"positive",
"one",
"when",
"the",
"amount",
"is",
"zero",
"and",
"one",
"when",
"the",
"amount",
"is",
"negative",
".",
"<p",
">",
"When",
"printing",
"the",
"amount... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyFormatterBuilder.java#L244-L251 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/style/ColorUtils.java | ColorUtils.getHexSingle | private static String getHexSingle(String hex, int colorIndex) {
"""
Get the hex single color
@param hex
hex color
@param colorIndex
red=0, green=1, blue=2, alpha=-1
@return hex single color in format FF or null
"""
validateHex(hex);
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int ... | java | private static String getHexSingle(String hex, int colorIndex) {
validateHex(hex);
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int colorCharacters = 1;
int numColors = hex.length();
if (numColors > 4) {
colorCharacters++;
numColors /= 2;
}
String color = null;
if (colorIndex >= 0 ... | [
"private",
"static",
"String",
"getHexSingle",
"(",
"String",
"hex",
",",
"int",
"colorIndex",
")",
"{",
"validateHex",
"(",
"hex",
")",
";",
"if",
"(",
"hex",
".",
"startsWith",
"(",
"\"#\"",
")",
")",
"{",
"hex",
"=",
"hex",
".",
"substring",
"(",
... | Get the hex single color
@param hex
hex color
@param colorIndex
red=0, green=1, blue=2, alpha=-1
@return hex single color in format FF or null | [
"Get",
"the",
"hex",
"single",
"color"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/ColorUtils.java#L498-L526 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayLineSegment | public static float intersectRayLineSegment(Vector2fc origin, Vector2fc dir, Vector2fc a, Vector2fc b) {
"""
Determine whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the undirected line segment
given by the two end points <code>a</code> and <code>b</code>, and return the ... | java | public static float intersectRayLineSegment(Vector2fc origin, Vector2fc dir, Vector2fc a, Vector2fc b) {
return intersectRayLineSegment(origin.x(), origin.y(), dir.x(), dir.y(), a.x(), a.y(), b.x(), b.y());
} | [
"public",
"static",
"float",
"intersectRayLineSegment",
"(",
"Vector2fc",
"origin",
",",
"Vector2fc",
"dir",
",",
"Vector2fc",
"a",
",",
"Vector2fc",
"b",
")",
"{",
"return",
"intersectRayLineSegment",
"(",
"origin",
".",
"x",
"(",
")",
",",
"origin",
".",
"... | Determine whether the ray with given <code>origin</code> and direction <code>dir</code> intersects the undirected line segment
given by the two end points <code>a</code> and <code>b</code>, and return the value of the parameter <i>t</i> in the ray equation
<i>p(t) = origin + t * dir</i> of the intersection point, if an... | [
"Determine",
"whether",
"the",
"ray",
"with",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"undirected",
"line",
"segment",
"given",
"by",
"the",
"two",
"end",
"points"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L4015-L4017 |
reactor/reactor-netty | src/main/java/reactor/netty/http/server/HttpServer.java | HttpServer.httpRequestDecoder | public final HttpServer httpRequestDecoder(Function<HttpRequestDecoderSpec, HttpRequestDecoderSpec> requestDecoderOptions) {
"""
Configure the {@link io.netty.handler.codec.http.HttpServerCodec}'s request decoding options.
@param requestDecoderOptions a function to mutate the provided Http request decoder optio... | java | public final HttpServer httpRequestDecoder(Function<HttpRequestDecoderSpec, HttpRequestDecoderSpec> requestDecoderOptions) {
return tcpConfiguration(
requestDecoderOptions.apply(new HttpRequestDecoderSpec())
.build());
} | [
"public",
"final",
"HttpServer",
"httpRequestDecoder",
"(",
"Function",
"<",
"HttpRequestDecoderSpec",
",",
"HttpRequestDecoderSpec",
">",
"requestDecoderOptions",
")",
"{",
"return",
"tcpConfiguration",
"(",
"requestDecoderOptions",
".",
"apply",
"(",
"new",
"HttpRequest... | Configure the {@link io.netty.handler.codec.http.HttpServerCodec}'s request decoding options.
@param requestDecoderOptions a function to mutate the provided Http request decoder options
@return a new {@link HttpServer} | [
"Configure",
"the",
"{",
"@link",
"io",
".",
"netty",
".",
"handler",
".",
"codec",
".",
"http",
".",
"HttpServerCodec",
"}",
"s",
"request",
"decoding",
"options",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/server/HttpServer.java#L309-L313 |
google/truth | core/src/main/java/com/google/common/truth/IterableSubject.java | IterableSubject.keyToGoWithElementsString | private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {
"""
/*
Fact keys like "missing (1)" go against our recommendation that keys should be fixed strings.
But this violation lets the fact value contain only the elements (instead of also containing
the count), so it f... | java | private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {
/*
* elements.toString(), which the caller is going to use, includes the homogeneous type (if
* any), so we don't want to include it here. (And it's better to have it in the value, rather
* than in the ... | [
"private",
"static",
"String",
"keyToGoWithElementsString",
"(",
"String",
"label",
",",
"DuplicateGroupedAndTyped",
"elements",
")",
"{",
"/*\n * elements.toString(), which the caller is going to use, includes the homogeneous type (if\n * any), so we don't want to include it here. (... | /*
Fact keys like "missing (1)" go against our recommendation that keys should be fixed strings.
But this violation lets the fact value contain only the elements (instead of also containing
the count), so it feels worthwhile. | [
"/",
"*",
"Fact",
"keys",
"like",
"missing",
"(",
"1",
")",
"go",
"against",
"our",
"recommendation",
"that",
"keys",
"should",
"be",
"fixed",
"strings",
".",
"But",
"this",
"violation",
"lets",
"the",
"fact",
"value",
"contain",
"only",
"the",
"elements",... | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/IterableSubject.java#L633-L640 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java | Options.isUnset | public boolean isUnset(Option option, String value) {
"""
Check if the value for a choice option has not been set to a specific value.
"""
return (values.get(option.primaryName + value) == null);
} | java | public boolean isUnset(Option option, String value) {
return (values.get(option.primaryName + value) == null);
} | [
"public",
"boolean",
"isUnset",
"(",
"Option",
"option",
",",
"String",
"value",
")",
"{",
"return",
"(",
"values",
".",
"get",
"(",
"option",
".",
"primaryName",
"+",
"value",
")",
"==",
"null",
")",
";",
"}"
] | Check if the value for a choice option has not been set to a specific value. | [
"Check",
"if",
"the",
"value",
"for",
"a",
"choice",
"option",
"has",
"not",
"been",
"set",
"to",
"a",
"specific",
"value",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Options.java#L144-L146 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/user/UserClient.java | UserClient.addFriends | public ResponseWrapper addFriends(String username, String... users)
throws APIConnectionException, APIRequestException {
"""
Add friends to username
@param username Necessary
@param users username to be add
@return No content
@throws APIConnectionException connect exception
@throws APIRequest... | java | public ResponseWrapper addFriends(String username, String... users)
throws APIConnectionException, APIRequestException {
StringUtils.checkUsername(username);
Preconditions.checkArgument(null != users && users.length > 0, "friend list should not be empty");
JsonArray array = new Json... | [
"public",
"ResponseWrapper",
"addFriends",
"(",
"String",
"username",
",",
"String",
"...",
"users",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"StringUtils",
".",
"checkUsername",
"(",
"username",
")",
";",
"Preconditions",
".",
"chec... | Add friends to username
@param username Necessary
@param users username to be add
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Add",
"friends",
"to",
"username"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/user/UserClient.java#L283-L294 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/http/timers/TimeoutThreadPoolBuilder.java | TimeoutThreadPoolBuilder.buildDefaultTimeoutThreadPool | public static ScheduledThreadPoolExecutor buildDefaultTimeoutThreadPool(final String name) {
"""
Creates a {@link ScheduledThreadPoolExecutor} with custom name for the threads.
@param name the prefix to add to the thread name in ThreadFactory.
@return The default thread pool for request timeout and client exec... | java | public static ScheduledThreadPoolExecutor buildDefaultTimeoutThreadPool(final String name) {
ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5, getThreadFactory(name));
safeSetRemoveOnCancel(executor);
executor.setKeepAliveTime(5, TimeUnit.SECONDS);
executor.allowC... | [
"public",
"static",
"ScheduledThreadPoolExecutor",
"buildDefaultTimeoutThreadPool",
"(",
"final",
"String",
"name",
")",
"{",
"ScheduledThreadPoolExecutor",
"executor",
"=",
"new",
"ScheduledThreadPoolExecutor",
"(",
"5",
",",
"getThreadFactory",
"(",
"name",
")",
")",
... | Creates a {@link ScheduledThreadPoolExecutor} with custom name for the threads.
@param name the prefix to add to the thread name in ThreadFactory.
@return The default thread pool for request timeout and client execution timeout features. | [
"Creates",
"a",
"{",
"@link",
"ScheduledThreadPoolExecutor",
"}",
"with",
"custom",
"name",
"for",
"the",
"threads",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/http/timers/TimeoutThreadPoolBuilder.java#L38-L45 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getInteger | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption) {
"""
Returns the value associated with the given config option as an integer.
@param configOption The configuration option
@return the (default) value associated with the given config option
"""
Object o = getValueOrDefaultFromOp... | java | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption) {
Object o = getValueOrDefaultFromOption(configOption);
return convertToInt(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"int",
"getInteger",
"(",
"ConfigOption",
"<",
"Integer",
">",
"configOption",
")",
"{",
"Object",
"o",
"=",
"getValueOrDefaultFromOption",
"(",
"configOption",
")",
";",
"return",
"convertToInt",
"(",
"o",
",",
"configOption",
"... | Returns the value associated with the given config option as an integer.
@param configOption The configuration option
@return the (default) value associated with the given config option | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"an",
"integer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L219-L223 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/SentryClientFactory.java | SentryClientFactory.sentryClient | public static SentryClient sentryClient(String dsn, SentryClientFactory sentryClientFactory) {
"""
Creates an instance of Sentry using the provided DSN and the specified factory.
@param dsn Data Source Name of the Sentry server.
@param sentryClientFactory SentryClientFactory instance to use, or null to do a co... | java | public static SentryClient sentryClient(String dsn, SentryClientFactory sentryClientFactory) {
Dsn realDsn = resolveDsn(dsn);
// If the caller didn't pass a factory, try to look one up
if (sentryClientFactory == null) {
String sentryClientFactoryName = Lookup.lookup("factory", realD... | [
"public",
"static",
"SentryClient",
"sentryClient",
"(",
"String",
"dsn",
",",
"SentryClientFactory",
"sentryClientFactory",
")",
"{",
"Dsn",
"realDsn",
"=",
"resolveDsn",
"(",
"dsn",
")",
";",
"// If the caller didn't pass a factory, try to look one up",
"if",
"(",
"se... | Creates an instance of Sentry using the provided DSN and the specified factory.
@param dsn Data Source Name of the Sentry server.
@param sentryClientFactory SentryClientFactory instance to use, or null to do a config lookup.
@return SentryClient instance, or null if one couldn't be constructed. | [
"Creates",
"an",
"instance",
"of",
"Sentry",
"using",
"the",
"provided",
"DSN",
"and",
"the",
"specified",
"factory",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/SentryClientFactory.java#L41-L65 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.findMerge | protected static int findMerge(int end, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq) {
"""
Find the best merge.
@param mat Matrix view
@param prots Prototypes
@param builder Result builder
@param... | java | protected static int findMerge(int end, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
double mindist = Doubl... | [
"protected",
"static",
"int",
"findMerge",
"(",
"int",
"end",
",",
"MatrixParadigm",
"mat",
",",
"DBIDArrayMIter",
"prots",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"Int2ObjectOpenHashMap",
"<",
"ModifiableDBIDs",
">",
"clusters",
",",
"DistanceQuer... | Find the best merge.
@param mat Matrix view
@param prots Prototypes
@param builder Result builder
@param clusters Current clusters
@param dq Distance query
@return x, for shrinking the working set. | [
"Find",
"the",
"best",
"merge",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L147-L178 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java | BoxTermsOfServiceUserStatus.getInfo | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api, String termsOfServiceID) {
"""
Retrieves a list of User Status for Terms of Service as an Iterable.
@param api the API connection to be used by the resource.
@param termsOfServiceID the ID of the terms... | java | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api, String termsOfServiceID) {
return getInfo(api, termsOfServiceID);
} | [
"public",
"static",
"List",
"<",
"BoxTermsOfServiceUserStatus",
".",
"Info",
">",
"getInfo",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"termsOfServiceID",
")",
"{",
"return",
"getInfo",
"(",
"api",
",",
"termsOfServiceID",
")",
";",
"}"
] | Retrieves a list of User Status for Terms of Service as an Iterable.
@param api the API connection to be used by the resource.
@param termsOfServiceID the ID of the terms of service.
@return the Iterable of User Status for Terms of Service. | [
"Retrieves",
"a",
"list",
"of",
"User",
"Status",
"for",
"Terms",
"of",
"Service",
"as",
"an",
"Iterable",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java#L89-L91 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java | JavaScriptUtils.getUnencodedJavaScriptHtmlCookieString | public String getUnencodedJavaScriptHtmlCookieString(String name, String value) {
"""
Creates and returns a JavaScript line that sets a cookie with the specified name, value, and cookie properties. For
example, a cookie name of "test", value of "123", and properties "HttpOnly" and "path=/" would return
{@code do... | java | public String getUnencodedJavaScriptHtmlCookieString(String name, String value) {
return getUnencodedJavaScriptHtmlCookieString(name, value, null);
} | [
"public",
"String",
"getUnencodedJavaScriptHtmlCookieString",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"getUnencodedJavaScriptHtmlCookieString",
"(",
"name",
",",
"value",
",",
"null",
")",
";",
"}"
] | Creates and returns a JavaScript line that sets a cookie with the specified name, value, and cookie properties. For
example, a cookie name of "test", value of "123", and properties "HttpOnly" and "path=/" would return
{@code document.cookie="test=123; HttpOnly; path=/;";}. Note: The specified name and value will not be... | [
"Creates",
"and",
"returns",
"a",
"JavaScript",
"line",
"that",
"sets",
"a",
"cookie",
"with",
"the",
"specified",
"name",
"value",
"and",
"cookie",
"properties",
".",
"For",
"example",
"a",
"cookie",
"name",
"of",
"test",
"value",
"of",
"123",
"and",
"pro... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java#L57-L59 |
apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.resolveExplicitMethod | @SuppressWarnings( {
"""
This is a hook for subclasses to plugin a custom strategy for mapping
names to explicit methods.
@param methodName the name of the explicit method
@param args the arguments for the method
@return the closure for the matched explicit method.<br>
""""UnusedDeclaration"})
... | java | @SuppressWarnings({"UnusedDeclaration"})
protected Closure resolveExplicitMethod(String methodName, Object args) {
return getExplicitMethods().get(methodName);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"UnusedDeclaration\"",
"}",
")",
"protected",
"Closure",
"resolveExplicitMethod",
"(",
"String",
"methodName",
",",
"Object",
"args",
")",
"{",
"return",
"getExplicitMethods",
"(",
")",
".",
"get",
"(",
"methodName",
")",
";"... | This is a hook for subclasses to plugin a custom strategy for mapping
names to explicit methods.
@param methodName the name of the explicit method
@param args the arguments for the method
@return the closure for the matched explicit method.<br> | [
"This",
"is",
"a",
"hook",
"for",
"subclasses",
"to",
"plugin",
"a",
"custom",
"strategy",
"for",
"mapping",
"names",
"to",
"explicit",
"methods",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L758-L761 |
ACRA/acra | acra-core/src/main/java/org/acra/scheduler/SchedulerStarter.java | SchedulerStarter.scheduleReports | public void scheduleReports(@Nullable File report, boolean onlySendSilentReports) {
"""
Starts a process to start sending outstanding error reports.
@param report If not null, this report will be approved before scheduling.
@param onlySendSilentReports If true then only send silent reports.
... | java | public void scheduleReports(@Nullable File report, boolean onlySendSilentReports) {
if (report != null) {
if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Mark " + report.getName() + " as approved.");
final File approvedReport = new File(locator.getApprovedFolder(), report.getName());
... | [
"public",
"void",
"scheduleReports",
"(",
"@",
"Nullable",
"File",
"report",
",",
"boolean",
"onlySendSilentReports",
")",
"{",
"if",
"(",
"report",
"!=",
"null",
")",
"{",
"if",
"(",
"ACRA",
".",
"DEV_LOGGING",
")",
"ACRA",
".",
"log",
".",
"d",
"(",
... | Starts a process to start sending outstanding error reports.
@param report If not null, this report will be approved before scheduling.
@param onlySendSilentReports If true then only send silent reports. | [
"Starts",
"a",
"process",
"to",
"start",
"sending",
"outstanding",
"error",
"reports",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/scheduler/SchedulerStarter.java#L57-L67 |
modelmapper/modelmapper | core/src/main/java/org/modelmapper/internal/ExplicitMappingBuilder.java | ExplicitMappingBuilder.visitPropertyMap | public void visitPropertyMap(PropertyMap<S, D> propertyMap) {
"""
Visits the {@code propertyMap} and captures and validates mappings.
"""
String propertyMapClassName = propertyMap.getClass().getName();
try {
ClassReader cr = new ClassReader(propertyMap.getClass().getClassLoader().getResource... | java | public void visitPropertyMap(PropertyMap<S, D> propertyMap) {
String propertyMapClassName = propertyMap.getClass().getName();
try {
ClassReader cr = new ClassReader(propertyMap.getClass().getClassLoader().getResourceAsStream(
propertyMapClassName.replace('.', '/') + ".class"));
Expl... | [
"public",
"void",
"visitPropertyMap",
"(",
"PropertyMap",
"<",
"S",
",",
"D",
">",
"propertyMap",
")",
"{",
"String",
"propertyMapClassName",
"=",
"propertyMap",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"try",
"{",
"ClassReader",
"cr",
"="... | Visits the {@code propertyMap} and captures and validates mappings. | [
"Visits",
"the",
"{"
] | train | https://github.com/modelmapper/modelmapper/blob/491d165ded9dc9aba7ce8b56984249e1a1363204/core/src/main/java/org/modelmapper/internal/ExplicitMappingBuilder.java#L251-L267 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.