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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/closure-templates | java/src/com/google/template/soy/exprtree/AbstractOperatorNode.java | AbstractOperatorNode.getOperandProtectedForPrecHelper | private String getOperandProtectedForPrecHelper(int index, boolean shouldProtectEqualPrec) {
"""
Helper for getOperandProtectedForLowerPrec() and getOperandProtectedForLowerOrEqualPrec().
@param index The index of the operand to get.
@param shouldProtectEqualPrec Whether to proect the operand if it is an opera... | java | private String getOperandProtectedForPrecHelper(int index, boolean shouldProtectEqualPrec) {
int thisOpPrec = operator.getPrecedence();
ExprNode child = getChild(index);
boolean shouldProtect;
if (child instanceof OperatorNode) {
int childOpPrec = ((OperatorNode) child).getOperator().getPrecede... | [
"private",
"String",
"getOperandProtectedForPrecHelper",
"(",
"int",
"index",
",",
"boolean",
"shouldProtectEqualPrec",
")",
"{",
"int",
"thisOpPrec",
"=",
"operator",
".",
"getPrecedence",
"(",
")",
";",
"ExprNode",
"child",
"=",
"getChild",
"(",
"index",
")",
... | Helper for getOperandProtectedForLowerPrec() and getOperandProtectedForLowerOrEqualPrec().
@param index The index of the operand to get.
@param shouldProtectEqualPrec Whether to proect the operand if it is an operator with equal
precedence to this operator.
@return The source string for the operand at the given index,... | [
"Helper",
"for",
"getOperandProtectedForLowerPrec",
"()",
"and",
"getOperandProtectedForLowerOrEqualPrec",
"()",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/exprtree/AbstractOperatorNode.java#L128-L147 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java | GVRCameraRig.setFloat | public void setFloat(String key, float value) {
"""
Map {@code value} to {@code key}.
@param key
Key to map {@code value} to.
@param value
The {@code float} value to map.
"""
checkStringNotNullOrEmpty("key", key);
checkFloatNotNaNOrInfinity("value", value);
NativeCameraRig.setFloa... | java | public void setFloat(String key, float value) {
checkStringNotNullOrEmpty("key", key);
checkFloatNotNaNOrInfinity("value", value);
NativeCameraRig.setFloat(getNative(), key, value);
} | [
"public",
"void",
"setFloat",
"(",
"String",
"key",
",",
"float",
"value",
")",
"{",
"checkStringNotNullOrEmpty",
"(",
"\"key\"",
",",
"key",
")",
";",
"checkFloatNotNaNOrInfinity",
"(",
"\"value\"",
",",
"value",
")",
";",
"NativeCameraRig",
".",
"setFloat",
... | Map {@code value} to {@code key}.
@param key
Key to map {@code value} to.
@param value
The {@code float} value to map. | [
"Map",
"{",
"@code",
"value",
"}",
"to",
"{",
"@code",
"key",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L223-L227 |
huahin/huahin-core | src/main/java/org/huahinframework/core/io/Record.java | Record.addSort | public void addSort(WritableComparable<?> writable, int sort, int priority) {
"""
Add sort key
@param writable Hadoop sort key
@param sort sort type SORT_NON or SORT_LOWER or SORT_UPPER
@param priority sort order
"""
key.addHadoopValue(String.format(SORT_LABEL, priority), writable, sort, priority);
... | java | public void addSort(WritableComparable<?> writable, int sort, int priority) {
key.addHadoopValue(String.format(SORT_LABEL, priority), writable, sort, priority);
} | [
"public",
"void",
"addSort",
"(",
"WritableComparable",
"<",
"?",
">",
"writable",
",",
"int",
"sort",
",",
"int",
"priority",
")",
"{",
"key",
".",
"addHadoopValue",
"(",
"String",
".",
"format",
"(",
"SORT_LABEL",
",",
"priority",
")",
",",
"writable",
... | Add sort key
@param writable Hadoop sort key
@param sort sort type SORT_NON or SORT_LOWER or SORT_UPPER
@param priority sort order | [
"Add",
"sort",
"key"
] | train | https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/io/Record.java#L232-L234 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Expression.java | Expression.notEqualTo | @NonNull
public Expression notEqualTo(@NonNull Expression expression) {
"""
Create a NOT equal to expression that evaluates whether or not the current expression
is not equal to the given expression.
@param expression the expression to compare with the current expression.
@return a NOT equal to exprssion.... | java | @NonNull
public Expression notEqualTo(@NonNull Expression expression) {
if (expression == null) {
throw new IllegalArgumentException("expression cannot be null.");
}
return new BinaryExpression(this, expression, BinaryExpression.OpType.NotEqualTo);
} | [
"@",
"NonNull",
"public",
"Expression",
"notEqualTo",
"(",
"@",
"NonNull",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expression cannot be null.\"",
")",
";",
"}",
"r... | Create a NOT equal to expression that evaluates whether or not the current expression
is not equal to the given expression.
@param expression the expression to compare with the current expression.
@return a NOT equal to exprssion. | [
"Create",
"a",
"NOT",
"equal",
"to",
"expression",
"that",
"evaluates",
"whether",
"or",
"not",
"the",
"current",
"expression",
"is",
"not",
"equal",
"to",
"the",
"given",
"expression",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Expression.java#L692-L698 |
infinispan/infinispan | server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheConfigurationAdd.java | ClusteredCacheConfigurationAdd.processModelNode | @Override
void processModelNode(OperationContext context, String containerName, ModelNode cache, ConfigurationBuilder builder, List<Dependency<?>> dependencies)
throws OperationFailedException {
"""
Create a Configuration object initialized from the data in the operation.
@param cache data repre... | java | @Override
void processModelNode(OperationContext context, String containerName, ModelNode cache, ConfigurationBuilder builder, List<Dependency<?>> dependencies)
throws OperationFailedException {
// process cache attributes and elements
super.processModelNode(context, containerName, cach... | [
"@",
"Override",
"void",
"processModelNode",
"(",
"OperationContext",
"context",
",",
"String",
"containerName",
",",
"ModelNode",
"cache",
",",
"ConfigurationBuilder",
"builder",
",",
"List",
"<",
"Dependency",
"<",
"?",
">",
">",
"dependencies",
")",
"throws",
... | Create a Configuration object initialized from the data in the operation.
@param cache data representing cache configuration
@param builder
@param dependencies
@return initialised Configuration object | [
"Create",
"a",
"Configuration",
"object",
"initialized",
"from",
"the",
"data",
"in",
"the",
"operation",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ClusteredCacheConfigurationAdd.java#L63-L80 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeDescriptor.java | NodeDescriptor.appendNodeDetail | public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
"""
Convert a Node into a simple String representation
and append to StringBuffer
@param buf
@param nodeDetail
"""
appendNodeDetail(buf, nodeDetail.getNode(), true);
buf.append(" at ").append(nodeDetail.getXpathLo... | java | public static void appendNodeDetail(StringBuffer buf, NodeDetail nodeDetail) {
appendNodeDetail(buf, nodeDetail.getNode(), true);
buf.append(" at ").append(nodeDetail.getXpathLocation());
} | [
"public",
"static",
"void",
"appendNodeDetail",
"(",
"StringBuffer",
"buf",
",",
"NodeDetail",
"nodeDetail",
")",
"{",
"appendNodeDetail",
"(",
"buf",
",",
"nodeDetail",
".",
"getNode",
"(",
")",
",",
"true",
")",
";",
"buf",
".",
"append",
"(",
"\" at \"",
... | Convert a Node into a simple String representation
and append to StringBuffer
@param buf
@param nodeDetail | [
"Convert",
"a",
"Node",
"into",
"a",
"simple",
"String",
"representation",
"and",
"append",
"to",
"StringBuffer"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/NodeDescriptor.java#L56-L59 |
alkacon/opencms-core | src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java | CmsSetupXmlHelper.setValue | public int setValue(String xmlFilename, String xPath, String value) throws CmsXmlException {
"""
Sets the given value in all nodes identified by the given xpath of the given xml file.<p>
If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p>
If the node identified by the g... | java | public int setValue(String xmlFilename, String xPath, String value) throws CmsXmlException {
return setValue(getDocument(xmlFilename), xPath, value, null);
} | [
"public",
"int",
"setValue",
"(",
"String",
"xmlFilename",
",",
"String",
"xPath",
",",
"String",
"value",
")",
"throws",
"CmsXmlException",
"{",
"return",
"setValue",
"(",
"getDocument",
"(",
"xmlFilename",
")",
",",
"xPath",
",",
"value",
",",
"null",
")",... | Sets the given value in all nodes identified by the given xpath of the given xml file.<p>
If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p>
If the node identified by the given xpath does not exists, the missing nodes will be created
(if <code>value</code> not <code>null</code>... | [
"Sets",
"the",
"given",
"value",
"in",
"all",
"nodes",
"identified",
"by",
"the",
"given",
"xpath",
"of",
"the",
"given",
"xml",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java#L464-L467 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java | SdkUtils.toastSafely | public static void toastSafely(final Context context, final int resId, final int duration) {
"""
Helper method for showing a toast message checking to see if user is on ui thread, and not showing the
same toast if it has already been shown within TOAST_MIN_REPEAT_DELAY time.
@param context current context.
@... | java | public static void toastSafely(final Context context, final int resId, final int duration) {
Long lastToastTime = LAST_TOAST_TIME.get(resId);
if (lastToastTime != null && (lastToastTime + TOAST_MIN_REPEAT_DELAY) < System.currentTimeMillis()) {
return;
}
Looper mainLooper = Lo... | [
"public",
"static",
"void",
"toastSafely",
"(",
"final",
"Context",
"context",
",",
"final",
"int",
"resId",
",",
"final",
"int",
"duration",
")",
"{",
"Long",
"lastToastTime",
"=",
"LAST_TOAST_TIME",
".",
"get",
"(",
"resId",
")",
";",
"if",
"(",
"lastToa... | Helper method for showing a toast message checking to see if user is on ui thread, and not showing the
same toast if it has already been shown within TOAST_MIN_REPEAT_DELAY time.
@param context current context.
@param resId string resource id to display.
@param duration Toast.LENGTH_LONG or Toast.LENGTH_SHORT. | [
"Helper",
"method",
"for",
"showing",
"a",
"toast",
"message",
"checking",
"to",
"see",
"if",
"user",
"is",
"on",
"ui",
"thread",
"and",
"not",
"showing",
"the",
"same",
"toast",
"if",
"it",
"has",
"already",
"been",
"shown",
"within",
"TOAST_MIN_REPEAT_DELA... | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java#L523-L542 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java | SPSMMappingFilter.setStrongestMapping | private void setStrongestMapping(INode source, INode target) {
"""
Sets the relation between source and target as the strongest in the temp, setting all the other relations
for the same source as IDK if the relations are weaker.
@param source source node
@param target target node
"""
//if it's st... | java | private void setStrongestMapping(INode source, INode target) {
//if it's structure preserving
if (isSameStructure(source, target)) {
spsmMapping.setRelation(source, target, defautlMappings.getRelation(source, target));
//deletes all the less precedent relations for the same... | [
"private",
"void",
"setStrongestMapping",
"(",
"INode",
"source",
",",
"INode",
"target",
")",
"{",
"//if it's structure preserving\r",
"if",
"(",
"isSameStructure",
"(",
"source",
",",
"target",
")",
")",
"{",
"spsmMapping",
".",
"setRelation",
"(",
"source",
"... | Sets the relation between source and target as the strongest in the temp, setting all the other relations
for the same source as IDK if the relations are weaker.
@param source source node
@param target target node | [
"Sets",
"the",
"relation",
"between",
"source",
"and",
"target",
"as",
"the",
"strongest",
"in",
"the",
"temp",
"setting",
"all",
"the",
"other",
"relations",
"for",
"the",
"same",
"source",
"as",
"IDK",
"if",
"the",
"relations",
"are",
"weaker",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java#L271-L295 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Session.java | FineUploader5Session.addCustomHeader | @Nonnull
public FineUploader5Session addCustomHeader (@Nonnull @Nonempty final String sKey, @Nonnull final String sValue) {
"""
Any additional headers you would like included with the GET request sent to
your server. Ignored in IE9 and IE8 if the endpoint is cross-origin.
@param sKey
Custom header name
@pa... | java | @Nonnull
public FineUploader5Session addCustomHeader (@Nonnull @Nonempty final String sKey, @Nonnull final String sValue)
{
ValueEnforcer.notEmpty (sKey, "Key");
ValueEnforcer.notNull (sValue, "Value");
m_aSessionCustomHeaders.put (sKey, sValue);
return this;
} | [
"@",
"Nonnull",
"public",
"FineUploader5Session",
"addCustomHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sKey",
",",
"@",
"Nonnull",
"final",
"String",
"sValue",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sKey",
",",
"\"Key\"",
")"... | Any additional headers you would like included with the GET request sent to
your server. Ignored in IE9 and IE8 if the endpoint is cross-origin.
@param sKey
Custom header name
@param sValue
Custom header value
@return this | [
"Any",
"additional",
"headers",
"you",
"would",
"like",
"included",
"with",
"the",
"GET",
"request",
"sent",
"to",
"your",
"server",
".",
"Ignored",
"in",
"IE9",
"and",
"IE8",
"if",
"the",
"endpoint",
"is",
"cross",
"-",
"origin",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Session.java#L96-L104 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/DPTXlator.java | DPTXlator.setTypeID | protected void setTypeID(Map availableTypes, String dptID) throws KNXFormatException {
"""
Sets the DPT for the translator to use for translation, doing a lookup before in
the translator's map containing the available, implemented datapoint types.
<p>
@param availableTypes map of the translator with available... | java | protected void setTypeID(Map availableTypes, String dptID) throws KNXFormatException
{
final DPT t = (DPT) availableTypes.get(dptID);
if (t == null) {
// don't call logThrow since dpt is not set yet
final String s = "DPT " + dptID + " is not available";
logger.warn(s);
throw new KNXFormatExcepti... | [
"protected",
"void",
"setTypeID",
"(",
"Map",
"availableTypes",
",",
"String",
"dptID",
")",
"throws",
"KNXFormatException",
"{",
"final",
"DPT",
"t",
"=",
"(",
"DPT",
")",
"availableTypes",
".",
"get",
"(",
"dptID",
")",
";",
"if",
"(",
"t",
"==",
"null... | Sets the DPT for the translator to use for translation, doing a lookup before in
the translator's map containing the available, implemented datapoint types.
<p>
@param availableTypes map of the translator with available, implemented DPTs; the
map key is a dptID string, map value is of type {@link DPT}
@param dptID the... | [
"Sets",
"the",
"DPT",
"for",
"the",
"translator",
"to",
"use",
"for",
"translation",
"doing",
"a",
"lookup",
"before",
"in",
"the",
"translator",
"s",
"map",
"containing",
"the",
"available",
"implemented",
"datapoint",
"types",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/DPTXlator.java#L405-L415 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java | CepOperator.processEvent | private void processEvent(NFAState nfaState, IN event, long timestamp) throws Exception {
"""
Process the given event by giving it to the NFA and outputting the produced set of matched
event sequences.
@param nfaState Our NFAState object
@param event The current event to be processed
@param timestamp The tim... | java | private void processEvent(NFAState nfaState, IN event, long timestamp) throws Exception {
try (SharedBufferAccessor<IN> sharedBufferAccessor = partialMatches.getAccessor()) {
Collection<Map<String, List<IN>>> patterns =
nfa.process(sharedBufferAccessor, nfaState, event, timestamp, afterMatchSkipStrategy, cepTi... | [
"private",
"void",
"processEvent",
"(",
"NFAState",
"nfaState",
",",
"IN",
"event",
",",
"long",
"timestamp",
")",
"throws",
"Exception",
"{",
"try",
"(",
"SharedBufferAccessor",
"<",
"IN",
">",
"sharedBufferAccessor",
"=",
"partialMatches",
".",
"getAccessor",
... | Process the given event by giving it to the NFA and outputting the produced set of matched
event sequences.
@param nfaState Our NFAState object
@param event The current event to be processed
@param timestamp The timestamp of the event | [
"Process",
"the",
"given",
"event",
"by",
"giving",
"it",
"to",
"the",
"NFA",
"and",
"outputting",
"the",
"produced",
"set",
"of",
"matched",
"event",
"sequences",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java#L422-L428 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/input/PangoolMultipleInputs.java | PangoolMultipleInputs.addInputContext | public static void addInputContext(Job job, String inputName, String key, String value, int inputId) {
"""
Specific (key, value) configurations for each Input. Some Input Formats
read specific configuration values and act based on them.
"""
// Check that this named output has been configured before
Co... | java | public static void addInputContext(Job job, String inputName, String key, String value, int inputId) {
// Check that this named output has been configured before
Configuration conf = job.getConfiguration();
// Add specific configuration
conf.set(MI_PREFIX + inputName + "." + inputId + CONF + "." + key, ... | [
"public",
"static",
"void",
"addInputContext",
"(",
"Job",
"job",
",",
"String",
"inputName",
",",
"String",
"key",
",",
"String",
"value",
",",
"int",
"inputId",
")",
"{",
"// Check that this named output has been configured before",
"Configuration",
"conf",
"=",
"... | Specific (key, value) configurations for each Input. Some Input Formats
read specific configuration values and act based on them. | [
"Specific",
"(",
"key",
"value",
")",
"configurations",
"for",
"each",
"Input",
".",
"Some",
"Input",
"Formats",
"read",
"specific",
"configuration",
"values",
"and",
"act",
"based",
"on",
"them",
"."
] | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/input/PangoolMultipleInputs.java#L170-L175 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.encodeAttribute | @SuppressWarnings("unchecked")
private String encodeAttribute(String s, Charset charset) throws ErrorDataEncoderException {
"""
Encode one attribute
@return the encoded attribute
@throws ErrorDataEncoderException
if the encoding is in error
"""
if (s == null) {
return "";
}... | java | @SuppressWarnings("unchecked")
private String encodeAttribute(String s, Charset charset) throws ErrorDataEncoderException {
if (s == null) {
return "";
}
try {
String encoded = URLEncoder.encode(s, charset.name());
if (encoderMode == EncoderMode.RFC3986) {... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"String",
"encodeAttribute",
"(",
"String",
"s",
",",
"Charset",
"charset",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"t... | Encode one attribute
@return the encoded attribute
@throws ErrorDataEncoderException
if the encoding is in error | [
"Encode",
"one",
"attribute"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L836-L853 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_addressMove_move_POST | public OvhAsyncTask<Long> packName_addressMove_move_POST(String packName, OvhCreation creation, Boolean keepCurrentNumber, OvhLandline landline, Date moveOutDate, String offerCode, OvhProviderEnum provider) throws IOException {
"""
Move the access to another address
REST: POST /pack/xdsl/{packName}/addressMove/... | java | public OvhAsyncTask<Long> packName_addressMove_move_POST(String packName, OvhCreation creation, Boolean keepCurrentNumber, OvhLandline landline, Date moveOutDate, String offerCode, OvhProviderEnum provider) throws IOException {
String qPath = "/pack/xdsl/{packName}/addressMove/move";
StringBuilder sb = path(qPath, ... | [
"public",
"OvhAsyncTask",
"<",
"Long",
">",
"packName_addressMove_move_POST",
"(",
"String",
"packName",
",",
"OvhCreation",
"creation",
",",
"Boolean",
"keepCurrentNumber",
",",
"OvhLandline",
"landline",
",",
"Date",
"moveOutDate",
",",
"String",
"offerCode",
",",
... | Move the access to another address
REST: POST /pack/xdsl/{packName}/addressMove/move
@param moveOutDate [required] The date when the customer is no longer at the current address. Must be between now and +30 days
@param offerCode [required] The offerCode from addressMove/eligibility
@param keepCurrentNumber [required] ... | [
"Move",
"the",
"access",
"to",
"another",
"address"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L364-L376 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/UpdateDevEndpointRequest.java | UpdateDevEndpointRequest.withAddArguments | public UpdateDevEndpointRequest withAddArguments(java.util.Map<String, String> addArguments) {
"""
<p>
The map of arguments to add the map of arguments used to configure the DevEndpoint.
</p>
@param addArguments
The map of arguments to add the map of arguments used to configure the DevEndpoint.
@return Retu... | java | public UpdateDevEndpointRequest withAddArguments(java.util.Map<String, String> addArguments) {
setAddArguments(addArguments);
return this;
} | [
"public",
"UpdateDevEndpointRequest",
"withAddArguments",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"addArguments",
")",
"{",
"setAddArguments",
"(",
"addArguments",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The map of arguments to add the map of arguments used to configure the DevEndpoint.
</p>
@param addArguments
The map of arguments to add the map of arguments used to configure the DevEndpoint.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"map",
"of",
"arguments",
"to",
"add",
"the",
"map",
"of",
"arguments",
"used",
"to",
"configure",
"the",
"DevEndpoint",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/UpdateDevEndpointRequest.java#L503-L506 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/FloatRangeRandomizer.java | FloatRangeRandomizer.aNewFloatRangeRandomizer | public static FloatRangeRandomizer aNewFloatRangeRandomizer(final Float min, final Float max, final long seed) {
"""
Create a new {@link FloatRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link FloatRangeRandomizer}.
"""
return new FloatRang... | java | public static FloatRangeRandomizer aNewFloatRangeRandomizer(final Float min, final Float max, final long seed) {
return new FloatRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"FloatRangeRandomizer",
"aNewFloatRangeRandomizer",
"(",
"final",
"Float",
"min",
",",
"final",
"Float",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"FloatRangeRandomizer",
"(",
"min",
",",
"max",
",",
"seed",
")",
";",
... | Create a new {@link FloatRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link FloatRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"FloatRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/FloatRangeRandomizer.java#L90-L92 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.toLower | public static Expression<String> toLower(Expression<String> stringExpression) {
"""
Converts the given expression to lower(expression)
<p>Constants are lower()ed at creation time</p>
@param stringExpression the string to lower()
@return lower(stringExpression)
"""
if (stringExpression instanceof... | java | public static Expression<String> toLower(Expression<String> stringExpression) {
if (stringExpression instanceof Constant) {
Constant<String> constantExpression = (Constant<String>) stringExpression;
return ConstantImpl.create(constantExpression.getConstant().toLowerCase());
} els... | [
"public",
"static",
"Expression",
"<",
"String",
">",
"toLower",
"(",
"Expression",
"<",
"String",
">",
"stringExpression",
")",
"{",
"if",
"(",
"stringExpression",
"instanceof",
"Constant",
")",
"{",
"Constant",
"<",
"String",
">",
"constantExpression",
"=",
... | Converts the given expression to lower(expression)
<p>Constants are lower()ed at creation time</p>
@param stringExpression the string to lower()
@return lower(stringExpression) | [
"Converts",
"the",
"given",
"expression",
"to",
"lower",
"(",
"expression",
")"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L900-L907 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/impl/DocumentStyleImpl.java | DocumentStyleImpl.getCurrentStyle | public String getCurrentStyle(Element elem, String name) {
"""
Returns the computed style of the given element.<p>
@param elem the element
@param name the name of the CSS property
@return the currently computed style
"""
name = hyphenize(name);
String propVal = getComputedStyle(elem, na... | java | public String getCurrentStyle(Element elem, String name) {
name = hyphenize(name);
String propVal = getComputedStyle(elem, name);
if (CmsDomUtil.Style.opacity.name().equals(name) && ((propVal == null) || (propVal.trim().length() == 0))) {
propVal = "1";
}
return prop... | [
"public",
"String",
"getCurrentStyle",
"(",
"Element",
"elem",
",",
"String",
"name",
")",
"{",
"name",
"=",
"hyphenize",
"(",
"name",
")",
";",
"String",
"propVal",
"=",
"getComputedStyle",
"(",
"elem",
",",
"name",
")",
";",
"if",
"(",
"CmsDomUtil",
".... | Returns the computed style of the given element.<p>
@param elem the element
@param name the name of the CSS property
@return the currently computed style | [
"Returns",
"the",
"computed",
"style",
"of",
"the",
"given",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/impl/DocumentStyleImpl.java#L73-L81 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookXMLPreProcessor.java | DocBookXMLPreProcessor.processPrerequisiteInjections | public void processPrerequisiteInjections(final SpecNodeWithRelationships specNode, final Document doc, final boolean useFixedUrls) {
"""
Insert a itemized list into the start of the topic, below the title with any PREREQUISITE relationships that exists for
the Spec Topic. The title for the list is set to the "PR... | java | public void processPrerequisiteInjections(final SpecNodeWithRelationships specNode, final Document doc, final boolean useFixedUrls) {
processPrerequisiteInjections(specNode, doc, doc.getDocumentElement(), useFixedUrls);
} | [
"public",
"void",
"processPrerequisiteInjections",
"(",
"final",
"SpecNodeWithRelationships",
"specNode",
",",
"final",
"Document",
"doc",
",",
"final",
"boolean",
"useFixedUrls",
")",
"{",
"processPrerequisiteInjections",
"(",
"specNode",
",",
"doc",
",",
"doc",
".",... | Insert a itemized list into the start of the topic, below the title with any PREREQUISITE relationships that exists for
the Spec Topic. The title for the list is set to the "PREREQUISITE" property or "Prerequisites:" by default.
@param specNode The content spec node to process the injection for.
@param do... | [
"Insert",
"a",
"itemized",
"list",
"into",
"the",
"start",
"of",
"the",
"topic",
"below",
"the",
"title",
"with",
"any",
"PREREQUISITE",
"relationships",
"that",
"exists",
"for",
"the",
"Spec",
"Topic",
".",
"The",
"title",
"for",
"the",
"list",
"is",
"set... | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookXMLPreProcessor.java#L875-L877 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.addImageUrlInput | public Image addImageUrlInput(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) {
"""
Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@par... | java | public Image addImageUrlInput(String listId, String contentType, BodyModelModel imageUrl, AddImageUrlInputOptionalParameter addImageUrlInputOptionalParameter) {
return addImageUrlInputWithServiceResponseAsync(listId, contentType, imageUrl, addImageUrlInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"Image",
"addImageUrlInput",
"(",
"String",
"listId",
",",
"String",
"contentType",
",",
"BodyModelModel",
"imageUrl",
",",
"AddImageUrlInputOptionalParameter",
"addImageUrlInputOptionalParameter",
")",
"{",
"return",
"addImageUrlInputWithServiceResponseAsync",
"(",
... | Add an image to the list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param contentType The content type.
@param imageUrl The image url.
@param addImageUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentE... | [
"Add",
"an",
"image",
"to",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L505-L507 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java | AnnotationUtils.getAnnotation | public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
"""
Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method}.
<p>Correctly handles bridge {@link Method Methods} generated by the compiler.
@param method the method to look for annotat... | java | public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
Method resolvedMethod = BridgeMethodResolver.findBridgedMethod(method);
return getAnnotation((AnnotatedElement) resolvedMethod, annotationType);
} | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"Method",
"method",
",",
"Class",
"<",
"A",
">",
"annotationType",
")",
"{",
"Method",
"resolvedMethod",
"=",
"BridgeMethodResolver",
".",
"findBridgedMethod",
"(",
"method",
... | Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method}.
<p>Correctly handles bridge {@link Method Methods} generated by the compiler.
@param method the method to look for annotations on
@param annotationType the annotation type to look for
@return the annotations found | [
"Get",
"a",
"single",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java#L169-L172 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleTableModel.java | SimpleTableModel.setComparator | public void setComparator(final int col, final Comparator comparator) {
"""
Sets the comparator for the given column, to enable sorting.
@param col the column to set the comparator on.
@param comparator the comparator to set.
"""
synchronized (this) {
if (comparators == null) {
comparators = new H... | java | public void setComparator(final int col, final Comparator comparator) {
synchronized (this) {
if (comparators == null) {
comparators = new HashMap<>();
}
}
if (comparator == null) {
comparators.remove(col);
} else {
comparators.put(col, comparator);
}
} | [
"public",
"void",
"setComparator",
"(",
"final",
"int",
"col",
",",
"final",
"Comparator",
"comparator",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"comparators",
"==",
"null",
")",
"{",
"comparators",
"=",
"new",
"HashMap",
"<>",
"(",
"... | Sets the comparator for the given column, to enable sorting.
@param col the column to set the comparator on.
@param comparator the comparator to set. | [
"Sets",
"the",
"comparator",
"for",
"the",
"given",
"column",
"to",
"enable",
"sorting",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleTableModel.java#L86-L98 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/MediaType.java | MediaType.nonBinary | public static MediaType nonBinary( MediaType.Type type, String subType, Charset charSet ) {
"""
Creates a non-binary media type with the given type, subtype, and charSet
@throws com.tngtech.jgiven.exception.JGivenWrongUsageException if any of the given arguments is {@code null}
"""
ApiUtil.notNull( ch... | java | public static MediaType nonBinary( MediaType.Type type, String subType, Charset charSet ) {
ApiUtil.notNull( charSet, "charset must not be null" );
return new MediaType( type, subType, charSet );
} | [
"public",
"static",
"MediaType",
"nonBinary",
"(",
"MediaType",
".",
"Type",
"type",
",",
"String",
"subType",
",",
"Charset",
"charSet",
")",
"{",
"ApiUtil",
".",
"notNull",
"(",
"charSet",
",",
"\"charset must not be null\"",
")",
";",
"return",
"new",
"Medi... | Creates a non-binary media type with the given type, subtype, and charSet
@throws com.tngtech.jgiven.exception.JGivenWrongUsageException if any of the given arguments is {@code null} | [
"Creates",
"a",
"non",
"-",
"binary",
"media",
"type",
"with",
"the",
"given",
"type",
"subtype",
"and",
"charSet"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/MediaType.java#L185-L188 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/BaiduMessage.java | BaiduMessage.withSubstitutions | public BaiduMessage withSubstitutions(java.util.Map<String, java.util.List<String>> substitutions) {
"""
Default message substitutions. Can be overridden by individual address substitutions.
@param substitutions
Default message substitutions. Can be overridden by individual address substitutions.
@return Retu... | java | public BaiduMessage withSubstitutions(java.util.Map<String, java.util.List<String>> substitutions) {
setSubstitutions(substitutions);
return this;
} | [
"public",
"BaiduMessage",
"withSubstitutions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"substitutions",
")",
"{",
"setSubstitutions",
"(",
"substitutions",
")",
";",
"return",
"th... | Default message substitutions. Can be overridden by individual address substitutions.
@param substitutions
Default message substitutions. Can be overridden by individual address substitutions.
@return Returns a reference to this object so that method calls can be chained together. | [
"Default",
"message",
"substitutions",
".",
"Can",
"be",
"overridden",
"by",
"individual",
"address",
"substitutions",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/BaiduMessage.java#L554-L557 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java | KafkaKeyValueProducerPusher.pushMessages | public void pushMessages(List<Pair<K, V>> messages) {
"""
Push all keyed messages to the Kafka topic.
@param messages List of keyed messages to push to Kakfa.
"""
for (Pair<K, V> message: messages) {
this.futures.offer(this.producer.send(new ProducerRecord<>(topic, message.getKey(), message.getValue... | java | public void pushMessages(List<Pair<K, V>> messages) {
for (Pair<K, V> message: messages) {
this.futures.offer(this.producer.send(new ProducerRecord<>(topic, message.getKey(), message.getValue()), (recordMetadata, e) -> {
if (e != null) {
log.error("Failed to send message to topic {} due to e... | [
"public",
"void",
"pushMessages",
"(",
"List",
"<",
"Pair",
"<",
"K",
",",
"V",
">",
">",
"messages",
")",
"{",
"for",
"(",
"Pair",
"<",
"K",
",",
"V",
">",
"message",
":",
"messages",
")",
"{",
"this",
".",
"futures",
".",
"offer",
"(",
"this",
... | Push all keyed messages to the Kafka topic.
@param messages List of keyed messages to push to Kakfa. | [
"Push",
"all",
"keyed",
"messages",
"to",
"the",
"Kafka",
"topic",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java#L99-L116 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_EL2 | @Pure
public static Point2d L1_EL2(double x, double y) {
"""
This function convert France Lambert I coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return the extended France Lambert II coordinate.
"""
... | java | @Pure
public static Point2d L1_EL2(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L1_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_XS",
",",
... | This function convert France Lambert I coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L305-L318 |
RKumsher/utils | src/main/java/com/github/rkumsher/collection/RandomCollectionUtils.java | RandomCollectionUtils.randomListFrom | public static <T> List<T> randomListFrom(Supplier<T> elementSupplier, Range<Integer> size) {
"""
Returns a list filled from the given element supplier.
@param elementSupplier element supplier to fill list from
@param size range that the size of the list will be randomly chosen from
@param <T> the type of elem... | java | public static <T> List<T> randomListFrom(Supplier<T> elementSupplier, Range<Integer> size) {
checkArgument(
size.hasLowerBound() && size.lowerEndpoint() >= 0,
"Size range must consist of only positive integers");
Set<Integer> rangeSet = ContiguousSet.create(size, DiscreteDomain.integers());
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"randomListFrom",
"(",
"Supplier",
"<",
"T",
">",
"elementSupplier",
",",
"Range",
"<",
"Integer",
">",
"size",
")",
"{",
"checkArgument",
"(",
"size",
".",
"hasLowerBound",
"(",
")",
"&&",
"siz... | Returns a list filled from the given element supplier.
@param elementSupplier element supplier to fill list from
@param size range that the size of the list will be randomly chosen from
@param <T> the type of element the given supplier returns
@return list filled from the given element supplier
@throws IllegalArgument... | [
"Returns",
"a",
"list",
"filled",
"from",
"the",
"given",
"element",
"supplier",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/collection/RandomCollectionUtils.java#L126-L133 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java | PythonDataStream.key_by | public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
"""
A thin wrapper layer over {@link DataStream#keyBy(KeySelector)}.
@param selector The KeySelector to be used for extracting the key for partitioning
@return The {@link PythonDataStream} with partitioned state (i.e. {... | java | public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
} | [
"public",
"PythonKeyedStream",
"key_by",
"(",
"KeySelector",
"<",
"PyObject",
",",
"PyKey",
">",
"selector",
")",
"throws",
"IOException",
"{",
"return",
"new",
"PythonKeyedStream",
"(",
"stream",
".",
"keyBy",
"(",
"new",
"PythonKeySelector",
"(",
"selector",
"... | A thin wrapper layer over {@link DataStream#keyBy(KeySelector)}.
@param selector The KeySelector to be used for extracting the key for partitioning
@return The {@link PythonDataStream} with partitioned state (i.e. {@link PythonKeyedStream}) | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"DataStream#keyBy",
"(",
"KeySelector",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java#L135-L137 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/Validate.java | Validate.isTrue | public static void isTrue(boolean expression, String message, Object value) {
"""
<p>Validate that the argument condition is <code>true</code>; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as validating an
ob... | java | public static void isTrue(boolean expression, String message, Object value) {
if (expression == false) {
throw new IllegalArgumentException(message + value);
}
} | [
"public",
"static",
"void",
"isTrue",
"(",
"boolean",
"expression",
",",
"String",
"message",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"expression",
"==",
"false",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
"+",
"value",
")",
... | <p>Validate that the argument condition is <code>true</code>; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as validating an
object or using your own custom validation expression.</p>
<pre>Validate.isTrue( myObject.i... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",... | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/Validate.java#L69-L73 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java | LinearLayout.isValidLayout | protected boolean isValidLayout(Gravity gravity, Orientation orientation) {
"""
Check if the gravity and orientation are not in conflict one with other.
@param gravity
@param orientation
@return true if orientation and gravity can be applied together, false - otherwise
"""
boolean isValid = true;
... | java | protected boolean isValidLayout(Gravity gravity, Orientation orientation) {
boolean isValid = true;
switch (gravity) {
case TOP:
case BOTTOM:
isValid = (!isUnlimitedSize() && orientation == Orientation.VERTICAL);
break;
case LEFT:
... | [
"protected",
"boolean",
"isValidLayout",
"(",
"Gravity",
"gravity",
",",
"Orientation",
"orientation",
")",
"{",
"boolean",
"isValid",
"=",
"true",
";",
"switch",
"(",
"gravity",
")",
"{",
"case",
"TOP",
":",
"case",
"BOTTOM",
":",
"isValid",
"=",
"(",
"!"... | Check if the gravity and orientation are not in conflict one with other.
@param gravity
@param orientation
@return true if orientation and gravity can be applied together, false - otherwise | [
"Check",
"if",
"the",
"gravity",
"and",
"orientation",
"are",
"not",
"in",
"conflict",
"one",
"with",
"other",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L278-L308 |
google/closure-compiler | src/com/google/javascript/jscomp/AstFactory.java | AstFactory.createObjectDotAssignCall | Node createObjectDotAssignCall(Scope scope, JSType returnType, Node... args) {
"""
Creates a call to Object.assign that returns the specified type.
<p>Object.assign returns !Object in the externs, which can lose type information if the actual
type is known.
"""
Node objAssign = createQName(scope, "Obje... | java | Node createObjectDotAssignCall(Scope scope, JSType returnType, Node... args) {
Node objAssign = createQName(scope, "Object.assign");
Node result = createCall(objAssign, args);
if (isAddingTypes()) {
// Make a unique function type that returns the exact type we've inferred it to be.
// Object.as... | [
"Node",
"createObjectDotAssignCall",
"(",
"Scope",
"scope",
",",
"JSType",
"returnType",
",",
"Node",
"...",
"args",
")",
"{",
"Node",
"objAssign",
"=",
"createQName",
"(",
"scope",
",",
"\"Object.assign\"",
")",
";",
"Node",
"result",
"=",
"createCall",
"(",
... | Creates a call to Object.assign that returns the specified type.
<p>Object.assign returns !Object in the externs, which can lose type information if the actual
type is known. | [
"Creates",
"a",
"call",
"to",
"Object",
".",
"assign",
"that",
"returns",
"the",
"specified",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L572-L589 |
buschmais/jqa-core-framework | plugin/src/main/java/com/buschmais/jqassistant/core/plugin/impl/AbstractPluginRepository.java | AbstractPluginRepository.createInstance | protected <T> T createInstance(String typeName) throws PluginRepositoryException {
"""
Create an instance of the given scanner plugin class.
@param typeName
The type name.
@param <T>
The type.
@return The plugin instance.
@throws PluginRepositoryException
If the requested instance could not be created.
... | java | protected <T> T createInstance(String typeName) throws PluginRepositoryException {
Class<T> type = getType(typeName.trim());
try {
return type.newInstance();
} catch (InstantiationException e) {
throw new PluginRepositoryException("Cannot create instance of class " + type... | [
"protected",
"<",
"T",
">",
"T",
"createInstance",
"(",
"String",
"typeName",
")",
"throws",
"PluginRepositoryException",
"{",
"Class",
"<",
"T",
">",
"type",
"=",
"getType",
"(",
"typeName",
".",
"trim",
"(",
")",
")",
";",
"try",
"{",
"return",
"type",... | Create an instance of the given scanner plugin class.
@param typeName
The type name.
@param <T>
The type.
@return The plugin instance.
@throws PluginRepositoryException
If the requested instance could not be created. | [
"Create",
"an",
"instance",
"of",
"the",
"given",
"scanner",
"plugin",
"class",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/plugin/src/main/java/com/buschmais/jqassistant/core/plugin/impl/AbstractPluginRepository.java#L72-L83 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setNClob | @Override
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
"""
Method setNClob.
@param parameterIndex
@param reader
@throws SQLException
@see java.sql.PreparedStatement#setNClob(int, Reader)
"""
internalStmt.setNClob(parameterIndex, reader);
} | java | @Override
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
internalStmt.setNClob(parameterIndex, reader);
} | [
"@",
"Override",
"public",
"void",
"setNClob",
"(",
"int",
"parameterIndex",
",",
"Reader",
"reader",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setNClob",
"(",
"parameterIndex",
",",
"reader",
")",
";",
"}"
] | Method setNClob.
@param parameterIndex
@param reader
@throws SQLException
@see java.sql.PreparedStatement#setNClob(int, Reader) | [
"Method",
"setNClob",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L830-L833 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/WorkbenchPanel.java | WorkbenchPanel.getTabbedStatus | public TabbedPanel2 getTabbedStatus() {
"""
Gets the tabbed panel that has the {@link PanelType#STATUS STATUS} panels.
<p>
Direct access/manipulation of the tabbed panel is discouraged, the changes done to it might be lost while changing
layouts.
@return the tabbed panel of the {@code status} panels, never {... | java | public TabbedPanel2 getTabbedStatus() {
if (tabbedStatus == null) {
tabbedStatus = new TabbedPanel2();
tabbedStatus.setPreferredSize(new Dimension(800, 200));
// ZAP: Move tabs to the top of the panel
tabbedStatus.setTabPlacement(JTabbedPane.TOP);
tabbedStatus.setName("tabbedStatus");
tabbedS... | [
"public",
"TabbedPanel2",
"getTabbedStatus",
"(",
")",
"{",
"if",
"(",
"tabbedStatus",
"==",
"null",
")",
"{",
"tabbedStatus",
"=",
"new",
"TabbedPanel2",
"(",
")",
";",
"tabbedStatus",
".",
"setPreferredSize",
"(",
"new",
"Dimension",
"(",
"800",
",",
"200"... | Gets the tabbed panel that has the {@link PanelType#STATUS STATUS} panels.
<p>
Direct access/manipulation of the tabbed panel is discouraged, the changes done to it might be lost while changing
layouts.
@return the tabbed panel of the {@code status} panels, never {@code null}
@see #addPanel(AbstractPanel, PanelType) | [
"Gets",
"the",
"tabbed",
"panel",
"that",
"has",
"the",
"{",
"@link",
"PanelType#STATUS",
"STATUS",
"}",
"panels",
".",
"<p",
">",
"Direct",
"access",
"/",
"manipulation",
"of",
"the",
"tabbed",
"panel",
"is",
"discouraged",
"the",
"changes",
"done",
"to",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L708-L718 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java | AVA.getValueString | public String getValueString() {
"""
Get the value of this AVA as a String.
@exception RuntimeException if we could not obtain the string form
(should not occur)
"""
try {
String s = value.getAsString();
if (s == null) {
throw new RuntimeException("AVA string... | java | public String getValueString() {
try {
String s = value.getAsString();
if (s == null) {
throw new RuntimeException("AVA string is null");
}
return s;
} catch (IOException e) {
// should not occur
throw new RuntimeExc... | [
"public",
"String",
"getValueString",
"(",
")",
"{",
"try",
"{",
"String",
"s",
"=",
"value",
".",
"getAsString",
"(",
")",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"AVA string is null\"",
")",
";",
"}",
"... | Get the value of this AVA as a String.
@exception RuntimeException if we could not obtain the string form
(should not occur) | [
"Get",
"the",
"value",
"of",
"this",
"AVA",
"as",
"a",
"String",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java#L249-L260 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/serialize/convert/SerializationConverterRegistry.java | SerializationConverterRegistry.iterateAllRegisteredSerializationConverters | public void iterateAllRegisteredSerializationConverters (@Nonnull final ISerializationConverterCallback aCallback) {
"""
Iterate all registered serialization converters. For informational purposes
only.
@param aCallback
The callback invoked for all iterations.
"""
// Create a static (non weak) copy of... | java | public void iterateAllRegisteredSerializationConverters (@Nonnull final ISerializationConverterCallback aCallback)
{
// Create a static (non weak) copy of the map
final Map <Class <?>, ISerializationConverter <?>> aCopy = m_aRWLock.readLocked ( () -> new CommonsHashMap <> (m_aMap));
// And iterate the co... | [
"public",
"void",
"iterateAllRegisteredSerializationConverters",
"(",
"@",
"Nonnull",
"final",
"ISerializationConverterCallback",
"aCallback",
")",
"{",
"// Create a static (non weak) copy of the map",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"ISerializationConverter... | Iterate all registered serialization converters. For informational purposes
only.
@param aCallback
The callback invoked for all iterations. | [
"Iterate",
"all",
"registered",
"serialization",
"converters",
".",
"For",
"informational",
"purposes",
"only",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/serialize/convert/SerializationConverterRegistry.java#L155-L164 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAPIInfo | public void getAPIInfo(String API, Callback<TokenInfo> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on TokenInfo API go <a href="https://wiki.guildwars2.com/wiki/API:2/tokeninfo">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback... | java | public void getAPIInfo(String API, Callback<TokenInfo> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
gw2API.getAPIInfo(API).enqueue(callback);
} | [
"public",
"void",
"getAPIInfo",
"(",
"String",
"API",
",",
"Callback",
"<",
"TokenInfo",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"API",
",",
"API"... | For more info on TokenInfo API go <a href="https://wiki.guildwars2.com/wiki/API:2/tokeninfo">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param callback callback that is going t... | [
"For",
"more",
"info",
"on",
"TokenInfo",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"tokeninfo",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L148-L151 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/RingLayout.java | RingLayout.setDividerPadding | public void setDividerPadding(final float padding, final Units units, final Axis axis) {
"""
Set the amount of padding between child objects. The actual padding can
be different from that if the {@link Gravity#FILL } is set. The divider
padding can be specified by either angle or length of the arch.
@param pa... | java | public void setDividerPadding(final float padding, final Units units, final Axis axis) {
super.setDividerPadding(units == Units.ARC_LENGTH ?
getSizeAngle(padding) : padding, axis);
} | [
"public",
"void",
"setDividerPadding",
"(",
"final",
"float",
"padding",
",",
"final",
"Units",
"units",
",",
"final",
"Axis",
"axis",
")",
"{",
"super",
".",
"setDividerPadding",
"(",
"units",
"==",
"Units",
".",
"ARC_LENGTH",
"?",
"getSizeAngle",
"(",
"pad... | Set the amount of padding between child objects. The actual padding can
be different from that if the {@link Gravity#FILL } is set. The divider
padding can be specified by either angle or length of the arch.
@param padding
@param units
{@link Units} units the padding is defined in | [
"Set",
"the",
"amount",
"of",
"padding",
"between",
"child",
"objects",
".",
"The",
"actual",
"padding",
"can",
"be",
"different",
"from",
"that",
"if",
"the",
"{",
"@link",
"Gravity#FILL",
"}",
"is",
"set",
".",
"The",
"divider",
"padding",
"can",
"be",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/RingLayout.java#L60-L63 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateFunctionOrMethodDeclaration | private void translateFunctionOrMethodDeclaration(WyilFile.Decl.FunctionOrMethod declaration) {
"""
Transform a function or method declaration into verification conditions as
necessary. This is done by traversing the control-flow graph of the function
or method in question. Verifications are emitted when conditi... | java | private void translateFunctionOrMethodDeclaration(WyilFile.Decl.FunctionOrMethod declaration) {
// Create the prototype for this function or method. This is the
// function or method declaration which can be used within verification
// conditions to refer to this function or method. This does not include
// a b... | [
"private",
"void",
"translateFunctionOrMethodDeclaration",
"(",
"WyilFile",
".",
"Decl",
".",
"FunctionOrMethod",
"declaration",
")",
"{",
"// Create the prototype for this function or method. This is the",
"// function or method declaration which can be used within verification",
"// co... | Transform a function or method declaration into verification conditions as
necessary. This is done by traversing the control-flow graph of the function
or method in question. Verifications are emitted when conditions are
encountered which must be checked. For example, that the preconditions are
met at a function invoca... | [
"Transform",
"a",
"function",
"or",
"method",
"declaration",
"into",
"verification",
"conditions",
"as",
"necessary",
".",
"This",
"is",
"done",
"by",
"traversing",
"the",
"control",
"-",
"flow",
"graph",
"of",
"the",
"function",
"or",
"method",
"in",
"questio... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L248-L285 |
inkstand-io/scribble | scribble-net/src/main/java/io/inkstand/scribble/net/NetworkMatchers.java | NetworkMatchers.remoteDatagramPort | public static NetworkPort remoteDatagramPort(String hostname, int port) {
"""
Creates a type-safe udp port pointing ot a remote host and port.
@param hostname
the hostname of the remote host
@param port
the port of the remote host
@return a {@link NetworkPort} instance describing the udp port
"""
... | java | public static NetworkPort remoteDatagramPort(String hostname, int port){
return new RemoteNetworkPort(hostname, port, NetworkPort.Type.UDP);
} | [
"public",
"static",
"NetworkPort",
"remoteDatagramPort",
"(",
"String",
"hostname",
",",
"int",
"port",
")",
"{",
"return",
"new",
"RemoteNetworkPort",
"(",
"hostname",
",",
"port",
",",
"NetworkPort",
".",
"Type",
".",
"UDP",
")",
";",
"}"
] | Creates a type-safe udp port pointing ot a remote host and port.
@param hostname
the hostname of the remote host
@param port
the port of the remote host
@return a {@link NetworkPort} instance describing the udp port | [
"Creates",
"a",
"type",
"-",
"safe",
"udp",
"port",
"pointing",
"ot",
"a",
"remote",
"host",
"and",
"port",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-net/src/main/java/io/inkstand/scribble/net/NetworkMatchers.java#L102-L104 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createImageTagsWithServiceResponseAsync | public Observable<ServiceResponse<ImageTagCreateSummary>> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) {
"""
Associate a set of images with a set of tags.
@param projectId The project id
@param createImageTagsOptionalParameter the ob... | java | public Observable<ServiceResponse<ImageTagCreateSummary>> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageTagCreateSummary",
">",
">",
"createImageTagsWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"CreateImageTagsOptionalParameter",
"createImageTagsOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"==",
... | Associate a set of images with a set of tags.
@param projectId The project id
@param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageTagCreateS... | [
"Associate",
"a",
"set",
"of",
"images",
"with",
"a",
"set",
"of",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3641-L3651 |
hector-client/hector | core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java | HFactory.createCounterColumn | public static HCounterColumn<String> createCounterColumn(String name, long value) {
"""
Convenient method for creating a counter column with a String name and long value
"""
StringSerializer se = StringSerializer.get();
return createCounterColumn(name, value, se);
} | java | public static HCounterColumn<String> createCounterColumn(String name, long value) {
StringSerializer se = StringSerializer.get();
return createCounterColumn(name, value, se);
} | [
"public",
"static",
"HCounterColumn",
"<",
"String",
">",
"createCounterColumn",
"(",
"String",
"name",
",",
"long",
"value",
")",
"{",
"StringSerializer",
"se",
"=",
"StringSerializer",
".",
"get",
"(",
")",
";",
"return",
"createCounterColumn",
"(",
"name",
... | Convenient method for creating a counter column with a String name and long value | [
"Convenient",
"method",
"for",
"creating",
"a",
"counter",
"column",
"with",
"a",
"String",
"name",
"and",
"long",
"value"
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L650-L653 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleEditorInterfaces.java | ModuleEditorInterfaces.fetchOne | public CMAEditorInterface fetchOne(String spaceId, String environmentId, String contentTypeId) {
"""
Get the editor interface by id, using the given space and environment.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and
{@link CMAClient.Builder... | java | public CMAEditorInterface fetchOne(String spaceId, String environmentId, String contentTypeId) {
assertNotNull(spaceId, "spaceId");
assertNotNull(environmentId, "environmentId");
assertNotNull(contentTypeId, "contentTypeId");
return service.fetchOne(spaceId, environmentId, contentTypeId).blockingFirst(... | [
"public",
"CMAEditorInterface",
"fetchOne",
"(",
"String",
"spaceId",
",",
"String",
"environmentId",
",",
"String",
"contentTypeId",
")",
"{",
"assertNotNull",
"(",
"spaceId",
",",
"\"spaceId\"",
")",
";",
"assertNotNull",
"(",
"environmentId",
",",
"\"environmentI... | Get the editor interface by id, using the given space and environment.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the id of the space this environment is part of.
@param envi... | [
"Get",
"the",
"editor",
"interface",
"by",
"id",
"using",
"the",
"given",
"space",
"and",
"environment",
".",
"<p",
">",
"This",
"method",
"will",
"override",
"the",
"configuration",
"specified",
"through",
"{",
"@link",
"CMAClient",
".",
"Builder#setSpaceId",
... | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleEditorInterfaces.java#L86-L92 |
JodaOrg/joda-money | src/main/java/org/joda/money/format/MoneyFormatterBuilder.java | MoneyFormatterBuilder.appendInternal | private MoneyFormatterBuilder appendInternal(MoneyPrinter printer, MoneyParser parser) {
"""
Appends the specified printer and parser to this builder.
<p>
Either the printer or parser must be non-null.
@param printer the printer to append, null makes the formatter unable to print
@param parser the parser t... | java | private MoneyFormatterBuilder appendInternal(MoneyPrinter printer, MoneyParser parser) {
printers.add(printer);
parsers.add(parser);
return this;
} | [
"private",
"MoneyFormatterBuilder",
"appendInternal",
"(",
"MoneyPrinter",
"printer",
",",
"MoneyParser",
"parser",
")",
"{",
"printers",
".",
"add",
"(",
"printer",
")",
";",
"parsers",
".",
"add",
"(",
"parser",
")",
";",
"return",
"this",
";",
"}"
] | Appends the specified printer and parser to this builder.
<p>
Either the printer or parser must be non-null.
@param printer the printer to append, null makes the formatter unable to print
@param parser the parser to append, null makes the formatter unable to parse
@return this for chaining, never null | [
"Appends",
"the",
"specified",
"printer",
"and",
"parser",
"to",
"this",
"builder",
".",
"<p",
">",
"Either",
"the",
"printer",
"or",
"parser",
"must",
"be",
"non",
"-",
"null",
"."
] | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyFormatterBuilder.java#L263-L267 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/Http2Ping.java | Http2Ping.notifyFailed | public static void notifyFailed(PingCallback callback, Executor executor, Throwable cause) {
"""
Notifies the given callback that the ping operation failed.
@param callback the callback
@param executor the executor used to invoke the callback
@param cause the cause of failure
"""
doExecute(executor, a... | java | public static void notifyFailed(PingCallback callback, Executor executor, Throwable cause) {
doExecute(executor, asRunnable(callback, cause));
} | [
"public",
"static",
"void",
"notifyFailed",
"(",
"PingCallback",
"callback",
",",
"Executor",
"executor",
",",
"Throwable",
"cause",
")",
"{",
"doExecute",
"(",
"executor",
",",
"asRunnable",
"(",
"callback",
",",
"cause",
")",
")",
";",
"}"
] | Notifies the given callback that the ping operation failed.
@param callback the callback
@param executor the executor used to invoke the callback
@param cause the cause of failure | [
"Notifies",
"the",
"given",
"callback",
"that",
"the",
"ping",
"operation",
"failed",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/Http2Ping.java#L170-L172 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUserSegmentRelPersistenceImpl.java | CommerceDiscountUserSegmentRelPersistenceImpl.findByCommerceDiscountId | @Override
public List<CommerceDiscountUserSegmentRel> findByCommerceDiscountId(
long commerceDiscountId, int start, int end) {
"""
Returns a range of all the commerce discount user segment rels where commerceDiscountId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code... | java | @Override
public List<CommerceDiscountUserSegmentRel> findByCommerceDiscountId(
long commerceDiscountId, int start, int end) {
return findByCommerceDiscountId(commerceDiscountId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountUserSegmentRel",
">",
"findByCommerceDiscountId",
"(",
"long",
"commerceDiscountId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommerceDiscountId",
"(",
"commerceDiscountId",
",",
"start... | Returns a range of all the commerce discount user segment rels where commerceDiscountId = ?.
<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",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discount",
"user",
"segment",
"rels",
"where",
"commerceDiscountId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUserSegmentRelPersistenceImpl.java#L146-L150 |
ronmamo/reflections | src/main/java/org/reflections/Reflections.java | Reflections.collect | public Reflections collect(final InputStream inputStream) {
"""
merges saved Reflections resources from the given input stream, using the serializer configured in this instance's Configuration
<br> useful if you know the serialized resource location and prefer not to look it up the classpath
"""
try {... | java | public Reflections collect(final InputStream inputStream) {
try {
merge(configuration.getSerializer().read(inputStream));
if (log != null) log.info("Reflections collected metadata from input stream using serializer " + configuration.getSerializer().getClass().getName());
} catch ... | [
"public",
"Reflections",
"collect",
"(",
"final",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"merge",
"(",
"configuration",
".",
"getSerializer",
"(",
")",
".",
"read",
"(",
"inputStream",
")",
")",
";",
"if",
"(",
"log",
"!=",
"null",
")",
"log... | merges saved Reflections resources from the given input stream, using the serializer configured in this instance's Configuration
<br> useful if you know the serialized resource location and prefer not to look it up the classpath | [
"merges",
"saved",
"Reflections",
"resources",
"from",
"the",
"given",
"input",
"stream",
"using",
"the",
"serializer",
"configured",
"in",
"this",
"instance",
"s",
"Configuration",
"<br",
">",
"useful",
"if",
"you",
"know",
"the",
"serialized",
"resource",
"loc... | train | https://github.com/ronmamo/reflections/blob/084cf4a759a06d88e88753ac00397478c2e0ed52/src/main/java/org/reflections/Reflections.java#L327-L336 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithPath.java | PactDslRequestWithPath.pathFromProviderState | public PactDslRequestWithPath pathFromProviderState(String expression, String example) {
"""
Sets the path to have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to use in the consumer test
"""
requestGenerator... | java | public PactDslRequestWithPath pathFromProviderState(String expression, String example) {
requestGenerators.addGenerator(Category.PATH, new ProviderStateGenerator(expression));
this.path = example;
return this;
} | [
"public",
"PactDslRequestWithPath",
"pathFromProviderState",
"(",
"String",
"expression",
",",
"String",
"example",
")",
"{",
"requestGenerators",
".",
"addGenerator",
"(",
"Category",
".",
"PATH",
",",
"new",
"ProviderStateGenerator",
"(",
"expression",
")",
")",
"... | Sets the path to have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to use in the consumer test | [
"Sets",
"the",
"path",
"to",
"have",
"it",
"s",
"value",
"injected",
"from",
"the",
"provider",
"state"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithPath.java#L437-L441 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.getObject | public DBObject getObject(TableDefinition tableDef, String objID) {
"""
Get all scalar and link fields for the object in the given table with the given ID.
@param tableDef {@link TableDefinition} in which object resides.
@param objID Object ID.
@return {@link DBObject} containing all object scal... | java | public DBObject getObject(TableDefinition tableDef, String objID) {
checkServiceState();
String storeName = objectsStoreName(tableDef);
Tenant tenant = Tenant.getTenant(tableDef);
Iterator<DColumn> colIter = DBService.instance(tenant).getAllColumns(storeName, objID).iterator();
... | [
"public",
"DBObject",
"getObject",
"(",
"TableDefinition",
"tableDef",
",",
"String",
"objID",
")",
"{",
"checkServiceState",
"(",
")",
";",
"String",
"storeName",
"=",
"objectsStoreName",
"(",
"tableDef",
")",
";",
"Tenant",
"tenant",
"=",
"Tenant",
".",
"get... | Get all scalar and link fields for the object in the given table with the given ID.
@param tableDef {@link TableDefinition} in which object resides.
@param objID Object ID.
@return {@link DBObject} containing all object scalar and link fields, or
null if there is no such object. | [
"Get",
"all",
"scalar",
"and",
"link",
"fields",
"for",
"the",
"object",
"in",
"the",
"given",
"table",
"with",
"the",
"given",
"ID",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L176-L188 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AlgorithmId.java | AlgorithmId.makeSigAlg | public static String makeSigAlg(String digAlg, String encAlg) {
"""
Creates a signature algorithm name from a digest algorithm
name and a encryption algorithm name.
"""
digAlg = digAlg.replace("-", "").toUpperCase(Locale.ENGLISH);
if (digAlg.equalsIgnoreCase("SHA")) digAlg = "SHA1";
e... | java | public static String makeSigAlg(String digAlg, String encAlg) {
digAlg = digAlg.replace("-", "").toUpperCase(Locale.ENGLISH);
if (digAlg.equalsIgnoreCase("SHA")) digAlg = "SHA1";
encAlg = encAlg.toUpperCase(Locale.ENGLISH);
if (encAlg.equals("EC")) encAlg = "ECDSA";
return digA... | [
"public",
"static",
"String",
"makeSigAlg",
"(",
"String",
"digAlg",
",",
"String",
"encAlg",
")",
"{",
"digAlg",
"=",
"digAlg",
".",
"replace",
"(",
"\"-\"",
",",
"\"\"",
")",
".",
"toUpperCase",
"(",
"Locale",
".",
"ENGLISH",
")",
";",
"if",
"(",
"di... | Creates a signature algorithm name from a digest algorithm
name and a encryption algorithm name. | [
"Creates",
"a",
"signature",
"algorithm",
"name",
"from",
"a",
"digest",
"algorithm",
"name",
"and",
"a",
"encryption",
"algorithm",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AlgorithmId.java#L947-L955 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/impl/util/ReflectionUtil.java | ReflectionUtil.forEachField | public static void forEachField( final Object object, Class<?> clazz, final FieldPredicate predicate, final FieldAction action ) {
"""
Iterates over all fields of the given class and all its super classes
and calls action.act() for the fields that are annotated with the given annotation.
"""
forEachSu... | java | public static void forEachField( final Object object, Class<?> clazz, final FieldPredicate predicate, final FieldAction action ) {
forEachSuperClass( clazz, new ClassAction() {
@Override
public void act( Class<?> clazz ) throws Exception {
for( Field field : clazz.getDecl... | [
"public",
"static",
"void",
"forEachField",
"(",
"final",
"Object",
"object",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"FieldPredicate",
"predicate",
",",
"final",
"FieldAction",
"action",
")",
"{",
"forEachSuperClass",
"(",
"clazz",
",",
"new",
"... | Iterates over all fields of the given class and all its super classes
and calls action.act() for the fields that are annotated with the given annotation. | [
"Iterates",
"over",
"all",
"fields",
"of",
"the",
"given",
"class",
"and",
"all",
"its",
"super",
"classes",
"and",
"calls",
"action",
".",
"act",
"()",
"for",
"the",
"fields",
"that",
"are",
"annotated",
"with",
"the",
"given",
"annotation",
"."
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/impl/util/ReflectionUtil.java#L30-L41 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.writeRecordBatchTo | public static void writeRecordBatchTo(BufferAllocator bufferAllocator ,List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream) {
"""
Write the records to the given output stream
@param recordBatch the record batch to write
@param inputSchema the input schema
@param outputStream the outpu... | java | public static void writeRecordBatchTo(BufferAllocator bufferAllocator ,List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream) {
if(!(recordBatch instanceof ArrowWritableRecordBatch)) {
val convertedSchema = toArrowSchema(inputSchema);
List<FieldVector> columns =... | [
"public",
"static",
"void",
"writeRecordBatchTo",
"(",
"BufferAllocator",
"bufferAllocator",
",",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
"recordBatch",
",",
"Schema",
"inputSchema",
",",
"OutputStream",
"outputStream",
")",
"{",
"if",
"(",
"!",
"(",
"... | Write the records to the given output stream
@param recordBatch the record batch to write
@param inputSchema the input schema
@param outputStream the output stream to write to | [
"Write",
"the",
"records",
"to",
"the",
"given",
"output",
"stream"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L276-L313 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Nodes.java | Nodes.replaceNode | public boolean replaceNode(final Node oldOne, final @Nonnull Node newOne) throws IOException {
"""
Replace node of given name.
@return {@code true} if node was replaced.
@since 2.8
"""
if (oldOne == nodes.get(oldOne.getNodeName())) {
// use the queue lock until Nodes has a way of direct... | java | public boolean replaceNode(final Node oldOne, final @Nonnull Node newOne) throws IOException {
if (oldOne == nodes.get(oldOne.getNodeName())) {
// use the queue lock until Nodes has a way of directly modifying a single node.
Queue.withLock(new Runnable() {
public void run... | [
"public",
"boolean",
"replaceNode",
"(",
"final",
"Node",
"oldOne",
",",
"final",
"@",
"Nonnull",
"Node",
"newOne",
")",
"throws",
"IOException",
"{",
"if",
"(",
"oldOne",
"==",
"nodes",
".",
"get",
"(",
"oldOne",
".",
"getNodeName",
"(",
")",
")",
")",
... | Replace node of given name.
@return {@code true} if node was replaced.
@since 2.8 | [
"Replace",
"node",
"of",
"given",
"name",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Nodes.java#L224-L245 |
code4everything/util | src/main/java/com/zhazhapan/util/MailSender.java | MailSender.config | public static void config(MailHost mailHost, String personal, String from, String key, int port) {
"""
配置邮箱
@param mailHost 邮件服务器
@param personal 个人名称
@param from 发件箱
@param key 密码
@param port 端口
"""
config(mailHost, personal, from, key);
setPort(port);
} | java | public static void config(MailHost mailHost, String personal, String from, String key, int port) {
config(mailHost, personal, from, key);
setPort(port);
} | [
"public",
"static",
"void",
"config",
"(",
"MailHost",
"mailHost",
",",
"String",
"personal",
",",
"String",
"from",
",",
"String",
"key",
",",
"int",
"port",
")",
"{",
"config",
"(",
"mailHost",
",",
"personal",
",",
"from",
",",
"key",
")",
";",
"set... | 配置邮箱
@param mailHost 邮件服务器
@param personal 个人名称
@param from 发件箱
@param key 密码
@param port 端口 | [
"配置邮箱"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/MailSender.java#L93-L96 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java | Bindable.listOf | public static <E> Bindable<List<E>> listOf(Class<E> elementType) {
"""
Create a new {@link Bindable} {@link List} of the specified element type.
@param <E> the element type
@param elementType the list element type
@return a {@link Bindable} instance
"""
return of(ResolvableType.forClassWithGenerics(List.c... | java | public static <E> Bindable<List<E>> listOf(Class<E> elementType) {
return of(ResolvableType.forClassWithGenerics(List.class, elementType));
} | [
"public",
"static",
"<",
"E",
">",
"Bindable",
"<",
"List",
"<",
"E",
">",
">",
"listOf",
"(",
"Class",
"<",
"E",
">",
"elementType",
")",
"{",
"return",
"of",
"(",
"ResolvableType",
".",
"forClassWithGenerics",
"(",
"List",
".",
"class",
",",
"element... | Create a new {@link Bindable} {@link List} of the specified element type.
@param <E> the element type
@param elementType the list element type
@return a {@link Bindable} instance | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java#L213-L215 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201808/orderservice/GetOrdersStartingSoon.java | GetOrdersStartingSoon.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
OrderServiceInterface orderService =
adManagerServices.get(session, OrderServiceInterface.class);
// Create a statement to select orders.
StatementBuilder statementBuilder = n... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"OrderServiceInterface",
"orderService",
"=",
"adManagerServices",
".",
"get",
"(",
"session",
",",
"Order... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201808/orderservice/GetOrdersStartingSoon.java#L55-L95 |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java | CmsMessageBundleEditorOptions.initLanguageSwitch | private void initLanguageSwitch(Collection<Locale> locales, Locale current) {
"""
Initializes the language switcher UI Component {@link #m_languageSwitch}, including {@link #m_languageSelect}.
@param locales the locales that can be selected.
@param current the currently selected locale.
"""
FormLayo... | java | private void initLanguageSwitch(Collection<Locale> locales, Locale current) {
FormLayout languages = new FormLayout();
languages.setHeight("100%");
languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
ComboBox languageSelect = new ComboBox();
languageSelect.setCaption(... | [
"private",
"void",
"initLanguageSwitch",
"(",
"Collection",
"<",
"Locale",
">",
"locales",
",",
"Locale",
"current",
")",
"{",
"FormLayout",
"languages",
"=",
"new",
"FormLayout",
"(",
")",
";",
"languages",
".",
"setHeight",
"(",
"\"100%\"",
")",
";",
"lang... | Initializes the language switcher UI Component {@link #m_languageSwitch}, including {@link #m_languageSelect}.
@param locales the locales that can be selected.
@param current the currently selected locale. | [
"Initializes",
"the",
"language",
"switcher",
"UI",
"Component",
"{"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java#L351-L390 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractNumberBindTransform.java | AbstractNumberBindTransform.generateSerializeOnXml | @Override
public void generateSerializeOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateSerializeOnXml(com.abubusoft.... | java | @Override
public void generateSerializeOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property) {
XmlType xmlType = property.xmlInfo.xmlType;
if (property.isNullable() && !property.isInCollection()) {
methodBuilder.begin... | [
"@",
"Override",
"public",
"void",
"generateSerializeOnXml",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"serializerName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"property... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateSerializeOnXml(com.abubusoft.kripton.processor.bind.BindTypeContext, com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.bind.model.BindPro... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractNumberBindTransform.java#L190-L242 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Completable.java | Completable.blockingGet | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Throwable blockingGet(long timeout, TimeUnit unit) {
"""
Subscribes to this Completable instance and blocks until it terminates or the specified timeout
elapses, then returns null for normal termination or the emitted exception if any... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Throwable blockingGet(long timeout, TimeUnit unit) {
ObjectHelper.requireNonNull(unit, "unit is null");
BlockingMultiObserver<Void> observer = new BlockingMultiObserver<Void>();
subscribe(observer);
return ob... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Throwable",
"blockingGet",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"unit",
",",
"\"uni... | Subscribes to this Completable instance and blocks until it terminates or the specified timeout
elapses, then returns null for normal termination or the emitted exception if any.
<p>
<img width="640" height="348" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.blockingGet.t.png" alt=""... | [
"Subscribes",
"to",
"this",
"Completable",
"instance",
"and",
"blocks",
"until",
"it",
"terminates",
"or",
"the",
"specified",
"timeout",
"elapses",
"then",
"returns",
"null",
"for",
"normal",
"termination",
"or",
"the",
"emitted",
"exception",
"if",
"any",
".",... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Completable.java#L1253-L1260 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/utils/DateUtils.java | DateUtils.date2Str | public static String date2Str(Date date, String format) {
"""
<p>将{@link Date}类型转换为指定格式的字符串</p>
author : Crab2Died
date : 2017年06月02日 15:32:04
@param date {@link Date}类型的时间
@param format 指定格式化类型
@return 返回格式化后的时间字符串
"""
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf... | java | public static String date2Str(Date date, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
} | [
"public",
"static",
"String",
"date2Str",
"(",
"Date",
"date",
",",
"String",
"format",
")",
"{",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"format",
")",
";",
"return",
"sdf",
".",
"format",
"(",
"date",
")",
";",
"}"
] | <p>将{@link Date}类型转换为指定格式的字符串</p>
author : Crab2Died
date : 2017年06月02日 15:32:04
@param date {@link Date}类型的时间
@param format 指定格式化类型
@return 返回格式化后的时间字符串 | [
"<p",
">",
"将",
"{",
"@link",
"Date",
"}",
"类型转换为指定格式的字符串<",
"/",
"p",
">",
"author",
":",
"Crab2Died",
"date",
":",
"2017年06月02日",
"15",
":",
"32",
":",
"04"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/utils/DateUtils.java#L96-L99 |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java | LiveReloadServer.createConnection | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
"""
Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@ret... | java | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | [
"protected",
"Connection",
"createConnection",
"(",
"Socket",
"socket",
",",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Connection",
"(",
"socket",
",",
"inputStream",
",",
"outputStream",
... | Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@return a connection
@throws IOException in case of I/O errors | [
"Factory",
"method",
"used",
"to",
"create",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java#L236-L239 |
dwdyer/reportng | reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java | HTMLReporter.createSuiteList | private void createSuiteList(List<ISuite> suites,
File outputDirectory,
boolean onlyFailures) throws Exception {
"""
Create the navigation frame.
@param outputDirectory The target directory for the generated file(s).
"""
VelocityContext... | java | private void createSuiteList(List<ISuite> suites,
File outputDirectory,
boolean onlyFailures) throws Exception
{
VelocityContext context = createContext();
context.put(SUITES_KEY, suites);
context.put(ONLY_FAILURES_KEY, onlyFa... | [
"private",
"void",
"createSuiteList",
"(",
"List",
"<",
"ISuite",
">",
"suites",
",",
"File",
"outputDirectory",
",",
"boolean",
"onlyFailures",
")",
"throws",
"Exception",
"{",
"VelocityContext",
"context",
"=",
"createContext",
"(",
")",
";",
"context",
".",
... | Create the navigation frame.
@param outputDirectory The target directory for the generated file(s). | [
"Create",
"the",
"navigation",
"frame",
"."
] | train | https://github.com/dwdyer/reportng/blob/df11f9cd9ab3fb5847fbba94ed3098ae0448f770/reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java#L153-L163 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java | DraggableViewCallback.clampViewPositionHorizontal | @Override public int clampViewPositionHorizontal(View child, int left, int dx) {
"""
Override method used to configure the horizontal drag. Restrict the motion of the dragged
child view along the horizontal axis.
@param child child view being dragged.
@param left attempted motion along the X axis.
@param dx ... | java | @Override public int clampViewPositionHorizontal(View child, int left, int dx) {
int newLeft = draggedView.getLeft();
if ((draggableView.isMinimized() && Math.abs(dx) > MINIMUM_DX_FOR_HORIZONTAL_DRAG) || (
draggableView.isDragViewAtBottom()
&& !draggableView.isDragViewAtRight())) {
new... | [
"@",
"Override",
"public",
"int",
"clampViewPositionHorizontal",
"(",
"View",
"child",
",",
"int",
"left",
",",
"int",
"dx",
")",
"{",
"int",
"newLeft",
"=",
"draggedView",
".",
"getLeft",
"(",
")",
";",
"if",
"(",
"(",
"draggableView",
".",
"isMinimized",... | Override method used to configure the horizontal drag. Restrict the motion of the dragged
child view along the horizontal axis.
@param child child view being dragged.
@param left attempted motion along the X axis.
@param dx proposed change in position for left.
@return the new clamped position for left. | [
"Override",
"method",
"used",
"to",
"configure",
"the",
"horizontal",
"drag",
".",
"Restrict",
"the",
"motion",
"of",
"the",
"dragged",
"child",
"view",
"along",
"the",
"horizontal",
"axis",
"."
] | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java#L108-L116 |
nemerosa/ontrack | ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/NameDescription.java | NameDescription.escapeName | public static String escapeName(String name) {
"""
Makes sure the given <code>name</code> is escaped properly before being used as a valid name.
@param name Name to convert
@return Name which is safe to use
@see #NAME
"""
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentExcept... | java | public static String escapeName(String name) {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("Blank or null is not a valid name.");
} else if (java.util.regex.Pattern.matches(NAME, name)) {
return name;
} else {
return name.replaceAll("[^... | [
"public",
"static",
"String",
"escapeName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"name",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Blank or null is not a valid name.\"",
")",
";",
"}",
"else",
... | Makes sure the given <code>name</code> is escaped properly before being used as a valid name.
@param name Name to convert
@return Name which is safe to use
@see #NAME | [
"Makes",
"sure",
"the",
"given",
"<code",
">",
"name<",
"/",
"code",
">",
"is",
"escaped",
"properly",
"before",
"being",
"used",
"as",
"a",
"valid",
"name",
"."
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/NameDescription.java#L49-L57 |
jayantk/jklol | src/com/jayantkrish/jklol/lisp/LispUtil.java | LispUtil.checkState | public static void checkState(boolean condition, String message, Object ... values) {
"""
Identical to Preconditions.checkState but throws an
{@code EvalError} instead of an IllegalArgumentException.
Use this check to verify properties of a Lisp program
execution, i.e., whenever the raised exception should be
... | java | public static void checkState(boolean condition, String message, Object ... values) {
if (!condition) {
throw new EvalError(String.format(message, values));
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"condition",
",",
"String",
"message",
",",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"EvalError",
"(",
"String",
".",
"format",
"(",
"message",
"... | Identical to Preconditions.checkState but throws an
{@code EvalError} instead of an IllegalArgumentException.
Use this check to verify properties of a Lisp program
execution, i.e., whenever the raised exception should be
catchable by the evaluator of the program.
@param condition
@param message
@param values | [
"Identical",
"to",
"Preconditions",
".",
"checkState",
"but",
"throws",
"an",
"{",
"@code",
"EvalError",
"}",
"instead",
"of",
"an",
"IllegalArgumentException",
".",
"Use",
"this",
"check",
"to",
"verify",
"properties",
"of",
"a",
"Lisp",
"program",
"execution",... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/lisp/LispUtil.java#L98-L102 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/JMProgressiveManager.java | JMProgressiveManager.registerTargetChangeListener | public JMProgressiveManager<T, R>
registerTargetChangeListener(Consumer<T> targetChangeListener) {
"""
Register target change listener jm progressive manager.
@param targetChangeListener the target change listener
@return the jm progressive manager
"""
return registerListener(currentTarget, targetChan... | java | public JMProgressiveManager<T, R>
registerTargetChangeListener(Consumer<T> targetChangeListener) {
return registerListener(currentTarget, targetChangeListener);
} | [
"public",
"JMProgressiveManager",
"<",
"T",
",",
"R",
">",
"registerTargetChangeListener",
"(",
"Consumer",
"<",
"T",
">",
"targetChangeListener",
")",
"{",
"return",
"registerListener",
"(",
"currentTarget",
",",
"targetChangeListener",
")",
";",
"}"
] | Register target change listener jm progressive manager.
@param targetChangeListener the target change listener
@return the jm progressive manager | [
"Register",
"target",
"change",
"listener",
"jm",
"progressive",
"manager",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/JMProgressiveManager.java#L296-L299 |
qiniu/java-sdk | src/main/java/com/qiniu/util/Auth.java | Auth.uploadToken | public String uploadToken(String bucket, String key, long expires, StringMap policy) {
"""
生成上传token
@param bucket 空间名
@param key key,可为 null
@param expires 有效时长,单位秒
@param policy 上传策略的其它参数,如 new StringMap().put("endUser", "uid").putNotEmpty("returnBody", "")。
scope通过 bucket、key间接设置,deadline 通过 expire... | java | public String uploadToken(String bucket, String key, long expires, StringMap policy) {
return uploadToken(bucket, key, expires, policy, true);
} | [
"public",
"String",
"uploadToken",
"(",
"String",
"bucket",
",",
"String",
"key",
",",
"long",
"expires",
",",
"StringMap",
"policy",
")",
"{",
"return",
"uploadToken",
"(",
"bucket",
",",
"key",
",",
"expires",
",",
"policy",
",",
"true",
")",
";",
"}"
... | 生成上传token
@param bucket 空间名
@param key key,可为 null
@param expires 有效时长,单位秒
@param policy 上传策略的其它参数,如 new StringMap().put("endUser", "uid").putNotEmpty("returnBody", "")。
scope通过 bucket、key间接设置,deadline 通过 expires 间接设置
@return 生成的上传token | [
"生成上传token"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/util/Auth.java#L232-L234 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/MailSteps.java | MailSteps.validActivationEmail | @Experimental(name = "validActivationEmail")
@RetryOnFailure(attempts = 3, delay = 60)
@Conditioned
@Et("Je valide le mail d'activation '(.*)'[\\.|\\?]")
@And("I valid activation email '(.*)'[\\.|\\?]")
public void validActivationEmail(String mailHost, String mailUser, String mailPassword, String se... | java | @Experimental(name = "validActivationEmail")
@RetryOnFailure(attempts = 3, delay = 60)
@Conditioned
@Et("Je valide le mail d'activation '(.*)'[\\.|\\?]")
@And("I valid activation email '(.*)'[\\.|\\?]")
public void validActivationEmail(String mailHost, String mailUser, String mailPassword, String se... | [
"@",
"Experimental",
"(",
"name",
"=",
"\"validActivationEmail\"",
")",
"@",
"RetryOnFailure",
"(",
"attempts",
"=",
"3",
",",
"delay",
"=",
"60",
")",
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je valide le mail d'activation '(.*)'[\\\\.|\\\\?]\"",
")",
"@",
"And",
... | Valid activation email.
@param mailHost
example: imap.gmail.com
@param mailUser
login of mail box
@param mailPassword
password of mail box
@param firstCssQuery
the first matching element
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
... | [
"Valid",
"activation",
"email",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/MailSteps.java#L83-L110 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java | NaaccrXmlDictionaryUtils.mergeDictionaries | public static NaaccrDictionary mergeDictionaries(NaaccrDictionary baseDictionary, NaaccrDictionary... userDictionaries) {
"""
Merges the given base dictionary and user dictionaries into one dictionary.
<br/><br/>
Sort order of the items is based on start column, items without a start column go to the end.
@para... | java | public static NaaccrDictionary mergeDictionaries(NaaccrDictionary baseDictionary, NaaccrDictionary... userDictionaries) {
if (baseDictionary == null)
throw new RuntimeException("Base dictionary is required");
NaaccrDictionary result = new NaaccrDictionary();
result.setNaaccrVersion(... | [
"public",
"static",
"NaaccrDictionary",
"mergeDictionaries",
"(",
"NaaccrDictionary",
"baseDictionary",
",",
"NaaccrDictionary",
"...",
"userDictionaries",
")",
"{",
"if",
"(",
"baseDictionary",
"==",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Base diction... | Merges the given base dictionary and user dictionaries into one dictionary.
<br/><br/>
Sort order of the items is based on start column, items without a start column go to the end.
@param baseDictionary base dictionary, required
@param userDictionaries user dictionaries, optional
@return a new merged dictionary contain... | [
"Merges",
"the",
"given",
"base",
"dictionary",
"and",
"user",
"dictionaries",
"into",
"one",
"dictionary",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"Sort",
"order",
"of",
"the",
"items",
"is",
"based",
"on",
"start",
"column",
"items",
"without",
"a",
"st... | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java#L690-L713 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/BeanAccess.java | BeanAccess.areBeansEqual | public static boolean areBeansEqual( Object bean1, Object bean2 ) {
"""
Test for equality between two BeanType values. Note this method is not entirely appropriate for
non-BeanType value i.e., it's not as intelligent as EqualityExpression comparing primitive types,
TypeKeys, etc.
<p/>
Msotly this method is for... | java | public static boolean areBeansEqual( Object bean1, Object bean2 )
{
if( bean1 == bean2 )
{
return true;
}
if( bean1 == null || bean2 == null )
{
return false;
}
IType class1 = TypeLoaderAccess.instance().getIntrinsicTypeFromObject( bean1 );
IType class2 = TypeLoaderAccess... | [
"public",
"static",
"boolean",
"areBeansEqual",
"(",
"Object",
"bean1",
",",
"Object",
"bean2",
")",
"{",
"if",
"(",
"bean1",
"==",
"bean2",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"bean1",
"==",
"null",
"||",
"bean2",
"==",
"null",
")",
"{"... | Test for equality between two BeanType values. Note this method is not entirely appropriate for
non-BeanType value i.e., it's not as intelligent as EqualityExpression comparing primitive types,
TypeKeys, etc.
<p/>
Msotly this method is for handling conversion of KeyableBean and Key for comparison.
@param bean1 A value... | [
"Test",
"for",
"equality",
"between",
"two",
"BeanType",
"values",
".",
"Note",
"this",
"method",
"is",
"not",
"entirely",
"appropriate",
"for",
"non",
"-",
"BeanType",
"value",
"i",
".",
"e",
".",
"it",
"s",
"not",
"as",
"intelligent",
"as",
"EqualityExpr... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/BeanAccess.java#L299-L325 |
aspnet/SignalR | clients/java/signalr/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java | HttpHubConnectionBuilder.withHeader | public HttpHubConnectionBuilder withHeader(String name, String value) {
"""
Sets a single header for the {@link HubConnection} to send.
@param name The name of the header to set.
@param value The value of the header to be set.
@return This instance of the HttpHubConnectionBuilder.
"""
if (headers ... | java | public HttpHubConnectionBuilder withHeader(String name, String value) {
if (headers == null) {
this.headers = new HashMap<>();
}
this.headers.put(name, value);
return this;
} | [
"public",
"HttpHubConnectionBuilder",
"withHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"{",
"this",
".",
"headers",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"this",
".",
"headers",
... | Sets a single header for the {@link HubConnection} to send.
@param name The name of the header to set.
@param value The value of the header to be set.
@return This instance of the HttpHubConnectionBuilder. | [
"Sets",
"a",
"single",
"header",
"for",
"the",
"{",
"@link",
"HubConnection",
"}",
"to",
"send",
"."
] | train | https://github.com/aspnet/SignalR/blob/8c6ed160d84f58ce8edf06a1c74221ddc8983ee9/clients/java/signalr/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java#L101-L107 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigest.java | MessageDigest.isEqual | public static boolean isEqual(byte[] digesta, byte[] digestb) {
"""
Compares two digests for equality. Does a simple byte compare.
@param digesta one of the digests to compare.
@param digestb the other digest to compare.
@return true if the digests are equal, false otherwise.
"""
if (digesta =... | java | public static boolean isEqual(byte[] digesta, byte[] digestb) {
if (digesta == digestb) return true;
if (digesta == null || digestb == null) {
return false;
}
if (digesta.length != digestb.length) {
return false;
}
int result = 0;
// time-... | [
"public",
"static",
"boolean",
"isEqual",
"(",
"byte",
"[",
"]",
"digesta",
",",
"byte",
"[",
"]",
"digestb",
")",
"{",
"if",
"(",
"digesta",
"==",
"digestb",
")",
"return",
"true",
";",
"if",
"(",
"digesta",
"==",
"null",
"||",
"digestb",
"==",
"nul... | Compares two digests for equality. Does a simple byte compare.
@param digesta one of the digests to compare.
@param digestb the other digest to compare.
@return true if the digests are equal, false otherwise. | [
"Compares",
"two",
"digests",
"for",
"equality",
".",
"Does",
"a",
"simple",
"byte",
"compare",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigest.java#L480-L495 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java | Stylesheet.containsExcludeResultPrefix | public boolean containsExcludeResultPrefix(String prefix, String uri) {
"""
Get whether or not the passed prefix is contained flagged by
the "exclude-result-prefixes" property.
@see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
@param prefix non-nu... | java | public boolean containsExcludeResultPrefix(String prefix, String uri)
{
if (null == m_ExcludeResultPrefixs || uri == null )
return false;
// This loop is ok here because this code only runs during
// stylesheet compile time.
for (int i =0; i< m_ExcludeResultPrefixs.size(); i++)
{
... | [
"public",
"boolean",
"containsExcludeResultPrefix",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"null",
"==",
"m_ExcludeResultPrefixs",
"||",
"uri",
"==",
"null",
")",
"return",
"false",
";",
"// This loop is ok here because this code only runs... | Get whether or not the passed prefix is contained flagged by
the "exclude-result-prefixes" property.
@see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a>
@param prefix non-null reference to prefix that might be excluded.
@param uri reference to namespace that... | [
"Get",
"whether",
"or",
"not",
"the",
"passed",
"prefix",
"is",
"contained",
"flagged",
"by",
"the",
"exclude",
"-",
"result",
"-",
"prefixes",
"property",
".",
"@see",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java#L348-L368 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java | Util.findMethod | public static MethodDoc findMethod(ClassDoc cd, MethodDoc method) {
"""
Search for the given method in the given class.
@param cd Class to search into.
@param method Method to be searched.
@return MethodDoc Method found, null otherwise.
"""
MethodDoc[] methods = cd.methods();
f... | java | public static MethodDoc findMethod(ClassDoc cd, MethodDoc method) {
MethodDoc[] methods = cd.methods();
for (int i = 0; i < methods.length; i++) {
if (executableMembersEqual(method, methods[i])) {
return methods[i];
}
}
return null;
} | [
"public",
"static",
"MethodDoc",
"findMethod",
"(",
"ClassDoc",
"cd",
",",
"MethodDoc",
"method",
")",
"{",
"MethodDoc",
"[",
"]",
"methods",
"=",
"cd",
".",
"methods",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methods",
".",
... | Search for the given method in the given class.
@param cd Class to search into.
@param method Method to be searched.
@return MethodDoc Method found, null otherwise. | [
"Search",
"for",
"the",
"given",
"method",
"in",
"the",
"given",
"class",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java#L120-L129 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java | HttpComponentsClientHttpRequestFactory.setLegacyConnectionTimeout | @SuppressWarnings("deprecation")
private void setLegacyConnectionTimeout(HttpClient client, int timeout) {
"""
Apply the specified connection timeout to deprecated {@link HttpClient}
implementations.
<p>
As of HttpClient 4.3, default parameters have to be exposed through a
{@link RequestConfig} instance inste... | java | @SuppressWarnings("deprecation")
private void setLegacyConnectionTimeout(HttpClient client, int timeout) {
if (org.apache.http.impl.client.AbstractHttpClient.class.isInstance(client)) {
client.getParams().setIntParameter(
org.apache.http.params.CoreConnectionPNames.CONNECTION_TIMEOUT, timeout);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"setLegacyConnectionTimeout",
"(",
"HttpClient",
"client",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"org",
".",
"apache",
".",
"http",
".",
"impl",
".",
"client",
".",
"AbstractHttpCli... | Apply the specified connection timeout to deprecated {@link HttpClient}
implementations.
<p>
As of HttpClient 4.3, default parameters have to be exposed through a
{@link RequestConfig} instance instead of setting the parameters on the client.
Unfortunately, this behavior is not backward-compatible and older
{@link Http... | [
"Apply",
"the",
"specified",
"connection",
"timeout",
"to",
"deprecated",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java#L137-L143 |
goodow/realtime-json | src/main/java/com/goodow/realtime/json/impl/Base64.java | Base64.encodeBytes | public static String encodeBytes(final byte[] source, final int options) {
"""
Encodes a byte array into Base64 notation.
<p/>
Valid options:
<pre>
GZIP: gzip-compresses object before encoding it.
DONT_BREAK_LINES: don't break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compli... | java | public static String encodeBytes(final byte[] source, final int options) {
return Base64.encodeBytes(source, 0, source.length, options);
} | [
"public",
"static",
"String",
"encodeBytes",
"(",
"final",
"byte",
"[",
"]",
"source",
",",
"final",
"int",
"options",
")",
"{",
"return",
"Base64",
".",
"encodeBytes",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
",",
"options",
")",
";",
"}... | Encodes a byte array into Base64 notation.
<p/>
Valid options:
<pre>
GZIP: gzip-compresses object before encoding it.
DONT_BREAK_LINES: don't break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compliant.</i>
</pre>
<p/>
Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
<p/>
Examp... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"notation",
".",
"<p",
"/",
">",
"Valid",
"options",
":"
] | train | https://github.com/goodow/realtime-json/blob/be2f5a8cab27afa052583ae2e09f6f7975d8cb0c/src/main/java/com/goodow/realtime/json/impl/Base64.java#L1116-L1118 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.parallelZip | public static <A, B, R> Stream<R> parallelZip(final Stream<A> a, final Stream<B> b, final BiFunction<? super A, ? super B, R> zipFunction) {
"""
Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelZip(a, b, zipFunction)) {
... | java | public static <A, B, R> Stream<R> parallelZip(final Stream<A> a, final Stream<B> b, final BiFunction<? super A, ? super B, R> zipFunction) {
return parallelZip(a, b, zipFunction, DEFAULT_QUEUE_SIZE_PER_ITERATOR);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"R",
">",
"Stream",
"<",
"R",
">",
"parallelZip",
"(",
"final",
"Stream",
"<",
"A",
">",
"a",
",",
"final",
"Stream",
"<",
"B",
">",
"b",
",",
"final",
"BiFunction",
"<",
"?",
"super",
"A",
",",
"?",... | Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelZip(a, b, zipFunction)) {
stream.forEach(N::println);
}
</code>
@param a
@param b
@param zipFunction
@return | [
"Put",
"the",
"stream",
"in",
"try",
"-",
"catch",
"to",
"stop",
"the",
"back",
"-",
"end",
"reading",
"thread",
"if",
"error",
"happens",
"<br",
"/",
">",
"<code",
">",
"try",
"(",
"Stream<Integer",
">",
"stream",
"=",
"Stream",
".",
"parallelZip",
"(... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L7770-L7772 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToGray | public static GrayU8 nv21ToGray(byte[] data , int width , int height , GrayU8 output ) {
"""
Converts an NV21 image into a gray scale U8 image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output imag... | java | public static GrayU8 nv21ToGray(byte[] data , int width , int height , GrayU8 output ) {
if( output != null ) {
output.reshape(width,height);
} else {
output = new GrayU8(width,height);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToGray(data, output);
} else {
ImplConvertNV21.n... | [
"public",
"static",
"GrayU8",
"nv21ToGray",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"GrayU8",
"output",
")",
"{",
"if",
"(",
"output",
"!=",
"null",
")",
"{",
"output",
".",
"reshape",
"(",
"width",
",",
"height... | Converts an NV21 image into a gray scale U8 image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null.
@return Gray scale image | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"gray",
"scale",
"U8",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L110-L124 |
JamesIry/jADT | jADT-core/src/main/java/com/pogofish/jadt/printer/ASTPrinter.java | ASTPrinter.printComments | public static String printComments(String indent, List<JavaComment> comments) {
"""
Prints a list of comments pretty much unmolested except to add \n s
"""
final StringBuilder builder = new StringBuilder();
for (JavaComment comment : comments) {
builder.append(print(indent, comment)... | java | public static String printComments(String indent, List<JavaComment> comments) {
final StringBuilder builder = new StringBuilder();
for (JavaComment comment : comments) {
builder.append(print(indent, comment));
builder.append("\n");
}
return builder.toString();
... | [
"public",
"static",
"String",
"printComments",
"(",
"String",
"indent",
",",
"List",
"<",
"JavaComment",
">",
"comments",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"JavaComment",
"comment",
":",
"c... | Prints a list of comments pretty much unmolested except to add \n s | [
"Prints",
"a",
"list",
"of",
"comments",
"pretty",
"much",
"unmolested",
"except",
"to",
"add",
"\\",
"n",
"s"
] | train | https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/printer/ASTPrinter.java#L142-L149 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/IndexMultiDCList.java | IndexMultiDCList.deleteElement | int deleteElement(int list, int node) {
"""
Deletes a node from a list. Returns the next node after the deleted one.
"""
int prev = getPrev(node);
int next = getNext(node);
if (prev != nullNode())
setNext_(prev, next);
else
m_lists.setField(list, 0, next);// change head
if (next != nullNode())
... | java | int deleteElement(int list, int node) {
int prev = getPrev(node);
int next = getNext(node);
if (prev != nullNode())
setNext_(prev, next);
else
m_lists.setField(list, 0, next);// change head
if (next != nullNode())
setPrev_(next, prev);
else
m_lists.setField(list, 1, prev);// change tail
freeN... | [
"int",
"deleteElement",
"(",
"int",
"list",
",",
"int",
"node",
")",
"{",
"int",
"prev",
"=",
"getPrev",
"(",
"node",
")",
";",
"int",
"next",
"=",
"getNext",
"(",
"node",
")",
";",
"if",
"(",
"prev",
"!=",
"nullNode",
"(",
")",
")",
"setNext_",
... | Deletes a node from a list. Returns the next node after the deleted one. | [
"Deletes",
"a",
"node",
"from",
"a",
"list",
".",
"Returns",
"the",
"next",
"node",
"after",
"the",
"deleted",
"one",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/IndexMultiDCList.java#L199-L214 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/DependencyResolver.java | DependencyResolver.getOneRequired | public Object getOneRequired(String name) throws ReferenceException {
"""
Gets one required dependency by its name. At least one dependency must
present. If the dependency was found it throws a ReferenceException
@param name the dependency name to locate.
@return a dependency reference
@throws ReferenceExc... | java | public Object getOneRequired(String name) throws ReferenceException {
Object locator = find(name);
if (locator == null)
throw new ReferenceException(null, name);
return _references.getOneRequired(locator);
} | [
"public",
"Object",
"getOneRequired",
"(",
"String",
"name",
")",
"throws",
"ReferenceException",
"{",
"Object",
"locator",
"=",
"find",
"(",
"name",
")",
";",
"if",
"(",
"locator",
"==",
"null",
")",
"throw",
"new",
"ReferenceException",
"(",
"null",
",",
... | Gets one required dependency by its name. At least one dependency must
present. If the dependency was found it throws a ReferenceException
@param name the dependency name to locate.
@return a dependency reference
@throws ReferenceException if dependency was not found. | [
"Gets",
"one",
"required",
"dependency",
"by",
"its",
"name",
".",
"At",
"least",
"one",
"dependency",
"must",
"present",
".",
"If",
"the",
"dependency",
"was",
"found",
"it",
"throws",
"a",
"ReferenceException"
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/DependencyResolver.java#L253-L259 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/util/UIUtils.java | UIUtils.setBackground | public static void setBackground(View v, @DrawableRes int drawableRes) {
"""
helper method to set the background depending on the android version
@param v
@param drawableRes
"""
ViewCompat.setBackground(v, ContextCompat.getDrawable(v.getContext(), drawableRes));
} | java | public static void setBackground(View v, @DrawableRes int drawableRes) {
ViewCompat.setBackground(v, ContextCompat.getDrawable(v.getContext(), drawableRes));
} | [
"public",
"static",
"void",
"setBackground",
"(",
"View",
"v",
",",
"@",
"DrawableRes",
"int",
"drawableRes",
")",
"{",
"ViewCompat",
".",
"setBackground",
"(",
"v",
",",
"ContextCompat",
".",
"getDrawable",
"(",
"v",
".",
"getContext",
"(",
")",
",",
"dra... | helper method to set the background depending on the android version
@param v
@param drawableRes | [
"helper",
"method",
"to",
"set",
"the",
"background",
"depending",
"on",
"the",
"android",
"version"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/util/UIUtils.java#L81-L83 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UserInterfaceApi.java | UserInterfaceApi.postUiOpenwindowNewmail | public void postUiOpenwindowNewmail(String datasource, String token, UiNewMail uiNewMail) throws ApiException {
"""
Open New Mail Window Open the New Mail window, according to settings from
the request if applicable --- SSO Scope: esi-ui.open_window.v1
@param datasource
The server name you would like data fro... | java | public void postUiOpenwindowNewmail(String datasource, String token, UiNewMail uiNewMail) throws ApiException {
postUiOpenwindowNewmailWithHttpInfo(datasource, token, uiNewMail);
} | [
"public",
"void",
"postUiOpenwindowNewmail",
"(",
"String",
"datasource",
",",
"String",
"token",
",",
"UiNewMail",
"uiNewMail",
")",
"throws",
"ApiException",
"{",
"postUiOpenwindowNewmailWithHttpInfo",
"(",
"datasource",
",",
"token",
",",
"uiNewMail",
")",
";",
"... | Open New Mail Window Open the New Mail window, according to settings from
the request if applicable --- SSO Scope: esi-ui.open_window.v1
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param token
Access token to use if unable to set a header (optional)
@param uiNewMail
(... | [
"Open",
"New",
"Mail",
"Window",
"Open",
"the",
"New",
"Mail",
"window",
"according",
"to",
"settings",
"from",
"the",
"request",
"if",
"applicable",
"---",
"SSO",
"Scope",
":",
"esi",
"-",
"ui",
".",
"open_window",
".",
"v1"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UserInterfaceApi.java#L749-L751 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getIntegerProperty | public static Integer getIntegerProperty(Configuration config, String key,
Integer defaultValue) throws DeployerConfigurationException {
"""
Returns the specified Integer property from the configuration
@param config the configuration
@param key the k... | java | public static Integer getIntegerProperty(Configuration config, String key,
Integer defaultValue) throws DeployerConfigurationException {
try {
return config.getInteger(key, defaultValue);
} catch (Exception e) {
throw new DeployerConfi... | [
"public",
"static",
"Integer",
"getIntegerProperty",
"(",
"Configuration",
"config",
",",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"{",
"return",
"config",
".",
"getInteger",
"(",
"key",
",",
"de... | Returns the specified Integer property from the configuration
@param config the configuration
@param key the key of the property
@param defaultValue the default value if the property is not found
@return the Integer value of the property, or the default value if not found
@throws DeployerConfigurationEx... | [
"Returns",
"the",
"specified",
"Integer",
"property",
"from",
"the",
"configuration"
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L183-L190 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java | PathUtils.deleteEmptyParentDirectories | public static void deleteEmptyParentDirectories(FileSystem fs, Path limitPath, Path startPath)
throws IOException {
"""
Deletes empty directories starting with startPath and all ancestors up to but not including limitPath.
@param fs {@link FileSystem} where paths are located.
@param limitPath only {@link P... | java | public static void deleteEmptyParentDirectories(FileSystem fs, Path limitPath, Path startPath)
throws IOException {
if (PathUtils.isAncestor(limitPath, startPath) && !PathUtils.getPathWithoutSchemeAndAuthority(limitPath)
.equals(PathUtils.getPathWithoutSchemeAndAuthority(startPath)) && fs.listStatus(s... | [
"public",
"static",
"void",
"deleteEmptyParentDirectories",
"(",
"FileSystem",
"fs",
",",
"Path",
"limitPath",
",",
"Path",
"startPath",
")",
"throws",
"IOException",
"{",
"if",
"(",
"PathUtils",
".",
"isAncestor",
"(",
"limitPath",
",",
"startPath",
")",
"&&",
... | Deletes empty directories starting with startPath and all ancestors up to but not including limitPath.
@param fs {@link FileSystem} where paths are located.
@param limitPath only {@link Path}s that are strict descendants of this path will be deleted.
@param startPath first {@link Path} to delete. Afterwards empty ances... | [
"Deletes",
"empty",
"directories",
"starting",
"with",
"startPath",
"and",
"all",
"ancestors",
"up",
"to",
"but",
"not",
"including",
"limitPath",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L189-L200 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/Record.java | Record.getFloat | public Number getFloat(int field) throws MPXJException {
"""
Accessor method used to retrieve a Float object representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the requi... | java | public Number getFloat(int field) throws MPXJException
{
try
{
Number result;
if ((field < m_fields.length) && (m_fields[field].length() != 0))
{
result = m_formats.getDecimalFormat().parse(m_fields[field]);
}
else
{
result = ... | [
"public",
"Number",
"getFloat",
"(",
"int",
"field",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Number",
"result",
";",
"if",
"(",
"(",
"field",
"<",
"m_fields",
".",
"length",
")",
"&&",
"(",
"m_fields",
"[",
"field",
"]",
".",
"length",
"(",
... | Accessor method used to retrieve a Float object representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the required field | [
"Accessor",
"method",
"used",
"to",
"retrieve",
"a",
"Float",
"object",
"representing",
"the",
"contents",
"of",
"an",
"individual",
"field",
".",
"If",
"the",
"field",
"does",
"not",
"exist",
"in",
"the",
"record",
"null",
"is",
"returned",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/Record.java#L181-L203 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.performMerge | private AdvancedModelWrapper performMerge(AdvancedModelWrapper source, AdvancedModelWrapper target) {
"""
Performs the merge from the source model to the target model and returns the result. Returns null if either the
source or the target is null.
"""
if (source == null || target == null) {
... | java | private AdvancedModelWrapper performMerge(AdvancedModelWrapper source, AdvancedModelWrapper target) {
if (source == null || target == null) {
return null;
}
ModelDescription sourceDesc = source.getModelDescription();
ModelDescription targetDesc = target.getModelDescription();... | [
"private",
"AdvancedModelWrapper",
"performMerge",
"(",
"AdvancedModelWrapper",
"source",
",",
"AdvancedModelWrapper",
"target",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"target",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ModelDescription",
... | Performs the merge from the source model to the target model and returns the result. Returns null if either the
source or the target is null. | [
"Performs",
"the",
"merge",
"from",
"the",
"source",
"model",
"to",
"the",
"target",
"model",
"and",
"returns",
"the",
"result",
".",
"Returns",
"null",
"if",
"either",
"the",
"source",
"or",
"the",
"target",
"is",
"null",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L272-L283 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putAuthentication | public static void putAuthentication(final Authentication authentication, final RequestContext ctx) {
"""
Put authentication into conversation scope.
@param authentication the authentication
@param ctx the ctx
"""
ctx.getConversationScope().put(PARAMETER_AUTHENTICATION, authentication);
... | java | public static void putAuthentication(final Authentication authentication, final RequestContext ctx) {
ctx.getConversationScope().put(PARAMETER_AUTHENTICATION, authentication);
} | [
"public",
"static",
"void",
"putAuthentication",
"(",
"final",
"Authentication",
"authentication",
",",
"final",
"RequestContext",
"ctx",
")",
"{",
"ctx",
".",
"getConversationScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_AUTHENTICATION",
",",
"authentication",
")",... | Put authentication into conversation scope.
@param authentication the authentication
@param ctx the ctx | [
"Put",
"authentication",
"into",
"conversation",
"scope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L466-L468 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/AnnotationRef.java | AnnotationRef.simpleArrayFieldWriter | private static FieldWriter simpleArrayFieldWriter(final String name) {
"""
Writes an simple array valued field to the annotation visitor.
"""
return new FieldWriter() {
@Override
public void write(AnnotationVisitor visitor, Object value) {
int len = Array.getLength(value);
Annot... | java | private static FieldWriter simpleArrayFieldWriter(final String name) {
return new FieldWriter() {
@Override
public void write(AnnotationVisitor visitor, Object value) {
int len = Array.getLength(value);
AnnotationVisitor arrayVisitor = visitor.visitArray(name);
for (int i = 0; i ... | [
"private",
"static",
"FieldWriter",
"simpleArrayFieldWriter",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"FieldWriter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"write",
"(",
"AnnotationVisitor",
"visitor",
",",
"Object",
"value",
")",
... | Writes an simple array valued field to the annotation visitor. | [
"Writes",
"an",
"simple",
"array",
"valued",
"field",
"to",
"the",
"annotation",
"visitor",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/AnnotationRef.java#L155-L167 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/DateUtils.java | DateUtils.getPeriodDays | public static int getPeriodDays(Date start, Date end) {
"""
计算两个日期之间相差的天数
@param start 较小的时间
@param end 较大的时间
@return 相差天数
@since 2.0.2
"""
try {
start = FORMAT_DATE_.parse(FORMAT_DATE_.format(start));
end = FORMAT_DATE_.parse(FORMAT_DATE_.format(end));
Calendar cal = Calendar.getInstance();
... | java | public static int getPeriodDays(Date start, Date end) {
try {
start = FORMAT_DATE_.parse(FORMAT_DATE_.format(start));
end = FORMAT_DATE_.parse(FORMAT_DATE_.format(end));
Calendar cal = Calendar.getInstance();
cal.setTime(start);
long time1 = cal.getTimeInMillis();
cal.setTime(end);
long time2 = c... | [
"public",
"static",
"int",
"getPeriodDays",
"(",
"Date",
"start",
",",
"Date",
"end",
")",
"{",
"try",
"{",
"start",
"=",
"FORMAT_DATE_",
".",
"parse",
"(",
"FORMAT_DATE_",
".",
"format",
"(",
"start",
")",
")",
";",
"end",
"=",
"FORMAT_DATE_",
".",
"p... | 计算两个日期之间相差的天数
@param start 较小的时间
@param end 较大的时间
@return 相差天数
@since 2.0.2 | [
"计算两个日期之间相差的天数"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/DateUtils.java#L244-L258 |
asciidoctor/asciidoctorj | asciidoctorj-core/src/main/java/org/asciidoctor/jruby/extension/internal/JRubyProcessor.java | JRubyProcessor.parseContent | @Override
public void parseContent(StructuralNode parent, List<String> lines) {
"""
Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.
<p>The following example will add two paragraphs with the role {@code newcontent} to all top
level sections of a docume... | java | @Override
public void parseContent(StructuralNode parent, List<String> lines) {
Ruby runtime = JRubyRuntimeContext.get(parent);
Parser parser = new Parser(runtime, parent, ReaderImpl.createReader(runtime, lines));
StructuralNode nextBlock = parser.nextBlock();
while (nextBlock != nu... | [
"@",
"Override",
"public",
"void",
"parseContent",
"(",
"StructuralNode",
"parent",
",",
"List",
"<",
"String",
">",
"lines",
")",
"{",
"Ruby",
"runtime",
"=",
"JRubyRuntimeContext",
".",
"get",
"(",
"parent",
")",
";",
"Parser",
"parser",
"=",
"new",
"Par... | Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.
<p>The following example will add two paragraphs with the role {@code newcontent} to all top
level sections of a document:
<pre>
<verbatim>
Asciidoctor asciidoctor = ...
asciidoctor.javaExtensionRegistry().treeproc... | [
"Parses",
"the",
"given",
"raw",
"asciidoctor",
"content",
"parses",
"it",
"and",
"appends",
"it",
"as",
"children",
"to",
"the",
"given",
"parent",
"block",
".",
"<p",
">",
"The",
"following",
"example",
"will",
"add",
"two",
"paragraphs",
"with",
"the",
... | train | https://github.com/asciidoctor/asciidoctorj/blob/e348c9a12b54c33fea7b05d70224c007e2ee75a9/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/extension/internal/JRubyProcessor.java#L335-L345 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsInvalidStrIsIncluded | public FessMessages addErrorsInvalidStrIsIncluded(String property, String arg0, String arg1) {
"""
Add the created action message for the key 'errors.invalid_str_is_included' with parameters.
<pre>
message: "{1}" in "{0}" is invalid.
</pre>
@param property The property name for the message. (NotNull)
@param a... | java | public FessMessages addErrorsInvalidStrIsIncluded(String property, String arg0, String arg1) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_invalid_str_is_included, arg0, arg1));
return this;
} | [
"public",
"FessMessages",
"addErrorsInvalidStrIsIncluded",
"(",
"String",
"property",
",",
"String",
"arg0",
",",
"String",
"arg1",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_invali... | Add the created action message for the key 'errors.invalid_str_is_included' with parameters.
<pre>
message: "{1}" in "{0}" is invalid.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@param arg1 The parameter arg1 for message. (NotNull)
@return t... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"invalid_str_is_included",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"1",
"}",
"in",
"{",
"0",
"}",
"is",
"invalid",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1777-L1781 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java | MuleUtil.getImmutableEndpoint | public static ImmutableEndpoint getImmutableEndpoint(MuleContext muleContext, String endpointName) throws IOException {
"""
Lookup an ImmutableEndpoint based on its name
@param muleContext
@param endpointName
@return
@throws IOException
"""
ImmutableEndpoint endpoint = null;
Object o = muleContext.g... | java | public static ImmutableEndpoint getImmutableEndpoint(MuleContext muleContext, String endpointName) throws IOException {
ImmutableEndpoint endpoint = null;
Object o = muleContext.getRegistry().lookupObject(endpointName);
if (o instanceof ImmutableEndpoint) {
// For Inbound and Outbound Endpoints
endpoint = ... | [
"public",
"static",
"ImmutableEndpoint",
"getImmutableEndpoint",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"throws",
"IOException",
"{",
"ImmutableEndpoint",
"endpoint",
"=",
"null",
";",
"Object",
"o",
"=",
"muleContext",
".",
"getRegistr... | Lookup an ImmutableEndpoint based on its name
@param muleContext
@param endpointName
@return
@throws IOException | [
"Lookup",
"an",
"ImmutableEndpoint",
"based",
"on",
"its",
"name"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java#L100-L118 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java | AccountFiltersInner.createOrUpdate | public AccountFilterInner createOrUpdate(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) {
"""
Create or update an Account Filter.
Creates or updates an Account Filter in the Media Services account.
@param resourceGroupName The name of the resource group within t... | java | public AccountFilterInner createOrUpdate(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).toBlocking().single().body();
} | [
"public",
"AccountFilterInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"filterName",
",",
"AccountFilterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Create or update an Account Filter.
Creates or updates an Account Filter in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param filterName The Account Filter name
@param parameters The request para... | [
"Create",
"or",
"update",
"an",
"Account",
"Filter",
".",
"Creates",
"or",
"updates",
"an",
"Account",
"Filter",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java#L330-L332 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java | JcrSystemViewExporter.emitProperty | private void emitProperty( Property property,
ContentHandler contentHandler,
boolean skipBinary ) throws RepositoryException, SAXException {
"""
Fires the appropriate SAX events on the content handler to build the XML elements for the property.
@para... | java | private void emitProperty( Property property,
ContentHandler contentHandler,
boolean skipBinary ) throws RepositoryException, SAXException {
assert property instanceof AbstractJcrProperty : "Illegal attempt to use " + getClass().getName()
... | [
"private",
"void",
"emitProperty",
"(",
"Property",
"property",
",",
"ContentHandler",
"contentHandler",
",",
"boolean",
"skipBinary",
")",
"throws",
"RepositoryException",
",",
"SAXException",
"{",
"assert",
"property",
"instanceof",
"AbstractJcrProperty",
":",
"\"Ille... | Fires the appropriate SAX events on the content handler to build the XML elements for the property.
@param property the property to be exported
@param contentHandler the SAX content handler for which SAX events will be invoked as the XML document is created.
@param skipBinary if <code>true</code>, indicates that binar... | [
"Fires",
"the",
"appropriate",
"SAX",
"events",
"on",
"the",
"content",
"handler",
"to",
"build",
"the",
"XML",
"elements",
"for",
"the",
"property",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java#L197-L244 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java | DeploymentsInner.checkExistence | public boolean checkExistence(String resourceGroupName, String deploymentName) {
"""
Checks whether the deployment exists.
@param resourceGroupName The name of the resource group with the deployment to check. The name is case insensitive.
@param deploymentName The name of the deployment to check.
@throws Ille... | java | public boolean checkExistence(String resourceGroupName, String deploymentName) {
return checkExistenceWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().body();
} | [
"public",
"boolean",
"checkExistence",
"(",
"String",
"resourceGroupName",
",",
"String",
"deploymentName",
")",
"{",
"return",
"checkExistenceWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"deploymentName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
... | Checks whether the deployment exists.
@param resourceGroupName The name of the resource group with the deployment to check. The name is case insensitive.
@param deploymentName The name of the deployment to check.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if... | [
"Checks",
"whether",
"the",
"deployment",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java#L287-L289 |
twitter/twitter-korean-text | src/main/java/com/twitter/penguin/korean/util/CharacterUtils.java | CharacterUtils.toLowerCase | public final void toLowerCase(final char[] buffer, final int offset, final int limit) {
"""
Converts each unicode codepoint to lowerCase via {@link Character#toLowerCase(int)} starting
at the given offset.
@param buffer the char buffer to lowercase
@param offset the offset to start at
@param limit the max c... | java | public final void toLowerCase(final char[] buffer, final int offset, final int limit) {
assert buffer.length >= limit;
assert offset <= 0 && offset <= buffer.length;
for (int i = offset; i < limit; ) {
i += Character.toChars(
Character.toLowerCase(
codePointAt(buffer, i, limit)... | [
"public",
"final",
"void",
"toLowerCase",
"(",
"final",
"char",
"[",
"]",
"buffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"limit",
")",
"{",
"assert",
"buffer",
".",
"length",
">=",
"limit",
";",
"assert",
"offset",
"<=",
"0",
"&&",
"offs... | Converts each unicode codepoint to lowerCase via {@link Character#toLowerCase(int)} starting
at the given offset.
@param buffer the char buffer to lowercase
@param offset the offset to start at
@param limit the max char in the buffer to lower case | [
"Converts",
"each",
"unicode",
"codepoint",
"to",
"lowerCase",
"via",
"{",
"@link",
"Character#toLowerCase",
"(",
"int",
")",
"}",
"starting",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/twitter/twitter-korean-text/blob/95bbe21fcc62fa7bf50b769ae80a5734fef6b903/src/main/java/com/twitter/penguin/korean/util/CharacterUtils.java#L101-L109 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/util/RepositoryUtils.java | RepositoryUtils.methodToString | public static String methodToString(final Class<?> type, final Method method) {
"""
Converts method signature to human readable string.
@param type root type (method may be called not from declaring class)
@param method method to print
@return string representation for method
"""
final StringBui... | java | public static String methodToString(final Class<?> type, final Method method) {
final StringBuilder res = new StringBuilder();
res.append(type.getSimpleName()).append('#').append(method.getName()).append('(');
int i = 0;
for (Class<?> param : method.getParameterTypes()) {
if ... | [
"public",
"static",
"String",
"methodToString",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Method",
"method",
")",
"{",
"final",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"res",
".",
"append",
"(",
"type",
".",... | Converts method signature to human readable string.
@param type root type (method may be called not from declaring class)
@param method method to print
@return string representation for method | [
"Converts",
"method",
"signature",
"to",
"human",
"readable",
"string",
"."
] | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/util/RepositoryUtils.java#L57-L76 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java | DirectoryRegistrationService.unregisterService | public void unregisterService(String serviceName, String providerId) {
"""
Unregister a ProvidedServiceInstance by serviceName and providerId.
@param serviceName
the serviceName of ProvidedServiceInstance.
@param providerId
the provierId of ProvidedServiceInstance.
"""
getServiceDirectoryClient()... | java | public void unregisterService(String serviceName, String providerId) {
getServiceDirectoryClient().unregisterServiceInstance(serviceName, providerId);
getCacheServiceInstances().remove(new ServiceInstanceToken(serviceName, providerId));
} | [
"public",
"void",
"unregisterService",
"(",
"String",
"serviceName",
",",
"String",
"providerId",
")",
"{",
"getServiceDirectoryClient",
"(",
")",
".",
"unregisterServiceInstance",
"(",
"serviceName",
",",
"providerId",
")",
";",
"getCacheServiceInstances",
"(",
")",
... | Unregister a ProvidedServiceInstance by serviceName and providerId.
@param serviceName
the serviceName of ProvidedServiceInstance.
@param providerId
the provierId of ProvidedServiceInstance. | [
"Unregister",
"a",
"ProvidedServiceInstance",
"by",
"serviceName",
"and",
"providerId",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java#L184-L187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.