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 |
|---|---|---|---|---|---|---|---|---|---|---|
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java | OAuth20Utils.checkClientSecret | public static boolean checkClientSecret(final OAuthRegisteredService registeredService, final String clientSecret) {
"""
Check the client secret.
@param registeredService the registered service
@param clientSecret the client secret
@return whether the secret is valid
"""
LOGGER.debug("Found: ... | java | public static boolean checkClientSecret(final OAuthRegisteredService registeredService, final String clientSecret) {
LOGGER.debug("Found: [{}] in secret check", registeredService);
if (StringUtils.isBlank(registeredService.getClientSecret())) {
LOGGER.debug("The client secret is not defined ... | [
"public",
"static",
"boolean",
"checkClientSecret",
"(",
"final",
"OAuthRegisteredService",
"registeredService",
",",
"final",
"String",
"clientSecret",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Found: [{}] in secret check\"",
",",
"registeredService",
")",
";",
"if",
... | Check the client secret.
@param registeredService the registered service
@param clientSecret the client secret
@return whether the secret is valid | [
"Check",
"the",
"client",
"secret",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java#L386-L397 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Point2D.java | Point2D.offset | double offset(/* const */Point2D pt1, /* const */Point2D pt2) {
"""
returns signed distance of point from infinite line represented by
pt_1...pt_2. The returned distance is positive if this point lies on the
right-hand side of the line, negative otherwise. If the two input points
are equal, the (positive) dista... | java | double offset(/* const */Point2D pt1, /* const */Point2D pt2) {
double newDistance = distance(pt1, pt2);
Point2D p = construct(x, y);
if (newDistance == 0.0)
return distance(p, pt1);
// get vectors relative to pt_1
Point2D p2 = new Point2D();
p2.setCoords(pt2);
p2.sub(pt1);
p.sub(pt1);
double cro... | [
"double",
"offset",
"(",
"/* const */",
"Point2D",
"pt1",
",",
"/* const */",
"Point2D",
"pt2",
")",
"{",
"double",
"newDistance",
"=",
"distance",
"(",
"pt1",
",",
"pt2",
")",
";",
"Point2D",
"p",
"=",
"construct",
"(",
"x",
",",
"y",
")",
";",
"if",
... | returns signed distance of point from infinite line represented by
pt_1...pt_2. The returned distance is positive if this point lies on the
right-hand side of the line, negative otherwise. If the two input points
are equal, the (positive) distance of this point to p_1 is returned. | [
"returns",
"signed",
"distance",
"of",
"point",
"from",
"infinite",
"line",
"represented",
"by",
"pt_1",
"...",
"pt_2",
".",
"The",
"returned",
"distance",
"is",
"positive",
"if",
"this",
"point",
"lies",
"on",
"the",
"right",
"-",
"hand",
"side",
"of",
"t... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Point2D.java#L421-L435 |
watson-developer-cloud/java-sdk | examples/src/main/java/com/ibm/watson/assistant/v1/tone_analyzer_integration/ToneDetection.java | ToneDetection.updateSocialTone | @SuppressWarnings("unchecked")
public static void updateSocialTone(Map<String, Object> user, List<ToneScore> socialTone, boolean maintainHistory) {
"""
updateSocialTone updates the user with the social tones interpreted based on the specified thresholds.
@param user a json object representing user information... | java | @SuppressWarnings("unchecked")
public static void updateSocialTone(Map<String, Object> user, List<ToneScore> socialTone, boolean maintainHistory) {
List<String> currentSocial = new ArrayList<String>();
Map<String, Object> currentSocialObject = new HashMap<String, Object>();
for (ToneScore tone : socialT... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"updateSocialTone",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"user",
",",
"List",
"<",
"ToneScore",
">",
"socialTone",
",",
"boolean",
"maintainHistory",
")",
"{",
"List",
... | updateSocialTone updates the user with the social tones interpreted based on the specified thresholds.
@param user a json object representing user information (tone) to be used in conversing with the Assistant
Service
@param socialTone a json object containing the social tones in the payload returned by the Tone Analy... | [
"updateSocialTone",
"updates",
"the",
"user",
"with",
"the",
"social",
"tones",
"interpreted",
"based",
"on",
"the",
"specified",
"thresholds",
"."
] | train | https://github.com/watson-developer-cloud/java-sdk/blob/c926117afd20e2002b69942537720ab733a914f3/examples/src/main/java/com/ibm/watson/assistant/v1/tone_analyzer_integration/ToneDetection.java#L241-L278 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_timeCondition_serviceName_condition_id_PUT | public void billingAccount_timeCondition_serviceName_condition_id_PUT(String billingAccount, String serviceName, Long id, OvhTimeCondition body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}
@param body [required] New obje... | java | public void billingAccount_timeCondition_serviceName_condition_id_PUT(String billingAccount, String serviceName, Long id, OvhTimeCondition body) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, i... | [
"public",
"void",
"billingAccount_timeCondition_serviceName_condition_id_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhTimeCondition",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{bill... | Alter this object properties
REST: PUT /telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5841-L5845 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/config/ConfigParams.java | ConfigParams.addSection | public void addSection(String section, ConfigParams sectionParams) {
"""
Adds parameters into this ConfigParams under specified section. Keys for the
new parameters are appended with section dot prefix.
@param section name of the section where add new parameters
@param sectionParams new parameters to be... | java | public void addSection(String section, ConfigParams sectionParams) {
if (section == null)
throw new NullPointerException("Section name cannot be null");
if (sectionParams != null) {
for (Map.Entry<String, String> entry : sectionParams.entrySet()) {
String key = entry.getKey();
if (key.length() > 0 &... | [
"public",
"void",
"addSection",
"(",
"String",
"section",
",",
"ConfigParams",
"sectionParams",
")",
"{",
"if",
"(",
"section",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Section name cannot be null\"",
")",
";",
"if",
"(",
"sectionParams",... | Adds parameters into this ConfigParams under specified section. Keys for the
new parameters are appended with section dot prefix.
@param section name of the section where add new parameters
@param sectionParams new parameters to be added. | [
"Adds",
"parameters",
"into",
"this",
"ConfigParams",
"under",
"specified",
"section",
".",
"Keys",
"for",
"the",
"new",
"parameters",
"are",
"appended",
"with",
"section",
"dot",
"prefix",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/config/ConfigParams.java#L130-L148 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.propertyAccess | public static Matcher propertyAccess(final String name) {
"""
Returns a Matcher that matches nodes representing a GETPROP access of
an object property.
@param name The name of the property to match. For non-static properties,
this must be the fully qualified name that includes the type of the
object. For insta... | java | public static Matcher propertyAccess(final String name) {
return new Matcher() {
@Override
public boolean matches(Node node, NodeMetadata metadata) {
if (node.isGetProp()) {
if (name == null) {
return true;
}
if (node.matchesQualifiedName(name)) {
... | [
"public",
"static",
"Matcher",
"propertyAccess",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"if",
"("... | Returns a Matcher that matches nodes representing a GETPROP access of
an object property.
@param name The name of the property to match. For non-static properties,
this must be the fully qualified name that includes the type of the
object. For instance: {@code ns.AppContext.prototype.root}
will match {@code appContext.... | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"nodes",
"representing",
"a",
"GETPROP",
"access",
"of",
"an",
"object",
"property",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L252-L269 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.fitRectInRect | public static Point fitRectInRect (Rectangle rect, Rectangle bounds) {
"""
Returns the most reasonable position for the specified rectangle to be placed at so as to
maximize its containment by the specified bounding rectangle while still placing it as near
its original coordinates as possible.
@param rect the... | java | public static Point fitRectInRect (Rectangle rect, Rectangle bounds)
{
// Guarantee that the right and bottom edges will be contained and do our best for the top
// and left edges.
return new Point(Math.min(bounds.x + bounds.width - rect.width,
Math.max(rect... | [
"public",
"static",
"Point",
"fitRectInRect",
"(",
"Rectangle",
"rect",
",",
"Rectangle",
"bounds",
")",
"{",
"// Guarantee that the right and bottom edges will be contained and do our best for the top",
"// and left edges.",
"return",
"new",
"Point",
"(",
"Math",
".",
"min",... | Returns the most reasonable position for the specified rectangle to be placed at so as to
maximize its containment by the specified bounding rectangle while still placing it as near
its original coordinates as possible.
@param rect the rectangle to be positioned.
@param bounds the containing rectangle. | [
"Returns",
"the",
"most",
"reasonable",
"position",
"for",
"the",
"specified",
"rectangle",
"to",
"be",
"placed",
"at",
"so",
"as",
"to",
"maximize",
"its",
"containment",
"by",
"the",
"specified",
"bounding",
"rectangle",
"while",
"still",
"placing",
"it",
"a... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L149-L157 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactionsAsProduct | public static IReactionSet getRelevantReactionsAsProduct(IReactionSet reactSet, IAtomContainer molecule) {
"""
Get all Reactions object containing a Molecule as a Product from a set of
Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a product
@return ... | java | public static IReactionSet getRelevantReactionsAsProduct(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getProdu... | [
"public",
"static",
"IReactionSet",
"getRelevantReactionsAsProduct",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
"."... | Get all Reactions object containing a Molecule as a Product from a set of
Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a product
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"as",
"a",
"Product",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L180-L187 |
fcrepo3/fcrepo | fcrepo-installer/src/main/java/org/fcrepo/utilities/install/InstallOptions.java | InstallOptions.getBooleanValue | public boolean getBooleanValue(String name, boolean defaultValue) {
"""
Get the value of the given option as a boolean, or the given default
value if unspecified. If specified, the value is assumed to be
<code>true</code> if given as "true", regardless of case. All other
values are assumed to be <code>false</co... | java | public boolean getBooleanValue(String name, boolean defaultValue) {
String value = getValue(name);
if (value == null) {
return defaultValue;
} else {
return value.equals("true");
}
} | [
"public",
"boolean",
"getBooleanValue",
"(",
"String",
"name",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getValue",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{... | Get the value of the given option as a boolean, or the given default
value if unspecified. If specified, the value is assumed to be
<code>true</code> if given as "true", regardless of case. All other
values are assumed to be <code>false</code>. | [
"Get",
"the",
"value",
"of",
"the",
"given",
"option",
"as",
"a",
"boolean",
"or",
"the",
"given",
"default",
"value",
"if",
"unspecified",
".",
"If",
"specified",
"the",
"value",
"is",
"assumed",
"to",
"be",
"<code",
">",
"true<",
"/",
"code",
">",
"i... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-installer/src/main/java/org/fcrepo/utilities/install/InstallOptions.java#L437-L446 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/robot/RobotExtensions.java | RobotExtensions.typeString | public static void typeString(final Robot robot, final String input)
throws NoSuchFieldException, IllegalAccessException {
"""
Type the given string with the given robot.
@param robot
the robot
@param input
the input
@throws NoSuchFieldException
the no such field exception
@throws IllegalAccessException... | java | public static void typeString(final Robot robot, final String input)
throws NoSuchFieldException, IllegalAccessException
{
if (input != null && !input.isEmpty())
{
for (final char character : input.toCharArray())
{
typeCharacter(robot, character);
}
}
} | [
"public",
"static",
"void",
"typeString",
"(",
"final",
"Robot",
"robot",
",",
"final",
"String",
"input",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"if",
"(",
"input",
"!=",
"null",
"&&",
"!",
"input",
".",
"isEmpty",
"(",
"... | Type the given string with the given robot.
@param robot
the robot
@param input
the input
@throws NoSuchFieldException
the no such field exception
@throws IllegalAccessException
the illegal access exception | [
"Type",
"the",
"given",
"string",
"with",
"the",
"given",
"robot",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/robot/RobotExtensions.java#L100-L110 |
census-instrumentation/opencensus-java | contrib/dropwizard5/src/main/java/io/opencensus/contrib/dropwizard5/DropWizardMetrics.java | DropWizardMetrics.collectHistogram | private Metric collectHistogram(MetricName dropwizardMetric, Histogram histogram) {
"""
Returns a {@code Metric} collected from {@link Histogram}.
@param dropwizardMetric the metric name.
@param histogram the histogram object to collect
@return a {@code Metric}.
"""
String metricName =
DropWiz... | java | private Metric collectHistogram(MetricName dropwizardMetric, Histogram histogram) {
String metricName =
DropWizardUtils.generateFullMetricName(dropwizardMetric.getKey(), "histogram");
String metricDescription =
DropWizardUtils.generateFullMetricDescription(dropwizardMetric.getKey(), histogram);
... | [
"private",
"Metric",
"collectHistogram",
"(",
"MetricName",
"dropwizardMetric",
",",
"Histogram",
"histogram",
")",
"{",
"String",
"metricName",
"=",
"DropWizardUtils",
".",
"generateFullMetricName",
"(",
"dropwizardMetric",
".",
"getKey",
"(",
")",
",",
"\"histogram\... | Returns a {@code Metric} collected from {@link Histogram}.
@param dropwizardMetric the metric name.
@param histogram the histogram object to collect
@return a {@code Metric}. | [
"Returns",
"a",
"{",
"@code",
"Metric",
"}",
"collected",
"from",
"{",
"@link",
"Histogram",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/dropwizard5/src/main/java/io/opencensus/contrib/dropwizard5/DropWizardMetrics.java#L197-L213 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.removePairs | public static <T> Transformer<T, T> removePairs(
final Func1<? super T, Boolean> isCandidateForFirst,
final Func2<? super T, ? super T, Boolean> remove) {
"""
Removes pairs non-recursively from a stream. Uses
{@code Transformers.stateMachine()} under the covers to ensure items are
emitted... | java | public static <T> Transformer<T, T> removePairs(
final Func1<? super T, Boolean> isCandidateForFirst,
final Func2<? super T, ? super T, Boolean> remove) {
return new Transformer<T, T>() {
@Override
public Observable<T> call(Observable<T> o) {
retu... | [
"public",
"static",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"T",
">",
"removePairs",
"(",
"final",
"Func1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"isCandidateForFirst",
",",
"final",
"Func2",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"T"... | Removes pairs non-recursively from a stream. Uses
{@code Transformers.stateMachine()} under the covers to ensure items are
emitted as soon as possible (if an item can't be in a pair then it is
emitted straight away).
@param isCandidateForFirst
returns true if item is potentially the first of a pair that
we want to rem... | [
"Removes",
"pairs",
"non",
"-",
"recursively",
"from",
"a",
"stream",
".",
"Uses",
"{",
"@code",
"Transformers",
".",
"stateMachine",
"()",
"}",
"under",
"the",
"covers",
"to",
"ensure",
"items",
"are",
"emitted",
"as",
"soon",
"as",
"possible",
"(",
"if",... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L958-L1007 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java | CRFClassifier.printFirstOrderProbs | public void printFirstOrderProbs(String filename, DocumentReaderAndWriter<IN> readerAndWriter) {
"""
Takes the file, reads it in, and prints out the likelihood of each possible
label at each point. This gives a simple way to examine the probability
distributions of the CRF. See <code>getCliqueTrees()</code> for ... | java | public void printFirstOrderProbs(String filename, DocumentReaderAndWriter<IN> readerAndWriter) {
// only for the OCR data does this matter
flags.ocrTrain = false;
ObjectBank<List<IN>> docs = makeObjectBankFromFile(filename, readerAndWriter);
printFirstOrderProbsDocuments(docs);
} | [
"public",
"void",
"printFirstOrderProbs",
"(",
"String",
"filename",
",",
"DocumentReaderAndWriter",
"<",
"IN",
">",
"readerAndWriter",
")",
"{",
"// only for the OCR data does this matter\r",
"flags",
".",
"ocrTrain",
"=",
"false",
";",
"ObjectBank",
"<",
"List",
"<"... | Takes the file, reads it in, and prints out the likelihood of each possible
label at each point. This gives a simple way to examine the probability
distributions of the CRF. See <code>getCliqueTrees()</code> for more.
@param filename
The path to the specified file | [
"Takes",
"the",
"file",
"reads",
"it",
"in",
"and",
"prints",
"out",
"the",
"likelihood",
"of",
"each",
"possible",
"label",
"at",
"each",
"point",
".",
"This",
"gives",
"a",
"simple",
"way",
"to",
"examine",
"the",
"probability",
"distributions",
"of",
"t... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java#L1393-L1399 |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java | DefaultTraceCollector.mergeProducer | protected void mergeProducer(Producer inner, Producer outer) {
"""
This method merges an inner Producer node information into its
containing Producer node, before removing the inner node.
@param inner
@param outer
"""
if (log.isLoggable(Level.FINEST)) {
log.finest("Merging Producer = "... | java | protected void mergeProducer(Producer inner, Producer outer) {
if (log.isLoggable(Level.FINEST)) {
log.finest("Merging Producer = " + inner + " into Producer = " + outer);
}
// NOTE: For now, assumption is that inner Producer is equivalent to the outer
// and results from in... | [
"protected",
"void",
"mergeProducer",
"(",
"Producer",
"inner",
",",
"Producer",
"outer",
")",
"{",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINEST",
")",
")",
"{",
"log",
".",
"finest",
"(",
"\"Merging Producer = \"",
"+",
"inner",
"+",
... | This method merges an inner Producer node information into its
containing Producer node, before removing the inner node.
@param inner
@param outer | [
"This",
"method",
"merges",
"an",
"inner",
"Producer",
"node",
"information",
"into",
"its",
"containing",
"Producer",
"node",
"before",
"removing",
"the",
"inner",
"node",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java#L571-L589 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java | TiledMap.getObjectImage | public String getObjectImage(int groupID, int objectID) {
"""
Retrieve the image source property for a given object
@param groupID
Index of a group
@param objectID
Index of an object
@return The image source reference or null if one isn't defined
"""
if (groupID >= 0 && groupID < objectGroups.size())... | java | public String getObjectImage(int groupID, int objectID) {
if (groupID >= 0 && groupID < objectGroups.size()) {
ObjectGroup grp = (ObjectGroup) objectGroups.get(groupID);
if (objectID >= 0 && objectID < grp.objects.size()) {
GroupObject object = (GroupObject) grp.objects.get(objectID);
if (object ... | [
"public",
"String",
"getObjectImage",
"(",
"int",
"groupID",
",",
"int",
"objectID",
")",
"{",
"if",
"(",
"groupID",
">=",
"0",
"&&",
"groupID",
"<",
"objectGroups",
".",
"size",
"(",
")",
")",
"{",
"ObjectGroup",
"grp",
"=",
"(",
"ObjectGroup",
")",
"... | Retrieve the image source property for a given object
@param groupID
Index of a group
@param objectID
Index of an object
@return The image source reference or null if one isn't defined | [
"Retrieve",
"the",
"image",
"source",
"property",
"for",
"a",
"given",
"object"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L926-L941 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/BrowserConfig.java | BrowserConfig.createDocumentSource | public DocumentSource createDocumentSource(URL base, String urlstring) {
"""
Creates a new instance of the {@link org.fit.cssbox.io.DocumentSource} class registered in the browser configuration.
@param base the base URL
@param urlstring the URL suffix
@return the document source.
"""
try
{
... | java | public DocumentSource createDocumentSource(URL base, String urlstring)
{
try
{
Constructor<? extends DocumentSource> constr = getDocumentSourceClass().getConstructor(URL.class, String.class);
return constr.newInstance(base, urlstring);
} catch (Exception e) {
... | [
"public",
"DocumentSource",
"createDocumentSource",
"(",
"URL",
"base",
",",
"String",
"urlstring",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
"extends",
"DocumentSource",
">",
"constr",
"=",
"getDocumentSourceClass",
"(",
")",
".",
"getConstructor",
"(",
"U... | Creates a new instance of the {@link org.fit.cssbox.io.DocumentSource} class registered in the browser configuration.
@param base the base URL
@param urlstring the URL suffix
@return the document source. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"{"
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/BrowserConfig.java#L298-L308 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.startFuture | public static <T> Observable<T> startFuture(Func0<? extends Future<? extends T>> functionAsync,
Scheduler scheduler) {
"""
Invokes the asynchronous function immediately, surfacing the result through an Observable and waits on
the specified Scheduler.
<p>
<img width="640" src="https://raw.github.com/wiki... | java | public static <T> Observable<T> startFuture(Func0<? extends Future<? extends T>> functionAsync,
Scheduler scheduler) {
return OperatorStartFuture.startFuture(functionAsync, scheduler);
} | [
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"startFuture",
"(",
"Func0",
"<",
"?",
"extends",
"Future",
"<",
"?",
"extends",
"T",
">",
">",
"functionAsync",
",",
"Scheduler",
"scheduler",
")",
"{",
"return",
"OperatorStartFuture",
".",
... | Invokes the asynchronous function immediately, surfacing the result through an Observable and waits on
the specified Scheduler.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startFuture.s.png" alt="">
@param <T> the result type
@param functionAsync the asynchronous function... | [
"Invokes",
"the",
"asynchronous",
"function",
"immediately",
"surfacing",
"the",
"result",
"through",
"an",
"Observable",
"and",
"waits",
"on",
"the",
"specified",
"Scheduler",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L1781-L1784 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/ObjectsApi.java | ObjectsApi.getDnsByDBIDs | public Results<Dn> getDnsByDBIDs(List<String> DBIDs) throws ProvisioningApiException {
"""
Get DNs by DBIDs.
Get DNs (directory numbers) or agent groups from Configuration Server with the specified DBIDs.
@param DBIDs List of DBIDs of Dns to be fetched. (required)
@return Results object which includes list of ... | java | public Results<Dn> getDnsByDBIDs(List<String> DBIDs) throws ProvisioningApiException {
return getDnsByDBIDs(null,null,null,null,null,null,null,DBIDs);
} | [
"public",
"Results",
"<",
"Dn",
">",
"getDnsByDBIDs",
"(",
"List",
"<",
"String",
">",
"DBIDs",
")",
"throws",
"ProvisioningApiException",
"{",
"return",
"getDnsByDBIDs",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
... | Get DNs by DBIDs.
Get DNs (directory numbers) or agent groups from Configuration Server with the specified DBIDs.
@param DBIDs List of DBIDs of Dns to be fetched. (required)
@return Results object which includes list of Dns with the specified DBIDs and total count.
@throws ProvisioningApiException if the call is unsuc... | [
"Get",
"DNs",
"by",
"DBIDs",
".",
"Get",
"DNs",
"(",
"directory",
"numbers",
")",
"or",
"agent",
"groups",
"from",
"Configuration",
"Server",
"with",
"the",
"specified",
"DBIDs",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/ObjectsApi.java#L156-L158 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilder.java | SpatialRuleLookupBuilder.buildIndex | public static SpatialRuleLookup buildIndex(JsonFeatureCollection jsonFeatureCollection, String jsonIdField, SpatialRuleFactory spatialRuleFactory) {
"""
Wrapper Method for {@link SpatialRuleLookupBuilder#buildIndex(JsonFeatureCollection, String, SpatialRuleFactory, double, BBox)}.
This method simply passes a worl... | java | public static SpatialRuleLookup buildIndex(JsonFeatureCollection jsonFeatureCollection, String jsonIdField, SpatialRuleFactory spatialRuleFactory) {
return buildIndex(jsonFeatureCollection, jsonIdField, spatialRuleFactory, .1, new BBox(-180, 180, -90, 90));
} | [
"public",
"static",
"SpatialRuleLookup",
"buildIndex",
"(",
"JsonFeatureCollection",
"jsonFeatureCollection",
",",
"String",
"jsonIdField",
",",
"SpatialRuleFactory",
"spatialRuleFactory",
")",
"{",
"return",
"buildIndex",
"(",
"jsonFeatureCollection",
",",
"jsonIdField",
"... | Wrapper Method for {@link SpatialRuleLookupBuilder#buildIndex(JsonFeatureCollection, String, SpatialRuleFactory, double, BBox)}.
This method simply passes a world-wide BBox, this won't limit the SpatialRuleLookup. | [
"Wrapper",
"Method",
"for",
"{"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/spatialrules/SpatialRuleLookupBuilder.java#L88-L90 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCommandLineRunner.java | AbstractCommandLineRunner.openExternExportsStream | @GwtIncompatible("Unnecessary")
private Writer openExternExportsStream(B options, String path) throws IOException {
"""
Returns a stream for outputting the generated externs file.
@param options The options to the Compiler.
@param path The path of the generated JS source file.
@return The stream or null if ... | java | @GwtIncompatible("Unnecessary")
private Writer openExternExportsStream(B options, String path) throws IOException {
if (options.externExportsPath == null) {
return null;
}
String exPath = options.externExportsPath;
if (!exPath.contains(File.separator)) {
File outputFile = new File(path);... | [
"@",
"GwtIncompatible",
"(",
"\"Unnecessary\"",
")",
"private",
"Writer",
"openExternExportsStream",
"(",
"B",
"options",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"options",
".",
"externExportsPath",
"==",
"null",
")",
"{",
"return",
... | Returns a stream for outputting the generated externs file.
@param options The options to the Compiler.
@param path The path of the generated JS source file.
@return The stream or null if no extern-ed exports are being generated. | [
"Returns",
"a",
"stream",
"for",
"outputting",
"the",
"generated",
"externs",
"file",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1656-L1670 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java | SeleniumDriverSetup.startDriverForWithProfile | public boolean startDriverForWithProfile(String browser, Map<String, Object> profile) throws Exception {
"""
Starts a local instance of the selenium driver for the specified browser
(using defaults to determine the correct class and configuration properties).
and injects it into SeleniumHelper, so other fixtures... | java | public boolean startDriverForWithProfile(String browser, Map<String, Object> profile) throws Exception {
if (OVERRIDE_ACTIVE) {
return true;
}
DriverFactory driverFactory = new ProjectDriverFactoryFactory().create(browser, profile);
WebDriver driver = setAndUseDriverFactory(... | [
"public",
"boolean",
"startDriverForWithProfile",
"(",
"String",
"browser",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"profile",
")",
"throws",
"Exception",
"{",
"if",
"(",
"OVERRIDE_ACTIVE",
")",
"{",
"return",
"true",
";",
"}",
"DriverFactory",
"driverF... | Starts a local instance of the selenium driver for the specified browser
(using defaults to determine the correct class and configuration properties).
and injects it into SeleniumHelper, so other fixtures can use it.
@param browser name of browser to connect to.
@param profile setting of the browser (for firefox, chrom... | [
"Starts",
"a",
"local",
"instance",
"of",
"the",
"selenium",
"driver",
"for",
"the",
"specified",
"browser",
"(",
"using",
"defaults",
"to",
"determine",
"the",
"correct",
"class",
"and",
"configuration",
"properties",
")",
".",
"and",
"injects",
"it",
"into",... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java#L90-L98 |
SahaginOrg/sahagin-java | src/main/java/org/sahagin/runlib/runresultsgen/HookMethodManager.java | HookMethodManager.afterMethodHook | public void afterMethodHook(String hookedClassQualifiedName, String hookedMethodSimpleName) {
"""
write runResult to YAML file if the method for the arguments is root method
"""
if (currentRunResult == null) {
return; // maybe called outside of the root method
}
TestMethod r... | java | public void afterMethodHook(String hookedClassQualifiedName, String hookedMethodSimpleName) {
if (currentRunResult == null) {
return; // maybe called outside of the root method
}
TestMethod rootMethod = currentRunResult.getRootMethod();
if (!rootMethod.getTestClassKey().equal... | [
"public",
"void",
"afterMethodHook",
"(",
"String",
"hookedClassQualifiedName",
",",
"String",
"hookedMethodSimpleName",
")",
"{",
"if",
"(",
"currentRunResult",
"==",
"null",
")",
"{",
"return",
";",
"// maybe called outside of the root method",
"}",
"TestMethod",
"roo... | write runResult to YAML file if the method for the arguments is root method | [
"write",
"runResult",
"to",
"YAML",
"file",
"if",
"the",
"method",
"for",
"the",
"arguments",
"is",
"root",
"method"
] | train | https://github.com/SahaginOrg/sahagin-java/blob/7ace428adebe3466ceb5826bc9681f8e3d52be68/src/main/java/org/sahagin/runlib/runresultsgen/HookMethodManager.java#L124-L154 |
brianwhu/xillium | base/src/main/java/org/xillium/base/text/Balanced.java | Balanced.indexOf | public static int indexOf(String text, int begin, int end, char target) {
"""
Returns the index within a string of the first occurrence of the specified character, similar to String.indexOf().
However, any occurrence of the specified character enclosed between balanced parentheses/brackets/braces is ignored.
@... | java | public static int indexOf(String text, int begin, int end, char target) {
return indexOf(text, begin, end, target, null);
} | [
"public",
"static",
"int",
"indexOf",
"(",
"String",
"text",
",",
"int",
"begin",
",",
"int",
"end",
",",
"char",
"target",
")",
"{",
"return",
"indexOf",
"(",
"text",
",",
"begin",
",",
"end",
",",
"target",
",",
"null",
")",
";",
"}"
] | Returns the index within a string of the first occurrence of the specified character, similar to String.indexOf().
However, any occurrence of the specified character enclosed between balanced parentheses/brackets/braces is ignored.
@param text a String
@param begin a begin offset
@param end an end offset
@param target... | [
"Returns",
"the",
"index",
"within",
"a",
"string",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"character",
"similar",
"to",
"String",
".",
"indexOf",
"()",
".",
"However",
"any",
"occurrence",
"of",
"the",
"specified",
"character",
"enclose... | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/text/Balanced.java#L82-L84 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.verifyValueBounds | public static void verifyValueBounds(String fieldName,
int value, int lowerBound, int upperBound) {
"""
Verify that input values are within specified bounds.
@param value the value to check
@param lowerBound the lower bound allowed for value
@param upperBound the up... | java | public static void verifyValueBounds(String fieldName,
int value, int lowerBound, int upperBound) {
if ((value < lowerBound) || (value > upperBound)) {
throw new IllegalFieldValueException
(fieldName, Integer.valueOf(value),
I... | [
"public",
"static",
"void",
"verifyValueBounds",
"(",
"String",
"fieldName",
",",
"int",
"value",
",",
"int",
"lowerBound",
",",
"int",
"upperBound",
")",
"{",
"if",
"(",
"(",
"value",
"<",
"lowerBound",
")",
"||",
"(",
"value",
">",
"upperBound",
")",
"... | Verify that input values are within specified bounds.
@param value the value to check
@param lowerBound the lower bound allowed for value
@param upperBound the upper bound allowed for value
@throws IllegalFieldValueException if value is not in the specified bounds | [
"Verify",
"that",
"input",
"values",
"are",
"within",
"specified",
"bounds",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L289-L296 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java | AbstractKMeansQualityMeasure.logLikelihood | @Reference(authors = "D. Pelleg, A. Moore", //
title = "X-means: Extending K-means with Efficient Estimation on the Number of Clusters", //
booktitle = "Proc. 17th Int. Conf. on Machine Learning (ICML 2000)", //
url = "http://www.pelleg.org/shared/hp/download/xmeans.ps", //
bibkey = "DBLP:conf/i... | java | @Reference(authors = "D. Pelleg, A. Moore", //
title = "X-means: Extending K-means with Efficient Estimation on the Number of Clusters", //
booktitle = "Proc. 17th Int. Conf. on Machine Learning (ICML 2000)", //
url = "http://www.pelleg.org/shared/hp/download/xmeans.ps", //
bibkey = "DBLP:conf/i... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"D. Pelleg, A. Moore\"",
",",
"//",
"title",
"=",
"\"X-means: Extending K-means with Efficient Estimation on the Number of Clusters\"",
",",
"//",
"booktitle",
"=",
"\"Proc. 17th Int. Conf. on Machine Learning (ICML 2000)\"",
",",
"//",
"u... | Computes log likelihood of an entire clustering.
<p>
Version as used in the X-means publication.
@param relation Data relation
@param clustering Clustering
@param distanceFunction Distance function
@param <V> Vector type
@return Log Likelihood. | [
"Computes",
"log",
"likelihood",
"of",
"an",
"entire",
"clustering",
".",
"<p",
">",
"Version",
"as",
"used",
"in",
"the",
"X",
"-",
"means",
"publication",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java#L124-L172 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsHistory.java | CmsHistory.loadDialog | public static void loadDialog(final CmsUUID structureId, final I_CmsHistoryActionHandler handler) {
"""
Loads the data necessary for the history dialog and then displays that dialog.<p>
@param structureId the structure id for which the history should be loaded.<p>
@param handler the history action handler to u... | java | public static void loadDialog(final CmsUUID structureId, final I_CmsHistoryActionHandler handler) {
CmsRpcAction<CmsHistoryResourceCollection> action = new CmsRpcAction<CmsHistoryResourceCollection>() {
@Override
public void execute() {
start(200, true);
... | [
"public",
"static",
"void",
"loadDialog",
"(",
"final",
"CmsUUID",
"structureId",
",",
"final",
"I_CmsHistoryActionHandler",
"handler",
")",
"{",
"CmsRpcAction",
"<",
"CmsHistoryResourceCollection",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"CmsHistoryResourceColl... | Loads the data necessary for the history dialog and then displays that dialog.<p>
@param structureId the structure id for which the history should be loaded.<p>
@param handler the history action handler to use | [
"Loads",
"the",
"data",
"necessary",
"for",
"the",
"history",
"dialog",
"and",
"then",
"displays",
"that",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsHistory.java#L71-L105 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java | HttpUtils.getCookie | public static Cookie getCookie(String name, HttpServletRequest request) {
"""
Returns the cookie with the given name for the given request
@param name the name of the cookie
@param request the request where to extract the request from
@return the cookie object, or null if not found
"""
Co... | java | public static Cookie getCookie(String name, HttpServletRequest request) {
Cookie[] cookies = request.getCookies();
if (ArrayUtils.isNotEmpty(cookies)) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(name)) {
return cookie;
}
... | [
"public",
"static",
"Cookie",
"getCookie",
"(",
"String",
"name",
",",
"HttpServletRequest",
"request",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"request",
".",
"getCookies",
"(",
")",
";",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"cookies",
"... | Returns the cookie with the given name for the given request
@param name the name of the cookie
@param request the request where to extract the request from
@return the cookie object, or null if not found | [
"Returns",
"the",
"cookie",
"with",
"the",
"given",
"name",
"for",
"the",
"given",
"request"
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java#L148-L159 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.removeColumn | public Matrix removeColumn(int j) {
"""
Removes one column from matrix.
@param j the column index
@return matrix without column.
"""
if (j >= columns || j < 0) {
throw new IndexOutOfBoundsException("Illegal column number, must be 0.." + (columns - 1));
}
Matrix result = b... | java | public Matrix removeColumn(int j) {
if (j >= columns || j < 0) {
throw new IndexOutOfBoundsException("Illegal column number, must be 0.." + (columns - 1));
}
Matrix result = blankOfShape(rows, columns - 1);
for (int jj = 0; jj < j; jj++) {
result.setColumn(jj, g... | [
"public",
"Matrix",
"removeColumn",
"(",
"int",
"j",
")",
"{",
"if",
"(",
"j",
">=",
"columns",
"||",
"j",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Illegal column number, must be 0..\"",
"+",
"(",
"columns",
"-",
"1",
")",
"... | Removes one column from matrix.
@param j the column index
@return matrix without column. | [
"Removes",
"one",
"column",
"from",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1128-L1144 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.asList | public static List<Integer> asList(final MutableIntTuple t) {
"""
Returns a <i>view</i> on the given tuple as a list that does not
allow <i>structural</i> modifications. Changes in the list will
write through to the given tuple. Changes in the backing tuple
will be visible in the returned list. The list will no... | java | public static List<Integer> asList(final MutableIntTuple t)
{
if (t == null)
{
throw new NullPointerException("The tuple may not be null");
}
return new AbstractList<Integer>()
{
@Override
public Integer get(int index)
... | [
"public",
"static",
"List",
"<",
"Integer",
">",
"asList",
"(",
"final",
"MutableIntTuple",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The tuple may not be null\"",
")",
";",
"}",
"return",
"new",
... | Returns a <i>view</i> on the given tuple as a list that does not
allow <i>structural</i> modifications. Changes in the list will
write through to the given tuple. Changes in the backing tuple
will be visible in the returned list. The list will not permit
<code>null</code> elements.
@param t The tuple
@return The list
... | [
"Returns",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"given",
"tuple",
"as",
"a",
"list",
"that",
"does",
"not",
"allow",
"<i",
">",
"structural<",
"/",
"i",
">",
"modifications",
".",
"Changes",
"in",
"the",
"list",
"will",
"write",
"thro... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L315-L343 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java | TiledMap.getTileId | public int getTileId(int x, int y, int layerIndex) {
"""
Get the global ID of a tile at specified location in the map
@param x
The x location of the tile
@param y
The y location of the tile
@param layerIndex
The index of the layer to retireve the tile from
@return The global ID of the tile
"""
Laye... | java | public int getTileId(int x, int y, int layerIndex) {
Layer layer = (Layer) layers.get(layerIndex);
return layer.getTileID(x, y);
} | [
"public",
"int",
"getTileId",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"layerIndex",
")",
"{",
"Layer",
"layer",
"=",
"(",
"Layer",
")",
"layers",
".",
"get",
"(",
"layerIndex",
")",
";",
"return",
"layer",
".",
"getTileID",
"(",
"x",
",",
"y"... | Get the global ID of a tile at specified location in the map
@param x
The x location of the tile
@param y
The y location of the tile
@param layerIndex
The index of the layer to retireve the tile from
@return The global ID of the tile | [
"Get",
"the",
"global",
"ID",
"of",
"a",
"tile",
"at",
"specified",
"location",
"in",
"the",
"map"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L259-L262 |
anotheria/moskito | moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java | JSTalkBackFilter.getValueOrDefault | private String getValueOrDefault(HttpServletRequest req, String paramName, String defaultValue) {
"""
Returns parameter value from request if exists, otherwise - default value.
@param req {@link HttpServletRequest}
@param paramName name of the parameter
@param defaultValue parameter default value
... | java | private String getValueOrDefault(HttpServletRequest req, String paramName, String defaultValue) {
final String value = req.getParameter(paramName);
return StringUtils.isEmpty(value) ? defaultValue : value;
} | [
"private",
"String",
"getValueOrDefault",
"(",
"HttpServletRequest",
"req",
",",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"req",
".",
"getParameter",
"(",
"paramName",
")",
";",
"return",
"StringUtils",
"."... | Returns parameter value from request if exists, otherwise - default value.
@param req {@link HttpServletRequest}
@param paramName name of the parameter
@param defaultValue parameter default value
@return request parameter value | [
"Returns",
"parameter",
"value",
"from",
"request",
"if",
"exists",
"otherwise",
"-",
"default",
"value",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-web/src/main/java/net/anotheria/moskito/web/filters/JSTalkBackFilter.java#L139-L142 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsCologneEqual | public boolean hasSlotIsCologneEqual(final String slotName, final String value) {
"""
Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Cologne phonetic algorithm
is optimized for German language and in this case is used to match s... | java | public boolean hasSlotIsCologneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new ColognePhonetic().isEncodeEqual(slotValue, value);
} | [
"public",
"boolean",
"hasSlotIsCologneEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"hasSlotNotBlank",
"(",
"slotName",
")",
"&&",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Cologne phonetic algorithm
is optimized for German language and in this case is used to match slot value with
value given to this method.
@param slotName name of the slot to look after
@pa... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"Cologne",
"phonetic",
"algorithm",
"is",
... | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L153-L157 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeURL | @Pure
public static URL getAttributeURL(Node document, boolean caseSensitive, String... path) {
"""
Replies the URL that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@par... | java | @Pure
public static URL getAttributeURL(Node document, boolean caseSensitive, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getAttributeURLWithDefault(document, caseSensitive, null, path);
} | [
"@",
"Pure",
"public",
"static",
"URL",
"getAttributeURL",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
";... | Replies the URL that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param path is the list of and e... | [
"Replies",
"the",
"URL",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L962-L966 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java | ST_DWithin.isWithinDistance | public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
"""
Returns true if the geometries are within the specified distance of one another.
@param geomA Geometry A
@param geomB Geometry B
@param distance Distance
@return True if if the geometries are within the specified di... | java | public static Boolean isWithinDistance(Geometry geomA, Geometry geomB, Double distance) {
if(geomA == null||geomB == null){
return null;
}
return geomA.isWithinDistance(geomB, distance);
} | [
"public",
"static",
"Boolean",
"isWithinDistance",
"(",
"Geometry",
"geomA",
",",
"Geometry",
"geomB",
",",
"Double",
"distance",
")",
"{",
"if",
"(",
"geomA",
"==",
"null",
"||",
"geomB",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"ge... | Returns true if the geometries are within the specified distance of one another.
@param geomA Geometry A
@param geomB Geometry B
@param distance Distance
@return True if if the geometries are within the specified distance of one another | [
"Returns",
"true",
"if",
"the",
"geometries",
"are",
"within",
"the",
"specified",
"distance",
"of",
"one",
"another",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_DWithin.java#L52-L57 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java | DateCalculator.getXNextWeek | public static String getXNextWeek(String date, Integer x, Language language) {
"""
get the x-next week of date
@param date current date
@param x amount of weeks to go forward
@return new week
"""
NormalizationManager nm = NormalizationManager.getInstance(language, false);
String date_no_W = date.replace... | java | public static String getXNextWeek(String date, Integer x, Language language) {
NormalizationManager nm = NormalizationManager.getInstance(language, false);
String date_no_W = date.replace("W", "");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-w");
String newDate = "";
Calendar c = Calendar.getInsta... | [
"public",
"static",
"String",
"getXNextWeek",
"(",
"String",
"date",
",",
"Integer",
"x",
",",
"Language",
"language",
")",
"{",
"NormalizationManager",
"nm",
"=",
"NormalizationManager",
".",
"getInstance",
"(",
"language",
",",
"false",
")",
";",
"String",
"... | get the x-next week of date
@param date current date
@param x amount of weeks to go forward
@return new week | [
"get",
"the",
"x",
"-",
"next",
"week",
"of",
"date"
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java#L213-L229 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<BigInteger[],BigInteger> onArrayFor(final BigInteger... elements) {
"""
<p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining
"""... | java | public static <T> Level0ArrayOperator<BigInteger[],BigInteger> onArrayFor(final BigInteger... elements) {
return onArrayOf(Types.BIG_INTEGER, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"BigInteger",
"[",
"]",
",",
"BigInteger",
">",
"onArrayFor",
"(",
"final",
"BigInteger",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"BIG_INTEGER",
",",
"VarArgsUtil",
... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L997-L999 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.telephony_billingAccount_portability_POST | public OvhOrder telephony_billingAccount_portability_POST(String billingAccount, String building, String callNumber, String city, String contactName, String contactNumber, OvhCountriesAvailable country, Date desireDate, Boolean displayUniversalDirectory, String door, Boolean executeAsSoonAsPossible, Boolean fiabilisati... | java | public OvhOrder telephony_billingAccount_portability_POST(String billingAccount, String building, String callNumber, String city, String contactName, String contactNumber, OvhCountriesAvailable country, Date desireDate, Boolean displayUniversalDirectory, String door, Boolean executeAsSoonAsPossible, Boolean fiabilisati... | [
"public",
"OvhOrder",
"telephony_billingAccount_portability_POST",
"(",
"String",
"billingAccount",
",",
"String",
"building",
",",
"String",
"callNumber",
",",
"String",
"city",
",",
"String",
"contactName",
",",
"String",
"contactNumber",
",",
"OvhCountriesAvailable",
... | Create order
REST: POST /order/telephony/{billingAccount}/portability
@param desireDate [required] The date you want for portability execution. Overridden if flag executeAsSoonAsPossible is set
@param type [required] The type of number : landline or special
@param callNumber [required] The number you want to port
@par... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L6526-L6561 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java | QueryDataUtils.exportQueryCommentsAsCsv | public static byte[] exportQueryCommentsAsCsv(Locale locale, ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, Query query, PanelStamp stamp) throws IOException {
"""
Export query comments into CSV byte array
@param locale locale
@param replierExportStrategy replies export strategy
@param... | java | public static byte[] exportQueryCommentsAsCsv(Locale locale, ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, Query query, PanelStamp stamp) throws IOException {
QueryPageDAO queryPageDAO = new QueryPageDAO();
List<QueryPage> queryPages = queryPageDAO.listByQuery(query);
Collectio... | [
"public",
"static",
"byte",
"[",
"]",
"exportQueryCommentsAsCsv",
"(",
"Locale",
"locale",
",",
"ReplierExportStrategy",
"replierExportStrategy",
",",
"List",
"<",
"QueryReply",
">",
"replies",
",",
"Query",
"query",
",",
"PanelStamp",
"stamp",
")",
"throws",
"IOE... | Export query comments into CSV byte array
@param locale locale
@param replierExportStrategy replies export strategy
@param replies replies to be exported
@param query query
@param stamp stamp
@return query comments in CSV byte array
@throws IOException throws IOException when CSV writing fails | [
"Export",
"query",
"comments",
"into",
"CSV",
"byte",
"array"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L121-L148 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java | AsyncButOrdered.performAsyncButOrdered | public boolean performAsyncButOrdered(K key, Runnable runnable) {
"""
Invoke the given {@link Runnable} asynchronous but ordered in respect to the given key.
@param key the key deriving the order
@param runnable the {@link Runnable} to run
@return true if a new thread was created
"""
Queue<Runnabl... | java | public boolean performAsyncButOrdered(K key, Runnable runnable) {
Queue<Runnable> keyQueue;
synchronized (pendingRunnables) {
keyQueue = pendingRunnables.get(key);
if (keyQueue == null) {
keyQueue = new ConcurrentLinkedQueue<>();
pendingRunnables.p... | [
"public",
"boolean",
"performAsyncButOrdered",
"(",
"K",
"key",
",",
"Runnable",
"runnable",
")",
"{",
"Queue",
"<",
"Runnable",
">",
"keyQueue",
";",
"synchronized",
"(",
"pendingRunnables",
")",
"{",
"keyQueue",
"=",
"pendingRunnables",
".",
"get",
"(",
"key... | Invoke the given {@link Runnable} asynchronous but ordered in respect to the given key.
@param key the key deriving the order
@param runnable the {@link Runnable} to run
@return true if a new thread was created | [
"Invoke",
"the",
"given",
"{",
"@link",
"Runnable",
"}",
"asynchronous",
"but",
"ordered",
"in",
"respect",
"to",
"the",
"given",
"key",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java#L75-L108 |
Inbot/inbot-utils | src/main/java/io/inbot/utils/PasswordHash.java | PasswordHash.slowEquals | private static boolean slowEquals(byte[] a, byte[] b) {
"""
Compares two byte arrays in length-constant time. This comparison method is used so that password hashes cannot
be extracted from an on-line system using a timing attack and then attacked off-line.
@param a
the first byte array
@param b
the second ... | java | private static boolean slowEquals(byte[] a, byte[] b) {
int diff = a.length ^ b.length;
for(int i = 0; i < a.length && i < b.length; i++) {
diff |= a[i] ^ b[i];
}
return diff == 0;
} | [
"private",
"static",
"boolean",
"slowEquals",
"(",
"byte",
"[",
"]",
"a",
",",
"byte",
"[",
"]",
"b",
")",
"{",
"int",
"diff",
"=",
"a",
".",
"length",
"^",
"b",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
... | Compares two byte arrays in length-constant time. This comparison method is used so that password hashes cannot
be extracted from an on-line system using a timing attack and then attacked off-line.
@param a
the first byte array
@param b
the second byte array
@return true if both byte arrays are the same, false if not | [
"Compares",
"two",
"byte",
"arrays",
"in",
"length",
"-",
"constant",
"time",
".",
"This",
"comparison",
"method",
"is",
"used",
"so",
"that",
"password",
"hashes",
"cannot",
"be",
"extracted",
"from",
"an",
"on",
"-",
"line",
"system",
"using",
"a",
"timi... | train | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PasswordHash.java#L140-L146 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static GeometryCollection convert(GeometryCollection gc, int dimension) {
"""
Force the dimension of the GeometryCollection and update correctly the coordinate
dimension
@param gc
@param dimension
@return
"""
int nb = gc.getNumGeometries();
final Geometry[] geometries = new Geometry[... | java | public static GeometryCollection convert(GeometryCollection gc, int dimension) {
int nb = gc.getNumGeometries();
final Geometry[] geometries = new Geometry[nb];
for (int i = 0; i < nb; i++) {
geometries[i]=force(gc.getGeometryN(i),dimension);
}
ret... | [
"public",
"static",
"GeometryCollection",
"convert",
"(",
"GeometryCollection",
"gc",
",",
"int",
"dimension",
")",
"{",
"int",
"nb",
"=",
"gc",
".",
"getNumGeometries",
"(",
")",
";",
"final",
"Geometry",
"[",
"]",
"geometries",
"=",
"new",
"Geometry",
"[",... | Force the dimension of the GeometryCollection and update correctly the coordinate
dimension
@param gc
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"GeometryCollection",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L78-L85 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.keyStore | public static KeyStore keyStore(AbstractConfig config, String key) {
"""
Method will create a KeyStore based on the KeyStore type specified in the config.
@param config Config to read from.
@param key Key to read from
@return KeyStore based on the type specified in the config.
"""
final String keyS... | java | public static KeyStore keyStore(AbstractConfig config, String key) {
final String keyStoreType = config.getString(key);
try {
return KeyStore.getInstance(keyStoreType);
} catch (KeyStoreException e) {
ConfigException exception = new ConfigException(
key,
keyStoreType,
... | [
"public",
"static",
"KeyStore",
"keyStore",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"final",
"String",
"keyStoreType",
"=",
"config",
".",
"getString",
"(",
"key",
")",
";",
"try",
"{",
"return",
"KeyStore",
".",
"getInstance",
"(",
... | Method will create a KeyStore based on the KeyStore type specified in the config.
@param config Config to read from.
@param key Key to read from
@return KeyStore based on the type specified in the config. | [
"Method",
"will",
"create",
"a",
"KeyStore",
"based",
"on",
"the",
"KeyStore",
"type",
"specified",
"in",
"the",
"config",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L377-L390 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/http/Authenticator.java | Authenticator.isAuthorizedForBucket | public boolean isAuthorizedForBucket(AuthContext ctx, Bucket bucket) {
"""
Determine if the given credentials allow access to the bucket
@param ctx The credentials
@param bucket The bucket to check against
@return true if the credentials match the bucket's credentials, or if the bucket is not password protected... | java | public boolean isAuthorizedForBucket(AuthContext ctx, Bucket bucket) {
if (ctx.getUsername().equals(adminName)) {
return ctx.getPassword().equals(adminPass);
}
if (bucket.getName().equals(ctx.getUsername())) {
return bucket.getPassword().equals(ctx.getPassword());
... | [
"public",
"boolean",
"isAuthorizedForBucket",
"(",
"AuthContext",
"ctx",
",",
"Bucket",
"bucket",
")",
"{",
"if",
"(",
"ctx",
".",
"getUsername",
"(",
")",
".",
"equals",
"(",
"adminName",
")",
")",
"{",
"return",
"ctx",
".",
"getPassword",
"(",
")",
"."... | Determine if the given credentials allow access to the bucket
@param ctx The credentials
@param bucket The bucket to check against
@return true if the credentials match the bucket's credentials, or if the bucket is not password protected, or if
the credentials match the administrative credentials | [
"Determine",
"if",
"the",
"given",
"credentials",
"allow",
"access",
"to",
"the",
"bucket"
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/http/Authenticator.java#L48-L58 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java | YokeRequest.getHeader | public String getHeader(@NotNull final String name, String defaultValue) {
"""
Allow getting headers in a generified way and return defaultValue if the key does not exist.
@param name The key to get
@param defaultValue value returned when the key does not exist
@return {String} The found object
"""
... | java | public String getHeader(@NotNull final String name, String defaultValue) {
if (headers().contains(name)) {
return getHeader(name);
} else {
return defaultValue;
}
} | [
"public",
"String",
"getHeader",
"(",
"@",
"NotNull",
"final",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"headers",
"(",
")",
".",
"contains",
"(",
"name",
")",
")",
"{",
"return",
"getHeader",
"(",
"name",
")",
";",
"}",
... | Allow getting headers in a generified way and return defaultValue if the key does not exist.
@param name The key to get
@param defaultValue value returned when the key does not exist
@return {String} The found object | [
"Allow",
"getting",
"headers",
"in",
"a",
"generified",
"way",
"and",
"return",
"defaultValue",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java#L176-L182 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/V1InstanceGetter.java | V1InstanceGetter.byID | public <T extends Entity> T byID(Class<T> clazz, AssetID id) {
"""
Returns an Entity of Type T with the given ID or null if the ID is
invalid.
@param <T> Entity Type to retrieve.
@param clazz - T Class.
@param id ID of the Entity to retrieve.
@return an instance of an Entity of Type T or null if ID is ... | java | public <T extends Entity> T byID(Class<T> clazz, AssetID id) {
return instance.getWrapperManager().create(clazz, id, true);
} | [
"public",
"<",
"T",
"extends",
"Entity",
">",
"T",
"byID",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"AssetID",
"id",
")",
"{",
"return",
"instance",
".",
"getWrapperManager",
"(",
")",
".",
"create",
"(",
"clazz",
",",
"id",
",",
"true",
")",
";"... | Returns an Entity of Type T with the given ID or null if the ID is
invalid.
@param <T> Entity Type to retrieve.
@param clazz - T Class.
@param id ID of the Entity to retrieve.
@return an instance of an Entity of Type T or null if ID is invalid. | [
"Returns",
"an",
"Entity",
"of",
"Type",
"T",
"with",
"the",
"given",
"ID",
"or",
"null",
"if",
"the",
"ID",
"is",
"invalid",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceGetter.java#L983-L985 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java | ChannelUpgradeHandler.addProtocol | public synchronized void addProtocol(String productString, ChannelListener<? super StreamConnection> openListener, final HttpUpgradeHandshake handshake) {
"""
Add a protocol to this handler.
@param productString the product string to match
@param openListener the open listener to call
@param handshake a ... | java | public synchronized void addProtocol(String productString, ChannelListener<? super StreamConnection> openListener, final HttpUpgradeHandshake handshake) {
addProtocol(productString, null, openListener, handshake);
} | [
"public",
"synchronized",
"void",
"addProtocol",
"(",
"String",
"productString",
",",
"ChannelListener",
"<",
"?",
"super",
"StreamConnection",
">",
"openListener",
",",
"final",
"HttpUpgradeHandshake",
"handshake",
")",
"{",
"addProtocol",
"(",
"productString",
",",
... | Add a protocol to this handler.
@param productString the product string to match
@param openListener the open listener to call
@param handshake a handshake implementation that can be used to verify the client request and modify the response | [
"Add",
"a",
"protocol",
"to",
"this",
"handler",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java#L53-L55 |
wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.buildJsonSchemaRefModel | private String buildJsonSchemaRefModel(String jsonSchemaRef, Class<?> modelClass) {
"""
If a json schema ref is given, this is returned unchanged.
Otherwise: Scans all project's dependencies for one with manifest with Caravan-HalDocs-DomainPath bundle header.
If the dependencies JAR files contains a matching JSO... | java | private String buildJsonSchemaRefModel(String jsonSchemaRef, Class<?> modelClass) {
if (StringUtils.isNotEmpty(jsonSchemaRef)) {
return jsonSchemaRef;
}
if (modelClass != void.class) {
return project.getDependencyArtifacts().stream()
.filter(artifact -> StringUtils.equals("jar", artifa... | [
"private",
"String",
"buildJsonSchemaRefModel",
"(",
"String",
"jsonSchemaRef",
",",
"Class",
"<",
"?",
">",
"modelClass",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"jsonSchemaRef",
")",
")",
"{",
"return",
"jsonSchemaRef",
";",
"}",
"if",
... | If a json schema ref is given, this is returned unchanged.
Otherwise: Scans all project's dependencies for one with manifest with Caravan-HalDocs-DomainPath bundle header.
If the dependencies JAR files contains a matching JSON schema file generated by this plugin, build a
URL to reference this schema.
@param modelClass... | [
"If",
"a",
"json",
"schema",
"ref",
"is",
"given",
"this",
"is",
"returned",
"unchanged",
".",
"Otherwise",
":",
"Scans",
"all",
"project",
"s",
"dependencies",
"for",
"one",
"with",
"manifest",
"with",
"Caravan",
"-",
"HalDocs",
"-",
"DomainPath",
"bundle",... | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L245-L258 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/record/RecordFile.java | RecordFile.formatFileHeader | public static void formatFileHeader(String fileName, Transaction tx) {
"""
Format the header of specified file.
@param fileName
the file name
@param tx
the transaction
"""
tx.concurrencyMgr().modifyFile(fileName);
// header should be the first block of the given file
if (VanillaDb.fileMgr().size... | java | public static void formatFileHeader(String fileName, Transaction tx) {
tx.concurrencyMgr().modifyFile(fileName);
// header should be the first block of the given file
if (VanillaDb.fileMgr().size(fileName) == 0) {
FileHeaderFormatter fhf = new FileHeaderFormatter();
Buffer buff = tx.bufferMgr().pinNew(... | [
"public",
"static",
"void",
"formatFileHeader",
"(",
"String",
"fileName",
",",
"Transaction",
"tx",
")",
"{",
"tx",
".",
"concurrencyMgr",
"(",
")",
".",
"modifyFile",
"(",
"fileName",
")",
";",
"// header should be the first block of the given file\r",
"if",
"(",
... | Format the header of specified file.
@param fileName
the file name
@param tx
the transaction | [
"Format",
"the",
"header",
"of",
"specified",
"file",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/record/RecordFile.java#L83-L91 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.newConditions | public Conditions newConditions(final ZonedDateTime notBefore, final ZonedDateTime notOnOrAfter, final String... audienceUri) {
"""
New conditions element.
@param notBefore the not before
@param notOnOrAfter the not on or after
@param audienceUri the service id
@return the conditions
"""
LOGG... | java | public Conditions newConditions(final ZonedDateTime notBefore, final ZonedDateTime notOnOrAfter, final String... audienceUri) {
LOGGER.debug("Building conditions for audience [{}] that enforce not-before [{}] and not-after [{}]", audienceUri, notBefore, notOnOrAfter);
val conditions = newSamlObject(Cond... | [
"public",
"Conditions",
"newConditions",
"(",
"final",
"ZonedDateTime",
"notBefore",
",",
"final",
"ZonedDateTime",
"notOnOrAfter",
",",
"final",
"String",
"...",
"audienceUri",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Building conditions for audience [{}] that enforce n... | New conditions element.
@param notBefore the not before
@param notOnOrAfter the not on or after
@param audienceUri the service id
@return the conditions | [
"New",
"conditions",
"element",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L383-L397 |
Whiley/WhileyCompiler | src/main/java/wyil/check/DefiniteUnassignmentCheck.java | DefiniteUnassignmentCheck.visitProperty | @Override
public ControlFlow visitProperty(Decl.Property declaration, MaybeAssignedSet dummy) {
"""
Check a function or method declaration for definite assignment.
@param declaration
@return
"""
MaybeAssignedSet environment = new MaybeAssignedSet();
// Definitely assigned variables includes all parame... | java | @Override
public ControlFlow visitProperty(Decl.Property declaration, MaybeAssignedSet dummy) {
MaybeAssignedSet environment = new MaybeAssignedSet();
// Definitely assigned variables includes all parameters.
environment = environment.addAll(declaration.getParameters());
//
return null;
} | [
"@",
"Override",
"public",
"ControlFlow",
"visitProperty",
"(",
"Decl",
".",
"Property",
"declaration",
",",
"MaybeAssignedSet",
"dummy",
")",
"{",
"MaybeAssignedSet",
"environment",
"=",
"new",
"MaybeAssignedSet",
"(",
")",
";",
"// Definitely assigned variables includ... | Check a function or method declaration for definite assignment.
@param declaration
@return | [
"Check",
"a",
"function",
"or",
"method",
"declaration",
"for",
"definite",
"assignment",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/DefiniteUnassignmentCheck.java#L111-L118 |
janus-project/guava.janusproject.io | guava/src/com/google/common/primitives/UnsignedLong.java | UnsignedLong.valueOf | public static UnsignedLong valueOf(String string, int radix) {
"""
Returns an {@code UnsignedLong} holding the value of the specified {@code String}, parsed as
an unsigned {@code long} value in the specified radix.
@throws NumberFormatException if the string does not contain a parsable unsigned {@code long}
v... | java | public static UnsignedLong valueOf(String string, int radix) {
return fromLongBits(UnsignedLongs.parseUnsignedLong(string, radix));
} | [
"public",
"static",
"UnsignedLong",
"valueOf",
"(",
"String",
"string",
",",
"int",
"radix",
")",
"{",
"return",
"fromLongBits",
"(",
"UnsignedLongs",
".",
"parseUnsignedLong",
"(",
"string",
",",
"radix",
")",
")",
";",
"}"
] | Returns an {@code UnsignedLong} holding the value of the specified {@code String}, parsed as
an unsigned {@code long} value in the specified radix.
@throws NumberFormatException if the string does not contain a parsable unsigned {@code long}
value, or {@code radix} is not between {@link Character#MIN_RADIX} and
{@link... | [
"Returns",
"an",
"{",
"@code",
"UnsignedLong",
"}",
"holding",
"the",
"value",
"of",
"the",
"specified",
"{",
"@code",
"String",
"}",
"parsed",
"as",
"an",
"unsigned",
"{",
"@code",
"long",
"}",
"value",
"in",
"the",
"specified",
"radix",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/primitives/UnsignedLong.java#L119-L121 |
leancloud/java-sdk-all | android-sdk/realtime-sample-app/src/main/java/cn/leancloud/realtime_sample_app/LoginActivity.java | LoginActivity.attemptLogin | private void attemptLogin() {
"""
Attempts to sign in or register the account specified by the login form.
If there are form errors (invalid email, missing fields, etc.), the
errors are presented and no actual login attempt is made.
"""
if (mAuthTask != null) {
return;
}
// Reset errors.
... | java | private void attemptLogin() {
if (mAuthTask != null) {
return;
}
// Reset errors.
mEmailView.setError(null);
mPasswordView.setError(null);
// Store values at the time of the login attempt.
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().t... | [
"private",
"void",
"attemptLogin",
"(",
")",
"{",
"if",
"(",
"mAuthTask",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"// Reset errors.",
"mEmailView",
".",
"setError",
"(",
"null",
")",
";",
"mPasswordView",
".",
"setError",
"(",
"null",
")",
";",
"// S... | Attempts to sign in or register the account specified by the login form.
If there are form errors (invalid email, missing fields, etc.), the
errors are presented and no actual login attempt is made. | [
"Attempts",
"to",
"sign",
"in",
"or",
"register",
"the",
"account",
"specified",
"by",
"the",
"login",
"form",
".",
"If",
"there",
"are",
"form",
"errors",
"(",
"invalid",
"email",
"missing",
"fields",
"etc",
".",
")",
"the",
"errors",
"are",
"presented",
... | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/realtime-sample-app/src/main/java/cn/leancloud/realtime_sample_app/LoginActivity.java#L155-L200 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.setItem | public String setItem(String iid, Map<String, Object> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
"""
Sets properties of a item. Implicitly creates the item if it's not already there. Properties
could be empty.
@param iid ID of the item
@param propertie... | java | public String setItem(String iid, Map<String, Object> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
return createEvent(setItemAsFuture(iid, properties, eventTime));
} | [
"public",
"String",
"setItem",
"(",
"String",
"iid",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"DateTime",
"eventTime",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"IOException",
"{",
"return",
"createEvent",
"(... | Sets properties of a item. Implicitly creates the item if it's not already there. Properties
could be empty.
@param iid ID of the item
@param properties a map of all the properties to be associated with the item, could be empty
@param eventTime timestamp of the event
@return ID of this event | [
"Sets",
"properties",
"of",
"a",
"item",
".",
"Implicitly",
"creates",
"the",
"item",
"if",
"it",
"s",
"not",
"already",
"there",
".",
"Properties",
"could",
"be",
"empty",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L483-L486 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final String[] pStringArray, final PrintStream pPrintStream) {
"""
Prints the content of a {@code java.lang.String[]} to a {@code java.io.PrintStream}.
<p>
@param pStringArray the {@code java.lang.String[]} to be printed.
@param pPrintStream the {@code java.io.PrintStream} for flus... | java | public static void printDebug(final String[] pStringArray, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
if (pStringArray == null) {
pPrintStream.println(STRINGARRAY_IS_NULL_ERROR_MESSAGE);
retu... | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"String",
"[",
"]",
"pStringArray",
",",
"final",
"PrintStream",
"pPrintStream",
")",
"{",
"if",
"(",
"pPrintStream",
"==",
"null",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"PRINTSTREAM_IS_N... | Prints the content of a {@code java.lang.String[]} to a {@code java.io.PrintStream}.
<p>
@param pStringArray the {@code java.lang.String[]} to be printed.
@param pPrintStream the {@code java.io.PrintStream} for flushing the results. | [
"Prints",
"the",
"content",
"of",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L389-L402 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.appendSeparatorIfFieldsAfter | public PeriodFormatterBuilder appendSeparatorIfFieldsAfter(String text) {
"""
Append a separator, which is output only if fields are printed after the separator.
<p>
For example,
<code>builder.appendDays().appendSeparatorIfFieldsAfter(",").appendHours()</code>
will only output the comma if the hours fields is ... | java | public PeriodFormatterBuilder appendSeparatorIfFieldsAfter(String text) {
return appendSeparator(text, text, null, false, true);
} | [
"public",
"PeriodFormatterBuilder",
"appendSeparatorIfFieldsAfter",
"(",
"String",
"text",
")",
"{",
"return",
"appendSeparator",
"(",
"text",
",",
"text",
",",
"null",
",",
"false",
",",
"true",
")",
";",
"}"
] | Append a separator, which is output only if fields are printed after the separator.
<p>
For example,
<code>builder.appendDays().appendSeparatorIfFieldsAfter(",").appendHours()</code>
will only output the comma if the hours fields is output.
<p>
The text will be parsed case-insensitively.
<p>
Note: appending a separator... | [
"Append",
"a",
"separator",
"which",
"is",
"output",
"only",
"if",
"fields",
"are",
"printed",
"after",
"the",
"separator",
".",
"<p",
">",
"For",
"example",
"<code",
">",
"builder",
".",
"appendDays",
"()",
".",
"appendSeparatorIfFieldsAfter",
"(",
")",
"."... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L747-L749 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentParser.java | PdfContentParser.readPRObject | public PdfObject readPRObject() throws IOException {
"""
Reads a pdf object.
@return the pdf object
@throws IOException on error
"""
if (!nextValidToken())
return null;
int type = tokeniser.getTokenType();
switch (type) {
case PRTokeniser.TK_START_DIC: {
... | java | public PdfObject readPRObject() throws IOException {
if (!nextValidToken())
return null;
int type = tokeniser.getTokenType();
switch (type) {
case PRTokeniser.TK_START_DIC: {
PdfDictionary dic = readDictionary();
return dic;
}
... | [
"public",
"PdfObject",
"readPRObject",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"nextValidToken",
"(",
")",
")",
"return",
"null",
";",
"int",
"type",
"=",
"tokeniser",
".",
"getTokenType",
"(",
")",
";",
"switch",
"(",
"type",
")",
"{",
... | Reads a pdf object.
@return the pdf object
@throws IOException on error | [
"Reads",
"a",
"pdf",
"object",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentParser.java#L166-L189 |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/DiscoveredBdas.java | DiscoveredBdas.addDiscoveredBda | public void addDiscoveredBda(ArchiveType moduleType, WebSphereBeanDeploymentArchive bda) throws CDIException {
"""
Registers a newly discovered BDA and adds it to the deployment
@param moduleType the module type
@param bda the new BDA
@throws CDIException
"""
webSphereCDIDeployment.addBeanDeployme... | java | public void addDiscoveredBda(ArchiveType moduleType, WebSphereBeanDeploymentArchive bda) throws CDIException {
webSphereCDIDeployment.addBeanDeploymentArchive(bda);
Set<WebSphereBeanDeploymentArchive> bdaSet = bdasByType.get(moduleType);
if (bdaSet != null) {
bdaSet.add(bda);
... | [
"public",
"void",
"addDiscoveredBda",
"(",
"ArchiveType",
"moduleType",
",",
"WebSphereBeanDeploymentArchive",
"bda",
")",
"throws",
"CDIException",
"{",
"webSphereCDIDeployment",
".",
"addBeanDeploymentArchive",
"(",
"bda",
")",
";",
"Set",
"<",
"WebSphereBeanDeploymentA... | Registers a newly discovered BDA and adds it to the deployment
@param moduleType the module type
@param bda the new BDA
@throws CDIException | [
"Registers",
"a",
"newly",
"discovered",
"BDA",
"and",
"adds",
"it",
"to",
"the",
"deployment"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/DiscoveredBdas.java#L90-L107 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java | CrsUtilities.writeProjectionFile | @SuppressWarnings("nls")
public static void writeProjectionFile( String filePath, String extention, CoordinateReferenceSystem crs )
throws IOException {
"""
Fill the prj file with the actual map projection.
@param filePath the path to the regarding data or prj file.
@param extention the extent... | java | @SuppressWarnings("nls")
public static void writeProjectionFile( String filePath, String extention, CoordinateReferenceSystem crs )
throws IOException {
/*
* fill a prj file
*/
String prjPath = null;
if (extention != null && filePath.toLowerCase().endsWith("." +... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"public",
"static",
"void",
"writeProjectionFile",
"(",
"String",
"filePath",
",",
"String",
"extention",
",",
"CoordinateReferenceSystem",
"crs",
")",
"throws",
"IOException",
"{",
"/*\n * fill a prj file\n */... | Fill the prj file with the actual map projection.
@param filePath the path to the regarding data or prj file.
@param extention the extention of the data file. If <code>null</code>, the crs is written to filePath directly.
@param crs the {@link CoordinateReferenceSystem} to write.
@throws IOException | [
"Fill",
"the",
"prj",
"file",
"with",
"the",
"actual",
"map",
"projection",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CrsUtilities.java#L82-L104 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GroupApi.java | GroupApi.addMember | public Member addMember(Object groupIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException {
"""
Adds a user to the list of group members.
<pre><code>GitLab Endpoint: POST /groups/:id/members</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group i... | java | public Member addMember(Object groupIdOrPath, Integer userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException {
return (addMember(groupIdOrPath, userId, accessLevel.toValue(), expiresAt));
} | [
"public",
"Member",
"addMember",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"userId",
",",
"AccessLevel",
"accessLevel",
",",
"Date",
"expiresAt",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"addMember",
"(",
"groupIdOrPath",
",",
"userId",
",",
... | Adds a user to the list of group members.
<pre><code>GitLab Endpoint: POST /groups/:id/members</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
@param userId the user ID of the member to add, required
@param accessLevel the access level for ... | [
"Adds",
"a",
"user",
"to",
"the",
"list",
"of",
"group",
"members",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L795-L797 |
Alluxio/alluxio | core/common/src/main/java/alluxio/AlluxioRemoteLogFilter.java | AlluxioRemoteLogFilter.setOption | @Deprecated
public void setOption(String key, String value) {
"""
@deprecated Sets option value use key=value format. The log4j.properties file uses this
to set options. See the log4j.properties for more details.
@param key key (name) of the option
@param value value of the option
"""
if (key.equals... | java | @Deprecated
public void setOption(String key, String value) {
if (key.equalsIgnoreCase(PROCESS_TYPE_OPTION)) {
mProcessType = value;
}
} | [
"@",
"Deprecated",
"public",
"void",
"setOption",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
".",
"equalsIgnoreCase",
"(",
"PROCESS_TYPE_OPTION",
")",
")",
"{",
"mProcessType",
"=",
"value",
";",
"}",
"}"
] | @deprecated Sets option value use key=value format. The log4j.properties file uses this
to set options. See the log4j.properties for more details.
@param key key (name) of the option
@param value value of the option | [
"@deprecated",
"Sets",
"option",
"value",
"use",
"key",
"=",
"value",
"format",
".",
"The",
"log4j",
".",
"properties",
"file",
"uses",
"this",
"to",
"set",
"options",
".",
"See",
"the",
"log4j",
".",
"properties",
"for",
"more",
"details",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/AlluxioRemoteLogFilter.java#L57-L62 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.nearestLabels | public Collection<String> nearestLabels(@NonNull String rawText, int topN) {
"""
This method returns top N labels nearest to specified text
@param rawText
@param topN
@return
"""
List<String> tokens = tokenizerFactory.create(rawText).getTokens();
List<VocabWord> document = new ArrayList<>(... | java | public Collection<String> nearestLabels(@NonNull String rawText, int topN) {
List<String> tokens = tokenizerFactory.create(rawText).getTokens();
List<VocabWord> document = new ArrayList<>();
for (String token : tokens) {
if (vocab.containsWord(token)) {
document.add(v... | [
"public",
"Collection",
"<",
"String",
">",
"nearestLabels",
"(",
"@",
"NonNull",
"String",
"rawText",
",",
"int",
"topN",
")",
"{",
"List",
"<",
"String",
">",
"tokens",
"=",
"tokenizerFactory",
".",
"create",
"(",
"rawText",
")",
".",
"getTokens",
"(",
... | This method returns top N labels nearest to specified text
@param rawText
@param topN
@return | [
"This",
"method",
"returns",
"top",
"N",
"labels",
"nearest",
"to",
"specified",
"text"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L533-L549 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseShort | public static short parseShort (@Nullable final String sStr, @Nonnegative final int nRadix, final short nDefault) {
"""
Parse the given {@link String} as short with the specified radix.
@param sStr
The string to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MI... | java | public static short parseShort (@Nullable final String sStr, @Nonnegative final int nRadix, final short nDefault)
{
if (sStr != null && sStr.length () > 0)
try
{
return Short.parseShort (sStr, nRadix);
}
catch (final NumberFormatException ex)
{
// Fall through
}... | [
"public",
"static",
"short",
"parseShort",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nRadix",
",",
"final",
"short",
"nDefault",
")",
"{",
"if",
"(",
"sStr",
"!=",
"null",
"&&",
"sStr",
".",
"length",
"(",... | Parse the given {@link String} as short with the specified radix.
@param sStr
The string to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX} and ≤
{@link Character#MAX_RADIX}.
@param nDefault
The default value to be returned if the passed object could not be
... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"short",
"with",
"the",
"specified",
"radix",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1237-L1249 |
astrapi69/runtime-compiler | src/main/java/de/alpharogroup/runtime/compiler/CompilerExtensions.java | CompilerExtensions.newQualifiedClassName | public static String newQualifiedClassName(final String packageName, final String className) {
"""
Factory method for create a qualified class name from the given arguments.
@param packageName
the package name
@param className
the class name
@return the created qualified class name
"""
if (StringUtil... | java | public static String newQualifiedClassName(final String packageName, final String className)
{
if (StringUtils.isBlank(packageName))
{
return className;
}
return new StringBuilder().append(packageName).append(SeparatorConstants.DOT)
.append(className).toString();
} | [
"public",
"static",
"String",
"newQualifiedClassName",
"(",
"final",
"String",
"packageName",
",",
"final",
"String",
"className",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"packageName",
")",
")",
"{",
"return",
"className",
";",
"}",
"return",... | Factory method for create a qualified class name from the given arguments.
@param packageName
the package name
@param className
the class name
@return the created qualified class name | [
"Factory",
"method",
"for",
"create",
"a",
"qualified",
"class",
"name",
"from",
"the",
"given",
"arguments",
"."
] | train | https://github.com/astrapi69/runtime-compiler/blob/9aed71f2940ddf30e6930de6cbf509206f3bd7de/src/main/java/de/alpharogroup/runtime/compiler/CompilerExtensions.java#L84-L92 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.executeObject | @Override
public <T, C> T executeObject(String name, C criteria, T result) throws CpoException {
"""
Executes an Object that represents an executable object within the datasource. It is assumed that the object exists
in the datasource. If the object does not exist, an exception will be thrown
<p>
<pre>Example... | java | @Override
public <T, C> T executeObject(String name, C criteria, T result) throws CpoException {
return getCurrentResource().executeObject( name, criteria, result );
} | [
"@",
"Override",
"public",
"<",
"T",
",",
"C",
">",
"T",
"executeObject",
"(",
"String",
"name",
",",
"C",
"criteria",
",",
"T",
"result",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"executeObject",
"(",
"name",
",... | Executes an Object that represents an executable object within the datasource. It is assumed that the object exists
in the datasource. If the object does not exist, an exception will be thrown
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new SomeObject();
class SomeResult sr = new SomeResult();
class CpoAdapter c... | [
"Executes",
"an",
"Object",
"that",
"represents",
"an",
"executable",
"object",
"within",
"the",
"datasource",
".",
"It",
"is",
"assumed",
"that",
"the",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"object",
"does",
"not",
"exist",
"an",... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L819-L822 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File sourceDir, OutputStream os, NameMapper mapper, int compressionLevel) {
"""
Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@pa... | java | public static void pack(File sourceDir, OutputStream os, NameMapper mapper, int compressionLevel) {
log.debug("Compressing '{}' into a stream.", sourceDir);
if (!sourceDir.exists()) {
throw new ZipException("Given file '" + sourceDir + "' doesn't exist!");
}
ZipOutputStream out = null;
IOExcep... | [
"public",
"static",
"void",
"pack",
"(",
"File",
"sourceDir",
",",
"OutputStream",
"os",
",",
"NameMapper",
"mapper",
",",
"int",
"compressionLevel",
")",
"{",
"log",
".",
"debug",
"(",
"\"Compressing '{}' into a stream.\"",
",",
"sourceDir",
")",
";",
"if",
"... | Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered in this method).
@param mapper
call-back for renaming the entries.
@param co... | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"into",
"the",
"passed",
"in",
"stream",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"close",
"the",
"passed",
"in",
"stream",
"prop... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1690-L1719 |
visenze/visearch-sdk-java | src/main/java/com/visenze/visearch/ViSearch.java | ViSearch.sendSolutionActions | private void sendSolutionActions(String action, String reqId) {
"""
send search actions after finishing search
@param action
@param reqId
"""
if(reqId!=null && !reqId.equals("")) {
Map<String, String> map = Maps.newHashMap();
map.put("action", action);
map.put("req... | java | private void sendSolutionActions(String action, String reqId){
if(reqId!=null && !reqId.equals("")) {
Map<String, String> map = Maps.newHashMap();
map.put("action", action);
map.put("reqid", reqId);
this.sendEvent(map);
}
} | [
"private",
"void",
"sendSolutionActions",
"(",
"String",
"action",
",",
"String",
"reqId",
")",
"{",
"if",
"(",
"reqId",
"!=",
"null",
"&&",
"!",
"reqId",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"="... | send search actions after finishing search
@param action
@param reqId | [
"send",
"search",
"actions",
"after",
"finishing",
"search"
] | train | https://github.com/visenze/visearch-sdk-java/blob/133611b84a7489f08bf40b55912ccd2acc7f002c/src/main/java/com/visenze/visearch/ViSearch.java#L330-L337 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findFirst | public static <E> E findFirst(Iterator<E> iterator, Predicate<E> predicate) {
"""
Searches the first matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException i... | java | public static <E> E findFirst(Iterator<E> iterator, Predicate<E> predicate) {
final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
return new FirstElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findFirst",
"(",
"Iterator",
"<",
"E",
">",
"iterator",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"final",
"Iterator",
"<",
"E",
">",
"filtered",
"=",
"new",
"FilteringIterator",
"<",
"E",
">",
"... | Searches the first matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if no element matches
@return the found element | [
"Searches",
"the",
"first",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L420-L423 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.permuteWith | public SmartHandle permuteWith(SmartHandle target) {
"""
Produce a new SmartHandle by permuting this Signature's arguments to the
Signature of a target SmartHandle. The new SmartHandle's signature will
match this one, permuting those arguments and invoking the target handle.
@param target the SmartHandle to u... | java | public SmartHandle permuteWith(SmartHandle target) {
String[] argNames = target.signature().argNames();
return new SmartHandle(this, permuteWith(target.handle(), argNames));
} | [
"public",
"SmartHandle",
"permuteWith",
"(",
"SmartHandle",
"target",
")",
"{",
"String",
"[",
"]",
"argNames",
"=",
"target",
".",
"signature",
"(",
")",
".",
"argNames",
"(",
")",
";",
"return",
"new",
"SmartHandle",
"(",
"this",
",",
"permuteWith",
"(",... | Produce a new SmartHandle by permuting this Signature's arguments to the
Signature of a target SmartHandle. The new SmartHandle's signature will
match this one, permuting those arguments and invoking the target handle.
@param target the SmartHandle to use as a permutation target
@return a new SmartHandle that permutes... | [
"Produce",
"a",
"new",
"SmartHandle",
"by",
"permuting",
"this",
"Signature",
"s",
"arguments",
"to",
"the",
"Signature",
"of",
"a",
"target",
"SmartHandle",
".",
"The",
"new",
"SmartHandle",
"s",
"signature",
"will",
"match",
"this",
"one",
"permuting",
"thos... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L744-L747 |
actframework/actframework | src/main/java/act/util/LogSupport.java | LogSupport.printCenterWithLead | protected void printCenterWithLead(String lead, String format, Object ... args) {
"""
Print the lead string followed by centered formatted string. The whole
length of the line is 80 chars.
Example:
```java
printCenterWithLead(" *", "Hello %s", "World");
```
will print something like
```
* ... | java | protected void printCenterWithLead(String lead, String format, Object ... args) {
String text = S.fmt(format, args);
int len = 80 - lead.length();
info(S.concat(lead, S.center(text, len)));
} | [
"protected",
"void",
"printCenterWithLead",
"(",
"String",
"lead",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"String",
"text",
"=",
"S",
".",
"fmt",
"(",
"format",
",",
"args",
")",
";",
"int",
"len",
"=",
"80",
"-",
"lead",
".... | Print the lead string followed by centered formatted string. The whole
length of the line is 80 chars.
Example:
```java
printCenterWithLead(" *", "Hello %s", "World");
```
will print something like
```
* Hello World
```
Note the above is just a demo, the exact number of whitespace might not be correct... | [
"Print",
"the",
"lead",
"string",
"followed",
"by",
"centered",
"formatted",
"string",
".",
"The",
"whole",
"length",
"of",
"the",
"line",
"is",
"80",
"chars",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/util/LogSupport.java#L126-L130 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/FlightInfoExtendedBuilder.java | FlightInfoExtendedBuilder.setArrivalAirport | public FlightInfoExtendedBuilder setArrivalAirport(String airportCode,
String city, String gate, String terminal) {
"""
Sets the arrival {@link Airport} for the current
{@link FlightInfoExtended} object. This field is mandatory for this
object and can't be null.
@param airportCode
the airport code. It can... | java | public FlightInfoExtendedBuilder setArrivalAirport(String airportCode,
String city, String gate, String terminal) {
Airport arrivalAirport = new Airport(airportCode, city, gate, terminal);
this.flightInfo.setArrivalAirport(arrivalAirport);
return this;
} | [
"public",
"FlightInfoExtendedBuilder",
"setArrivalAirport",
"(",
"String",
"airportCode",
",",
"String",
"city",
",",
"String",
"gate",
",",
"String",
"terminal",
")",
"{",
"Airport",
"arrivalAirport",
"=",
"new",
"Airport",
"(",
"airportCode",
",",
"city",
",",
... | Sets the arrival {@link Airport} for the current
{@link FlightInfoExtended} object. This field is mandatory for this
object and can't be null.
@param airportCode
the airport code. It can't be empty.
@param city
the city name. The city will be displayed over the airport
code in the template. It can't be empty.
@param g... | [
"Sets",
"the",
"arrival",
"{",
"@link",
"Airport",
"}",
"for",
"the",
"current",
"{",
"@link",
"FlightInfoExtended",
"}",
"object",
".",
"This",
"field",
"is",
"mandatory",
"for",
"this",
"object",
"and",
"can",
"t",
"be",
"null",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/FlightInfoExtendedBuilder.java#L153-L158 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCell.java | PdfCell.processActions | protected void processActions(Element element, PdfAction action, ArrayList allActions) {
"""
Processes all actions contained in the cell.
@param element an element in the cell
@param action an action that should be coupled to the cell
@param allActions
"""
if (element.type() == Element.ANCHOR) {
... | java | protected void processActions(Element element, PdfAction action, ArrayList allActions) {
if (element.type() == Element.ANCHOR) {
String url = ((Anchor) element).getReference();
if (url != null) {
action = new PdfAction(url);
}
}
Iterator i;
... | [
"protected",
"void",
"processActions",
"(",
"Element",
"element",
",",
"PdfAction",
"action",
",",
"ArrayList",
"allActions",
")",
"{",
"if",
"(",
"element",
".",
"type",
"(",
")",
"==",
"Element",
".",
"ANCHOR",
")",
"{",
"String",
"url",
"=",
"(",
"(",... | Processes all actions contained in the cell.
@param element an element in the cell
@param action an action that should be coupled to the cell
@param allActions | [
"Processes",
"all",
"actions",
"contained",
"in",
"the",
"cell",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCell.java#L781-L814 |
mnlipp/jgrapes | org.jgrapes.util/src/org/jgrapes/util/events/KeyValueStoreUpdate.java | KeyValueStoreUpdate.storeAs | public KeyValueStoreUpdate storeAs(String value, String... segments) {
"""
Adds a new update action to the event that stores the given value
on the path formed by the path segments.
@param value the value
@param segments the path segments
@return the event for easy chaining
"""
actions.add(new Update("... | java | public KeyValueStoreUpdate storeAs(String value, String... segments) {
actions.add(new Update("/" + String.join("/", segments), value));
return this;
} | [
"public",
"KeyValueStoreUpdate",
"storeAs",
"(",
"String",
"value",
",",
"String",
"...",
"segments",
")",
"{",
"actions",
".",
"add",
"(",
"new",
"Update",
"(",
"\"/\"",
"+",
"String",
".",
"join",
"(",
"\"/\"",
",",
"segments",
")",
",",
"value",
")",
... | Adds a new update action to the event that stores the given value
on the path formed by the path segments.
@param value the value
@param segments the path segments
@return the event for easy chaining | [
"Adds",
"a",
"new",
"update",
"action",
"to",
"the",
"event",
"that",
"stores",
"the",
"given",
"value",
"on",
"the",
"path",
"formed",
"by",
"the",
"path",
"segments",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.util/src/org/jgrapes/util/events/KeyValueStoreUpdate.java#L55-L58 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java | PhotosetsInterface.removePhotos | public void removePhotos(String photosetId, String photoIds) throws FlickrException {
"""
Remove a photo from the set.
@param photosetId
The photoset ID
@param photoIds
The ID's of the photos, in CVS format
@throws FlickrException
"""
Map<String, Object> parameters = new HashMap<String, Object>... | java | public void removePhotos(String photosetId, String photoIds) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_REMOVE_PHOTOS);
parameters.put("photoset_id", photosetId);
parameters.put("photo_ids", photoIds);
... | [
"public",
"void",
"removePhotos",
"(",
"String",
"photosetId",
",",
"String",
"photoIds",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";"... | Remove a photo from the set.
@param photosetId
The photoset ID
@param photoIds
The ID's of the photos, in CVS format
@throws FlickrException | [
"Remove",
"a",
"photo",
"from",
"the",
"set",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java#L609-L620 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/orders/_2013_09_01/MarketplaceWebServiceOrdersConfig.java | MarketplaceWebServiceOrdersConfig.withRequestHeader | public MarketplaceWebServiceOrdersConfig withRequestHeader(String name, String value) {
"""
Sets the value of a request header to be included on every request
@param name the name of the header to set
@param value value to send with header
@return the current config object
"""
cc.includeRequestHea... | java | public MarketplaceWebServiceOrdersConfig withRequestHeader(String name, String value) {
cc.includeRequestHeader(name, value);
return this;
} | [
"public",
"MarketplaceWebServiceOrdersConfig",
"withRequestHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"cc",
".",
"includeRequestHeader",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of a request header to be included on every request
@param name the name of the header to set
@param value value to send with header
@return the current config object | [
"Sets",
"the",
"value",
"of",
"a",
"request",
"header",
"to",
"be",
"included",
"on",
"every",
"request"
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/orders/_2013_09_01/MarketplaceWebServiceOrdersConfig.java#L371-L374 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getKeyAsync | public Observable<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) {
"""
Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/g... | java | public Observable<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion) {
return getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() {
@Override
public KeyBundle call(ServiceResponse<KeyBundle> ... | [
"public",
"Observable",
"<",
"KeyBundle",
">",
"getKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
")",
"{",
"return",
"getKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyName",
",",
"keyVersion",
")",
"... | Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param keyNa... | [
"Gets",
"the",
"public",
"part",
"of",
"a",
"stored",
"key",
".",
"The",
"get",
"key",
"operation",
"is",
"applicable",
"to",
"all",
"key",
"types",
".",
"If",
"the",
"requested",
"key",
"is",
"symmetric",
"then",
"no",
"key",
"material",
"is",
"released... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1414-L1421 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java | CommonExpectations.jwtCookieExists | public static Expectations jwtCookieExists(String testAction, WebClient webClient, String jwtCookieName, boolean isSecure, boolean isHttpOnly) {
"""
Sets expectations that will check:
<ol>
<li>The provided WebClient contains a cookie with the default JWT SSO cookie name, its value is a JWT, is NOT marked secure,... | java | public static Expectations jwtCookieExists(String testAction, WebClient webClient, String jwtCookieName, boolean isSecure, boolean isHttpOnly) {
Expectations expectations = new Expectations();
expectations.addExpectation(new CookieExpectation(testAction, webClient, jwtCookieName, JwtFatConstants.JWT_REG... | [
"public",
"static",
"Expectations",
"jwtCookieExists",
"(",
"String",
"testAction",
",",
"WebClient",
"webClient",
",",
"String",
"jwtCookieName",
",",
"boolean",
"isSecure",
",",
"boolean",
"isHttpOnly",
")",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expect... | Sets expectations that will check:
<ol>
<li>The provided WebClient contains a cookie with the default JWT SSO cookie name, its value is a JWT, is NOT marked secure, and is marked HttpOnly
</ol> | [
"Sets",
"expectations",
"that",
"will",
"check",
":",
"<ol",
">",
"<li",
">",
"The",
"provided",
"WebClient",
"contains",
"a",
"cookie",
"with",
"the",
"default",
"JWT",
"SSO",
"cookie",
"name",
"its",
"value",
"is",
"a",
"JWT",
"is",
"NOT",
"marked",
"s... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java#L82-L86 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/java/Java.java | Java.emitCommentIndentNOnly | private static String emitCommentIndentNOnly(PrintWriter fp, String text, int indent) {
"""
Write a comment indent only.
@param fp
@param text
@param indent
@return
"""
synchronized (lock) {
return (emitCommentIndentNOnly(fp, text, indent, true));
}
} | java | private static String emitCommentIndentNOnly(PrintWriter fp, String text, int indent) {
synchronized (lock) {
return (emitCommentIndentNOnly(fp, text, indent, true));
}
} | [
"private",
"static",
"String",
"emitCommentIndentNOnly",
"(",
"PrintWriter",
"fp",
",",
"String",
"text",
",",
"int",
"indent",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"return",
"(",
"emitCommentIndentNOnly",
"(",
"fp",
",",
"text",
",",
"indent",
"... | Write a comment indent only.
@param fp
@param text
@param indent
@return | [
"Write",
"a",
"comment",
"indent",
"only",
"."
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/java/Java.java#L140-L144 |
aaberg/sql2o | core/src/main/java/org/sql2o/ArrayParameters.java | ArrayParameters.computeNewIndex | static int computeNewIndex(int index, List<ArrayParameter> arrayParametersSortedAsc) {
"""
Compute the new index of a parameter given the index positions of the array parameters.
"""
int newIndex = index;
for(ArrayParameter arrayParameter : arrayParametersSortedAsc) {
if(index > arr... | java | static int computeNewIndex(int index, List<ArrayParameter> arrayParametersSortedAsc) {
int newIndex = index;
for(ArrayParameter arrayParameter : arrayParametersSortedAsc) {
if(index > arrayParameter.parameterIndex) {
newIndex = newIndex + arrayParameter.parameterCount - 1;
... | [
"static",
"int",
"computeNewIndex",
"(",
"int",
"index",
",",
"List",
"<",
"ArrayParameter",
">",
"arrayParametersSortedAsc",
")",
"{",
"int",
"newIndex",
"=",
"index",
";",
"for",
"(",
"ArrayParameter",
"arrayParameter",
":",
"arrayParametersSortedAsc",
")",
"{",... | Compute the new index of a parameter given the index positions of the array parameters. | [
"Compute",
"the",
"new",
"index",
"of",
"a",
"parameter",
"given",
"the",
"index",
"positions",
"of",
"the",
"array",
"parameters",
"."
] | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/ArrayParameters.java#L66-L76 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/service/WorkflowServiceImpl.java | WorkflowServiceImpl.startWorkflow | @Service
public String startWorkflow(String name, Integer version, String correlationId, Map<String, Object> input) {
"""
Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking.
@param name Name of the workflow you want to start.
@param version Ver... | java | @Service
public String startWorkflow(String name, Integer version, String correlationId, Map<String, Object> input) {
WorkflowDef workflowDef = metadataService.getWorkflowDef(name, version);
if (workflowDef == null) {
throw new ApplicationException(ApplicationException.Code.NOT_FOUND, St... | [
"@",
"Service",
"public",
"String",
"startWorkflow",
"(",
"String",
"name",
",",
"Integer",
"version",
",",
"String",
"correlationId",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"input",
")",
"{",
"WorkflowDef",
"workflowDef",
"=",
"metadataService",
".",
... | Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking.
@param name Name of the workflow you want to start.
@param version Version of the workflow you want to start.
@param correlationId CorrelationID of the workflow you want to start.
@param input Inp... | [
"Start",
"a",
"new",
"workflow",
".",
"Returns",
"the",
"ID",
"of",
"the",
"workflow",
"instance",
"that",
"can",
"be",
"later",
"used",
"for",
"tracking",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/WorkflowServiceImpl.java#L134-L141 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ThreadUtils.java | ThreadUtils.shutdownAndAwaitTermination | public static void shutdownAndAwaitTermination(ExecutorService pool, long timeoutMs) {
"""
From https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html
The following method shuts down an ExecutorService in two phases, first by calling shutdown to
reject incoming tasks, and then call... | java | public static void shutdownAndAwaitTermination(ExecutorService pool, long timeoutMs) {
pool.shutdown(); // Disable new tasks from being submitted
try {
// Wait a while for existing tasks to terminate
if (!pool.awaitTermination(timeoutMs / 2, TimeUnit.MILLISECONDS)) {
pool.shutdownNow(); // C... | [
"public",
"static",
"void",
"shutdownAndAwaitTermination",
"(",
"ExecutorService",
"pool",
",",
"long",
"timeoutMs",
")",
"{",
"pool",
".",
"shutdown",
"(",
")",
";",
"// Disable new tasks from being submitted",
"try",
"{",
"// Wait a while for existing tasks to terminate",... | From https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html
The following method shuts down an ExecutorService in two phases, first by calling shutdown to
reject incoming tasks, and then calling shutdownNow, if necessary, to cancel any lingering
tasks.
@param pool the executor service to ... | [
"From",
"https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"api",
"/",
"java",
"/",
"util",
"/",
"concurrent",
"/",
"ExecutorService",
".",
"html"
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ThreadUtils.java#L62-L78 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/logging/LogTemplates.java | LogTemplates.whenSplitLongerThanMilliseconds | public static SplitThresholdLogTemplate whenSplitLongerThanMilliseconds(LogTemplate<Split> delegateLogger, long threshold) {
"""
Produces a log template which logs something when stopwatch split is longer than threshold.
@param delegateLogger Concrete log template
@param threshold Threshold (in milliseconds), ... | java | public static SplitThresholdLogTemplate whenSplitLongerThanMilliseconds(LogTemplate<Split> delegateLogger, long threshold) {
return whenSplitLongerThanNanoseconds(delegateLogger, threshold * SimonClock.NANOS_IN_MILLIS);
} | [
"public",
"static",
"SplitThresholdLogTemplate",
"whenSplitLongerThanMilliseconds",
"(",
"LogTemplate",
"<",
"Split",
">",
"delegateLogger",
",",
"long",
"threshold",
")",
"{",
"return",
"whenSplitLongerThanNanoseconds",
"(",
"delegateLogger",
",",
"threshold",
"*",
"Simo... | Produces a log template which logs something when stopwatch split is longer than threshold.
@param delegateLogger Concrete log template
@param threshold Threshold (in milliseconds), above which logging is enabled
@return Logger | [
"Produces",
"a",
"log",
"template",
"which",
"logs",
"something",
"when",
"stopwatch",
"split",
"is",
"longer",
"than",
"threshold",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/logging/LogTemplates.java#L125-L127 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.sealStream | public void sealStream(String scope, String streamName, Duration latency) {
"""
This method increments the global and Stream-specific counters of seal Stream operations, set the number of open
Transactions to 0, and reports the latency of the operation.
@param scope Scope.
@param streamName Name of... | java | public void sealStream(String scope, String streamName, Duration latency) {
DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM, 1);
DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName));
sealStreamLatency.reportSuccessValue(latency.toMillis());
} | [
"public",
"void",
"sealStream",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"Duration",
"latency",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"SEAL_STREAM",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
".",
"reportGaugeValue",
"(",
"OPEN_TRA... | This method increments the global and Stream-specific counters of seal Stream operations, set the number of open
Transactions to 0, and reports the latency of the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of the sealStream operation. | [
"This",
"method",
"increments",
"the",
"global",
"and",
"Stream",
"-",
"specific",
"counters",
"of",
"seal",
"Stream",
"operations",
"set",
"the",
"number",
"of",
"open",
"Transactions",
"to",
"0",
"and",
"reports",
"the",
"latency",
"of",
"the",
"operation",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L113-L117 |
radkovo/Pdf2Dom | src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java | CSSBoxTree.createDeclaration | protected Declaration createDeclaration(String property, Term<?> term) {
"""
Creates a single property declaration.
@param property Property name.
@param term Property value.
@return The resulting declaration.
"""
Declaration d = CSSFactory.getRuleFactory().createDeclaration();
d.unlock();
... | java | protected Declaration createDeclaration(String property, Term<?> term)
{
Declaration d = CSSFactory.getRuleFactory().createDeclaration();
d.unlock();
d.setProperty(property);
d.add(term);
return d;
} | [
"protected",
"Declaration",
"createDeclaration",
"(",
"String",
"property",
",",
"Term",
"<",
"?",
">",
"term",
")",
"{",
"Declaration",
"d",
"=",
"CSSFactory",
".",
"getRuleFactory",
"(",
")",
".",
"createDeclaration",
"(",
")",
";",
"d",
".",
"unlock",
"... | Creates a single property declaration.
@param property Property name.
@param term Property value.
@return The resulting declaration. | [
"Creates",
"a",
"single",
"property",
"declaration",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java#L531-L538 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/InkscapeLoader.java | InkscapeLoader.loadDiagram | private Diagram loadDiagram(InputStream in, boolean offset)
throws SlickException {
"""
Load a SVG document into a diagram
@param in
The input stream from which to read the SVG
@param offset
Offset the diagram for the height of the document
@return The diagram loaded
@throws SlickException
Indicates a... | java | private Diagram loadDiagram(InputStream in, boolean offset)
throws SlickException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
buil... | [
"private",
"Diagram",
"loadDiagram",
"(",
"InputStream",
"in",
",",
"boolean",
"offset",
")",
"throws",
"SlickException",
"{",
"try",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setVa... | Load a SVG document into a diagram
@param in
The input stream from which to read the SVG
@param offset
Offset the diagram for the height of the document
@return The diagram loaded
@throws SlickException
Indicates a failure to process the document | [
"Load",
"a",
"SVG",
"document",
"into",
"a",
"diagram"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/InkscapeLoader.java#L144-L190 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java | TagLibFactory.endElement | @Override
public void endElement(String uri, String name, String qName) {
"""
Geerbte Methode von org.xml.sax.ContentHandler, wird bei durchparsen des XML, beim auftreten
eines End-Tag aufgerufen.
@see org.xml.sax.ContentHandler#endElement(String, String, String)
"""
setContent(content.toString().trim... | java | @Override
public void endElement(String uri, String name, String qName) {
setContent(content.toString().trim());
content = new StringBuffer();
inside = "";
/*
* if(tag!=null && tag.getName().equalsIgnoreCase("input")) {
* print.ln(tag.getName()+"-"+att.getName()+":"+inside+"-"+insideTag+"-"+insideAtt);
* ... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"name",
",",
"String",
"qName",
")",
"{",
"setContent",
"(",
"content",
".",
"toString",
"(",
")",
".",
"trim",
"(",
")",
")",
";",
"content",
"=",
"new",
"StringBuff... | Geerbte Methode von org.xml.sax.ContentHandler, wird bei durchparsen des XML, beim auftreten
eines End-Tag aufgerufen.
@see org.xml.sax.ContentHandler#endElement(String, String, String) | [
"Geerbte",
"Methode",
"von",
"org",
".",
"xml",
".",
"sax",
".",
"ContentHandler",
"wird",
"bei",
"durchparsen",
"des",
"XML",
"beim",
"auftreten",
"eines",
"End",
"-",
"Tag",
"aufgerufen",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java#L209-L224 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.mergeSeq | public static String mergeSeq(final String first, final String second) {
"""
<p>
mergeSeq.
</p>
@param first
a {@link java.lang.String} object.
@param second
a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
return mergeSeq(first, second, DELIMITER);
} | java | public static String mergeSeq(final String first, final String second) {
return mergeSeq(first, second, DELIMITER);
} | [
"public",
"static",
"String",
"mergeSeq",
"(",
"final",
"String",
"first",
",",
"final",
"String",
"second",
")",
"{",
"return",
"mergeSeq",
"(",
"first",
",",
"second",
",",
"DELIMITER",
")",
";",
"}"
] | <p>
mergeSeq.
</p>
@param first
a {@link java.lang.String} object.
@param second
a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"mergeSeq",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L573-L575 |
jmeter-maven-plugin/jmeter-maven-plugin | src/main/java/com/lazerycode/jmeter/configuration/ArtifactHelpers.java | ArtifactHelpers.isArtifactIsOlderThanArtifact | public static boolean isArtifactIsOlderThanArtifact(Artifact artifact, Artifact comparisonArtifact) throws InvalidVersionSpecificationException {
"""
Check to see if a specified artifact is the same version, or a newer version that the comparative artifact
@param artifact An artifact
@param compariso... | java | public static boolean isArtifactIsOlderThanArtifact(Artifact artifact, Artifact comparisonArtifact) throws InvalidVersionSpecificationException {
GenericVersionScheme genericVersionScheme = new GenericVersionScheme();
Version firstArtifactVersion = genericVersionScheme.parseVersion(artifact.getVersion()... | [
"public",
"static",
"boolean",
"isArtifactIsOlderThanArtifact",
"(",
"Artifact",
"artifact",
",",
"Artifact",
"comparisonArtifact",
")",
"throws",
"InvalidVersionSpecificationException",
"{",
"GenericVersionScheme",
"genericVersionScheme",
"=",
"new",
"GenericVersionScheme",
"(... | Check to see if a specified artifact is the same version, or a newer version that the comparative artifact
@param artifact An artifact
@param comparisonArtifact another Artifact to compare with.
@return true if artifact is the same or a higher version. False if the artifact is a lower version
@throws MojoEx... | [
"Check",
"to",
"see",
"if",
"a",
"specified",
"artifact",
"is",
"the",
"same",
"version",
"or",
"a",
"newer",
"version",
"that",
"the",
"comparative",
"artifact"
] | train | https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/configuration/ArtifactHelpers.java#L165-L172 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java | IntegerExtensions.operator_doubleDotLessThan | @Pure
@Inline(value="new $3($1, $2, true)", imported=ExclusiveRange.class, statementExpression=false)
public static ExclusiveRange operator_doubleDotLessThan(final int a, final int b) {
"""
The <code>..<</code> operator yields an {@link ExclusiveRange} that increments from
a to b (exclusive).
@param a the... | java | @Pure
@Inline(value="new $3($1, $2, true)", imported=ExclusiveRange.class, statementExpression=false)
public static ExclusiveRange operator_doubleDotLessThan(final int a, final int b) {
return new ExclusiveRange(a, b, true);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"new $3($1, $2, true)\"",
",",
"imported",
"=",
"ExclusiveRange",
".",
"class",
",",
"statementExpression",
"=",
"false",
")",
"public",
"static",
"ExclusiveRange",
"operator_doubleDotLessThan",
"(",
"final",
"int",
... | The <code>..<</code> operator yields an {@link ExclusiveRange} that increments from
a to b (exclusive).
@param a the start of the range.
@param b the end of the range (exclusive).
@return an incrementing {@link ExclusiveRange}. Never <code>null</code>.
@since 2.4 | [
"The",
"<code",
">",
"..",
"<",
";",
"<",
"/",
"code",
">",
"operator",
"yields",
"an",
"{",
"@link",
"ExclusiveRange",
"}",
"that",
"increments",
"from",
"a",
"to",
"b",
"(",
"exclusive",
")",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java#L46-L50 |
VoltDB/voltdb | examples/callcenter/client/callcenter/CallSimulator.java | CallSimulator.makeRandomEvent | CallEvent[] makeRandomEvent() {
"""
Generate a random call event with a duration.
Reserves agent and phone number from the pool.
"""
long callId = ++lastCallIdUsed;
// get agentid
Integer agentId = agentsAvailable.poll();
if (agentId == null) {
return null;
... | java | CallEvent[] makeRandomEvent() {
long callId = ++lastCallIdUsed;
// get agentid
Integer agentId = agentsAvailable.poll();
if (agentId == null) {
return null;
}
// get phone number
Long phoneNo = phoneNumbersAvailable.poll();
assert(phoneNo != ... | [
"CallEvent",
"[",
"]",
"makeRandomEvent",
"(",
")",
"{",
"long",
"callId",
"=",
"++",
"lastCallIdUsed",
";",
"// get agentid",
"Integer",
"agentId",
"=",
"agentsAvailable",
".",
"poll",
"(",
")",
";",
"if",
"(",
"agentId",
"==",
"null",
")",
"{",
"return",... | Generate a random call event with a duration.
Reserves agent and phone number from the pool. | [
"Generate",
"a",
"random",
"call",
"event",
"with",
"a",
"duration",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/callcenter/client/callcenter/CallSimulator.java#L86-L123 |
craterdog/java-security-framework | java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java | CertificateManager.createPkcs12KeyStore | public final KeyStore createPkcs12KeyStore(String keyName, char[] password, PrivateKey privateKey, X509Certificate certificate) {
"""
This method creates a new PKCS12 format key store containing a named private key and public certificate.
@param keyName The name of the private key and public certificate.
@para... | java | public final KeyStore createPkcs12KeyStore(String keyName, char[] password, PrivateKey privateKey, X509Certificate certificate) {
logger.entry();
List<X509Certificate> certificates = new ArrayList<>();
certificates.add(certificate);
KeyStore keyStore = createPkcs12KeyStore(keyName, p... | [
"public",
"final",
"KeyStore",
"createPkcs12KeyStore",
"(",
"String",
"keyName",
",",
"char",
"[",
"]",
"password",
",",
"PrivateKey",
"privateKey",
",",
"X509Certificate",
"certificate",
")",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"List",
"<",
"X509Certi... | This method creates a new PKCS12 format key store containing a named private key and public certificate.
@param keyName The name of the private key and public certificate.
@param password The password used to encrypt the private key.
@param privateKey The private key.
@param certificate The X509 format public certific... | [
"This",
"method",
"creates",
"a",
"new",
"PKCS12",
"format",
"key",
"store",
"containing",
"a",
"named",
"private",
"key",
"and",
"public",
"certificate",
"."
] | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java#L161-L168 |
FasterXML/jackson-jr | jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSONObjectException.java | JSONObjectException.wrapWithPath | public static JSONObjectException wrapWithPath(Throwable src, Object refFrom,
String refFieldName) {
"""
Method that can be called to either create a new JsonMappingException
(if underlying exception is not a JsonMappingException), or augment
given exception wi... | java | public static JSONObjectException wrapWithPath(Throwable src, Object refFrom,
String refFieldName)
{
return wrapWithPath(src, new Reference(refFrom, refFieldName));
} | [
"public",
"static",
"JSONObjectException",
"wrapWithPath",
"(",
"Throwable",
"src",
",",
"Object",
"refFrom",
",",
"String",
"refFieldName",
")",
"{",
"return",
"wrapWithPath",
"(",
"src",
",",
"new",
"Reference",
"(",
"refFrom",
",",
"refFieldName",
")",
")",
... | Method that can be called to either create a new JsonMappingException
(if underlying exception is not a JsonMappingException), or augment
given exception with given path/reference information.
This version of method is called when the reference is through a
non-indexed object, such as a Map or POJO/bean. | [
"Method",
"that",
"can",
"be",
"called",
"to",
"either",
"create",
"a",
"new",
"JsonMappingException",
"(",
"if",
"underlying",
"exception",
"is",
"not",
"a",
"JsonMappingException",
")",
"or",
"augment",
"given",
"exception",
"with",
"given",
"path",
"/",
"re... | train | https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSONObjectException.java#L201-L205 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java | ThrottleFilter.getContentType | private String getContentType(HttpServletRequest pRequest) {
"""
Gets the content type for the response, suitable for the requesting user agent.
@param pRequest
@return the content type
"""
if (responseMessageTypes != null) {
String accept = pRequest.getHeader("Accept");
... | java | private String getContentType(HttpServletRequest pRequest) {
if (responseMessageTypes != null) {
String accept = pRequest.getHeader("Accept");
for (String type : responseMessageTypes) {
// Note: This is not 100% correct way of doing content negotiation
... | [
"private",
"String",
"getContentType",
"(",
"HttpServletRequest",
"pRequest",
")",
"{",
"if",
"(",
"responseMessageTypes",
"!=",
"null",
")",
"{",
"String",
"accept",
"=",
"pRequest",
".",
"getHeader",
"(",
"\"Accept\"",
")",
";",
"for",
"(",
"String",
"type",... | Gets the content type for the response, suitable for the requesting user agent.
@param pRequest
@return the content type | [
"Gets",
"the",
"content",
"type",
"for",
"the",
"response",
"suitable",
"for",
"the",
"requesting",
"user",
"agent",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java#L222-L237 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java | ClustersInner.beginCreateAsync | public Observable<ClusterInner> beginCreateAsync(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
"""
Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The na... | java | public Observable<ClusterInner> beginCreateAsync(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, clusterName, parameters).map(new Func1<ServiceResponse<ClusterInner>, ClusterInn... | [
"public",
"Observable",
"<",
"ClusterInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"clusterName",
",",
"ClusterCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
... | Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through ... | [
"Creates",
"a",
"Cluster",
"in",
"the",
"given",
"Workspace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java#L709-L716 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONNavi.java | JSONNavi.set | public JSONNavi<T> set(String key, long value) {
"""
write an value in the current object
@param key
key to access
@param value
new value
@return this
"""
return set(key, Long.valueOf(value));
} | java | public JSONNavi<T> set(String key, long value) {
return set(key, Long.valueOf(value));
} | [
"public",
"JSONNavi",
"<",
"T",
">",
"set",
"(",
"String",
"key",
",",
"long",
"value",
")",
"{",
"return",
"set",
"(",
"key",
",",
"Long",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | write an value in the current object
@param key
key to access
@param value
new value
@return this | [
"write",
"an",
"value",
"in",
"the",
"current",
"object"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONNavi.java#L239-L241 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/filters/FacebookAuthFilter.java | FacebookAuthFilter.attemptAuthentication | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException {
"""
Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal object if success... | java | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final String requestURI = request.getRequestURI();
UserAuthentication userAuth = null;
if (requestURI.endsWith(FACEBOOK_ACTION)) {
String authCode = request.getParameter("co... | [
"@",
"Override",
"public",
"Authentication",
"attemptAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"final",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",... | Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal object if successful.
@throws IOException ex | [
"Handles",
"an",
"authentication",
"request",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/filters/FacebookAuthFilter.java#L92-L119 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/impl/VaultConfig.java | VaultConfig.readVaultElement_3_0 | static VaultConfig readVaultElement_3_0(XMLExtendedStreamReader reader, Namespace expectedNs) throws XMLStreamException {
"""
In the 3.0 xsd the vault configuration and its options are part of the vault xsd.
@param reader the reader at the vault element
@param expectedNs the namespace
@return the vault config... | java | static VaultConfig readVaultElement_3_0(XMLExtendedStreamReader reader, Namespace expectedNs) throws XMLStreamException {
final VaultConfig config = new VaultConfig();
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttr... | [
"static",
"VaultConfig",
"readVaultElement_3_0",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"Namespace",
"expectedNs",
")",
"throws",
"XMLStreamException",
"{",
"final",
"VaultConfig",
"config",
"=",
"new",
"VaultConfig",
"(",
")",
";",
"final",
"int",
"count",
... | In the 3.0 xsd the vault configuration and its options are part of the vault xsd.
@param reader the reader at the vault element
@param expectedNs the namespace
@return the vault configuration | [
"In",
"the",
"3",
".",
"0",
"xsd",
"the",
"vault",
"configuration",
"and",
"its",
"options",
"are",
"part",
"of",
"the",
"vault",
"xsd",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/impl/VaultConfig.java#L104-L125 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java | ProjectedCentroid.put | @Override
public void put(double[] val, double weight) {
"""
Add data with a given weight.
@param val data
@param weight weight
"""
assert (val.length == elements.length);
if(weight == 0) {
return; // Skip zero weights.
}
final double nwsum = weight + wsum;
for(int i = BitsUtil.... | java | @Override
public void put(double[] val, double weight) {
assert (val.length == elements.length);
if(weight == 0) {
return; // Skip zero weights.
}
final double nwsum = weight + wsum;
for(int i = BitsUtil.nextSetBit(dims, 0); i >= 0; i = BitsUtil.nextSetBit(dims, i + 1)) {
final double ... | [
"@",
"Override",
"public",
"void",
"put",
"(",
"double",
"[",
"]",
"val",
",",
"double",
"weight",
")",
"{",
"assert",
"(",
"val",
".",
"length",
"==",
"elements",
".",
"length",
")",
";",
"if",
"(",
"weight",
"==",
"0",
")",
"{",
"return",
";",
... | Add data with a given weight.
@param val data
@param weight weight | [
"Add",
"data",
"with",
"a",
"given",
"weight",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java#L80-L93 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.toHex | public static String toHex(String str, Charset charset) {
"""
字符串转换成十六进制字符串,结果为小写
@param str 待转换的ASCII字符串
@param charset 编码
@return 16进制字符串
@see HexUtil#encodeHexStr(String, Charset)
"""
return HexUtil.encodeHexStr(str, charset);
} | java | public static String toHex(String str, Charset charset) {
return HexUtil.encodeHexStr(str, charset);
} | [
"public",
"static",
"String",
"toHex",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"{",
"return",
"HexUtil",
".",
"encodeHexStr",
"(",
"str",
",",
"charset",
")",
";",
"}"
] | 字符串转换成十六进制字符串,结果为小写
@param str 待转换的ASCII字符串
@param charset 编码
@return 16进制字符串
@see HexUtil#encodeHexStr(String, Charset) | [
"字符串转换成十六进制字符串,结果为小写"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L695-L697 |
upwork/java-upwork | src/com/Upwork/api/Routers/Messages.java | Messages.getRoomDetails | public JSONObject getRoomDetails(String company, String roomId, HashMap<String, String> params) throws JSONException {
"""
Get a specific room information
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
""... | java | public JSONObject getRoomDetails(String company, String roomId, HashMap<String, String> params) throws JSONException {
return oClient.get("/messages/v3/" + company + "/rooms/" + roomId, params);
} | [
"public",
"JSONObject",
"getRoomDetails",
"(",
"String",
"company",
",",
"String",
"roomId",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
"\"/messages/v3/\"",
"+",
"comp... | Get a specific room information
@param company Company ID
@param roomId Room ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Get",
"a",
"specific",
"room",
"information"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Messages.java#L62-L64 |
google/closure-compiler | src/com/google/javascript/jscomp/RuntimeTypeCheck.java | RuntimeTypeCheck.paramNamesOf | private static void paramNamesOf(Node node, ImmutableList.Builder<Node> names) {
"""
Recursively collects the NAME parameter nodes of a FUNCTION.
<p>This lookup abstracts over the other legal node types in a PARAM_LIST. It includes only
those nodes that declare bindings within the function body.
"""
sw... | java | private static void paramNamesOf(Node node, ImmutableList.Builder<Node> names) {
switch (node.getToken()) {
case NAME:
names.add(node);
break;
case REST:
case DEFAULT_VALUE:
paramNamesOf(node.getFirstChild(), names);
break;
case PARAM_LIST:
case ARRAY_... | [
"private",
"static",
"void",
"paramNamesOf",
"(",
"Node",
"node",
",",
"ImmutableList",
".",
"Builder",
"<",
"Node",
">",
"names",
")",
"{",
"switch",
"(",
"node",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"NAME",
":",
"names",
".",
"add",
"(",
"n... | Recursively collects the NAME parameter nodes of a FUNCTION.
<p>This lookup abstracts over the other legal node types in a PARAM_LIST. It includes only
those nodes that declare bindings within the function body. | [
"Recursively",
"collects",
"the",
"NAME",
"parameter",
"nodes",
"of",
"a",
"FUNCTION",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RuntimeTypeCheck.java#L443-L472 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.