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 |
|---|---|---|---|---|---|---|---|---|---|---|
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java | PacketParserUtils.parseContent | public static CharSequence parseContent(XmlPullParser parser)
throws XmlPullParserException, IOException {
"""
Returns the content of a element.
<p>
The parser must be positioned on the START_TAG of the element which content is going to get
returned. If the current element is the empty eleme... | java | public static CharSequence parseContent(XmlPullParser parser)
throws XmlPullParserException, IOException {
assert (parser.getEventType() == XmlPullParser.START_TAG);
if (parser.isEmptyElementTag()) {
return "";
}
// Advance the parser, since we want to par... | [
"public",
"static",
"CharSequence",
"parseContent",
"(",
"XmlPullParser",
"parser",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"assert",
"(",
"parser",
".",
"getEventType",
"(",
")",
"==",
"XmlPullParser",
".",
"START_TAG",
")",
";",
"if",
... | Returns the content of a element.
<p>
The parser must be positioned on the START_TAG of the element which content is going to get
returned. If the current element is the empty element, then the empty string is returned. If
it is a element which contains just text, then just the text is returned. If it contains
nested e... | [
"Returns",
"the",
"content",
"of",
"a",
"element",
".",
"<p",
">",
"The",
"parser",
"must",
"be",
"positioned",
"on",
"the",
"START_TAG",
"of",
"the",
"element",
"which",
"content",
"is",
"going",
"to",
"get",
"returned",
".",
"If",
"the",
"current",
"el... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java#L382-L391 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/AbstractParsedStmt.java | AbstractParsedStmt.resolveCommonTableByName | private StmtCommonTableScan resolveCommonTableByName(String tableName, String tableAlias) {
"""
Look for a common table by name, possibly in parent scopes.
This is different from resolveStmtTableByAlias in that it
looks for common tables and only by name, not by alias. Of
course, a name and an alias are both s... | java | private StmtCommonTableScan resolveCommonTableByName(String tableName, String tableAlias) {
StmtCommonTableScan answer = null;
StmtCommonTableScanShared scan = null;
for (AbstractParsedStmt scope = this; scope != null && scan == null; scope = scope.getParentStmt()) {
scan = scope.get... | [
"private",
"StmtCommonTableScan",
"resolveCommonTableByName",
"(",
"String",
"tableName",
",",
"String",
"tableAlias",
")",
"{",
"StmtCommonTableScan",
"answer",
"=",
"null",
";",
"StmtCommonTableScanShared",
"scan",
"=",
"null",
";",
"for",
"(",
"AbstractParsedStmt",
... | Look for a common table by name, possibly in parent scopes.
This is different from resolveStmtTableByAlias in that it
looks for common tables and only by name, not by alias. Of
course, a name and an alias are both strings, so this is kind
of a stylized distinction.
@param tableName
@return | [
"Look",
"for",
"a",
"common",
"table",
"by",
"name",
"possibly",
"in",
"parent",
"scopes",
".",
"This",
"is",
"different",
"from",
"resolveStmtTableByAlias",
"in",
"that",
"it",
"looks",
"for",
"common",
"tables",
"and",
"only",
"by",
"name",
"not",
"by",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/AbstractParsedStmt.java#L1482-L1492 |
JodaOrg/joda-time | src/main/java/org/joda/time/MonthDay.java | MonthDay.withChronologyRetainFields | public MonthDay withChronologyRetainFields(Chronology newChronology) {
"""
Returns a copy of this month-day with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different instant... | java | public MonthDay withChronologyRetainFields(Chronology newChronology) {
newChronology = DateTimeUtils.getChronology(newChronology);
newChronology = newChronology.withUTC();
if (newChronology == getChronology()) {
return this;
} else {
MonthDay newMonthDay = new Mon... | [
"public",
"MonthDay",
"withChronologyRetainFields",
"(",
"Chronology",
"newChronology",
")",
"{",
"newChronology",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"newChronology",
")",
";",
"newChronology",
"=",
"newChronology",
".",
"withUTC",
"(",
")",
";",
"if",... | Returns a copy of this month-day with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different instant.
<p>
The time zone of the specified chronology is ignored, as MonthDay
operates wit... | [
"Returns",
"a",
"copy",
"of",
"this",
"month",
"-",
"day",
"with",
"the",
"specified",
"chronology",
".",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
".",
"<p",
">",
"This",
"method",
"retains",
"the",
"value... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MonthDay.java#L455-L465 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmap | public static Bitmap loadBitmap(Uri uri, Context context) throws ImageLoadException {
"""
Loading bitmap without any modifications
@param uri content uri for bitmap
@param context Application Context
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file
"""
... | java | public static Bitmap loadBitmap(Uri uri, Context context) throws ImageLoadException {
return loadBitmap(new UriSource(uri, context));
} | [
"public",
"static",
"Bitmap",
"loadBitmap",
"(",
"Uri",
"uri",
",",
"Context",
"context",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmap",
"(",
"new",
"UriSource",
"(",
"uri",
",",
"context",
")",
")",
";",
"}"
] | Loading bitmap without any modifications
@param uri content uri for bitmap
@param context Application Context
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"without",
"any",
"modifications"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L49-L51 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/AccordionExample.java | AccordionExample.constructExample | private void constructExample() {
"""
Helper to do the work of the constructor since we do not really want to call over-rideable methods in a
constructor.
"""
add(new WHeading(HeadingLevel.H3, "ACCORDION tabs"));
WTabSet tabset1c = new SampleWTabset(TabSetType.ACCORDION);
add(tabset1c);
/* Content h... | java | private void constructExample() {
add(new WHeading(HeadingLevel.H3, "ACCORDION tabs"));
WTabSet tabset1c = new SampleWTabset(TabSetType.ACCORDION);
add(tabset1c);
/* Content height */
add(new WHeading(HeadingLevel.H2, "Examples showing content height property."));
add(new WHeading(HeadingLevel.H3, "Tall c... | [
"private",
"void",
"constructExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"ACCORDION tabs\"",
")",
")",
";",
"WTabSet",
"tabset1c",
"=",
"new",
"SampleWTabset",
"(",
"TabSetType",
".",
"ACCORDION",
")",
";",
... | Helper to do the work of the constructor since we do not really want to call over-rideable methods in a
constructor. | [
"Helper",
"to",
"do",
"the",
"work",
"of",
"the",
"constructor",
"since",
"we",
"do",
"not",
"really",
"want",
"to",
"call",
"over",
"-",
"rideable",
"methods",
"in",
"a",
"constructor",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/AccordionExample.java#L54-L106 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/adapters/AbstractWrapAdapter.java | AbstractWrapAdapter.onBindViewHolder | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads) {
"""
the onBindViewHolder is managed by the FastAdapter so forward this correctly
@param holder
@param position
"""
if (shouldInsertItemAtPosition(position)) {
getItem(position).bind... | java | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads) {
if (shouldInsertItemAtPosition(position)) {
getItem(position).bindView(holder, payloads);
} else {
mAdapter.onBindViewHolder(holder, position - itemInsertedBeforeCount(positi... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"RecyclerView",
".",
"ViewHolder",
"holder",
",",
"int",
"position",
",",
"List",
"payloads",
")",
"{",
"if",
"(",
"shouldInsertItemAtPosition",
"(",
"position",
")",
")",
"{",
"getItem",
"(",
"positi... | the onBindViewHolder is managed by the FastAdapter so forward this correctly
@param holder
@param position | [
"the",
"onBindViewHolder",
"is",
"managed",
"by",
"the",
"FastAdapter",
"so",
"forward",
"this",
"correctly"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/AbstractWrapAdapter.java#L180-L187 |
iipc/webarchive-commons | src/main/java/org/archive/util/FileUtils.java | FileUtils.maybeRelative | public static File maybeRelative(File context, String path) {
"""
Turn path into a File, relative to context (which may be ignored
if path is absolute).
@param context File context if path is relative
@param path String path to make into a File
@return File created
"""
File f = new File(path);
... | java | public static File maybeRelative(File context, String path) {
File f = new File(path);
if(f.isAbsolute()) {
return f;
}
return new File(context, path);
} | [
"public",
"static",
"File",
"maybeRelative",
"(",
"File",
"context",
",",
"String",
"path",
")",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"f",
".",
"isAbsolute",
"(",
")",
")",
"{",
"return",
"f",
";",
"}",
"return",
... | Turn path into a File, relative to context (which may be ignored
if path is absolute).
@param context File context if path is relative
@param path String path to make into a File
@return File created | [
"Turn",
"path",
"into",
"a",
"File",
"relative",
"to",
"context",
"(",
"which",
"may",
"be",
"ignored",
"if",
"path",
"is",
"absolute",
")",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/FileUtils.java#L320-L326 |
maxirosson/jdroid-android | jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java | MapRepository.replaceMapChildren | public void replaceMapChildren(Map<String, String> map, String parentId) {
"""
This method allows to replace all children of a given parent, it will remove any children which are not in the
list, add the new ones and update which are in the list.
@param map map of list to replace.
@param parentId id of parent... | java | public void replaceMapChildren(Map<String, String> map, String parentId) {
ArrayList<StringEntity> entities = new ArrayList<>();
for (String key : map.keySet()) {
StringEntity entity = new StringEntity();
entity.setParentId(parentId);
entity.setId(key);
entity.setValue(map.get(key));
entities.add(ent... | [
"public",
"void",
"replaceMapChildren",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"String",
"parentId",
")",
"{",
"ArrayList",
"<",
"StringEntity",
">",
"entities",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"key... | This method allows to replace all children of a given parent, it will remove any children which are not in the
list, add the new ones and update which are in the list.
@param map map of list to replace.
@param parentId id of parent entity. | [
"This",
"method",
"allows",
"to",
"replace",
"all",
"children",
"of",
"a",
"given",
"parent",
"it",
"will",
"remove",
"any",
"children",
"which",
"are",
"not",
"in",
"the",
"list",
"add",
"the",
"new",
"ones",
"and",
"update",
"which",
"are",
"in",
"the"... | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/MapRepository.java#L42-L52 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateLocal | public Matrix4f rotateLocal(Quaternionfc quat, Matrix4f dest) {
"""
Pre-multiply the rotation transformation of the given {@link Quaternionfc} to this matrix and store
the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockw... | java | public Matrix4f rotateLocal(Quaternionfc quat, Matrix4f dest) {
float w2 = quat.w() * quat.w(), x2 = quat.x() * quat.x();
float y2 = quat.y() * quat.y(), z2 = quat.z() * quat.z();
float zw = quat.z() * quat.w(), dzw = zw + zw, xy = quat.x() * quat.y(), dxy = xy + xy;
float xz = quat.x() ... | [
"public",
"Matrix4f",
"rotateLocal",
"(",
"Quaternionfc",
"quat",
",",
"Matrix4f",
"dest",
")",
"{",
"float",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")",
",",
"x2",
"=",
"quat",
".",
"x",
"(",
")",
"*",
"quat",
".",
... | Pre-multiply the rotation transformation of the given {@link Quaternionfc} to this matrix and store
the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axis direction ... | [
"Pre",
"-",
"multiply",
"the",
"rotation",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaternionfc",
"}",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",
">",
".",
"<p",
">",
"When",
"used",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L11403-L11452 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java | PropertyChangeSupport.addPropertyChangeListener | public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
"""
Add a PropertyChangeListener for a specific property. The listener will
be invoked only when a call on firePropertyChange names that specific
property.
@param propertyName The name of the property to listen on.
... | java | public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
if (children == null) {
children = new HashMap();
}
PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName);
if (child == null) {
child = new PropertyChangeSupport(source);
children.pu... | [
"public",
"void",
"addPropertyChangeListener",
"(",
"String",
"propertyName",
",",
"PropertyChangeListener",
"listener",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"{",
"children",
"=",
"new",
"HashMap",
"(",
")",
";",
"}",
"PropertyChangeSupport",
"chi... | Add a PropertyChangeListener for a specific property. The listener will
be invoked only when a call on firePropertyChange names that specific
property.
@param propertyName The name of the property to listen on.
@param listener The PropertyChangeListener to be added | [
"Add",
"a",
"PropertyChangeListener",
"for",
"a",
"specific",
"property",
".",
"The",
"listener",
"will",
"be",
"invoked",
"only",
"when",
"a",
"call",
"on",
"firePropertyChange",
"names",
"that",
"specific",
"property",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L160-L170 |
paymill/paymill-java | src/main/java/com/paymill/services/PreauthorizationService.java | PreauthorizationService.createWithPayment | public Preauthorization createWithPayment( final Payment payment, final Integer amount, final String currency, final String description ) {
"""
Authorizes the given amount with the given {@link Payment}.
<strong>Works only for credit cards. Direct debit not supported.</strong>
@param payment
The {@link Paymen... | java | public Preauthorization createWithPayment( final Payment payment, final Integer amount, final String currency, final String description ) {
ValidationUtils.validatesPayment( payment );
ValidationUtils.validatesAmount( amount );
ValidationUtils.validatesCurrency( currency );
ParameterMap<String, String>... | [
"public",
"Preauthorization",
"createWithPayment",
"(",
"final",
"Payment",
"payment",
",",
"final",
"Integer",
"amount",
",",
"final",
"String",
"currency",
",",
"final",
"String",
"description",
")",
"{",
"ValidationUtils",
".",
"validatesPayment",
"(",
"payment",... | Authorizes the given amount with the given {@link Payment}.
<strong>Works only for credit cards. Direct debit not supported.</strong>
@param payment
The {@link Payment} itself (only creditcard-object)
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted currency code.
@param descri... | [
"Authorizes",
"the",
"given",
"amount",
"with",
"the",
"given",
"{",
"@link",
"Payment",
"}",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PreauthorizationService.java#L173-L189 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.createForRevisions | public <T> String createForRevisions(Class<T> clazz) {
"""
Creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.
@param <T> Document class
@param clazz Document class
@return created subscription
"""
retu... | java | public <T> String createForRevisions(Class<T> clazz) {
return createForRevisions(clazz, null, null);
} | [
"public",
"<",
"T",
">",
"String",
"createForRevisions",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"createForRevisions",
"(",
"clazz",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.
@param <T> Document class
@param clazz Document class
@return created subscription | [
"Creates",
"a",
"data",
"subscription",
"in",
"a",
"database",
".",
"The",
"subscription",
"will",
"expose",
"all",
"documents",
"that",
"match",
"the",
"specified",
"subscription",
"options",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L97-L99 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getStreamOfTypeForField | @SuppressWarnings("WeakerAccess")
@Internal
protected final Stream getStreamOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
"""
Obtains a bean definition for the field at the given index and the argument at the given index
<p>
Warning: th... | java | @SuppressWarnings("WeakerAccess")
@Internal
protected final Stream getStreamOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
return resolveBeanWithGenericsForField(resolutionContext, injectionPoint, (beanType, qualifier) ->
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"Internal",
"protected",
"final",
"Stream",
"getStreamOfTypeForField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"FieldInjectionPoint",
"injectionPoint",
")",
"{",
"re... | Obtains a bean definition for the field at the given index and the argument at the given index
<p>
Warning: this method is used by internal generated code and should not be called by user code.
@param resolutionContext The resolution context
@param context The context
@param injectionPoint The field injec... | [
"Obtains",
"a",
"bean",
"definition",
"for",
"the",
"field",
"at",
"the",
"given",
"index",
"and",
"the",
"argument",
"at",
"the",
"given",
"index",
"<p",
">",
"Warning",
":",
"this",
"method",
"is",
"used",
"by",
"internal",
"generated",
"code",
"and",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1430-L1436 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.ensureTyped | private void ensureTyped(Node n, JSType type) {
"""
Ensures the node is typed.
@param n The node getting a type assigned to it.
@param type The type to be assigned.
"""
// Make sure FUNCTION nodes always get function type.
checkState(!n.isFunction() || type.isFunctionType() || type.isUnknownType())... | java | private void ensureTyped(Node n, JSType type) {
// Make sure FUNCTION nodes always get function type.
checkState(!n.isFunction() || type.isFunctionType() || type.isUnknownType());
if (n.getJSType() == null) {
n.setJSType(type);
}
} | [
"private",
"void",
"ensureTyped",
"(",
"Node",
"n",
",",
"JSType",
"type",
")",
"{",
"// Make sure FUNCTION nodes always get function type.",
"checkState",
"(",
"!",
"n",
".",
"isFunction",
"(",
")",
"||",
"type",
".",
"isFunctionType",
"(",
")",
"||",
"type",
... | Ensures the node is typed.
@param n The node getting a type assigned to it.
@param type The type to be assigned. | [
"Ensures",
"the",
"node",
"is",
"typed",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L3028-L3034 |
yegor256/takes | src/main/java/org/takes/rs/RsWithType.java | RsWithType.make | private static Response make(final Response res, final CharSequence type,
final Opt<Charset> charset) {
"""
Factory allowing to create {@code Response} with the corresponding
content type and character set.
@param res Original response
@param type Content type
@param charset The character set to add to... | java | private static Response make(final Response res, final CharSequence type,
final Opt<Charset> charset) {
final Response response;
if (charset.has()) {
response = new RsWithHeader(
new RsWithoutHeader(res, RsWithType.HEADER),
RsWithType.HEADER,
... | [
"private",
"static",
"Response",
"make",
"(",
"final",
"Response",
"res",
",",
"final",
"CharSequence",
"type",
",",
"final",
"Opt",
"<",
"Charset",
">",
"charset",
")",
"{",
"final",
"Response",
"response",
";",
"if",
"(",
"charset",
".",
"has",
"(",
")... | Factory allowing to create {@code Response} with the corresponding
content type and character set.
@param res Original response
@param type Content type
@param charset The character set to add to the content type header. If
absent no character set will be added to the content type header
@return Response | [
"Factory",
"allowing",
"to",
"create",
"{"
] | train | https://github.com/yegor256/takes/blob/a4f4d939c8f8e0af190025716ad7f22b7de40e70/src/main/java/org/takes/rs/RsWithType.java#L102-L124 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec2f.java | MFVec2f.get1Value | public void get1Value(int index, float[] valueDestination) {
"""
Get an individual value from the existing field array.
@param index -
@param valueDestination - where the SFVec2f value is returned
"""
try {
SFVec2f sfVec2f = value.get(index);
valueDestination[0] = sfVec2f.x;
... | java | public void get1Value(int index, float[] valueDestination) {
try {
SFVec2f sfVec2f = value.get(index);
valueDestination[0] = sfVec2f.x;
valueDestination[1] = sfVec2f.y;
}
catch (IndexOutOfBoundsException e) {
Log.e(TAG, "X3D MFVec2f get1Value(index... | [
"public",
"void",
"get1Value",
"(",
"int",
"index",
",",
"float",
"[",
"]",
"valueDestination",
")",
"{",
"try",
"{",
"SFVec2f",
"sfVec2f",
"=",
"value",
".",
"get",
"(",
"index",
")",
";",
"valueDestination",
"[",
"0",
"]",
"=",
"sfVec2f",
".",
"x",
... | Get an individual value from the existing field array.
@param index -
@param valueDestination - where the SFVec2f value is returned | [
"Get",
"an",
"individual",
"value",
"from",
"the",
"existing",
"field",
"array",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec2f.java#L86-L98 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.verifyFaceToFace | public VerifyResult verifyFaceToFace(UUID faceId1, UUID faceId2) {
"""
Verify whether two faces belong to a same person or whether one face belongs to a person.
@param faceId1 FaceId of the first face, comes from Face - Detect
@param faceId2 FaceId of the second face, comes from Face - Detect
@throws IllegalA... | java | public VerifyResult verifyFaceToFace(UUID faceId1, UUID faceId2) {
return verifyFaceToFaceWithServiceResponseAsync(faceId1, faceId2).toBlocking().single().body();
} | [
"public",
"VerifyResult",
"verifyFaceToFace",
"(",
"UUID",
"faceId1",
",",
"UUID",
"faceId2",
")",
"{",
"return",
"verifyFaceToFaceWithServiceResponseAsync",
"(",
"faceId1",
",",
"faceId2",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
... | Verify whether two faces belong to a same person or whether one face belongs to a person.
@param faceId1 FaceId of the first face, comes from Face - Detect
@param faceId2 FaceId of the second face, comes from Face - Detect
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorExcept... | [
"Verify",
"whether",
"two",
"faces",
"belong",
"to",
"a",
"same",
"person",
"or",
"whether",
"one",
"face",
"belongs",
"to",
"a",
"person",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L569-L571 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.startOkConnection | AmqpClient startOkConnection(AmqpArguments clientProperties, String mechanism, String response, String locale) {
"""
Sends a StartOkConnection to server.
@param clientProperties
@param mechanism
@param response
@param locale
@return AmqpClient
"""
this.startOkConnection(clientProperties, mechani... | java | AmqpClient startOkConnection(AmqpArguments clientProperties, String mechanism, String response, String locale) {
this.startOkConnection(clientProperties, mechanism, response, locale, null, null);
return this;
} | [
"AmqpClient",
"startOkConnection",
"(",
"AmqpArguments",
"clientProperties",
",",
"String",
"mechanism",
",",
"String",
"response",
",",
"String",
"locale",
")",
"{",
"this",
".",
"startOkConnection",
"(",
"clientProperties",
",",
"mechanism",
",",
"response",
",",
... | Sends a StartOkConnection to server.
@param clientProperties
@param mechanism
@param response
@param locale
@return AmqpClient | [
"Sends",
"a",
"StartOkConnection",
"to",
"server",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L778-L781 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java | ReflectionUtils.setFieldValue | public static void setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue) {
"""
Sets a value to a field using reflection even if the field is private.
@param instanceContainingField the object containing the field
@param fieldName the name of the field in the object
@param fieldVal... | java | public static void setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue)
{
// Find the class containing the field to set
Class<?> targetClass = instanceContainingField.getClass();
while (targetClass != null) {
for (Field field : targetClass.getDeclare... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"instanceContainingField",
",",
"String",
"fieldName",
",",
"Object",
"fieldValue",
")",
"{",
"// Find the class containing the field to set",
"Class",
"<",
"?",
">",
"targetClass",
"=",
"instanceContainingField"... | Sets a value to a field using reflection even if the field is private.
@param instanceContainingField the object containing the field
@param fieldName the name of the field in the object
@param fieldValue the value to set for the provided field | [
"Sets",
"a",
"value",
"to",
"a",
"field",
"using",
"reflection",
"even",
"if",
"the",
"field",
"is",
"private",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java#L155-L184 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisResourceHelper.java | CmsCmisResourceHelper.collectAcl | protected Acl collectAcl(CmsObject cms, CmsResource resource, boolean onlyBasic) throws CmsException {
"""
Compiles the ACL for a file or folder.
@param cms the CMS context
@param resource the resource for which to collect the ACLs
@param onlyBasic flag to only include basic ACEs
@return the ACL for the reso... | java | protected Acl collectAcl(CmsObject cms, CmsResource resource, boolean onlyBasic) throws CmsException {
AccessControlListImpl cmisAcl = new AccessControlListImpl();
List<Ace> cmisAces = new ArrayList<Ace>();
List<CmsAccessControlEntry> aces = cms.getAccessControlEntries(resource.getRootPath(... | [
"protected",
"Acl",
"collectAcl",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"boolean",
"onlyBasic",
")",
"throws",
"CmsException",
"{",
"AccessControlListImpl",
"cmisAcl",
"=",
"new",
"AccessControlListImpl",
"(",
")",
";",
"List",
"<",
"Ace",
... | Compiles the ACL for a file or folder.
@param cms the CMS context
@param resource the resource for which to collect the ACLs
@param onlyBasic flag to only include basic ACEs
@return the ACL for the resource
@throws CmsException if something goes wrong | [
"Compiles",
"the",
"ACL",
"for",
"a",
"file",
"or",
"folder",
".",
"@param",
"cms",
"the",
"CMS",
"context",
"@param",
"resource",
"the",
"resource",
"for",
"which",
"to",
"collect",
"the",
"ACLs",
"@param",
"onlyBasic",
"flag",
"to",
"only",
"include",
"b... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisResourceHelper.java#L246-L266 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.tagImageInStreamAsync | public Observable<TagResult> tagImageInStreamAsync(byte[] image, TagImageInStreamOptionalParameter tagImageInStreamOptionalParameter) {
"""
This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living bei... | java | public Observable<TagResult> tagImageInStreamAsync(byte[] image, TagImageInStreamOptionalParameter tagImageInStreamOptionalParameter) {
return tagImageInStreamWithServiceResponseAsync(image, tagImageInStreamOptionalParameter).map(new Func1<ServiceResponse<TagResult>, TagResult>() {
@Override
... | [
"public",
"Observable",
"<",
"TagResult",
">",
"tagImageInStreamAsync",
"(",
"byte",
"[",
"]",
"image",
",",
"TagImageInStreamOptionalParameter",
"tagImageInStreamOptionalParameter",
")",
"{",
"return",
"tagImageInStreamWithServiceResponseAsync",
"(",
"image",
",",
"tagImag... | This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but corresp... | [
"This",
"operation",
"generates",
"a",
"list",
"of",
"words",
"or",
"tags",
"that",
"are",
"relevant",
"to",
"the",
"content",
"of",
"the",
"supplied",
"image",
".",
"The",
"Computer",
"Vision",
"API",
"can",
"return",
"tags",
"based",
"on",
"objects",
"li... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L451-L458 |
sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java | SearchEngine.isProductMatchingSearchCriteria | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
"""
Filters those items that contains the search query text in name, description or category
"""
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) retu... | java | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) return true;
if (product.getDescription().contains(w)) return true;
if (product.getCategory().cont... | [
"private",
"boolean",
"isProductMatchingSearchCriteria",
"(",
"Product",
"product",
",",
"String",
"searchQueryText",
")",
"{",
"String",
"words",
"[",
"]",
"=",
"searchQueryText",
".",
"split",
"(",
"\" \"",
")",
";",
"for",
"(",
"String",
"w",
":",
"words",
... | Filters those items that contains the search query text in name, description or category | [
"Filters",
"those",
"items",
"that",
"contains",
"the",
"search",
"query",
"text",
"in",
"name",
"description",
"or",
"category"
] | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java#L60-L68 |
openzipkin-contrib/brave-opentracing | src/main/java/brave/opentracing/BraveSpan.java | BraveSpan.setTag | @Override public BraveSpan setTag(String key, Number value) {
"""
<em>Note:</em>If the key is {@linkplain Tags#SAMPLING_PRIORITY} and the value is zero, the
current span will be abandoned and future references to the {@link #context()} will be
unsampled. This does not affect the active span, nor does it affect a... | java | @Override public BraveSpan setTag(String key, Number value) {
if (finishCalled) return this;
if (trySetPeer(key, value)) return this;
// handle late sampling decision
if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) {
delegate.abandon();
// convert the span to no-o... | [
"@",
"Override",
"public",
"BraveSpan",
"setTag",
"(",
"String",
"key",
",",
"Number",
"value",
")",
"{",
"if",
"(",
"finishCalled",
")",
"return",
"this",
";",
"if",
"(",
"trySetPeer",
"(",
"key",
",",
"value",
")",
")",
"return",
"this",
";",
"// han... | <em>Note:</em>If the key is {@linkplain Tags#SAMPLING_PRIORITY} and the value is zero, the
current span will be abandoned and future references to the {@link #context()} will be
unsampled. This does not affect the active span, nor does it affect any equivalent instances of
this object. This is a best efforts means to h... | [
"<em",
">",
"Note",
":",
"<",
"/",
"em",
">",
"If",
"the",
"key",
"is",
"{"
] | train | https://github.com/openzipkin-contrib/brave-opentracing/blob/07653ac3a67beb7df71008961051ff03db2b60b7/src/main/java/brave/opentracing/BraveSpan.java#L82-L94 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java | LoadedFieldSet.addStore | public void addStore(InstructionHandle handle, XField field) {
"""
Add a store of given field at given instruction.
@param handle
the instruction
@param field
the field
"""
getLoadStoreCount(field).storeCount++;
handleToFieldMap.put(handle, field);
} | java | public void addStore(InstructionHandle handle, XField field) {
getLoadStoreCount(field).storeCount++;
handleToFieldMap.put(handle, field);
} | [
"public",
"void",
"addStore",
"(",
"InstructionHandle",
"handle",
",",
"XField",
"field",
")",
"{",
"getLoadStoreCount",
"(",
"field",
")",
".",
"storeCount",
"++",
";",
"handleToFieldMap",
".",
"put",
"(",
"handle",
",",
"field",
")",
";",
"}"
] | Add a store of given field at given instruction.
@param handle
the instruction
@param field
the field | [
"Add",
"a",
"store",
"of",
"given",
"field",
"at",
"given",
"instruction",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/LoadedFieldSet.java#L118-L121 |
moparisthebest/beehive | beehive-jms-control/src/main/java/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.java | JMSControlImpl.getSession | public Session getSession() throws ControlException {
"""
Implementation of the {@link org.apache.beehive.controls.system.jms.JMSControl#getSession()} method.
@return the {@link Session}
@throws ControlException when an error occurs trying to create a JMS session
"""
if (_session == null) {
... | java | public Session getSession() throws ControlException {
if (_session == null) {
try {
switch (getDestinationType()) {
case Auto:
determineDestination();
return getSession();
case Topic:
... | [
"public",
"Session",
"getSession",
"(",
")",
"throws",
"ControlException",
"{",
"if",
"(",
"_session",
"==",
"null",
")",
"{",
"try",
"{",
"switch",
"(",
"getDestinationType",
"(",
")",
")",
"{",
"case",
"Auto",
":",
"determineDestination",
"(",
")",
";",
... | Implementation of the {@link org.apache.beehive.controls.system.jms.JMSControl#getSession()} method.
@return the {@link Session}
@throws ControlException when an error occurs trying to create a JMS session | [
"Implementation",
"of",
"the",
"{",
"@link",
"org",
".",
"apache",
".",
"beehive",
".",
"controls",
".",
"system",
".",
"jms",
".",
"JMSControl#getSession",
"()",
"}",
"method",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jms-control/src/main/java/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.java#L81-L101 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/common/ProjectClassLoader.java | ProjectClassLoader.tryDefineType | public Class<?> tryDefineType(String name, ClassNotFoundException cnfe) throws ClassNotFoundException {
"""
This method has to be public because is also used by the android ClassLoader
"""
byte[] bytecode = getBytecode(convertClassToResourcePath(name));
if (bytecode == null) {
if (C... | java | public Class<?> tryDefineType(String name, ClassNotFoundException cnfe) throws ClassNotFoundException {
byte[] bytecode = getBytecode(convertClassToResourcePath(name));
if (bytecode == null) {
if (CACHE_NON_EXISTING_CLASSES) {
nonExistingClasses.add(name);
}
... | [
"public",
"Class",
"<",
"?",
">",
"tryDefineType",
"(",
"String",
"name",
",",
"ClassNotFoundException",
"cnfe",
")",
"throws",
"ClassNotFoundException",
"{",
"byte",
"[",
"]",
"bytecode",
"=",
"getBytecode",
"(",
"convertClassToResourcePath",
"(",
"name",
")",
... | This method has to be public because is also used by the android ClassLoader | [
"This",
"method",
"has",
"to",
"be",
"public",
"because",
"is",
"also",
"used",
"by",
"the",
"android",
"ClassLoader"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/common/ProjectClassLoader.java#L190-L199 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/UserAuthenticationEvent.java | UserAuthenticationEvent.addNodeActiveParticipant | public void addNodeActiveParticipant(String userId, String altUserId, String userName, String networkId) {
"""
Adds an Active Participant representing the node that is performing the authentication
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param... | java | public void addNodeActiveParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
true,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | [
"public",
"void",
"addNodeActiveParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"true",
",",
"Colle... | Adds an Active Participant representing the node that is performing the authentication
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Adds",
"an",
"Active",
"Participant",
"representing",
"the",
"node",
"that",
"is",
"performing",
"the",
"authentication"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/UserAuthenticationEvent.java#L91-L100 |
zxing/zxing | core/src/main/java/com/google/zxing/common/HybridBinarizer.java | HybridBinarizer.getBlackMatrix | @Override
public BitMatrix getBlackMatrix() throws NotFoundException {
"""
Calculates the final BitMatrix once for all requests. This could be called once from the
constructor instead, but there are some advantages to doing it lazily, such as making
profiling easier, and not doing heavy lifting when callers do... | java | @Override
public BitMatrix getBlackMatrix() throws NotFoundException {
if (matrix != null) {
return matrix;
}
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
int height = source.getHeight();
if (width >= MINIMUM_DIMENSION && height >= MINIMUM_DIMENSION) {
... | [
"@",
"Override",
"public",
"BitMatrix",
"getBlackMatrix",
"(",
")",
"throws",
"NotFoundException",
"{",
"if",
"(",
"matrix",
"!=",
"null",
")",
"{",
"return",
"matrix",
";",
"}",
"LuminanceSource",
"source",
"=",
"getLuminanceSource",
"(",
")",
";",
"int",
"... | Calculates the final BitMatrix once for all requests. This could be called once from the
constructor instead, but there are some advantages to doing it lazily, such as making
profiling easier, and not doing heavy lifting when callers don't expect it. | [
"Calculates",
"the",
"final",
"BitMatrix",
"once",
"for",
"all",
"requests",
".",
"This",
"could",
"be",
"called",
"once",
"from",
"the",
"constructor",
"instead",
"but",
"there",
"are",
"some",
"advantages",
"to",
"doing",
"it",
"lazily",
"such",
"as",
"mak... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/HybridBinarizer.java#L61-L89 |
kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java | GatewayManagementBeanImpl.doSessionCreatedListeners | @Override
public void doSessionCreatedListeners(final long sessionId, final ManagementSessionType managementSessionType) {
"""
Notify the management listeners on a sessionCreated.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread.
"""
runManagementTask(new Runnable() {
... | java | @Override
public void doSessionCreatedListeners(final long sessionId, final ManagementSessionType managementSessionType) {
runManagementTask(new Runnable() {
@Override
public void run() {
try {
// The particular management listeners change on strat... | [
"@",
"Override",
"public",
"void",
"doSessionCreatedListeners",
"(",
"final",
"long",
"sessionId",
",",
"final",
"ManagementSessionType",
"managementSessionType",
")",
"{",
"runManagementTask",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void"... | Notify the management listeners on a sessionCreated.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread. | [
"Notify",
"the",
"management",
"listeners",
"on",
"a",
"sessionCreated",
".",
"<p",
"/",
">",
"NOTE",
":",
"this",
"starts",
"on",
"the",
"IO",
"thread",
"but",
"runs",
"a",
"task",
"OFF",
"the",
"thread",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java#L428-L445 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.getCurrencies | public static Collection<CurrencyUnit> getCurrencies(String... providers) {
"""
Access all currencies known.
@param providers the (optional) specification of providers to consider.
@return the list of known currencies, never null.
"""
return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).... | java | public static Collection<CurrencyUnit> getCurrencies(String... providers) {
return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow(
() -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup."))
.getCurrencies(providers);
... | [
"public",
"static",
"Collection",
"<",
"CurrencyUnit",
">",
"getCurrencies",
"(",
"String",
"...",
"providers",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
")",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
... | Access all currencies known.
@param providers the (optional) specification of providers to consider.
@return the list of known currencies, never null. | [
"Access",
"all",
"currencies",
"known",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L458-L462 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.includeErrorpage | public void includeErrorpage(CmsWorkplace wp, Throwable t) throws JspException {
"""
Displays the throwable on the error page and logs the error.<p>
@param wp the workplace class
@param t the throwable to be displayed on the error page
@throws JspException if the include of the error page jsp fails
"""
... | java | public void includeErrorpage(CmsWorkplace wp, Throwable t) throws JspException {
CmsLog.getLog(wp).error(Messages.get().getBundle().key(Messages.ERR_WORKPLACE_DIALOG_0), t);
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, wp);
getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, ... | [
"public",
"void",
"includeErrorpage",
"(",
"CmsWorkplace",
"wp",
",",
"Throwable",
"t",
")",
"throws",
"JspException",
"{",
"CmsLog",
".",
"getLog",
"(",
"wp",
")",
".",
"error",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
"(",
")",
".",
"... | Displays the throwable on the error page and logs the error.<p>
@param wp the workplace class
@param t the throwable to be displayed on the error page
@throws JspException if the include of the error page jsp fails | [
"Displays",
"the",
"throwable",
"on",
"the",
"error",
"page",
"and",
"logs",
"the",
"error",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L1419-L1425 |
lightbend/config | config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java | ConfigDelayedMerge.makeReplacement | static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) {
"""
static method also used by ConfigDelayedMergeObject; end may be null
"""
List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size());
if (subStack.isEmpty()) {... | java | static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) {
List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size());
if (subStack.isEmpty()) {
if (ConfigImpl.traceSubstitutionsEnabled())
ConfigImpl.tr... | [
"static",
"AbstractConfigValue",
"makeReplacement",
"(",
"ResolveContext",
"context",
",",
"List",
"<",
"AbstractConfigValue",
">",
"stack",
",",
"int",
"skipping",
")",
"{",
"List",
"<",
"AbstractConfigValue",
">",
"subStack",
"=",
"stack",
".",
"subList",
"(",
... | static method also used by ConfigDelayedMergeObject; end may be null | [
"static",
"method",
"also",
"used",
"by",
"ConfigDelayedMergeObject",
";",
"end",
"may",
"be",
"null"
] | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java#L161-L179 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.fillPayload | private void fillPayload(InternalRequest internalRequest, AbstractBceRequest bceRequest) {
"""
The method to fill the internalRequest's content field with bceRequest.
Only support HttpMethodName.POST or HttpMethodName.PUT
@param internalRequest A request object, populated with endpoint, resource path, ready fo... | java | private void fillPayload(InternalRequest internalRequest, AbstractBceRequest bceRequest) {
if (internalRequest.getHttpMethod() == HttpMethodName.POST
|| internalRequest.getHttpMethod() == HttpMethodName.PUT) {
String strJson = JsonUtils.toJsonString(bceRequest);
byte[] re... | [
"private",
"void",
"fillPayload",
"(",
"InternalRequest",
"internalRequest",
",",
"AbstractBceRequest",
"bceRequest",
")",
"{",
"if",
"(",
"internalRequest",
".",
"getHttpMethod",
"(",
")",
"==",
"HttpMethodName",
".",
"POST",
"||",
"internalRequest",
".",
"getHttpM... | The method to fill the internalRequest's content field with bceRequest.
Only support HttpMethodName.POST or HttpMethodName.PUT
@param internalRequest A request object, populated with endpoint, resource path, ready for callers to populate
any additional headers or parameters, and execute.
@param bceRequest The original... | [
"The",
"method",
"to",
"fill",
"the",
"internalRequest",
"s",
"content",
"field",
"with",
"bceRequest",
".",
"Only",
"support",
"HttpMethodName",
".",
"POST",
"or",
"HttpMethodName",
".",
"PUT"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L188-L202 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/SwaptionSimple.java | SwaptionSimple.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
RandomVariableInterface value = swaption.getValue(evaluationTime, model);
if(valueUnit == ValueUnit.VALUE) {
return value;
}
ForwardCurveInterface forwardCu... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"RandomVariableInterface",
"value",
"=",
"swaption",
".",
"getValue",
"(",... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/SwaptionSimple.java#L77-L112 |
romannurik/muzei | muzei-api/src/main/java/com/google/android/apps/muzei/api/provider/MuzeiArtProvider.java | MuzeiArtProvider.getDescription | @NonNull
protected String getDescription() {
"""
Gets the longer description for the current state of this MuzeiArtProvider. For example,
'Popular photos tagged "landscape"'). The default implementation returns the
<code>android:description</code> element of the provider element in the manifest.
@return T... | java | @NonNull
protected String getDescription() {
Context context = getContext();
if (context == null) {
return "";
}
try {
@SuppressLint("InlinedApi")
ProviderInfo info = context.getPackageManager().getProviderInfo(
new ComponentNam... | [
"@",
"NonNull",
"protected",
"String",
"getDescription",
"(",
")",
"{",
"Context",
"context",
"=",
"getContext",
"(",
")",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"@",
"SuppressLint",
"(",
"\"InlinedApi\... | Gets the longer description for the current state of this MuzeiArtProvider. For example,
'Popular photos tagged "landscape"'). The default implementation returns the
<code>android:description</code> element of the provider element in the manifest.
@return The description that should be shown when this provider is sele... | [
"Gets",
"the",
"longer",
"description",
"for",
"the",
"current",
"state",
"of",
"this",
"MuzeiArtProvider",
".",
"For",
"example",
"Popular",
"photos",
"tagged",
"landscape",
")",
".",
"The",
"default",
"implementation",
"returns",
"the",
"<code",
">",
"android"... | train | https://github.com/romannurik/muzei/blob/d00777a5fc59f34471be338c814ea85ddcbde304/muzei-api/src/main/java/com/google/android/apps/muzei/api/provider/MuzeiArtProvider.java#L557-L573 |
facebook/fresco | fbcore/src/main/java/com/facebook/datasource/AbstractDataSource.java | AbstractDataSource.setResult | protected boolean setResult(@Nullable T value, boolean isLast) {
"""
Subclasses should invoke this method to set the result to {@code value}.
<p> This method will return {@code true} if the value was successfully set, or
{@code false} if the data source has already been set, failed or closed.
<p> If the val... | java | protected boolean setResult(@Nullable T value, boolean isLast) {
boolean result = setResultInternal(value, isLast);
if (result) {
notifyDataSubscribers();
}
return result;
} | [
"protected",
"boolean",
"setResult",
"(",
"@",
"Nullable",
"T",
"value",
",",
"boolean",
"isLast",
")",
"{",
"boolean",
"result",
"=",
"setResultInternal",
"(",
"value",
",",
"isLast",
")",
";",
"if",
"(",
"result",
")",
"{",
"notifyDataSubscribers",
"(",
... | Subclasses should invoke this method to set the result to {@code value}.
<p> This method will return {@code true} if the value was successfully set, or
{@code false} if the data source has already been set, failed or closed.
<p> If the value was successfully set and {@code isLast} is {@code true}, state of the
data s... | [
"Subclasses",
"should",
"invoke",
"this",
"method",
"to",
"set",
"the",
"result",
"to",
"{",
"@code",
"value",
"}",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/fbcore/src/main/java/com/facebook/datasource/AbstractDataSource.java#L207-L213 |
spring-projects/spring-social-facebook | spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookTemplate.java | FacebookTemplate.fetchPreviousPagedConnections | public <T> PagedList<T> fetchPreviousPagedConnections(PagedList<T> page, Class<T> type) {
"""
Fetchs the previous {@link org.springframework.social.facebook.api.PagedList PagedList} of the current one.
@param page source {@link org.springframework.social.facebook.api.PagedList PagedList} to fetch the previous one... | java | public <T> PagedList<T> fetchPreviousPagedConnections(PagedList<T> page, Class<T> type) {
if (null != page && null != page.getPreviousPage() && !"".equals(page.getPreviousPage().getFullUrl().trim())) {
URIBuilder uriBuilder = URIBuilder.fromUri(page.getPreviousPage().getFullUrl());
JsonNode jsonNode = getRestTe... | [
"public",
"<",
"T",
">",
"PagedList",
"<",
"T",
">",
"fetchPreviousPagedConnections",
"(",
"PagedList",
"<",
"T",
">",
"page",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"null",
"!=",
"page",
"&&",
"null",
"!=",
"page",
".",
"getPrevio... | Fetchs the previous {@link org.springframework.social.facebook.api.PagedList PagedList} of the current one.
@param page source {@link org.springframework.social.facebook.api.PagedList PagedList} to fetch the previous one.
@param type type of the source {@link org.springframework.social.facebook.api.PagedList PagedList}... | [
"Fetchs",
"the",
"previous",
"{"
] | train | https://github.com/spring-projects/spring-social-facebook/blob/ae2234d94367eaa3adbba251ec7790d5ba7ffa41/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookTemplate.java#L279-L286 |
banq/jdonframework | JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/hessian/HessianToJdonRequestProcessor.java | HessianToJdonRequestProcessor.getMethod | public Method getMethod(Class clz, String mangledMethodName) {
"""
/*
Finds method of class by using mangled name from incoming request
"""
Map<String, Method> methods = methodsByComponentType.get(clz);
if (methods == null) {
methods = new HashMap<String, Method>();
methodsByComponentType.pu... | java | public Method getMethod(Class clz, String mangledMethodName) {
Map<String, Method> methods = methodsByComponentType.get(clz);
if (methods == null) {
methods = new HashMap<String, Method>();
methodsByComponentType.put(clz, methods);
for (Method method : clz.getDeclaredMethods()) {
Class<?>[]... | [
"public",
"Method",
"getMethod",
"(",
"Class",
"clz",
",",
"String",
"mangledMethodName",
")",
"{",
"Map",
"<",
"String",
",",
"Method",
">",
"methods",
"=",
"methodsByComponentType",
".",
"get",
"(",
"clz",
")",
";",
"if",
"(",
"methods",
"==",
"null",
... | /*
Finds method of class by using mangled name from incoming request | [
"/",
"*",
"Finds",
"method",
"of",
"class",
"by",
"using",
"mangled",
"name",
"from",
"incoming",
"request"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/hessian/HessianToJdonRequestProcessor.java#L150-L174 |
apache/spark | core/src/main/java/org/apache/spark/util/collection/TimSort.java | TimSort.reverseRange | private void reverseRange(Buffer a, int lo, int hi) {
"""
Reverse the specified range of the specified array.
@param a the array in which a range is to be reversed
@param lo the index of the first element in the range to be reversed
@param hi the index after the last element in the range to be reversed
""... | java | private void reverseRange(Buffer a, int lo, int hi) {
hi--;
while (lo < hi) {
s.swap(a, lo, hi);
lo++;
hi--;
}
} | [
"private",
"void",
"reverseRange",
"(",
"Buffer",
"a",
",",
"int",
"lo",
",",
"int",
"hi",
")",
"{",
"hi",
"--",
";",
"while",
"(",
"lo",
"<",
"hi",
")",
"{",
"s",
".",
"swap",
"(",
"a",
",",
"lo",
",",
"hi",
")",
";",
"lo",
"++",
";",
"hi"... | Reverse the specified range of the specified array.
@param a the array in which a range is to be reversed
@param lo the index of the first element in the range to be reversed
@param hi the index after the last element in the range to be reversed | [
"Reverse",
"the",
"specified",
"range",
"of",
"the",
"specified",
"array",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/TimSort.java#L289-L296 |
oboehm/jfachwert | src/main/java/de/jfachwert/bank/Geldbetrag.java | Geldbetrag.ofMinor | public static Geldbetrag ofMinor(CurrencyUnit currency, long amountMinor) {
"""
Legt einen Geldbetrag unter Angabe der Unter-Einheit an. So liefert
{@code ofMinor(EUR, 12345)} die Instanz fuer '123,45 EUR' zurueck.
<p>
Die Methode wurde aus Kompatibitaetsgrunden zur Money-Klasse
hinzugefuegt.
</p>
@param c... | java | public static Geldbetrag ofMinor(CurrencyUnit currency, long amountMinor) {
return ofMinor(currency, amountMinor, currency.getDefaultFractionDigits());
} | [
"public",
"static",
"Geldbetrag",
"ofMinor",
"(",
"CurrencyUnit",
"currency",
",",
"long",
"amountMinor",
")",
"{",
"return",
"ofMinor",
"(",
"currency",
",",
"amountMinor",
",",
"currency",
".",
"getDefaultFractionDigits",
"(",
")",
")",
";",
"}"
] | Legt einen Geldbetrag unter Angabe der Unter-Einheit an. So liefert
{@code ofMinor(EUR, 12345)} die Instanz fuer '123,45 EUR' zurueck.
<p>
Die Methode wurde aus Kompatibitaetsgrunden zur Money-Klasse
hinzugefuegt.
</p>
@param currency Waehrung
@param amountMinor Betrag der Unter-Einzeit (z.B. 12345 Cents)
@return Geld... | [
"Legt",
"einen",
"Geldbetrag",
"unter",
"Angabe",
"der",
"Unter",
"-",
"Einheit",
"an",
".",
"So",
"liefert",
"{",
"@code",
"ofMinor",
"(",
"EUR",
"12345",
")",
"}",
"die",
"Instanz",
"fuer",
"123",
"45",
"EUR",
"zurueck",
".",
"<p",
">",
"Die",
"Metho... | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/bank/Geldbetrag.java#L190-L192 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.readFromStream | @Nullable
public static IJson readFromStream (@Nonnull final InputStream aIS,
@Nonnull final Charset aFallbackCharset,
@Nullable final IJsonParseExceptionCallback aCustomExceptionCallback) {
"""
Read the Json from the passed {@link Input... | java | @Nullable
public static IJson readFromStream (@Nonnull final InputStream aIS,
@Nonnull final Charset aFallbackCharset,
@Nullable final IJsonParseExceptionCallback aCustomExceptionCallback)
{
ValueEnforcer.notNull (aIS, "InputStream");
... | [
"@",
"Nullable",
"public",
"static",
"IJson",
"readFromStream",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"aIS",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
",",
"@",
"Nullable",
"final",
"IJsonParseExceptionCallback",
"aCustomExceptionCallback",
"... | Read the Json from the passed {@link InputStream}.
@param aIS
The input stream to use. May not be <code>null</code>.
@param aFallbackCharset
The charset to be used in case no BOM is present. May not be
<code>null</code>.
@param aCustomExceptionCallback
An optional custom exception handler that can be used to collect t... | [
"Read",
"the",
"Json",
"from",
"the",
"passed",
"{",
"@link",
"InputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L676-L693 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/graph/BellmanFord.java | BellmanFord.hasNegativeCycle | public static boolean hasNegativeCycle(Object sourceOrDest,
DirectedGraph g, Mode mode) {
"""
Determines if there are any negative cycles found.
@param sourceOrDest
a vertex.
@return <code>true</code> if a negative cycle was found,
<code>false</code> otherwise.
"""
return calcShortestDistances(sourc... | java | public static boolean hasNegativeCycle(Object sourceOrDest,
DirectedGraph g, Mode mode) {
return calcShortestDistances(sourceOrDest, g, mode) == null;
} | [
"public",
"static",
"boolean",
"hasNegativeCycle",
"(",
"Object",
"sourceOrDest",
",",
"DirectedGraph",
"g",
",",
"Mode",
"mode",
")",
"{",
"return",
"calcShortestDistances",
"(",
"sourceOrDest",
",",
"g",
",",
"mode",
")",
"==",
"null",
";",
"}"
] | Determines if there are any negative cycles found.
@param sourceOrDest
a vertex.
@return <code>true</code> if a negative cycle was found,
<code>false</code> otherwise. | [
"Determines",
"if",
"there",
"are",
"any",
"negative",
"cycles",
"found",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/graph/BellmanFord.java#L82-L85 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java | RegistriesInner.beginQueueBuild | public BuildInner beginQueueBuild(String resourceGroupName, String registryName, QueueBuildRequest buildRequest) {
"""
Creates a new build based on the request parameters and add it to the build queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param regis... | java | public BuildInner beginQueueBuild(String resourceGroupName, String registryName, QueueBuildRequest buildRequest) {
return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).toBlocking().single().body();
} | [
"public",
"BuildInner",
"beginQueueBuild",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"QueueBuildRequest",
"buildRequest",
")",
"{",
"return",
"beginQueueBuildWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"buildR... | Creates a new build based on the request parameters and add it to the build queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildRequest The parameters of a build that needs to queued.
@throws Illegal... | [
"Creates",
"a",
"new",
"build",
"based",
"on",
"the",
"request",
"parameters",
"and",
"add",
"it",
"to",
"the",
"build",
"queue",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java#L1802-L1804 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterByName | public static QueryParameter getParameterByName(Report report, String parameterName) {
"""
Get parameter by name
@param report next report object
@param parameterName parameter name
@return return paramater with the specified name, null if parameter not found
"""
return getParameterByName(r... | java | public static QueryParameter getParameterByName(Report report, String parameterName) {
return getParameterByName(report.getParameters(), parameterName);
} | [
"public",
"static",
"QueryParameter",
"getParameterByName",
"(",
"Report",
"report",
",",
"String",
"parameterName",
")",
"{",
"return",
"getParameterByName",
"(",
"report",
".",
"getParameters",
"(",
")",
",",
"parameterName",
")",
";",
"}"
] | Get parameter by name
@param report next report object
@param parameterName parameter name
@return return paramater with the specified name, null if parameter not found | [
"Get",
"parameter",
"by",
"name"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L615-L617 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.optBool | @Override
public final Boolean optBool(final String key, final Boolean defaultValue) {
"""
Get a property as a boolean or default value.
@param key the property name
@param defaultValue the default
"""
Boolean result = optBool(key);
return result == null ? defaultValue : result;
} | java | @Override
public final Boolean optBool(final String key, final Boolean defaultValue) {
Boolean result = optBool(key);
return result == null ? defaultValue : result;
} | [
"@",
"Override",
"public",
"final",
"Boolean",
"optBool",
"(",
"final",
"String",
"key",
",",
"final",
"Boolean",
"defaultValue",
")",
"{",
"Boolean",
"result",
"=",
"optBool",
"(",
"key",
")",
";",
"return",
"result",
"==",
"null",
"?",
"defaultValue",
":... | Get a property as a boolean or default value.
@param key the property name
@param defaultValue the default | [
"Get",
"a",
"property",
"as",
"a",
"boolean",
"or",
"default",
"value",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L169-L173 |
jmeter-maven-plugin/jmeter-maven-plugin | src/main/java/com/lazerycode/jmeter/mojo/CheckResultsMojo.java | CheckResultsMojo.doExecute | @Override
public void doExecute() throws MojoExecutionException, MojoFailureException {
"""
Scan JMeter result files for successful, and failed requests/
@throws MojoExecutionException Exception
@throws MojoFailureException Exception
"""
if (!ignoreResultFailures && !scanResultsForFailedReque... | java | @Override
public void doExecute() throws MojoExecutionException, MojoFailureException {
if (!ignoreResultFailures && !scanResultsForFailedRequests) {
getLog().warn(String.format(
"current value of scanResultsForFailedRequests(%s) is incompatible with ignoreResultFailures(%s),... | [
"@",
"Override",
"public",
"void",
"doExecute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"if",
"(",
"!",
"ignoreResultFailures",
"&&",
"!",
"scanResultsForFailedRequests",
")",
"{",
"getLog",
"(",
")",
".",
"warn",
"(",
"St... | Scan JMeter result files for successful, and failed requests/
@throws MojoExecutionException Exception
@throws MojoFailureException Exception | [
"Scan",
"JMeter",
"result",
"files",
"for",
"successful",
"and",
"failed",
"requests",
"/"
] | train | https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/mojo/CheckResultsMojo.java#L57-L109 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java | JobScheduler.unscheduleJob | public void unscheduleJob(String jobName)
throws JobException {
"""
Unschedule and delete a job.
@param jobName Job name
@throws JobException when there is anything wrong unschedule the job
"""
if (this.scheduledJobs.containsKey(jobName)) {
try {
this.scheduler.getScheduler().delete... | java | public void unscheduleJob(String jobName)
throws JobException {
if (this.scheduledJobs.containsKey(jobName)) {
try {
this.scheduler.getScheduler().deleteJob(this.scheduledJobs.remove(jobName));
} catch (SchedulerException se) {
LOG.error("Failed to unschedule and delete job " + job... | [
"public",
"void",
"unscheduleJob",
"(",
"String",
"jobName",
")",
"throws",
"JobException",
"{",
"if",
"(",
"this",
".",
"scheduledJobs",
".",
"containsKey",
"(",
"jobName",
")",
")",
"{",
"try",
"{",
"this",
".",
"scheduler",
".",
"getScheduler",
"(",
")"... | Unschedule and delete a job.
@param jobName Job name
@throws JobException when there is anything wrong unschedule the job | [
"Unschedule",
"and",
"delete",
"a",
"job",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java#L408-L418 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java | CommerceDiscountRelPersistenceImpl.findAll | @Override
public List<CommerceDiscountRel> findAll() {
"""
Returns all the commerce discount rels.
@return the commerce discount rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscountRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discount rels.
@return the commerce discount rels | [
"Returns",
"all",
"the",
"commerce",
"discount",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java#L2286-L2289 |
haraldk/TwelveMonkeys | imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/tiff/Rational.java | Rational.times | public Rational times(final Rational pOther) {
"""
return a * b, staving off overflow as much as possible by cross-cancellation
"""
// special cases
if (equals(ZERO) || pOther.equals(ZERO)) {
return ZERO;
}
// reduce p1/q2 and p2/q1, then multiply, where a = p1/q1 a... | java | public Rational times(final Rational pOther) {
// special cases
if (equals(ZERO) || pOther.equals(ZERO)) {
return ZERO;
}
// reduce p1/q2 and p2/q1, then multiply, where a = p1/q1 and b = p2/q2
Rational c = new Rational(numerator, pOther.denominator);
Rationa... | [
"public",
"Rational",
"times",
"(",
"final",
"Rational",
"pOther",
")",
"{",
"// special cases",
"if",
"(",
"equals",
"(",
"ZERO",
")",
"||",
"pOther",
".",
"equals",
"(",
"ZERO",
")",
")",
"{",
"return",
"ZERO",
";",
"}",
"// reduce p1/q2 and p2/q1, then mu... | return a * b, staving off overflow as much as possible by cross-cancellation | [
"return",
"a",
"*",
"b",
"staving",
"off",
"overflow",
"as",
"much",
"as",
"possible",
"by",
"cross",
"-",
"cancellation"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/tiff/Rational.java#L173-L184 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java | OctTreeQuantizer.buildColorTable | public void buildColorTable(int[] inPixels, int[] table) {
"""
A quick way to use the quantizer. Just create a table the right size and pass in the pixels.
@param inPixels the input colors
@param table the output color table
"""
int count = inPixels.length;
maximumColors = table.length;
... | java | public void buildColorTable(int[] inPixels, int[] table) {
int count = inPixels.length;
maximumColors = table.length;
for (int i = 0; i < count; i++) {
insertColor(inPixels[i]);
if (colors > reduceColors)
reduceTree(reduceColors);
}
if (col... | [
"public",
"void",
"buildColorTable",
"(",
"int",
"[",
"]",
"inPixels",
",",
"int",
"[",
"]",
"table",
")",
"{",
"int",
"count",
"=",
"inPixels",
".",
"length",
";",
"maximumColors",
"=",
"table",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | A quick way to use the quantizer. Just create a table the right size and pass in the pixels.
@param inPixels the input colors
@param table the output color table | [
"A",
"quick",
"way",
"to",
"use",
"the",
"quantizer",
".",
"Just",
"create",
"a",
"table",
"the",
"right",
"size",
"and",
"pass",
"in",
"the",
"pixels",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java#L256-L267 |
scala/scala | src/library/scala/runtime/BoxesRunTime.java | BoxesRunTime.equals2 | public static boolean equals2(Object x, Object y) {
"""
Since all applicable logic has to be present in the equals method of a ScalaNumber
in any case, we dispatch to it as soon as we spot one on either side.
"""
if (x instanceof java.lang.Number)
return equalsNumObject((java.lang.Number)x... | java | public static boolean equals2(Object x, Object y) {
if (x instanceof java.lang.Number)
return equalsNumObject((java.lang.Number)x, y);
if (x instanceof java.lang.Character)
return equalsCharObject((java.lang.Character)x, y);
if (x == null)
return y == null;
... | [
"public",
"static",
"boolean",
"equals2",
"(",
"Object",
"x",
",",
"Object",
"y",
")",
"{",
"if",
"(",
"x",
"instanceof",
"java",
".",
"lang",
".",
"Number",
")",
"return",
"equalsNumObject",
"(",
"(",
"java",
".",
"lang",
".",
"Number",
")",
"x",
",... | Since all applicable logic has to be present in the equals method of a ScalaNumber
in any case, we dispatch to it as soon as we spot one on either side. | [
"Since",
"all",
"applicable",
"logic",
"has",
"to",
"be",
"present",
"in",
"the",
"equals",
"method",
"of",
"a",
"ScalaNumber",
"in",
"any",
"case",
"we",
"dispatch",
"to",
"it",
"as",
"soon",
"as",
"we",
"spot",
"one",
"on",
"either",
"side",
"."
] | train | https://github.com/scala/scala/blob/bec2441a24cbf3159a1118049b857a5ae7c452eb/src/library/scala/runtime/BoxesRunTime.java#L126-L135 |
ikew0ng/SwipeBackLayout | library/src/main/java/me/imid/swipebacklayout/lib/ViewDragHelper.java | ViewDragHelper.setSensitivity | public void setSensitivity(Context context, float sensitivity) {
"""
Sets the sensitivity of the dragger.
@param context The application context.
@param sensitivity value between 0 and 1, the final value for touchSlop =
ViewConfiguration.getScaledTouchSlop * (1 / s);
"""
float s = Math.max(0f,... | java | public void setSensitivity(Context context, float sensitivity) {
float s = Math.max(0f, Math.min(1.0f, sensitivity));
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
mTouchSlop = (int) (viewConfiguration.getScaledTouchSlop() * (1 / s));
} | [
"public",
"void",
"setSensitivity",
"(",
"Context",
"context",
",",
"float",
"sensitivity",
")",
"{",
"float",
"s",
"=",
"Math",
".",
"max",
"(",
"0f",
",",
"Math",
".",
"min",
"(",
"1.0f",
",",
"sensitivity",
")",
")",
";",
"ViewConfiguration",
"viewCon... | Sets the sensitivity of the dragger.
@param context The application context.
@param sensitivity value between 0 and 1, the final value for touchSlop =
ViewConfiguration.getScaledTouchSlop * (1 / s); | [
"Sets",
"the",
"sensitivity",
"of",
"the",
"dragger",
"."
] | train | https://github.com/ikew0ng/SwipeBackLayout/blob/7c6b0ac424813266cec57db86d65a7c9d9ff5fa6/library/src/main/java/me/imid/swipebacklayout/lib/ViewDragHelper.java#L439-L443 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_virtualNumbers_number_outgoing_GET | public ArrayList<Long> serviceName_virtualNumbers_number_outgoing_GET(String serviceName, String number, Date creationDatetime_from, Date creationDatetime_to, Long deliveryReceipt, Long differedDelivery, Long ptt, String receiver, String sender, String tag) throws IOException {
"""
Sms sent associated to the sms a... | java | public ArrayList<Long> serviceName_virtualNumbers_number_outgoing_GET(String serviceName, String number, Date creationDatetime_from, Date creationDatetime_to, Long deliveryReceipt, Long differedDelivery, Long ptt, String receiver, String sender, String tag) throws IOException {
String qPath = "/sms/{serviceName}/virt... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_virtualNumbers_number_outgoing_GET",
"(",
"String",
"serviceName",
",",
"String",
"number",
",",
"Date",
"creationDatetime_from",
",",
"Date",
"creationDatetime_to",
",",
"Long",
"deliveryReceipt",
",",
"Long",
"diff... | Sms sent associated to the sms account
REST: GET /sms/{serviceName}/virtualNumbers/{number}/outgoing
@param sender [required] Filter the value of sender property (=)
@param receiver [required] Filter the value of receiver property (=)
@param tag [required] Filter the value of tag property (=)
@param creationDatetime_f... | [
"Sms",
"sent",
"associated",
"to",
"the",
"sms",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L340-L353 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesInner.java | MediaServicesInner.regenerateKeyAsync | public Observable<RegenerateKeyOutputInner> regenerateKeyAsync(String resourceGroupName, String mediaServiceName, KeyType keyType) {
"""
Regenerates a primary or secondary key for a Media Service.
@param resourceGroupName Name of the resource group within the Azure subscription.
@param mediaServiceName Name of... | java | public Observable<RegenerateKeyOutputInner> regenerateKeyAsync(String resourceGroupName, String mediaServiceName, KeyType keyType) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, mediaServiceName, keyType).map(new Func1<ServiceResponse<RegenerateKeyOutputInner>, RegenerateKeyOutputInner>() {
... | [
"public",
"Observable",
"<",
"RegenerateKeyOutputInner",
">",
"regenerateKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"mediaServiceName",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Regenerates a primary or secondary key for a Media Service.
@param resourceGroupName Name of the resource group within the Azure subscription.
@param mediaServiceName Name of the Media Service.
@param keyType The keyType indicating which key you want to regenerate, Primary or Secondary. Possible values include: 'Prima... | [
"Regenerates",
"a",
"primary",
"or",
"secondary",
"key",
"for",
"a",
"Media",
"Service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesInner.java#L674-L681 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPostForProxy | protected ClientResponse doPostForProxy(String path, InputStream inputStream, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException {
"""
Passes a new resource, form or other POST body to a proxied server.
@param path the path to the resource. Cannot be <cod... | java | protected ClientResponse doPostForProxy(String path, InputStream inputStream, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException {
this.readLock.lock();
try {
WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, Ht... | [
"protected",
"ClientResponse",
"doPostForProxy",
"(",
"String",
"path",
",",
"InputStream",
"inputStream",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"parameterMap",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",... | Passes a new resource, form or other POST body to a proxied server.
@param path the path to the resource. Cannot be <code>null</code>.
@param inputStream the contents of the POST body. Cannot be
<code>null</code>.
@param parameterMap query parameters. May be <code>null</code>.
@param headers any request headers to add... | [
"Passes",
"a",
"new",
"resource",
"form",
"or",
"other",
"POST",
"body",
"to",
"a",
"proxied",
"server",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L868-L879 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceVaultConfigsInner.java | BackupResourceVaultConfigsInner.updateAsync | public Observable<BackupResourceVaultConfigResourceInner> updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) {
"""
Updates vault security config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource g... | java | public Observable<BackupResourceVaultConfigResourceInner> updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) {
return updateWithServiceResponseAsync(vaultName, resourceGroupName, parameters).map(new Func1<ServiceResponse<BackupResourceVaultConfigResourceIn... | [
"public",
"Observable",
"<",
"BackupResourceVaultConfigResourceInner",
">",
"updateAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"BackupResourceVaultConfigResourceInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"... | Updates vault security config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param parameters resource config request
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ... | [
"Updates",
"vault",
"security",
"config",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceVaultConfigsInner.java#L189-L196 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java | AlignedBox3d.setZ | @Override
public void setZ(double min, double max) {
"""
Set the z bounds of the box.
@param min the min value for the z axis.
@param max the max value for the z axis.
"""
if (min <= max) {
this.minzProperty.set(min);
this.maxzProperty.set(max);
} else {
this.minzProperty.set(max);
this.ma... | java | @Override
public void setZ(double min, double max) {
if (min <= max) {
this.minzProperty.set(min);
this.maxzProperty.set(max);
} else {
this.minzProperty.set(max);
this.maxzProperty.set(min);
}
} | [
"@",
"Override",
"public",
"void",
"setZ",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"min",
"<=",
"max",
")",
"{",
"this",
".",
"minzProperty",
".",
"set",
"(",
"min",
")",
";",
"this",
".",
"maxzProperty",
".",
"set",
"(",
... | Set the z bounds of the box.
@param min the min value for the z axis.
@param max the max value for the z axis. | [
"Set",
"the",
"z",
"bounds",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3d.java#L705-L714 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.setFieldValue | public static void setFieldValue(final Field field, final Object instance, final Object value) throws CoreException {
"""
Update an object field even if it has a private or protected visibility.
@param field the field to update
@param instance the object instance that hold this field
@param value the value to... | java | public static void setFieldValue(final Field field, final Object instance, final Object value) throws CoreException {
try {
// store current visibility
final boolean accessible = field.isAccessible();
// let it accessible anyway
field.setAccessible(true);
... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"instance",
",",
"final",
"Object",
"value",
")",
"throws",
"CoreException",
"{",
"try",
"{",
"// store current visibility",
"final",
"boolean",
"accessible",
"=",... | Update an object field even if it has a private or protected visibility.
@param field the field to update
@param instance the object instance that hold this field
@param value the value to set into this field
@throws CoreException if the new value cannot be set | [
"Update",
"an",
"object",
"field",
"even",
"if",
"it",
"has",
"a",
"private",
"or",
"protected",
"visibility",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L552-L570 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsyncThrowing | public static <T1, T2, R> Func2<T1, T2, Observable<R>> toAsyncThrowing(final ThrowingFunc2<? super T1, ? super T2, ? extends R> func, final Scheduler scheduler) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wik... | java | public static <T1, T2, R> Func2<T1, T2, Observable<R>> toAsyncThrowing(final ThrowingFunc2<? super T1, ? super T2, ? extends R> func, final Scheduler scheduler) {
return new Func2<T1, T2, Observable<R>>() {
@Override
public Observable<R> call(T1 t1, T2 t2) {
return startC... | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"Func2",
"<",
"T1",
",",
"T2",
",",
"Observable",
"<",
"R",
">",
">",
"toAsyncThrowing",
"(",
"final",
"ThrowingFunc2",
"<",
"?",
"super",
"T1",
",",
"?",
"super",
"T2",
",",
"?",
"extends",
... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.s.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <R> the result type
@param fu... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L959-L966 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java | PHPMethods.substr_count | public static int substr_count(final String string, final char character) {
"""
Count the number of times a character appears in the string.
@param string
@param character
@return
"""
int count = 0;
int n = string.length();
for(int i=0;i<n;i++) {
if(string.charAt(i)==ch... | java | public static int substr_count(final String string, final char character) {
int count = 0;
int n = string.length();
for(int i=0;i<n;i++) {
if(string.charAt(i)==character) {
++count;
}
}
return count;
} | [
"public",
"static",
"int",
"substr_count",
"(",
"final",
"String",
"string",
",",
"final",
"char",
"character",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"n",
"=",
"string",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",... | Count the number of times a character appears in the string.
@param string
@param character
@return | [
"Count",
"the",
"number",
"of",
"times",
"a",
"character",
"appears",
"in",
"the",
"string",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java#L85-L95 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.deleteJob | public JenkinsServer deleteJob(FolderJob folder, String jobName, boolean crumbFlag) throws IOException {
"""
Delete a job from Jenkins within a folder.
@param folder The folder where the given job is located.
@param jobName The job which should be deleted.
@param crumbFlag The crumbFlag
@throws IOException i... | java | public JenkinsServer deleteJob(FolderJob folder, String jobName, boolean crumbFlag) throws IOException {
client.post(UrlUtils.toJobBaseUrl(folder, jobName) + "/doDelete", crumbFlag);
return this;
} | [
"public",
"JenkinsServer",
"deleteJob",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
",",
"boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"client",
".",
"post",
"(",
"UrlUtils",
".",
"toJobBaseUrl",
"(",
"folder",
",",
"jobName",
")",
"+",
... | Delete a job from Jenkins within a folder.
@param folder The folder where the given job is located.
@param jobName The job which should be deleted.
@param crumbFlag The crumbFlag
@throws IOException in case of problems. | [
"Delete",
"a",
"job",
"from",
"Jenkins",
"within",
"a",
"folder",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L704-L707 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableImport.java | SSTableImport.importJson | public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException {
"""
Convert a JSON formatted file to an SSTable.
@param jsonFile the file containing JSON formatted data
@param keyspace keyspace the data belongs to
@param cf column family the data belongs to
@param ... | java | public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException
{
ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf);
IPartitioner partitioner = DatabaseDescriptor.getPartitioner();
int importedKeys = (isSorted) ? impo... | [
"public",
"int",
"importJson",
"(",
"String",
"jsonFile",
",",
"String",
"keyspace",
",",
"String",
"cf",
",",
"String",
"ssTablePath",
")",
"throws",
"IOException",
"{",
"ColumnFamily",
"columnFamily",
"=",
"ArrayBackedSortedColumns",
".",
"factory",
".",
"create... | Convert a JSON formatted file to an SSTable.
@param jsonFile the file containing JSON formatted data
@param keyspace keyspace the data belongs to
@param cf column family the data belongs to
@param ssTablePath file to write the SSTable to
@throws IOException for errors reading/writing input/output | [
"Convert",
"a",
"JSON",
"formatted",
"file",
"to",
"an",
"SSTable",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L282-L294 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ClientAsynchEventThreadPool.java | ClientAsynchEventThreadPool.dispatchConsumerSetChangeCallbackEvent | public void dispatchConsumerSetChangeCallbackEvent(ConsumerSetChangeCallback consumerSetChangeCallback,boolean isEmpty) {
"""
Dispatches a thread which will call the consumerSetChange method on the ConsumerSetChangeCallback passing in the supplied parameters.
@param consumerSetChangeCallback
@param isEmpty
... | java | public void dispatchConsumerSetChangeCallbackEvent(ConsumerSetChangeCallback consumerSetChangeCallback,boolean isEmpty)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dispatchConsumerSetChangeCallbackEvent",
new Object[]{consumerSetChangeCallback, isEmpty})... | [
"public",
"void",
"dispatchConsumerSetChangeCallbackEvent",
"(",
"ConsumerSetChangeCallback",
"consumerSetChangeCallback",
",",
"boolean",
"isEmpty",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")"... | Dispatches a thread which will call the consumerSetChange method on the ConsumerSetChangeCallback passing in the supplied parameters.
@param consumerSetChangeCallback
@param isEmpty | [
"Dispatches",
"a",
"thread",
"which",
"will",
"call",
"the",
"consumerSetChange",
"method",
"on",
"the",
"ConsumerSetChangeCallback",
"passing",
"in",
"the",
"supplied",
"parameters",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ClientAsynchEventThreadPool.java#L209-L219 |
cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java | HighlightGenerator.createBondHighlight | private static Shape createBondHighlight(IBond bond, double radius) {
"""
Create the shape which will highlight the provided bond.
@param bond the bond to highlight
@param radius the specified radius
@return the shape which will highlight the atom
"""
double x1 = bond.getBegin().getPoint2d().x;... | java | private static Shape createBondHighlight(IBond bond, double radius) {
double x1 = bond.getBegin().getPoint2d().x;
double x2 = bond.getEnd().getPoint2d().x;
double y1 = bond.getBegin().getPoint2d().y;
double y2 = bond.getEnd().getPoint2d().y;
double dx = x2 - x1;
double ... | [
"private",
"static",
"Shape",
"createBondHighlight",
"(",
"IBond",
"bond",
",",
"double",
"radius",
")",
"{",
"double",
"x1",
"=",
"bond",
".",
"getBegin",
"(",
")",
".",
"getPoint2d",
"(",
")",
".",
"x",
";",
"double",
"x2",
"=",
"bond",
".",
"getEnd"... | Create the shape which will highlight the provided bond.
@param bond the bond to highlight
@param radius the specified radius
@return the shape which will highlight the atom | [
"Create",
"the",
"shape",
"which",
"will",
"highlight",
"the",
"provided",
"bond",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/HighlightGenerator.java#L204-L226 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/Algorithm.java | Algorithm.lcs | public static <T extends Comparable<T>> List<T> lcs(List<T> arg0, List<T> arg1) {
"""
求最长公共子序列(序列中的元素需要实现Comparable接口)(有可能有多种解,该方法只返回其中一种)
@param arg0 第一个序列
@param arg1 第二个序列
@param <T> 数组中数据的实际类型
@return 两个序列的公共子序列(返回的是原队列中的倒序) (集合{1 , 2 , 3 , 4}和集合{2 , 3 , 4 ,
1}的公共子序列返回值为{4 , 3 , 2})
"""
if ... | java | public static <T extends Comparable<T>> List<T> lcs(List<T> arg0, List<T> arg1) {
if (arg0 == null || arg1 == null) {
return Collections.emptyList();
}
return lcs(arg0, arg1, 0, 0);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"List",
"<",
"T",
">",
"lcs",
"(",
"List",
"<",
"T",
">",
"arg0",
",",
"List",
"<",
"T",
">",
"arg1",
")",
"{",
"if",
"(",
"arg0",
"==",
"null",
"||",
"arg1",
"==",
"n... | 求最长公共子序列(序列中的元素需要实现Comparable接口)(有可能有多种解,该方法只返回其中一种)
@param arg0 第一个序列
@param arg1 第二个序列
@param <T> 数组中数据的实际类型
@return 两个序列的公共子序列(返回的是原队列中的倒序) (集合{1 , 2 , 3 , 4}和集合{2 , 3 , 4 ,
1}的公共子序列返回值为{4 , 3 , 2}) | [
"求最长公共子序列(序列中的元素需要实现Comparable接口)(有可能有多种解,该方法只返回其中一种)"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/Algorithm.java#L69-L74 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java | BigtableTableAdminClient.create | public static BigtableTableAdminClient create(
@Nonnull String projectId,
@Nonnull String instanceId,
@Nonnull EnhancedBigtableTableAdminStub stub) {
"""
Constructs an instance of BigtableTableAdminClient with the given instanceName and stub.
"""
return new BigtableTableAdminClient(projec... | java | public static BigtableTableAdminClient create(
@Nonnull String projectId,
@Nonnull String instanceId,
@Nonnull EnhancedBigtableTableAdminStub stub) {
return new BigtableTableAdminClient(projectId, instanceId, stub);
} | [
"public",
"static",
"BigtableTableAdminClient",
"create",
"(",
"@",
"Nonnull",
"String",
"projectId",
",",
"@",
"Nonnull",
"String",
"instanceId",
",",
"@",
"Nonnull",
"EnhancedBigtableTableAdminStub",
"stub",
")",
"{",
"return",
"new",
"BigtableTableAdminClient",
"("... | Constructs an instance of BigtableTableAdminClient with the given instanceName and stub. | [
"Constructs",
"an",
"instance",
"of",
"BigtableTableAdminClient",
"with",
"the",
"given",
"instanceName",
"and",
"stub",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java#L130-L135 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/provider/AbstractWrapper.java | AbstractWrapper.factoryImpl | protected static ChaiProviderImplementor factoryImpl(
final Class wrapperClass,
final ChaiSetting enableSetting,
final ChaiProviderImplementor chaiProvider
)
throws Exception {
"""
Wrap a pre-existing ChaiProvider with a WatchdogWrapper instance.
@param chaiPr... | java | protected static ChaiProviderImplementor factoryImpl(
final Class wrapperClass,
final ChaiSetting enableSetting,
final ChaiProviderImplementor chaiProvider
)
throws Exception
{
//check to make sure watchdog ise enabled;
final boolean isEnabled = Bo... | [
"protected",
"static",
"ChaiProviderImplementor",
"factoryImpl",
"(",
"final",
"Class",
"wrapperClass",
",",
"final",
"ChaiSetting",
"enableSetting",
",",
"final",
"ChaiProviderImplementor",
"chaiProvider",
")",
"throws",
"Exception",
"{",
"//check to make sure watchdog ise e... | Wrap a pre-existing ChaiProvider with a WatchdogWrapper instance.
@param chaiProvider a pre-existing {@code ChaiProvider}
@param enableSetting setting to mark if watchdog is enabled
@param wrapperClass chai provider wrapper
@return a wrapped {@code ChaiProvider} instance. | [
"Wrap",
"a",
"pre",
"-",
"existing",
"ChaiProvider",
"with",
"a",
"WatchdogWrapper",
"instance",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/provider/AbstractWrapper.java#L45-L80 |
riversun/string-grabber | src/main/java/org/riversun/string_grabber/StringCropper.java | StringCropper.getAfterOf | public String getAfterOf(String srcStr, String token, boolean useTailSearch) {
"""
returns the string that is cropped after token with position-detail-info<br>
<br>
Method Example1 tail mode=true,<br>
<br>
getAfterOf("AAABCDBCDEEE","BCD",true) returns "EEE" <br>
<br>
Method Example2 tail mode=true,<br>
getA... | java | public String getAfterOf(String srcStr, String token, boolean useTailSearch) {
return getAfterOfWithDetails(srcStr, token, useTailSearch).str;
} | [
"public",
"String",
"getAfterOf",
"(",
"String",
"srcStr",
",",
"String",
"token",
",",
"boolean",
"useTailSearch",
")",
"{",
"return",
"getAfterOfWithDetails",
"(",
"srcStr",
",",
"token",
",",
"useTailSearch",
")",
".",
"str",
";",
"}"
] | returns the string that is cropped after token with position-detail-info<br>
<br>
Method Example1 tail mode=true,<br>
<br>
getAfterOf("AAABCDBCDEEE","BCD",true) returns "EEE" <br>
<br>
Method Example2 tail mode=true,<br>
getAfterOf("AAABCDBCDEEE","BCD",true) returns "BCDEEE"
@param srcStr
@param token
@param useTailSe... | [
"returns",
"the",
"string",
"that",
"is",
"cropped",
"after",
"token",
"with",
"position",
"-",
"detail",
"-",
"info<br",
">",
"<br",
">",
"Method",
"Example1",
"tail",
"mode",
"=",
"true",
"<br",
">",
"<br",
">",
"getAfterOf",
"(",
"AAABCDBCDEEE",
"BCD",
... | train | https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringCropper.java#L270-L272 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java | SelectorRefresher.createSelection | private StateUpdater createSelection(Viewer viewer, Cursor cursor, SelectorModel model, StateUpdater reset) {
"""
Create selection action.
@param viewer The viewer reference.
@param cursor The cursor reference.
@param model The selector model.
@param reset The reset action.
@return The selection action.
... | java | private StateUpdater createSelection(Viewer viewer, Cursor cursor, SelectorModel model, StateUpdater reset)
{
return (extrp, current) ->
{
computeSelection(viewer, cursor, model);
if (model.getSelectionClick() != cursor.getClick())
{
collidable.se... | [
"private",
"StateUpdater",
"createSelection",
"(",
"Viewer",
"viewer",
",",
"Cursor",
"cursor",
",",
"SelectorModel",
"model",
",",
"StateUpdater",
"reset",
")",
"{",
"return",
"(",
"extrp",
",",
"current",
")",
"->",
"{",
"computeSelection",
"(",
"viewer",
",... | Create selection action.
@param viewer The viewer reference.
@param cursor The cursor reference.
@param model The selector model.
@param reset The reset action.
@return The selection action. | [
"Create",
"selection",
"action",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java#L182-L204 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayWriter.java | ByteArrayWriter.writeString | public void writeString(String str, String charset) throws IOException {
"""
Write a String to the byte array converting the bytes using the given
character set.
@param str
@param charset
@throws IOException
"""
if (str == null) {
writeInt(0);
} else {
byte[] tmp;
if (ByteArrayReader.encod... | java | public void writeString(String str, String charset) throws IOException {
if (str == null) {
writeInt(0);
} else {
byte[] tmp;
if (ByteArrayReader.encode)
tmp = str.getBytes(charset);
else
tmp = str.getBytes();
writeInt(tmp.length);
write(tmp);
}
} | [
"public",
"void",
"writeString",
"(",
"String",
"str",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"writeInt",
"(",
"0",
")",
";",
"}",
"else",
"{",
"byte",
"[",
"]",
"tmp",
";",
"if",
"(",... | Write a String to the byte array converting the bytes using the given
character set.
@param str
@param charset
@throws IOException | [
"Write",
"a",
"String",
"to",
"the",
"byte",
"array",
"converting",
"the",
"bytes",
"using",
"the",
"given",
"character",
"set",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayWriter.java#L240-L255 |
groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java | StaticTypeCheckingSupport.buildParameter | private static Parameter buildParameter(final Map<String, GenericsType> genericFromReceiver, final Map<String, GenericsType> placeholdersFromContext, final Parameter methodParameter, final ClassNode paramType) {
"""
Given a parameter, builds a new parameter for which the known generics placeholders are resolved.
... | java | private static Parameter buildParameter(final Map<String, GenericsType> genericFromReceiver, final Map<String, GenericsType> placeholdersFromContext, final Parameter methodParameter, final ClassNode paramType) {
if (genericFromReceiver.isEmpty() && (placeholdersFromContext==null||placeholdersFromContext.isEmpty... | [
"private",
"static",
"Parameter",
"buildParameter",
"(",
"final",
"Map",
"<",
"String",
",",
"GenericsType",
">",
"genericFromReceiver",
",",
"final",
"Map",
"<",
"String",
",",
"GenericsType",
">",
"placeholdersFromContext",
",",
"final",
"Parameter",
"methodParame... | Given a parameter, builds a new parameter for which the known generics placeholders are resolved.
@param genericFromReceiver resolved generics from the receiver of the message
@param placeholdersFromContext, resolved generics from the method context
@param methodParameter the method parameter for which we want to resol... | [
"Given",
"a",
"parameter",
"builds",
"a",
"new",
"parameter",
"for",
"which",
"the",
"known",
"generics",
"placeholders",
"are",
"resolved",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java#L1170-L1183 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java | BoxApiCollaboration.getAddRequest | @Deprecated
public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role role, String login) {
"""
Deprecated use getAddToFolderRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login)
@param folderId id of the folder to be collaborated.
@para... | java | @Deprecated
public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role role, String login) {
return getAddToFolderRequest(folderId, role, login);
} | [
"@",
"Deprecated",
"public",
"BoxRequestsShare",
".",
"AddCollaboration",
"getAddRequest",
"(",
"String",
"folderId",
",",
"BoxCollaboration",
".",
"Role",
"role",
",",
"String",
"login",
")",
"{",
"return",
"getAddToFolderRequest",
"(",
"folderId",
",",
"role",
"... | Deprecated use getAddToFolderRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login)
@param folderId id of the folder to be collaborated.
@param role role of the collaboration
@param login email address of the user to add
@return request to add/create a collaboration | [
"Deprecated",
"use",
"getAddToFolderRequest",
"(",
"BoxCollaborationItem",
"collaborationItem",
"BoxCollaboration",
".",
"Role",
"role",
"String",
"login",
")"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L132-L135 |
jboss/jboss-el-api_spec | src/main/java/javax/el/StaticFieldELResolver.java | StaticFieldELResolver.isReadOnly | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
"""
<p>Inquires whether the static field is writable.</p>
<p>If the base object is an instance of <code>ELClass</code>and the
property is a String,
the <code>propertyResolved</code> property of the
<code>ELContext</code>... | java | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base instanceof ELClass && property instanceof String) {
Class<?> klass = ((ELClass)base).getKlass();
co... | [
"@",
"Override",
"public",
"boolean",
"isReadOnly",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"... | <p>Inquires whether the static field is writable.</p>
<p>If the base object is an instance of <code>ELClass</code>and the
property is a String,
the <code>propertyResolved</code> property of the
<code>ELContext</code> object must be set to <code>true</code>
by the resolver, before returning. If this property is not
<cod... | [
"<p",
">",
"Inquires",
"whether",
"the",
"static",
"field",
"is",
"writable",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"base",
"object",
"is",
"an",
"instance",
"of",
"<code",
">",
"ELClass<",
"/",
"code",
">",
"and",
"the",
"property",
"is",... | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/StaticFieldELResolver.java#L280-L291 |
jayantk/jklol | src/com/jayantkrish/jklol/util/KbestQueue.java | KbestQueue.offer | public final T offer(T toQueue, double score) {
"""
Add {@code toQueue} to this with {@code score}.
Calling this method may remove the lowest-scoring
element if adding the new element causes the size of
{@code this} to exceed {@code this.maxElements}.
@param toQueue
@param score
@return the removed element... | java | public final T offer(T toQueue, double score) {
HeapUtils.offer(keys, values, size, toQueue, score);
size++;
if (size > maxElements) {
return removeMin();
} else {
return null;
}
} | [
"public",
"final",
"T",
"offer",
"(",
"T",
"toQueue",
",",
"double",
"score",
")",
"{",
"HeapUtils",
".",
"offer",
"(",
"keys",
",",
"values",
",",
"size",
",",
"toQueue",
",",
"score",
")",
";",
"size",
"++",
";",
"if",
"(",
"size",
">",
"maxEleme... | Add {@code toQueue} to this with {@code score}.
Calling this method may remove the lowest-scoring
element if adding the new element causes the size of
{@code this} to exceed {@code this.maxElements}.
@param toQueue
@param score
@return the removed element if an element was removed,
{@code null} otherwise. | [
"Add",
"{",
"@code",
"toQueue",
"}",
"to",
"this",
"with",
"{",
"@code",
"score",
"}",
".",
"Calling",
"this",
"method",
"may",
"remove",
"the",
"lowest",
"-",
"scoring",
"element",
"if",
"adding",
"the",
"new",
"element",
"causes",
"the",
"size",
"of",
... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/KbestQueue.java#L45-L54 |
micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/QueryStringDecoder.java | QueryStringDecoder.decodeComponent | private static String decodeComponent(final String s, final Charset charset) {
"""
Decodes a bit of an URL encoded by a browser.
<p>
The string is expected to be encoded as per RFC 3986, Section 2.
This is the encoding used by JavaScript functions {@code encodeURI}
and {@code encodeURIComponent}, but not {@cod... | java | private static String decodeComponent(final String s, final Charset charset) {
if (s == null) {
return EMPTY_STRING;
}
return decodeComponent(s, 0, s.length(), charset, false);
} | [
"private",
"static",
"String",
"decodeComponent",
"(",
"final",
"String",
"s",
",",
"final",
"Charset",
"charset",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"EMPTY_STRING",
";",
"}",
"return",
"decodeComponent",
"(",
"s",
",",
"0",
",",... | Decodes a bit of an URL encoded by a browser.
<p>
The string is expected to be encoded as per RFC 3986, Section 2.
This is the encoding used by JavaScript functions {@code encodeURI}
and {@code encodeURIComponent}, but not {@code escape}. For example
in this encoding, é (in Unicode {@code U+00E9} or in UTF-8
{@... | [
"Decodes",
"a",
"bit",
"of",
"an",
"URL",
"encoded",
"by",
"a",
"browser",
".",
"<p",
">",
"The",
"string",
"is",
"expected",
"to",
"be",
"encoded",
"as",
"per",
"RFC",
"3986",
"Section",
"2",
".",
"This",
"is",
"the",
"encoding",
"used",
"by",
"Java... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/QueryStringDecoder.java#L307-L312 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/SchemaUtil.java | SchemaUtil.partitionFieldSchema | public static Schema partitionFieldSchema(FieldPartitioner<?, ?> fp, Schema schema) {
"""
Builds a Schema for the FieldPartitioner using the given Schema to
determine types not fixed by the FieldPartitioner.
@param fp a FieldPartitioner
@param schema an entity Schema that will be partitioned
@return a Schema... | java | public static Schema partitionFieldSchema(FieldPartitioner<?, ?> fp, Schema schema) {
if (fp instanceof IdentityFieldPartitioner) {
// copy the schema directly from the entity to preserve annotations
return fieldSchema(schema, fp.getSourceName());
} else {
Class<?> fieldType = getPartitionType... | [
"public",
"static",
"Schema",
"partitionFieldSchema",
"(",
"FieldPartitioner",
"<",
"?",
",",
"?",
">",
"fp",
",",
"Schema",
"schema",
")",
"{",
"if",
"(",
"fp",
"instanceof",
"IdentityFieldPartitioner",
")",
"{",
"// copy the schema directly from the entity to preser... | Builds a Schema for the FieldPartitioner using the given Schema to
determine types not fixed by the FieldPartitioner.
@param fp a FieldPartitioner
@param schema an entity Schema that will be partitioned
@return a Schema for the field partitioner | [
"Builds",
"a",
"Schema",
"for",
"the",
"FieldPartitioner",
"using",
"the",
"given",
"Schema",
"to",
"determine",
"types",
"not",
"fixed",
"by",
"the",
"FieldPartitioner",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/SchemaUtil.java#L165-L184 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/css/CSSFactory.java | CSSFactory.parseString | public static final StyleSheet parseString(String css, URL base) throws IOException,
CSSException {
"""
Parses text into a StyleSheet
@param css
Text with CSS declarations
@param base
The URL to be used as a base for loading external resources. Base URL may
be {@code null} if there are no extern... | java | public static final StyleSheet parseString(String css, URL base) throws IOException,
CSSException {
return parseString(css, base, getNetworkProcessor());
} | [
"public",
"static",
"final",
"StyleSheet",
"parseString",
"(",
"String",
"css",
",",
"URL",
"base",
")",
"throws",
"IOException",
",",
"CSSException",
"{",
"return",
"parseString",
"(",
"css",
",",
"base",
",",
"getNetworkProcessor",
"(",
")",
")",
";",
"}"
... | Parses text into a StyleSheet
@param css
Text with CSS declarations
@param base
The URL to be used as a base for loading external resources. Base URL may
be {@code null} if there are no external resources in the CSS string
referenced by relative URLs.
@return Parsed StyleSheet
@throws IOException
When exception during... | [
"Parses",
"text",
"into",
"a",
"StyleSheet"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/css/CSSFactory.java#L519-L522 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropPatchCommand.java | PropPatchCommand.removeList | public List<HierarchicalProperty> removeList(HierarchicalProperty request) {
"""
List of properties to remove.
@param request request body
@return list of properties to remove.
"""
HierarchicalProperty remove = request.getChild(new QName("DAV:", "remove"));
HierarchicalProperty prop = remove.... | java | public List<HierarchicalProperty> removeList(HierarchicalProperty request)
{
HierarchicalProperty remove = request.getChild(new QName("DAV:", "remove"));
HierarchicalProperty prop = remove.getChild(new QName("DAV:", "prop"));
List<HierarchicalProperty> removeList = prop.getChildren();
re... | [
"public",
"List",
"<",
"HierarchicalProperty",
">",
"removeList",
"(",
"HierarchicalProperty",
"request",
")",
"{",
"HierarchicalProperty",
"remove",
"=",
"request",
".",
"getChild",
"(",
"new",
"QName",
"(",
"\"DAV:\"",
",",
"\"remove\"",
")",
")",
";",
"Hierar... | List of properties to remove.
@param request request body
@return list of properties to remove. | [
"List",
"of",
"properties",
"to",
"remove",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PropPatchCommand.java#L148-L154 |
f2prateek/rx-preferences | rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java | RxSharedPreferences.getString | @CheckResult @NonNull
public Preference<String> getString(@NonNull String key) {
"""
Create a string preference for {@code key}. Default is {@code ""}.
"""
return getString(key, DEFAULT_STRING);
} | java | @CheckResult @NonNull
public Preference<String> getString(@NonNull String key) {
return getString(key, DEFAULT_STRING);
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"Preference",
"<",
"String",
">",
"getString",
"(",
"@",
"NonNull",
"String",
"key",
")",
"{",
"return",
"getString",
"(",
"key",
",",
"DEFAULT_STRING",
")",
";",
"}"
] | Create a string preference for {@code key}. Default is {@code ""}. | [
"Create",
"a",
"string",
"preference",
"for",
"{"
] | train | https://github.com/f2prateek/rx-preferences/blob/e338b4e6cee9c0c7b850be86ab41ed7b39a3637e/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java#L140-L143 |
strator-dev/greenpepper | greenpepper-open/extensions-external/ognl/src/main/java/com/greenpepper/extensions/ognl/OgnlExpression.java | OgnlExpression.onSingleExpression | public static OgnlExpression onSingleExpression( String expression, Object... targets ) {
"""
<p>onSingleExpression.</p>
@param expression a {@link java.lang.String} object.
@param targets a {@link java.lang.Object} object.
@return a {@link com.greenpepper.extensions.ognl.OgnlExpression} object.
"""
... | java | public static OgnlExpression onSingleExpression( String expression, Object... targets )
{
List<String> expressions = new ArrayList<String>();
expressions.add( expression );
return new OgnlExpression( expressions, targets );
} | [
"public",
"static",
"OgnlExpression",
"onSingleExpression",
"(",
"String",
"expression",
",",
"Object",
"...",
"targets",
")",
"{",
"List",
"<",
"String",
">",
"expressions",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"expressions",
".",
"ad... | <p>onSingleExpression.</p>
@param expression a {@link java.lang.String} object.
@param targets a {@link java.lang.Object} object.
@return a {@link com.greenpepper.extensions.ognl.OgnlExpression} object. | [
"<p",
">",
"onSingleExpression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/ognl/src/main/java/com/greenpepper/extensions/ognl/OgnlExpression.java#L66-L72 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/parser/AbstractModelParser.java | AbstractModelParser.validateModel | public void validateModel(DomDocument document) {
"""
Validate DOM document
@param document the DOM document to validate
"""
Schema schema = getSchema(document);
if (schema == null) {
return;
}
Validator validator = schema.newValidator();
try {
synchronized(document) {
... | java | public void validateModel(DomDocument document) {
Schema schema = getSchema(document);
if (schema == null) {
return;
}
Validator validator = schema.newValidator();
try {
synchronized(document) {
validator.validate(document.getDomSource());
}
} catch (IOException e) {... | [
"public",
"void",
"validateModel",
"(",
"DomDocument",
"document",
")",
"{",
"Schema",
"schema",
"=",
"getSchema",
"(",
"document",
")",
";",
"if",
"(",
"schema",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Validator",
"validator",
"=",
"schema",
".",
"... | Validate DOM document
@param document the DOM document to validate | [
"Validate",
"DOM",
"document"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/parser/AbstractModelParser.java#L121-L139 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java | DefaultApplicationObjectConfigurer.configureDescription | protected void configureDescription(DescriptionConfigurable configurable, String objectName) {
"""
Sets the description and caption of the given object. These values are
loaded from this instance's {@link MessageSource} using message codes in
the format
<pre>
<objectName>.description
</pre>
and
... | java | protected void configureDescription(DescriptionConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
String caption = loadMessage(objectName + "." + CAPTION_KEY);
if (StringUtils.hasText(caption)) {
configurable.setCaption(ca... | [
"protected",
"void",
"configureDescription",
"(",
"DescriptionConfigurable",
"configurable",
",",
"String",
"objectName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"configurable",
",",
"\"configurable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"objectName",
",",
... | Sets the description and caption of the given object. These values are
loaded from this instance's {@link MessageSource} using message codes in
the format
<pre>
<objectName>.description
</pre>
and
<pre>
<objectName>.caption
</pre>
respectively.
@param configurable The object to be configured. Must not ... | [
"Sets",
"the",
"description",
"and",
"caption",
"of",
"the",
"given",
"object",
".",
"These",
"values",
"are",
"loaded",
"from",
"this",
"instance",
"s",
"{",
"@link",
"MessageSource",
"}",
"using",
"message",
"codes",
"in",
"the",
"format"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L462-L478 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/Camera.java | Camera.createPerspective | public static Camera createPerspective(float fieldOfView, int windowWidth, int windowHeight, float near, float far) {
"""
Creates a new camera with a standard perspective projection matrix.
@param fieldOfView The field of view, in degrees
@param windowWidth The window width
@param windowHeight The widow heigh... | java | public static Camera createPerspective(float fieldOfView, int windowWidth, int windowHeight, float near, float far) {
return new Camera(Matrix4f.createPerspective(fieldOfView, (float) windowWidth / windowHeight, near, far));
} | [
"public",
"static",
"Camera",
"createPerspective",
"(",
"float",
"fieldOfView",
",",
"int",
"windowWidth",
",",
"int",
"windowHeight",
",",
"float",
"near",
",",
"float",
"far",
")",
"{",
"return",
"new",
"Camera",
"(",
"Matrix4f",
".",
"createPerspective",
"(... | Creates a new camera with a standard perspective projection matrix.
@param fieldOfView The field of view, in degrees
@param windowWidth The window width
@param windowHeight The widow height
@param near The near plane
@param far The far plane
@return The camera | [
"Creates",
"a",
"new",
"camera",
"with",
"a",
"standard",
"perspective",
"projection",
"matrix",
"."
] | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/Camera.java#L166-L168 |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/FileUtil.java | FileUtil.getRelativePath | public static String getRelativePath(File file, File base) throws IOException {
"""
Gets the <code>String</code> representing the path to a file relative to
a given directory.
@param file The <code>File</code> for which to obtain the relative path.
@param base The <code>File</code> representing the directory th... | java | public static String getRelativePath(File file, File base) throws IOException {
StringWriter path = new StringWriter();
while (!isAncestor(file, base)) {
path.append("../");
}
String fileName = file.getAbsolutePath();
String baseName = base.getAbsolutePath();
int prefixLength = baseName.... | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"file",
",",
"File",
"base",
")",
"throws",
"IOException",
"{",
"StringWriter",
"path",
"=",
"new",
"StringWriter",
"(",
")",
";",
"while",
"(",
"!",
"isAncestor",
"(",
"file",
",",
"base",
")",... | Gets the <code>String</code> representing the path to a file relative to
a given directory.
@param file The <code>File</code> for which to obtain the relative path.
@param base The <code>File</code> representing the directory that the
resulting path should be relative to.
@return The <code>String</code> representing th... | [
"Gets",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"representing",
"the",
"path",
"to",
"a",
"file",
"relative",
"to",
"a",
"given",
"directory",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/FileUtil.java#L317-L335 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java | CmsUpdateDBCmsUsers.writeUserInfo | protected void writeUserInfo(CmsSetupDb dbCon, String id, String key, Object value) {
"""
Writes one set of additional user info (key and its value) to the CMS_USERDATA table.<p>
@param dbCon the db connection interface
@param id the user id
@param key the data key
@param value the data value
"""
... | java | protected void writeUserInfo(CmsSetupDb dbCon, String id, String key, Object value) {
String query = readQuery(QUERY_INSERT_CMS_USERDATA);
try {
// Generate the list of parameters to add into the user info table
List<Object> params = new ArrayList<Object>();
params.... | [
"protected",
"void",
"writeUserInfo",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"id",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"String",
"query",
"=",
"readQuery",
"(",
"QUERY_INSERT_CMS_USERDATA",
")",
";",
"try",
"{",
"// Generate the list of p... | Writes one set of additional user info (key and its value) to the CMS_USERDATA table.<p>
@param dbCon the db connection interface
@param id the user id
@param key the data key
@param value the data value | [
"Writes",
"one",
"set",
"of",
"additional",
"user",
"info",
"(",
"key",
"and",
"its",
"value",
")",
"to",
"the",
"CMS_USERDATA",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBCmsUsers.java#L369-L385 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathContainsFunction.java | JmesPathContainsFunction.doesArrayContain | private static BooleanNode doesArrayContain(JsonNode subject, JsonNode search) {
"""
If subject is an array, this function returns true if
one of the elements in the array is equal to the provided search
value.
@param subject Array
@param search JmesPath expression
@return True array contains search;
Fals... | java | private static BooleanNode doesArrayContain(JsonNode subject, JsonNode search) {
Iterator<JsonNode> elements = subject.elements();
while (elements.hasNext()) {
if (elements.next().equals(search)) {
return BooleanNode.TRUE;
}
}
return BooleanNode.FA... | [
"private",
"static",
"BooleanNode",
"doesArrayContain",
"(",
"JsonNode",
"subject",
",",
"JsonNode",
"search",
")",
"{",
"Iterator",
"<",
"JsonNode",
">",
"elements",
"=",
"subject",
".",
"elements",
"(",
")",
";",
"while",
"(",
"elements",
".",
"hasNext",
"... | If subject is an array, this function returns true if
one of the elements in the array is equal to the provided search
value.
@param subject Array
@param search JmesPath expression
@return True array contains search;
False otherwise | [
"If",
"subject",
"is",
"an",
"array",
"this",
"function",
"returns",
"true",
"if",
"one",
"of",
"the",
"elements",
"in",
"the",
"array",
"is",
"equal",
"to",
"the",
"provided",
"search",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathContainsFunction.java#L80-L88 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java | HelpFormatter.printHelp | public void printHelp(String cmdLineSyntax, String header, Options options, String footer) {
"""
Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param header the banner to... | java | public void printHelp(String cmdLineSyntax, String header, Options options, String footer)
{
printHelp(cmdLineSyntax, header, options, footer, false);
} | [
"public",
"void",
"printHelp",
"(",
"String",
"cmdLineSyntax",
",",
"String",
"header",
",",
"Options",
"options",
",",
"String",
"footer",
")",
"{",
"printHelp",
"(",
"cmdLineSyntax",
",",
"header",
",",
"options",
",",
"footer",
",",
"false",
")",
";",
"... | Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param header the banner to display at the beginning of the help
@param options the Options instance
@param footer the banner to displ... | [
"Print",
"the",
"help",
"for",
"<code",
">",
"options<",
"/",
"code",
">",
"with",
"the",
"specified",
"command",
"line",
"syntax",
".",
"This",
"method",
"prints",
"help",
"information",
"to",
"System",
".",
"out",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L436-L439 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getUntilLastIncl | @Nullable
public static String getUntilLastIncl (@Nullable final String sStr, final char cSearch) {
"""
Get everything from the string up to and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if th... | java | @Nullable
public static String getUntilLastIncl (@Nullable final String sStr, final char cSearch)
{
return _getUntilLast (sStr, cSearch, true);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getUntilLastIncl",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"_getUntilLast",
"(",
"sStr",
",",
"cSearch",
",",
"true",
")",
";",
"}"
] | Get everything from the string up to and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the passed string does not contain the search
character. | [
"Get",
"everything",
"from",
"the",
"string",
"up",
"to",
"and",
"including",
"the",
"first",
"passed",
"char",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4845-L4849 |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/CircuitBreaker.java | CircuitBreaker.transitionTo | private void transitionTo(State newState, CheckedRunnable listener) {
"""
Transitions to the {@code newState} if not already in that state and calls any associated event listener.
"""
boolean transitioned = false;
synchronized (this) {
if (!getState().equals(newState)) {
switch (newState)... | java | private void transitionTo(State newState, CheckedRunnable listener) {
boolean transitioned = false;
synchronized (this) {
if (!getState().equals(newState)) {
switch (newState) {
case CLOSED:
state.set(new ClosedState(this));
break;
case OPEN:
... | [
"private",
"void",
"transitionTo",
"(",
"State",
"newState",
",",
"CheckedRunnable",
"listener",
")",
"{",
"boolean",
"transitioned",
"=",
"false",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"getState",
"(",
")",
".",
"equals",
"(",
"newSt... | Transitions to the {@code newState} if not already in that state and calls any associated event listener. | [
"Transitions",
"to",
"the",
"{"
] | train | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/CircuitBreaker.java#L380-L405 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java | DisksInner.beginGrantAccess | public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
"""
Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk... | java | public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
return beginGrantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().single().body();
} | [
"public",
"AccessUriInner",
"beginGrantAccess",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
",",
"GrantAccessData",
"grantAccessData",
")",
"{",
"return",
"beginGrantAccessWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
",",
"grantAc... | Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param grantAcc... | [
"Grants",
"access",
"to",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java#L1028-L1030 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java | OpenSSLAnalyzer.analyzeDependency | @Override
protected void analyzeDependency(Dependency dependency, Engine engine)
throws AnalysisException {
"""
Analyzes python packages and adds evidence to the dependency.
@param dependency the dependency being analyzed
@param engine the engine being used to perform the scan
@throws Analysis... | java | @Override
protected void analyzeDependency(Dependency dependency, Engine engine)
throws AnalysisException {
final File file = dependency.getActualFile();
final String parentName = file.getParentFile().getName();
boolean found = false;
final String contents = getFileConten... | [
"@",
"Override",
"protected",
"void",
"analyzeDependency",
"(",
"Dependency",
"dependency",
",",
"Engine",
"engine",
")",
"throws",
"AnalysisException",
"{",
"final",
"File",
"file",
"=",
"dependency",
".",
"getActualFile",
"(",
")",
";",
"final",
"String",
"par... | Analyzes python packages and adds evidence to the dependency.
@param dependency the dependency being analyzed
@param engine the engine being used to perform the scan
@throws AnalysisException thrown if there is an unrecoverable error
analyzing the dependency | [
"Analyzes",
"python",
"packages",
"and",
"adds",
"evidence",
"to",
"the",
"dependency",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java#L189-L222 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.modifyAckDeadline | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final List<String> ackIds) {
"""
Modify the ack deadline for a list of received messages.
@param project The Google Cloud project.
... | java | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final List<String> ackIds) {
return modifyAckDeadline(Subscription.canonicalSubscription(project, subscription), ackDeadlineSeconds, ackIds);
} | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"modifyAckDeadline",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"subscription",
",",
"final",
"int",
"ackDeadlineSeconds",
",",
"final",
"List",
"<",
"String",
">",
"ackIds",
")",
"{",
"return",
"modi... | Modify the ack deadline for a list of received messages.
@param project The Google Cloud project.
@param subscription The subscription of the received message to modify the ack deadline on.
@param ackDeadlineSeconds The new ack deadline.
@param ackIds List of message ID's to modify the ack... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"a",
"list",
"of",
"received",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L687-L690 |
martinkirch/jlcm | src/main/java/fr/liglab/jlcm/internals/Selector.java | Selector.select | final boolean select(int extension, ExplorationStep state) throws WrongFirstParentException {
"""
This one handles chained calls
@param extension
@param state
@return false if, at the given state, trying to extend the current
pattern with the given extension is useless
@throws WrongFirstParentException
... | java | final boolean select(int extension, ExplorationStep state) throws WrongFirstParentException {
if (this.allowExploration(extension, state)) {
return (this.next == null || this.next.select(extension, state));
} else {
PLCMCounters key = this.getCountersKey();
if (key != null) {
((PLCM.PLCMThread) Thread.... | [
"final",
"boolean",
"select",
"(",
"int",
"extension",
",",
"ExplorationStep",
"state",
")",
"throws",
"WrongFirstParentException",
"{",
"if",
"(",
"this",
".",
"allowExploration",
"(",
"extension",
",",
"state",
")",
")",
"{",
"return",
"(",
"this",
".",
"n... | This one handles chained calls
@param extension
@param state
@return false if, at the given state, trying to extend the current
pattern with the given extension is useless
@throws WrongFirstParentException | [
"This",
"one",
"handles",
"chained",
"calls"
] | train | https://github.com/martinkirch/jlcm/blob/6fbe53d3a1078028ac324c0f2382ec06925ffaa7/src/main/java/fr/liglab/jlcm/internals/Selector.java#L72-L82 |
shevek/jcpp | src/main/java/org/anarres/cpp/CppReader.java | CppReader.addMacro | public void addMacro(@Nonnull String name, @Nonnull String value)
throws LexerException {
"""
Defines the given name as a macro.
This is a convnience method.
"""
cpp.addMacro(name, value);
} | java | public void addMacro(@Nonnull String name, @Nonnull String value)
throws LexerException {
cpp.addMacro(name, value);
} | [
"public",
"void",
"addMacro",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nonnull",
"String",
"value",
")",
"throws",
"LexerException",
"{",
"cpp",
".",
"addMacro",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Defines the given name as a macro.
This is a convnience method. | [
"Defines",
"the",
"given",
"name",
"as",
"a",
"macro",
"."
] | train | https://github.com/shevek/jcpp/blob/71462c702097cabf8304202c740f780285fc35a8/src/main/java/org/anarres/cpp/CppReader.java#L83-L86 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/RestAction.java | RestAction.queue | @SuppressWarnings("unchecked")
public void queue(Consumer<? super T> success, Consumer<? super Throwable> failure) {
"""
Submits a Request for execution.
<p><b>This method is asynchronous</b>
@param success
The success callback that will be called at a convenient time
for the API. (can be null)
@para... | java | @SuppressWarnings("unchecked")
public void queue(Consumer<? super T> success, Consumer<? super Throwable> failure)
{
Route.CompiledRoute route = finalizeRoute();
Checks.notNull(route, "Route");
RequestBody data = finalizeData();
CaseInsensitiveMap<String, String> headers = finali... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"queue",
"(",
"Consumer",
"<",
"?",
"super",
"T",
">",
"success",
",",
"Consumer",
"<",
"?",
"super",
"Throwable",
">",
"failure",
")",
"{",
"Route",
".",
"CompiledRoute",
"route",
"=",
... | Submits a Request for execution.
<p><b>This method is asynchronous</b>
@param success
The success callback that will be called at a convenient time
for the API. (can be null)
@param failure
The failure callback that will be called if the Request
encounters an exception at its execution point. | [
"Submits",
"a",
"Request",
"for",
"execution",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/RestAction.java#L332-L345 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.answerCall | public void answerCall(
String connId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Answer the specified call.
@param connId The connection ID of the call.
@param reasons Information on causes for, and results of, actio... | java | public void answerCall(
String connId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
VoicecallsidanswerData answerData = new VoicecallsidanswerData();
answerData.setReasons(Util.toKVList(rea... | [
"public",
"void",
"answerCall",
"(",
"String",
"connId",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicecallsidanswerData",
"answerData",
"=",
"new",
"VoicecallsidanswerData",
... | Answer the specified call.
@param connId The connection ID of the call.
@param reasons Information on causes for, and results of, actions taken by the user of the current DN. For details about reasons, refer to the [*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System/Current/GenE... | [
"Answer",
"the",
"specified",
"call",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L533-L551 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.scrollListToLine | public void scrollListToLine(AbsListView absListView, int line) {
"""
Scroll the specified AbsListView to the specified line.
@param absListView the {@link AbsListView} to scroll
@param line the line to scroll to
"""
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+absLis... | java | public void scrollListToLine(AbsListView absListView, int line){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollListToLine("+absListView+", "+line+")");
}
scroller.scrollListToLine(absListView, line);
} | [
"public",
"void",
"scrollListToLine",
"(",
"AbsListView",
"absListView",
",",
"int",
"line",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"scrollListToLine(\"",
"+",
"absListVi... | Scroll the specified AbsListView to the specified line.
@param absListView the {@link AbsListView} to scroll
@param line the line to scroll to | [
"Scroll",
"the",
"specified",
"AbsListView",
"to",
"the",
"specified",
"line",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2186-L2192 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Base.java | Base.withDb | public static <T> T withDb(DataSource dataSource, Supplier<T> supplier) {
"""
Same as {@link DB#withDb(DataSource, Supplier)}, but with db name {@link DB#DEFAULT_NAME}.
"""
return new DB(DB.DEFAULT_NAME).withDb(dataSource, supplier);
} | java | public static <T> T withDb(DataSource dataSource, Supplier<T> supplier) {
return new DB(DB.DEFAULT_NAME).withDb(dataSource, supplier);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withDb",
"(",
"DataSource",
"dataSource",
",",
"Supplier",
"<",
"T",
">",
"supplier",
")",
"{",
"return",
"new",
"DB",
"(",
"DB",
".",
"DEFAULT_NAME",
")",
".",
"withDb",
"(",
"dataSource",
",",
"supplier",
")",... | Same as {@link DB#withDb(DataSource, Supplier)}, but with db name {@link DB#DEFAULT_NAME}. | [
"Same",
"as",
"{"
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Base.java#L398-L400 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/ShapiroWilk.java | ShapiroWilk.poly | private static double poly(double[] cc, int nord, double x) {
"""
Used internally by ShapiroWilkW().
@param cc
@param nord
@param x
@return
"""
/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2
Calculates the algebraic polynomial of order nord-1 with array of coefficients c... | java | private static double poly(double[] cc, int nord, double x) {
/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2
Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.
Zero order coefficient is cc(1) = cc[0] */
double ret_val = cc[0];
... | [
"private",
"static",
"double",
"poly",
"(",
"double",
"[",
"]",
"cc",
",",
"int",
"nord",
",",
"double",
"x",
")",
"{",
"/* Algorithm AS 181.2 Appl. Statist. (1982) Vol. 31, No. 2\n Calculates the algebraic polynomial of order nord-1 with array of coefficients cc.\n ... | Used internally by ShapiroWilkW().
@param cc
@param nord
@param x
@return | [
"Used",
"internally",
"by",
"ShapiroWilkW",
"()",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/ShapiroWilk.java#L66-L80 |
beanshell/beanshell | src/main/java/bsh/org/objectweb/asm/SymbolTable.java | SymbolTable.addType | int addType(final String value) {
"""
Adds a type in the type table of this symbol table. Does nothing if the type table already
contains a similar type.
@param value an internal class name.
@return the index of a new or already existing type Symbol with the given value.
"""
int hashCode = hash(Symbol... | java | int addType(final String value) {
int hashCode = hash(Symbol.TYPE_TAG, value);
Entry entry = get(hashCode);
while (entry != null) {
if (entry.tag == Symbol.TYPE_TAG && entry.hashCode == hashCode && entry.value.equals(value)) {
return entry.index;
}
entry = entry.next;
}
ret... | [
"int",
"addType",
"(",
"final",
"String",
"value",
")",
"{",
"int",
"hashCode",
"=",
"hash",
"(",
"Symbol",
".",
"TYPE_TAG",
",",
"value",
")",
";",
"Entry",
"entry",
"=",
"get",
"(",
"hashCode",
")",
";",
"while",
"(",
"entry",
"!=",
"null",
")",
... | Adds a type in the type table of this symbol table. Does nothing if the type table already
contains a similar type.
@param value an internal class name.
@return the index of a new or already existing type Symbol with the given value. | [
"Adds",
"a",
"type",
"in",
"the",
"type",
"table",
"of",
"this",
"symbol",
"table",
".",
"Does",
"nothing",
"if",
"the",
"type",
"table",
"already",
"contains",
"a",
"similar",
"type",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/SymbolTable.java#L992-L1002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.