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 |
|---|---|---|---|---|---|---|---|---|---|---|
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextBundleRegistry.java | DefaultTextBundleRegistry.toJavaResourceName | protected final String toJavaResourceName(String bundleName, Locale locale) {
"""
java properties bundle name
@param bundleName
@param locale
@return convented properties ended file path.
"""
String fullName = bundleName;
final String localeName = toLocaleStr(locale);
final String suffix = "pr... | java | protected final String toJavaResourceName(String bundleName, Locale locale) {
String fullName = bundleName;
final String localeName = toLocaleStr(locale);
final String suffix = "properties";
if (!"".equals(localeName)) fullName = fullName + "_" + localeName;
StringBuilder sb = new StringBuilder(full... | [
"protected",
"final",
"String",
"toJavaResourceName",
"(",
"String",
"bundleName",
",",
"Locale",
"locale",
")",
"{",
"String",
"fullName",
"=",
"bundleName",
";",
"final",
"String",
"localeName",
"=",
"toLocaleStr",
"(",
"locale",
")",
";",
"final",
"String",
... | java properties bundle name
@param bundleName
@param locale
@return convented properties ended file path. | [
"java",
"properties",
"bundle",
"name"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/text/i18n/impl/DefaultTextBundleRegistry.java#L177-L185 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java | CurrencyHelper.parseCurrency | @Nullable
public static BigDecimal parseCurrency (@Nullable final String sStr,
@Nonnull final DecimalFormat aFormat,
@Nullable final BigDecimal aDefault) {
"""
Parse a currency value from string using the currency default roundin... | java | @Nullable
public static BigDecimal parseCurrency (@Nullable final String sStr,
@Nonnull final DecimalFormat aFormat,
@Nullable final BigDecimal aDefault)
{
return parseCurrency (sStr, aFormat, aDefault, DEFAULT_ROUNDING_MODE);
... | [
"@",
"Nullable",
"public",
"static",
"BigDecimal",
"parseCurrency",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnull",
"final",
"DecimalFormat",
"aFormat",
",",
"@",
"Nullable",
"final",
"BigDecimal",
"aDefault",
")",
"{",
"return",
"parseCurr... | Parse a currency value from string using the currency default rounding
mode.<br>
Source:
<code>http://wheelworkshop.blogspot.com/2006/02/parsing-currency-into-bigdecimal.html</code>
@param sStr
The string to be parsed.
@param aFormat
The formatting object to be used. May not be <code>null</code>.
@param aDefault
The d... | [
"Parse",
"a",
"currency",
"value",
"from",
"string",
"using",
"the",
"currency",
"default",
"rounding",
"mode",
".",
"<br",
">",
"Source",
":",
"<code",
">",
"http",
":",
"//",
"wheelworkshop",
".",
"blogspot",
".",
"com",
"/",
"2006",
"/",
"02",
"/",
... | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java#L199-L205 |
codegist/crest | core/src/main/java/org/codegist/crest/param/ParamProcessors.java | ParamProcessors.newInstance | public static ParamProcessor newInstance(ParamType type, String listSeparator) {
"""
Returns an instance of a param processor.
@param type parameter type
@param listSeparator list separator if applicable, otherwise null
@return instance of param processor
"""
switch(type){
case COOKIE:
... | java | public static ParamProcessor newInstance(ParamType type, String listSeparator){
switch(type){
case COOKIE:
return listSeparator != null ? new CollectionMergingCookieParamProcessor(listSeparator) : DefaultCookieParamProcessor.INSTANCE;
default:
return listS... | [
"public",
"static",
"ParamProcessor",
"newInstance",
"(",
"ParamType",
"type",
",",
"String",
"listSeparator",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"COOKIE",
":",
"return",
"listSeparator",
"!=",
"null",
"?",
"new",
"CollectionMergingCookieParamProce... | Returns an instance of a param processor.
@param type parameter type
@param listSeparator list separator if applicable, otherwise null
@return instance of param processor | [
"Returns",
"an",
"instance",
"of",
"a",
"param",
"processor",
"."
] | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/param/ParamProcessors.java#L48-L55 |
dkmfbk/knowledgestore | ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java | SelectQuery.replaceVariables | public SelectQuery replaceVariables(final BindingSet bindings) {
"""
Replaces some variables of this queries with the constant values specified, returning the
resulting <tt>SelectQuery</tt> object.
@param bindings
the bindings to apply
@return the resulting <tt>SelectQuery</tt> object (possibly <tt>this</tt>... | java | public SelectQuery replaceVariables(final BindingSet bindings) {
if (bindings.size() == 0) {
return this;
}
// TODO: check whether the visitor code (taken from BindingAssigner) is enough, especially
// w.r.t. variables appearing in projection nodes (= SELECT clause).
... | [
"public",
"SelectQuery",
"replaceVariables",
"(",
"final",
"BindingSet",
"bindings",
")",
"{",
"if",
"(",
"bindings",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"// TODO: check whether the visitor code (taken from BindingAssigner) is enoug... | Replaces some variables of this queries with the constant values specified, returning the
resulting <tt>SelectQuery</tt> object.
@param bindings
the bindings to apply
@return the resulting <tt>SelectQuery</tt> object (possibly <tt>this</tt> if no change is
required). | [
"Replaces",
"some",
"variables",
"of",
"this",
"queries",
"with",
"the",
"constant",
"values",
"specified",
"returning",
"the",
"resulting",
"<tt",
">",
"SelectQuery<",
"/",
"tt",
">",
"object",
"."
] | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java#L221-L248 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listWebWorkerUsagesAsync | public Observable<Page<UsageInner>> listWebWorkerUsagesAsync(final String resourceGroupName, final String name, final String workerPoolName) {
"""
Get usage metrics for a worker pool of an App Service Environment.
Get usage metrics for a worker pool of an App Service Environment.
@param resourceGroupName Name ... | java | public Observable<Page<UsageInner>> listWebWorkerUsagesAsync(final String resourceGroupName, final String name, final String workerPoolName) {
return listWebWorkerUsagesWithServiceResponseAsync(resourceGroupName, name, workerPoolName)
.map(new Func1<ServiceResponse<Page<UsageInner>>, Page<UsageInner... | [
"public",
"Observable",
"<",
"Page",
"<",
"UsageInner",
">",
">",
"listWebWorkerUsagesAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"workerPoolName",
")",
"{",
"return",
"listWebWorkerUsagesWithServiceResp... | Get usage metrics for a worker pool of an App Service Environment.
Get usage metrics for a worker pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@throw... | [
"Get",
"usage",
"metrics",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"usage",
"metrics",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L6524-L6532 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.translateTo2BitCrid | private String translateTo2BitCrid(Map cuData, String id, String defVal) {
"""
Try to translate 3-bit CRID to 2-bit version stored in the map
@param cuData the cultivar data record
@param id the field id for contain crop id info
@param defVal the default value when id is not available
@return 2-bit crop ID
... | java | private String translateTo2BitCrid(Map cuData, String id, String defVal) {
String crid = getValueOr(cuData, id, "");
if (!crid.equals("")) {
return DssatCRIDHelper.get2BitCrid(crid);
} else {
return defVal;
}
} | [
"private",
"String",
"translateTo2BitCrid",
"(",
"Map",
"cuData",
",",
"String",
"id",
",",
"String",
"defVal",
")",
"{",
"String",
"crid",
"=",
"getValueOr",
"(",
"cuData",
",",
"id",
",",
"\"\"",
")",
";",
"if",
"(",
"!",
"crid",
".",
"equals",
"(",
... | Try to translate 3-bit CRID to 2-bit version stored in the map
@param cuData the cultivar data record
@param id the field id for contain crop id info
@param defVal the default value when id is not available
@return 2-bit crop ID | [
"Try",
"to",
"translate",
"3",
"-",
"bit",
"CRID",
"to",
"2",
"-",
"bit",
"version",
"stored",
"in",
"the",
"map"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1565-L1572 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CovarianceOps_DDRM.java | CovarianceOps_DDRM.randomVector | public static void randomVector( DMatrixRMaj cov ,
DMatrixRMaj vector ,
Random rand ) {
"""
Sets vector to a random value based upon a zero-mean multivariate Gaussian distribution with
covariance 'cov'. If repeat calls are made to this cl... | java | public static void randomVector( DMatrixRMaj cov ,
DMatrixRMaj vector ,
Random rand )
{
CovarianceRandomDraw_DDRM rng = new CovarianceRandomDraw_DDRM(rand,cov);
rng.next(vector);
} | [
"public",
"static",
"void",
"randomVector",
"(",
"DMatrixRMaj",
"cov",
",",
"DMatrixRMaj",
"vector",
",",
"Random",
"rand",
")",
"{",
"CovarianceRandomDraw_DDRM",
"rng",
"=",
"new",
"CovarianceRandomDraw_DDRM",
"(",
"rand",
",",
"cov",
")",
";",
"rng",
".",
"n... | Sets vector to a random value based upon a zero-mean multivariate Gaussian distribution with
covariance 'cov'. If repeat calls are made to this class, consider using {@link CovarianceRandomDraw_DDRM} instead.
@param cov The distirbutions covariance. Not modified.
@param vector The random vector. Modified.
@param ran... | [
"Sets",
"vector",
"to",
"a",
"random",
"value",
"based",
"upon",
"a",
"zero",
"-",
"mean",
"multivariate",
"Gaussian",
"distribution",
"with",
"covariance",
"cov",
".",
"If",
"repeat",
"calls",
"are",
"made",
"to",
"this",
"class",
"consider",
"using",
"{",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CovarianceOps_DDRM.java#L119-L125 |
f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.updateProgressButton | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
"""
Helper method to update the progressButton's progress and it's
content description.
"""
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | java | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | [
"private",
"void",
"updateProgressButton",
"(",
"ProgressButton",
"progressButton",
",",
"SeekBar",
"progressSeekBar",
")",
"{",
"progressButton",
".",
"setProgress",
"(",
"progressSeekBar",
".",
"getProgress",
"(",
")",
")",
";",
"updatePinProgressContentDescription",
... | Helper method to update the progressButton's progress and it's
content description. | [
"Helper",
"method",
"to",
"update",
"the",
"progressButton",
"s",
"progress",
"and",
"it",
"s",
"content",
"description",
"."
] | train | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L149-L152 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/V1InstanceGetter.java | V1InstanceGetter.regressionPlans | public Collection<RegressionPlan> regressionPlans(RegressionPlanFilter filter) {
"""
Gets regression plans filtered by the criteria specified in the passed in filter.
@param filter Limit the items returned. If null, then all items are returned.
@return Collection of items as specified in the filter.
"""
... | java | public Collection<RegressionPlan> regressionPlans(RegressionPlanFilter filter) {
return get(RegressionPlan.class, (filter != null) ? filter : new RegressionPlanFilter());
} | [
"public",
"Collection",
"<",
"RegressionPlan",
">",
"regressionPlans",
"(",
"RegressionPlanFilter",
"filter",
")",
"{",
"return",
"get",
"(",
"RegressionPlan",
".",
"class",
",",
"(",
"filter",
"!=",
"null",
")",
"?",
"filter",
":",
"new",
"RegressionPlanFilter"... | Gets regression plans filtered by the criteria specified in the passed in filter.
@param filter Limit the items returned. If null, then all items are returned.
@return Collection of items as specified in the filter. | [
"Gets",
"regression",
"plans",
"filtered",
"by",
"the",
"criteria",
"specified",
"in",
"the",
"passed",
"in",
"filter",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceGetter.java#L370-L372 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java | ObjectiveMessageResources.getBundleResolvedExtends | protected MessageResourceBundle getBundleResolvedExtends(String appMessageName, List<String> extendsNameList, Locale locale) {
"""
Resolve the extends bundle, basically called by {@link #getBundle(Locale)}. <br>
Returned bundle has merged properties for application and extends messages. <br>
You can get your mes... | java | protected MessageResourceBundle getBundleResolvedExtends(String appMessageName, List<String> extendsNameList, Locale locale) {
final MessageResourceBundle appBundle = findBundleSimply(appMessageName, locale);
if (extendsNameList.isEmpty()) { // no extends, no logic
return appBundle;
... | [
"protected",
"MessageResourceBundle",
"getBundleResolvedExtends",
"(",
"String",
"appMessageName",
",",
"List",
"<",
"String",
">",
"extendsNameList",
",",
"Locale",
"locale",
")",
"{",
"final",
"MessageResourceBundle",
"appBundle",
"=",
"findBundleSimply",
"(",
"appMes... | Resolve the extends bundle, basically called by {@link #getBundle(Locale)}. <br>
Returned bundle has merged properties for application and extends messages. <br>
You can get your message by normal way.
@param appMessageName The message name for application. (NotNull)
@param extendsNameList The list of extends-message n... | [
"Resolve",
"the",
"extends",
"bundle",
"basically",
"called",
"by",
"{"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/ruts/message/objective/ObjectiveMessageResources.java#L406-L423 |
termsuite/termsuite-core | src/main/java/fr/univnantes/termsuite/model/Word.java | Word.getNeoclassicalAffix | public Component getNeoclassicalAffix() {
"""
Returns the {@link Component} object if
@return
The neoclassical component affix
@throws IllegalStateException when this word is not a neoclassical compound
"""
Preconditions.checkState(isCompound(), MSG_NOT_COMPOUND, this);
Preconditions.checkState(getC... | java | public Component getNeoclassicalAffix() {
Preconditions.checkState(isCompound(), MSG_NOT_COMPOUND, this);
Preconditions.checkState(getCompoundType() == CompoundType.NEOCLASSICAL, MSG_NOT_NEOCLASSICAL, this);
for(Component c:components)
if(c.isNeoclassicalAffix())
return c;
throw new IllegalArgumentExcept... | [
"public",
"Component",
"getNeoclassicalAffix",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"isCompound",
"(",
")",
",",
"MSG_NOT_COMPOUND",
",",
"this",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"getCompoundType",
"(",
")",
"==",
"CompoundTy... | Returns the {@link Component} object if
@return
The neoclassical component affix
@throws IllegalStateException when this word is not a neoclassical compound | [
"Returns",
"the",
"{",
"@link",
"Component",
"}",
"object",
"if"
] | train | https://github.com/termsuite/termsuite-core/blob/731e5d0bc7c14180713c01a9c7dffe1925f26130/src/main/java/fr/univnantes/termsuite/model/Word.java#L129-L136 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getNormalizedMessages | public NormalizedMessagesEnvelope getNormalizedMessages(String uid, String sdid, String mid, String fieldPresence, String filter, String offset, Integer count, Long startDate, Long endDate, String order) throws ApiException {
"""
Get Normalized Messages
Get the messages normalized
@param uid User ID. If not spec... | java | public NormalizedMessagesEnvelope getNormalizedMessages(String uid, String sdid, String mid, String fieldPresence, String filter, String offset, Integer count, Long startDate, Long endDate, String order) throws ApiException {
ApiResponse<NormalizedMessagesEnvelope> resp = getNormalizedMessagesWithHttpInfo(uid, ... | [
"public",
"NormalizedMessagesEnvelope",
"getNormalizedMessages",
"(",
"String",
"uid",
",",
"String",
"sdid",
",",
"String",
"mid",
",",
"String",
"fieldPresence",
",",
"String",
"filter",
",",
"String",
"offset",
",",
"Integer",
"count",
",",
"Long",
"startDate",... | Get Normalized Messages
Get the messages normalized
@param uid User ID. If not specified, assume that of the current authenticated user. If specified, it must be that of a user for which the current authenticated user has read access to. (optional)
@param sdid Source device ID of the messages being searched. (optional)... | [
"Get",
"Normalized",
"Messages",
"Get",
"the",
"messages",
"normalized"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L1000-L1003 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/BigIntegerRangeRandomizer.java | BigIntegerRangeRandomizer.aNewBigIntegerRangeRandomizer | public static BigIntegerRangeRandomizer aNewBigIntegerRangeRandomizer(final Integer min, final Integer max, final long seed) {
"""
Create a new {@link BigIntegerRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link BigIntegerRangeRandomizer}.
"""
... | java | public static BigIntegerRangeRandomizer aNewBigIntegerRangeRandomizer(final Integer min, final Integer max, final long seed) {
return new BigIntegerRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"BigIntegerRangeRandomizer",
"aNewBigIntegerRangeRandomizer",
"(",
"final",
"Integer",
"min",
",",
"final",
"Integer",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"BigIntegerRangeRandomizer",
"(",
"min",
",",
"max",
",",
"se... | Create a new {@link BigIntegerRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link BigIntegerRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"BigIntegerRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/BigIntegerRangeRandomizer.java#L79-L81 |
alkacon/opencms-core | src/org/opencms/ui/shared/CmsContextMenuState.java | CmsContextMenuState.addChild | public ContextMenuItemState addChild(String itemCaption, String itemId) {
"""
Adds a child item.<p>
@param itemCaption the caption
@param itemId the id
@return the item state
"""
ContextMenuItemState rootItem = new ContextMenuItemState();
rootItem.setCaption(itemCaption);
ro... | java | public ContextMenuItemState addChild(String itemCaption, String itemId) {
ContextMenuItemState rootItem = new ContextMenuItemState();
rootItem.setCaption(itemCaption);
rootItem.setId(itemId);
m_rootItems.add(rootItem);
return rootItem;
} | [
"public",
"ContextMenuItemState",
"addChild",
"(",
"String",
"itemCaption",
",",
"String",
"itemId",
")",
"{",
"ContextMenuItemState",
"rootItem",
"=",
"new",
"ContextMenuItemState",
"(",
")",
";",
"rootItem",
".",
"setCaption",
"(",
"itemCaption",
")",
";",
"root... | Adds a child item.<p>
@param itemCaption the caption
@param itemId the id
@return the item state | [
"Adds",
"a",
"child",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/shared/CmsContextMenuState.java#L277-L286 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.isControlStructureCodeBlock | static boolean isControlStructureCodeBlock(Node parent, Node n) {
"""
Determines whether the given node is code node for FOR, DO,
WHILE, WITH, or IF node.
"""
switch (parent.getToken()) {
case DO:
return parent.getFirstChild() == n;
case TRY:
return parent.getFirstChild() == n ... | java | static boolean isControlStructureCodeBlock(Node parent, Node n) {
switch (parent.getToken()) {
case DO:
return parent.getFirstChild() == n;
case TRY:
return parent.getFirstChild() == n || parent.getLastChild() == n;
case FOR:
case FOR_IN:
case FOR_OF:
case FOR_AWA... | [
"static",
"boolean",
"isControlStructureCodeBlock",
"(",
"Node",
"parent",
",",
"Node",
"n",
")",
"{",
"switch",
"(",
"parent",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"DO",
":",
"return",
"parent",
".",
"getFirstChild",
"(",
")",
"==",
"n",
";",
... | Determines whether the given node is code node for FOR, DO,
WHILE, WITH, or IF node. | [
"Determines",
"whether",
"the",
"given",
"node",
"is",
"code",
"node",
"for",
"FOR",
"DO",
"WHILE",
"WITH",
"or",
"IF",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L2563-L2588 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.isPrivate | public static Matcher isPrivate() {
"""
Returns a Matcher that matches against nodes that are declared {@code @private}.
"""
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(node);
if (jsDoc != null... | java | public static Matcher isPrivate() {
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(node);
if (jsDoc != null) {
return jsDoc.getVisibility() == Visibility.PRIVATE;
}
return false;
... | [
"public",
"static",
"Matcher",
"isPrivate",
"(",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"JSDocInfo",
"jsDoc",
"=",
"NodeUtil",
".... | Returns a Matcher that matches against nodes that are declared {@code @private}. | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"against",
"nodes",
"that",
"are",
"declared",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L392-L402 |
wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java | ElementHelper.declareInstance | public static Element declareInstance(ComponentWorkbench workbench) {
"""
Declares an instance.
@param workbench the workbench
@return the Instance element
"""
Element instance = new Element("instance", "");
instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()))... | java | public static Element declareInstance(ComponentWorkbench workbench) {
Element instance = new Element("instance", "");
instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()));
return instance;
} | [
"public",
"static",
"Element",
"declareInstance",
"(",
"ComponentWorkbench",
"workbench",
")",
"{",
"Element",
"instance",
"=",
"new",
"Element",
"(",
"\"instance\"",
",",
"\"\"",
")",
";",
"instance",
".",
"addAttribute",
"(",
"new",
"Attribute",
"(",
"COMPONEN... | Declares an instance.
@param workbench the workbench
@return the Instance element | [
"Declares",
"an",
"instance",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java#L43-L47 |
datacleaner/DataCleaner | desktop/api/src/main/java/org/datacleaner/util/WidgetUtils.java | WidgetUtils.findCompatibleFont | public static Font findCompatibleFont(final String text, final Font fallbackFont) {
"""
Finds a font that is capable of displaying the provided text.
@param text the text to display.
@param fallbackFont the font to fall back to in case no capable font was found
@return a font suitable for displaying the text
... | java | public static Font findCompatibleFont(final String text, final Font fallbackFont) {
final String[] searchFonts = new String[] { Font.SANS_SERIF, Font.SERIF, "Verdana", "Arial Unicode MS",
"MS UI Gothic", "MS Mincho", "MS Gothic", "Osaka" };
for (final String fontName : searchFonts) {
... | [
"public",
"static",
"Font",
"findCompatibleFont",
"(",
"final",
"String",
"text",
",",
"final",
"Font",
"fallbackFont",
")",
"{",
"final",
"String",
"[",
"]",
"searchFonts",
"=",
"new",
"String",
"[",
"]",
"{",
"Font",
".",
"SANS_SERIF",
",",
"Font",
".",
... | Finds a font that is capable of displaying the provided text.
@param text the text to display.
@param fallbackFont the font to fall back to in case no capable font was found
@return a font suitable for displaying the text | [
"Finds",
"a",
"font",
"that",
"is",
"capable",
"of",
"displaying",
"the",
"provided",
"text",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/api/src/main/java/org/datacleaner/util/WidgetUtils.java#L637-L655 |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapAttachmentResourceHandler.java | MapAttachmentResourceHandler.addResourceHandler | public void addResourceHandler(Class<? extends NamedResource> clazz, JavaMailAttachmentResourceHandler handler) {
"""
Register a new attachment resource handler.
@param clazz
the class of the attachment resource
@param handler
the attachment resource handler
"""
map.put(clazz, handler);
} | java | public void addResourceHandler(Class<? extends NamedResource> clazz, JavaMailAttachmentResourceHandler handler) {
map.put(clazz, handler);
} | [
"public",
"void",
"addResourceHandler",
"(",
"Class",
"<",
"?",
"extends",
"NamedResource",
">",
"clazz",
",",
"JavaMailAttachmentResourceHandler",
"handler",
")",
"{",
"map",
".",
"put",
"(",
"clazz",
",",
"handler",
")",
";",
"}"
] | Register a new attachment resource handler.
@param clazz
the class of the attachment resource
@param handler
the attachment resource handler | [
"Register",
"a",
"new",
"attachment",
"resource",
"handler",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapAttachmentResourceHandler.java#L64-L66 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/Utils.java | Utils.getUrl | public static String getUrl(final URL url, final Properties requestProps, final Integer timeout) throws Exception {
"""
Get contents from an URL.
@param url
The url
@param requestProps
The request props
@param timeout
The timeout
@return Requested value
@throws IOException
-
"""
return HttpU... | java | public static String getUrl(final URL url, final Properties requestProps, final Integer timeout) throws Exception {
return HttpUtils.doGET(url, requestProps, timeout, false, false);
} | [
"public",
"static",
"String",
"getUrl",
"(",
"final",
"URL",
"url",
",",
"final",
"Properties",
"requestProps",
",",
"final",
"Integer",
"timeout",
")",
"throws",
"Exception",
"{",
"return",
"HttpUtils",
".",
"doGET",
"(",
"url",
",",
"requestProps",
",",
"t... | Get contents from an URL.
@param url
The url
@param requestProps
The request props
@param timeout
The timeout
@return Requested value
@throws IOException
- | [
"Get",
"contents",
"from",
"an",
"URL",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/Utils.java#L67-L70 |
google/closure-compiler | src/com/google/javascript/jscomp/gwt/super/com/google/javascript/jscomp/SourceMapResolver.java | SourceMapResolver.extractSourceMap | static SourceFile extractSourceMap(
SourceFile jsFile, String sourceMapURL, boolean parseInlineSourceMaps) {
"""
For a given //# sourceMappingUrl, this locates the appropriate sourcemap on disk. This is use
for sourcemap merging (--apply_input_source_maps) and for error resolution.
"""
// Javascript... | java | static SourceFile extractSourceMap(
SourceFile jsFile, String sourceMapURL, boolean parseInlineSourceMaps) {
// Javascript version of the compiler can only deal with inline sources.
if (sourceMapURL.startsWith(BASE64_URL_PREFIX)) {
byte[] data =
BaseEncoding.base64().decode(sourceMapURL.su... | [
"static",
"SourceFile",
"extractSourceMap",
"(",
"SourceFile",
"jsFile",
",",
"String",
"sourceMapURL",
",",
"boolean",
"parseInlineSourceMaps",
")",
"{",
"// Javascript version of the compiler can only deal with inline sources.",
"if",
"(",
"sourceMapURL",
".",
"startsWith",
... | For a given //# sourceMappingUrl, this locates the appropriate sourcemap on disk. This is use
for sourcemap merging (--apply_input_source_maps) and for error resolution. | [
"For",
"a",
"given",
"//",
"#",
"sourceMappingUrl",
"this",
"locates",
"the",
"appropriate",
"sourcemap",
"on",
"disk",
".",
"This",
"is",
"use",
"for",
"sourcemap",
"merging",
"(",
"--",
"apply_input_source_maps",
")",
"and",
"for",
"error",
"resolution",
"."... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/gwt/super/com/google/javascript/jscomp/SourceMapResolver.java#L33-L43 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Cosh | public static double Cosh(double x, int nTerms) {
"""
compute Cosh using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result.
"""
if (nTerms < 2) return x;
if (nTerms == 2) {
return 1 + (x * x) / 2D;
} else {
... | java | public static double Cosh(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return 1 + (x * x) / 2D;
} else {
double mult = x * x;
double fact = 2;
int factS = 4;
double result = 1 + mult / fact;
... | [
"public",
"static",
"double",
"Cosh",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"1",
"+",
"(",
"x",
"*",
"x",
")",
"/",
"2D"... | compute Cosh using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Cosh",
"using",
"Taylor",
"Series",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L135-L154 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java | TrackerClientCache.createClient | private CoronaTaskTrackerProtocol createClient(String host, int port)
throws IOException {
"""
Connect to the task tracker and get the RPC client.
@param host The host.
@param port the port.
@return The RPC client.
@throws IOException
"""
String staticHost = NetUtils.getStaticResolution(host);
... | java | private CoronaTaskTrackerProtocol createClient(String host, int port)
throws IOException {
String staticHost = NetUtils.getStaticResolution(host);
InetSocketAddress s = null;
InetAddress inetAddress = null;
byte[] byteArr = null;
if (staticHost != null) {
inetAddress = InetAddress.getByNa... | [
"private",
"CoronaTaskTrackerProtocol",
"createClient",
"(",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"String",
"staticHost",
"=",
"NetUtils",
".",
"getStaticResolution",
"(",
"host",
")",
";",
"InetSocketAddress",
"s",
"=",
"null",... | Connect to the task tracker and get the RPC client.
@param host The host.
@param port the port.
@return The RPC client.
@throws IOException | [
"Connect",
"to",
"the",
"task",
"tracker",
"and",
"get",
"the",
"RPC",
"client",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/TrackerClientCache.java#L100-L131 |
maxschuster/Vaadin-SignatureField | vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/converter/StringToByteArrayConverter.java | StringToByteArrayConverter.matchMimeType | protected boolean matchMimeType(DataUrl dataUrl, MimeType mimeType) {
"""
Matches the MIME-Type of the given {@code DataUrl} with the given
{@link MimeType}.
@param dataUrl The {@link DataUrl} to match.
@param mimeType The {@link MimeType} to match against.
@return MIME-Type matches the {@link MimeType}.
... | java | protected boolean matchMimeType(DataUrl dataUrl, MimeType mimeType) {
MimeType dataUrlMimeType;
try {
dataUrlMimeType = MimeType.valueOfMimeType(dataUrl.getMimeType());
} catch (IllegalArgumentException e) {
// The MIME-Type is not supported
return false;
... | [
"protected",
"boolean",
"matchMimeType",
"(",
"DataUrl",
"dataUrl",
",",
"MimeType",
"mimeType",
")",
"{",
"MimeType",
"dataUrlMimeType",
";",
"try",
"{",
"dataUrlMimeType",
"=",
"MimeType",
".",
"valueOfMimeType",
"(",
"dataUrl",
".",
"getMimeType",
"(",
")",
"... | Matches the MIME-Type of the given {@code DataUrl} with the given
{@link MimeType}.
@param dataUrl The {@link DataUrl} to match.
@param mimeType The {@link MimeType} to match against.
@return MIME-Type matches the {@link MimeType}. | [
"Matches",
"the",
"MIME",
"-",
"Type",
"of",
"the",
"given",
"{",
"@code",
"DataUrl",
"}",
"with",
"the",
"given",
"{",
"@link",
"MimeType",
"}",
"."
] | train | https://github.com/maxschuster/Vaadin-SignatureField/blob/b6f6b7042ea9c46060af54bd92d21770abfcccee/vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/converter/StringToByteArrayConverter.java#L230-L239 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/CellProcessor.java | CellProcessor.getCellPosition | private CellPosition getCellPosition(final FieldAccessor accessor, final XlsCell anno) throws AnnotationInvalidException {
"""
アノテーションから、セルのアドレスを取得する。
@param accessor フィールド情報
@param anno アノテーション
@return 値が設定されているセルのアドレス
@throws AnnotationInvalidException アドレスの設定値が不正な場合
"""
if(Utils.isNotEmpty(an... | java | private CellPosition getCellPosition(final FieldAccessor accessor, final XlsCell anno) throws AnnotationInvalidException {
if(Utils.isNotEmpty(anno.address())) {
try {
return CellPosition.of(anno.address());
} catch(IllegalArgumentException e) {
thr... | [
"private",
"CellPosition",
"getCellPosition",
"(",
"final",
"FieldAccessor",
"accessor",
",",
"final",
"XlsCell",
"anno",
")",
"throws",
"AnnotationInvalidException",
"{",
"if",
"(",
"Utils",
".",
"isNotEmpty",
"(",
"anno",
".",
"address",
"(",
")",
")",
")",
... | アノテーションから、セルのアドレスを取得する。
@param accessor フィールド情報
@param anno アノテーション
@return 値が設定されているセルのアドレス
@throws AnnotationInvalidException アドレスの設定値が不正な場合 | [
"アノテーションから、セルのアドレスを取得する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/CellProcessor.java#L69-L108 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java | AlertResources.deleteTriggersById | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Deletes a trigger from alert.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null.
@param triggerId The trigger Id. Cannot be null.
@return Updated alert object.
@throws W... | java | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/{alertId}/triggers/{triggerId}")
@Description("Deletes a trigger having the given ID and removes any associations with the alert or notifications.")
public Response deleteTriggersById(@Context HttpServletRequest req,
@PathParam("alertId") BigInteger alertId,
... | [
"@",
"DELETE",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{alertId}/triggers/{triggerId}\"",
")",
"@",
"Description",
"(",
"\"Deletes a trigger having the given ID and removes any associations with the alert or notifications.\"",
")",
... | Deletes a trigger from alert.
@param req The HttpServlet request object. Cannot be null.
@param alertId The alert Id. Cannot be null.
@param triggerId The trigger Id. Cannot be null.
@return Updated alert object.
@throws WebApplicationException The exception with 404 status will be thrown if an a... | [
"Deletes",
"a",
"trigger",
"from",
"alert",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java#L1251-L1286 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginRegenerateKey | public void beginRegenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) {
"""
Regenerates an access key for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param keyKind The acc... | java | public void beginRegenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) {
beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().single().body();
} | [
"public",
"void",
"beginRegenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"KeyKind",
"keyKind",
")",
"{",
"beginRegenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"keyKind",
")",
".",
"toBlocki... | Regenerates an access key for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly... | [
"Regenerates",
"an",
"access",
"key",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1877-L1879 |
UrielCh/ovh-java-sdk | ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java | ApiOvhSupport.tickets_ticketId_GET | public OvhTicket tickets_ticketId_GET(Long ticketId) throws IOException {
"""
Get ticket
REST: GET /support/tickets/{ticketId}
@param ticketId [required] internal identifier ticket
"""
String qPath = "/support/tickets/{ticketId}";
StringBuilder sb = path(qPath, ticketId);
String resp = exec(qPath, "G... | java | public OvhTicket tickets_ticketId_GET(Long ticketId) throws IOException {
String qPath = "/support/tickets/{ticketId}";
StringBuilder sb = path(qPath, ticketId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTicket.class);
} | [
"public",
"OvhTicket",
"tickets_ticketId_GET",
"(",
"Long",
"ticketId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/support/tickets/{ticketId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ticketId",
")",
";",
"String",
"resp"... | Get ticket
REST: GET /support/tickets/{ticketId}
@param ticketId [required] internal identifier ticket | [
"Get",
"ticket"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-support/src/main/java/net/minidev/ovh/api/ApiOvhSupport.java#L104-L109 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/MemberConfig.java | MemberConfig.setProperties | public MemberConfig setProperties(Map<String, String> map) {
"""
Sets the member properties.
@param map the member properties
@return the member configuration
"""
Properties properties = new Properties();
properties.putAll(map);
return setProperties(properties);
} | java | public MemberConfig setProperties(Map<String, String> map) {
Properties properties = new Properties();
properties.putAll(map);
return setProperties(properties);
} | [
"public",
"MemberConfig",
"setProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"putAll",
"(",
"map",
")",
";",
"return",
"setProperties",
"(... | Sets the member properties.
@param map the member properties
@return the member configuration | [
"Sets",
"the",
"member",
"properties",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/MemberConfig.java#L188-L192 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/Context.java | Context.getUserAttribute | public String getUserAttribute(final String _key)
throws EFapsException {
"""
This method retrieves a UserAttribute of the Person this Context belongs
to. The UserAttributes are stored in the {@link #sessionAttributes} Map,
therefore are thought to be valid for one session.
@param _key key to Search f... | java | public String getUserAttribute(final String _key)
throws EFapsException
{
if (containsSessionAttribute(UserAttributesSet.CONTEXTMAPKEY)) {
return ((UserAttributesSet) getSessionAttribute(UserAttributesSet.CONTEXTMAPKEY)).getString(_key);
} else {
throw new EFapsExcept... | [
"public",
"String",
"getUserAttribute",
"(",
"final",
"String",
"_key",
")",
"throws",
"EFapsException",
"{",
"if",
"(",
"containsSessionAttribute",
"(",
"UserAttributesSet",
".",
"CONTEXTMAPKEY",
")",
")",
"{",
"return",
"(",
"(",
"UserAttributesSet",
")",
"getSe... | This method retrieves a UserAttribute of the Person this Context belongs
to. The UserAttributes are stored in the {@link #sessionAttributes} Map,
therefore are thought to be valid for one session.
@param _key key to Search for
@return String with the value
@throws EFapsException on error | [
"This",
"method",
"retrieves",
"a",
"UserAttribute",
"of",
"the",
"Person",
"this",
"Context",
"belongs",
"to",
".",
"The",
"UserAttributes",
"are",
"stored",
"in",
"the",
"{",
"@link",
"#sessionAttributes",
"}",
"Map",
"therefore",
"are",
"thought",
"to",
"be... | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/Context.java#L618-L626 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/WsLogRecord.java | WsLogRecord.createWsLogRecord | public static WsLogRecord createWsLogRecord(TraceComponent tc, Level level, String msg, Object[] msgParms) {
"""
Static method constructs a WsLogRecord object using the given parameters.
This bridges Tr-based trace and Logger based trace
"""
WsLogRecord retMe = new WsLogRecord(level, msg);
re... | java | public static WsLogRecord createWsLogRecord(TraceComponent tc, Level level, String msg, Object[] msgParms) {
WsLogRecord retMe = new WsLogRecord(level, msg);
retMe.setLoggerName(tc.getName());
retMe.setParameters(msgParms);
retMe.setTraceClass(tc.getTraceClass());
retMe.setResou... | [
"public",
"static",
"WsLogRecord",
"createWsLogRecord",
"(",
"TraceComponent",
"tc",
",",
"Level",
"level",
",",
"String",
"msg",
",",
"Object",
"[",
"]",
"msgParms",
")",
"{",
"WsLogRecord",
"retMe",
"=",
"new",
"WsLogRecord",
"(",
"level",
",",
"msg",
")",... | Static method constructs a WsLogRecord object using the given parameters.
This bridges Tr-based trace and Logger based trace | [
"Static",
"method",
"constructs",
"a",
"WsLogRecord",
"object",
"using",
"the",
"given",
"parameters",
".",
"This",
"bridges",
"Tr",
"-",
"based",
"trace",
"and",
"Logger",
"based",
"trace"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/logging/internal/WsLogRecord.java#L514-L529 |
bazaarvoice/jolt | jolt-core/src/main/java/com/bazaarvoice/jolt/common/pathelement/TransposePathElement.java | TransposePathElement.innerParse | private static TransposePathElement innerParse( String originalKey, String meat ) {
"""
Parse the core of the TransposePathElement key, once basic errors have been checked and
syntax has been handled.
@param originalKey The original text for reference.
@param meat The string to actually parse into a Transpose... | java | private static TransposePathElement innerParse( String originalKey, String meat ) {
char first = meat.charAt( 0 );
if ( Character.isDigit( first ) ) {
// loop until we find a comma or end of string
StringBuilder sb = new StringBuilder().append( first );
for ( int ind... | [
"private",
"static",
"TransposePathElement",
"innerParse",
"(",
"String",
"originalKey",
",",
"String",
"meat",
")",
"{",
"char",
"first",
"=",
"meat",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"Character",
".",
"isDigit",
"(",
"first",
")",
")",
"{"... | Parse the core of the TransposePathElement key, once basic errors have been checked and
syntax has been handled.
@param originalKey The original text for reference.
@param meat The string to actually parse into a TransposePathElement
@return TransposePathElement | [
"Parse",
"the",
"core",
"of",
"the",
"TransposePathElement",
"key",
"once",
"basic",
"errors",
"have",
"been",
"checked",
"and",
"syntax",
"has",
"been",
"handled",
"."
] | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/jolt-core/src/main/java/com/bazaarvoice/jolt/common/pathelement/TransposePathElement.java#L120-L157 |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/retry/ExponentialBackoffRetryStrategy.java | ExponentialBackoffRetryStrategy.shouldRetry | @Override
public boolean shouldRetry(int retryCount, Response response) {
"""
Returns if a request should be retried based on the retry count, current response,
and the current strategy.
@param retryCount The current retry attempt count.
@param response The exception that caused the retry conditions to oc... | java | @Override
public boolean shouldRetry(int retryCount, Response response) {
int code = response.code();
//CHECKSTYLE IGNORE MagicNumber FOR NEXT 2 LINES
return retryCount < this.retryCount
&& (code == 408 || (code >= 500 && code != 501 && code != 505));
} | [
"@",
"Override",
"public",
"boolean",
"shouldRetry",
"(",
"int",
"retryCount",
",",
"Response",
"response",
")",
"{",
"int",
"code",
"=",
"response",
".",
"code",
"(",
")",
";",
"//CHECKSTYLE IGNORE MagicNumber FOR NEXT 2 LINES",
"return",
"retryCount",
"<",
"this... | Returns if a request should be retried based on the retry count, current response,
and the current strategy.
@param retryCount The current retry attempt count.
@param response The exception that caused the retry conditions to occur.
@return true if the request should be retried; false otherwise. | [
"Returns",
"if",
"a",
"request",
"should",
"be",
"retried",
"based",
"on",
"the",
"retry",
"count",
"current",
"response",
"and",
"the",
"current",
"strategy",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/retry/ExponentialBackoffRetryStrategy.java#L98-L104 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_frontend_frontendId_GET | public OvhFrontendTcp serviceName_tcp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
"""
Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId ... | java | public OvhFrontendTcp serviceName_tcp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
String resp = exec(qPath, "GET", sb.toString(), null);
retur... | [
"public",
"OvhFrontendTcp",
"serviceName_tcp_frontend_frontendId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"frontendId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}\"",
";",
"StringBuilder",
"sb",... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [required] Id of your frontend | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1432-L1437 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java | GeneratorXMLDatabaseConnection.processElementNormal | private void processElementNormal(GeneratorSingleCluster cluster, Node cur) {
"""
Process a 'normal' Element in the XML stream.
@param cluster
@param cur Current document nod
"""
double mean = 0.0;
double stddev = 1.0;
String meanstr = ((Element) cur).getAttribute(ATTR_MEAN);
if(meanstr != ... | java | private void processElementNormal(GeneratorSingleCluster cluster, Node cur) {
double mean = 0.0;
double stddev = 1.0;
String meanstr = ((Element) cur).getAttribute(ATTR_MEAN);
if(meanstr != null && meanstr.length() > 0) {
mean = ParseUtil.parseDouble(meanstr);
}
String stddevstr = ((Elemen... | [
"private",
"void",
"processElementNormal",
"(",
"GeneratorSingleCluster",
"cluster",
",",
"Node",
"cur",
")",
"{",
"double",
"mean",
"=",
"0.0",
";",
"double",
"stddev",
"=",
"1.0",
";",
"String",
"meanstr",
"=",
"(",
"(",
"Element",
")",
"cur",
")",
".",
... | Process a 'normal' Element in the XML stream.
@param cluster
@param cur Current document nod | [
"Process",
"a",
"normal",
"Element",
"in",
"the",
"XML",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L426-L451 |
leonchen83/redis-replicator | src/main/java/com/moilioncircle/redis/replicator/rdb/BaseRdbParser.java | BaseRdbParser.rdbLoadLen | public Len rdbLoadLen() throws IOException {
"""
read bytes 1 or 2 or 5
<p>
1. |00xxxxxx| remaining 6 bits represent the length
<p>
2. |01xxxxxx|xxxxxxxx| the combined 14 bits represent the length
<p>
3. |10xxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx| the remaining 6 bits are discarded.Additional 4 bytes repr... | java | public Len rdbLoadLen() throws IOException {
boolean isencoded = false;
int rawByte = in.read();
int type = (rawByte & 0xC0) >> 6;
long value;
if (type == RDB_ENCVAL) {
isencoded = true;
value = rawByte & 0x3F;
} else if (type == RDB_6BITLEN) {
... | [
"public",
"Len",
"rdbLoadLen",
"(",
")",
"throws",
"IOException",
"{",
"boolean",
"isencoded",
"=",
"false",
";",
"int",
"rawByte",
"=",
"in",
".",
"read",
"(",
")",
";",
"int",
"type",
"=",
"(",
"rawByte",
"&",
"0xC0",
")",
">>",
"6",
";",
"long",
... | read bytes 1 or 2 or 5
<p>
1. |00xxxxxx| remaining 6 bits represent the length
<p>
2. |01xxxxxx|xxxxxxxx| the combined 14 bits represent the length
<p>
3. |10xxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx| the remaining 6 bits are discarded.Additional 4 bytes represent the length(big endian in version6)
<p>
4. |11xxxxxx| t... | [
"read",
"bytes",
"1",
"or",
"2",
"or",
"5",
"<p",
">",
"1",
".",
"|00xxxxxx|",
"remaining",
"6",
"bits",
"represent",
"the",
"length",
"<p",
">",
"2",
".",
"|01xxxxxx|xxxxxxxx|",
"the",
"combined",
"14",
"bits",
"represent",
"the",
"length",
"<p",
">",
... | train | https://github.com/leonchen83/redis-replicator/blob/645aac2de1452e26c0f8f9d01d60edb45bba38c9/src/main/java/com/moilioncircle/redis/replicator/rdb/BaseRdbParser.java#L92-L112 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java | MolecularFormulaManipulator.getMolecularFormula | public static IMolecularFormula getMolecularFormula(String stringMF, IChemObjectBuilder builder) {
"""
Construct an instance of IMolecularFormula, initialized with a molecular
formula string. The string is immediately analyzed and a set of Nodes
is built based on this analysis
<p> The hydrogens must be implicit... | java | public static IMolecularFormula getMolecularFormula(String stringMF, IChemObjectBuilder builder) {
return getMolecularFormula(stringMF, false, builder);
} | [
"public",
"static",
"IMolecularFormula",
"getMolecularFormula",
"(",
"String",
"stringMF",
",",
"IChemObjectBuilder",
"builder",
")",
"{",
"return",
"getMolecularFormula",
"(",
"stringMF",
",",
"false",
",",
"builder",
")",
";",
"}"
] | Construct an instance of IMolecularFormula, initialized with a molecular
formula string. The string is immediately analyzed and a set of Nodes
is built based on this analysis
<p> The hydrogens must be implicit.
@param stringMF The molecularFormula string
@param builder a IChemObjectBuilder which is used to construc... | [
"Construct",
"an",
"instance",
"of",
"IMolecularFormula",
"initialized",
"with",
"a",
"molecular",
"formula",
"string",
".",
"The",
"string",
"is",
"immediately",
"analyzed",
"and",
"a",
"set",
"of",
"Nodes",
"is",
"built",
"based",
"on",
"this",
"analysis",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L576-L578 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/OAuthActivity.java | OAuthActivity.startMakingOAuthAPICall | protected void startMakingOAuthAPICall(final String code, final String baseDomain) {
"""
Start to create OAuth after getting the code.
@param code
OAuth 2 authorization code
@param baseDomain
base domain used for changing host if applicable.
"""
if (apiCallStarted.getAndSet(true)) {
r... | java | protected void startMakingOAuthAPICall(final String code, final String baseDomain) {
if (apiCallStarted.getAndSet(true)) {
return;
}
showSpinner();
if (baseDomain != null) {
mSession.getAuthInfo().setBaseDomain(baseDomain);
BoxLogUtils.nonFatalE("setti... | [
"protected",
"void",
"startMakingOAuthAPICall",
"(",
"final",
"String",
"code",
",",
"final",
"String",
"baseDomain",
")",
"{",
"if",
"(",
"apiCallStarted",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"return",
";",
"}",
"showSpinner",
"(",
")",
";",
"if... | Start to create OAuth after getting the code.
@param code
OAuth 2 authorization code
@param baseDomain
base domain used for changing host if applicable. | [
"Start",
"to",
"create",
"OAuth",
"after",
"getting",
"the",
"code",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/OAuthActivity.java#L376-L404 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java | MapTileCollisionComputer.containsCollisionFormula | private static boolean containsCollisionFormula(TileCollision tile, CollisionCategory category) {
"""
Check if tile contains at least one collision from the category.
@param tile The tile reference.
@param category The category reference.
@return <code>true</code> if there is a formula in common between tile ... | java | private static boolean containsCollisionFormula(TileCollision tile, CollisionCategory category)
{
final Collection<CollisionFormula> formulas = tile.getCollisionFormulas();
for (final CollisionFormula formula : category.getFormulas())
{
if (formulas.contains(formula))
... | [
"private",
"static",
"boolean",
"containsCollisionFormula",
"(",
"TileCollision",
"tile",
",",
"CollisionCategory",
"category",
")",
"{",
"final",
"Collection",
"<",
"CollisionFormula",
">",
"formulas",
"=",
"tile",
".",
"getCollisionFormulas",
"(",
")",
";",
"for",... | Check if tile contains at least one collision from the category.
@param tile The tile reference.
@param category The category reference.
@return <code>true</code> if there is a formula in common between tile and category. | [
"Check",
"if",
"tile",
"contains",
"at",
"least",
"one",
"collision",
"from",
"the",
"category",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionComputer.java#L38-L49 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.getTableAdminClientWrapper | public synchronized IBigtableTableAdminClient getTableAdminClientWrapper() throws IOException {
"""
Initializes bigtableTableAdminClient based on flag to use GCJ adapter, available in
{@link BigtableOptions}.
@return a {@link BigtableTableAdminClientWrapper} object.
@throws java.io.IOException if any.
"""... | java | public synchronized IBigtableTableAdminClient getTableAdminClientWrapper() throws IOException {
if (options.useGCJClient()) {
if (adminGCJClient == null) {
com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient adminClientV2 =
com.google.cloud.bigtable.admin.v2.BigtableTableAdminClien... | [
"public",
"synchronized",
"IBigtableTableAdminClient",
"getTableAdminClientWrapper",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"options",
".",
"useGCJClient",
"(",
")",
")",
"{",
"if",
"(",
"adminGCJClient",
"==",
"null",
")",
"{",
"com",
".",
"google",... | Initializes bigtableTableAdminClient based on flag to use GCJ adapter, available in
{@link BigtableOptions}.
@return a {@link BigtableTableAdminClientWrapper} object.
@throws java.io.IOException if any. | [
"Initializes",
"bigtableTableAdminClient",
"based",
"on",
"flag",
"to",
"use",
"GCJ",
"adapter",
"available",
"in",
"{",
"@link",
"BigtableOptions",
"}",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L461-L476 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.dropWhileIndexed | @NotNull
public Stream<T> dropWhileIndexed(@NotNull IndexedPredicate<? super T> predicate) {
"""
Drops elements while the {@code IndexedPredicate} is true, then returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) < 5
stream: [1, ... | java | @NotNull
public Stream<T> dropWhileIndexed(@NotNull IndexedPredicate<? super T> predicate) {
return dropWhileIndexed(0, 1, predicate);
} | [
"@",
"NotNull",
"public",
"Stream",
"<",
"T",
">",
"dropWhileIndexed",
"(",
"@",
"NotNull",
"IndexedPredicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"dropWhileIndexed",
"(",
"0",
",",
"1",
",",
"predicate",
")",
";",
"}"
] | Drops elements while the {@code IndexedPredicate} is true, then returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) < 5
stream: [1, 2, 3, 4, 0, 1, 2]
index: [0, 1, 2, 3, 4, 5, 6]
sum: [1, 3, 5, 7, 4, 6, 8]
result: [3, 4, 0, 1, 2]
</pre>
@pa... | [
"Drops",
"elements",
"while",
"the",
"{",
"@code",
"IndexedPredicate",
"}",
"is",
"true",
"then",
"returns",
"the",
"rest",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1476-L1479 |
line/line-bot-sdk-java | line-bot-api-client/src/main/java/com/linecorp/bot/client/LineSignatureValidator.java | LineSignatureValidator.validateSignature | public boolean validateSignature(@NonNull byte[] content, @NonNull String headerSignature) {
"""
Validate signature.
@param content Body of the http request in byte array.
@param headerSignature Signature value from `X-LINE-Signature` HTTP header
@return True if headerSignature matches signature of the cont... | java | public boolean validateSignature(@NonNull byte[] content, @NonNull String headerSignature) {
final byte[] signature = generateSignature(content);
final byte[] decodeHeaderSignature = Base64.getDecoder().decode(headerSignature);
return MessageDigest.isEqual(decodeHeaderSignature, signature);
... | [
"public",
"boolean",
"validateSignature",
"(",
"@",
"NonNull",
"byte",
"[",
"]",
"content",
",",
"@",
"NonNull",
"String",
"headerSignature",
")",
"{",
"final",
"byte",
"[",
"]",
"signature",
"=",
"generateSignature",
"(",
"content",
")",
";",
"final",
"byte... | Validate signature.
@param content Body of the http request in byte array.
@param headerSignature Signature value from `X-LINE-Signature` HTTP header
@return True if headerSignature matches signature of the content. False otherwise. | [
"Validate",
"signature",
"."
] | train | https://github.com/line/line-bot-sdk-java/blob/d6d30b19d5b90c2d3269eb9d6f88fe76fb6fcb55/line-bot-api-client/src/main/java/com/linecorp/bot/client/LineSignatureValidator.java#L51-L55 |
logic-ng/LogicNG | src/main/java/org/logicng/cardinalityconstraints/CCAMKCardinalityNetwork.java | CCAMKCardinalityNetwork.buildForIncremental | void buildForIncremental(final EncodingResult result, final Variable[] vars, int rhs) {
"""
Builds the constraint for incremental usage.
@param result the result
@param vars the variables
@param rhs the right-hand side
"""
cardinalityNetwork.buildAMKForIncremental(result, vars, rhs);
} | java | void buildForIncremental(final EncodingResult result, final Variable[] vars, int rhs) {
cardinalityNetwork.buildAMKForIncremental(result, vars, rhs);
} | [
"void",
"buildForIncremental",
"(",
"final",
"EncodingResult",
"result",
",",
"final",
"Variable",
"[",
"]",
"vars",
",",
"int",
"rhs",
")",
"{",
"cardinalityNetwork",
".",
"buildAMKForIncremental",
"(",
"result",
",",
"vars",
",",
"rhs",
")",
";",
"}"
] | Builds the constraint for incremental usage.
@param result the result
@param vars the variables
@param rhs the right-hand side | [
"Builds",
"the",
"constraint",
"for",
"incremental",
"usage",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/cardinalityconstraints/CCAMKCardinalityNetwork.java#L67-L69 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java | TilesOverlay.setViewPort | protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) {
"""
Get the area we are drawing to
@since 6.0.0
@return true if the tiles are to be drawn
"""
setProjection(pProjection);
getProjection().getMercatorViewPort(mViewPort);
return true;
} | java | protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) {
setProjection(pProjection);
getProjection().getMercatorViewPort(mViewPort);
return true;
} | [
"protected",
"boolean",
"setViewPort",
"(",
"final",
"Canvas",
"pCanvas",
",",
"final",
"Projection",
"pProjection",
")",
"{",
"setProjection",
"(",
"pProjection",
")",
";",
"getProjection",
"(",
")",
".",
"getMercatorViewPort",
"(",
"mViewPort",
")",
";",
"retu... | Get the area we are drawing to
@since 6.0.0
@return true if the tiles are to be drawn | [
"Get",
"the",
"area",
"we",
"are",
"drawing",
"to"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java#L186-L190 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java | AbstractCreator.constructorCallCode | private CodeBlock constructorCallCode( ClassName className, ImmutableList<? extends JParameterizedMapper> parameters ) {
"""
Build the code to call the constructor of a class
@param className the class to call
@param parameters the parameters of the constructor
@return the code calling the constructor
"... | java | private CodeBlock constructorCallCode( ClassName className, ImmutableList<? extends JParameterizedMapper> parameters ) {
CodeBlock.Builder builder = CodeBlock.builder();
builder.add( "new $T", className );
return methodCallCodeWithJParameterizedMapperParameters( builder, parameters );
} | [
"private",
"CodeBlock",
"constructorCallCode",
"(",
"ClassName",
"className",
",",
"ImmutableList",
"<",
"?",
"extends",
"JParameterizedMapper",
">",
"parameters",
")",
"{",
"CodeBlock",
".",
"Builder",
"builder",
"=",
"CodeBlock",
".",
"builder",
"(",
")",
";",
... | Build the code to call the constructor of a class
@param className the class to call
@param parameters the parameters of the constructor
@return the code calling the constructor | [
"Build",
"the",
"code",
"to",
"call",
"the",
"constructor",
"of",
"a",
"class"
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L855-L859 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.getAndTouch | @Override
public CASValue<Object> getAndTouch(String key, int exp) {
"""
Get a single key and reset its expiration using the default transcoder.
@param key the key to get
@param exp the new expiration for the key
@return the result from the cache and CAS id (null if there is none)
@throws OperationTimeoutE... | java | @Override
public CASValue<Object> getAndTouch(String key, int exp) {
return getAndTouch(key, exp, transcoder);
} | [
"@",
"Override",
"public",
"CASValue",
"<",
"Object",
">",
"getAndTouch",
"(",
"String",
"key",
",",
"int",
"exp",
")",
"{",
"return",
"getAndTouch",
"(",
"key",
",",
"exp",
",",
"transcoder",
")",
";",
"}"
] | Get a single key and reset its expiration using the default transcoder.
@param key the key to get
@param exp the new expiration for the key
@return the result from the cache and CAS id (null if there is none)
@throws OperationTimeoutException if the global operation timeout is
exceeded
@throws IllegalStateException in... | [
"Get",
"a",
"single",
"key",
"and",
"reset",
"its",
"expiration",
"using",
"the",
"default",
"transcoder",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1193-L1196 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/filter/DumpResultSqlFilter.java | DumpResultSqlFilter.getSubstringByte | private String getSubstringByte(final Object obj, final int capacity) throws CharacterCodingException,
UnsupportedEncodingException {
"""
指定したバイト数で文字列をカットする
@param obj 対象オブジェクト
@param capacity カットするバイト数
@return String
@throws CharacterCodingException
@throws UnsupportedEncodingException
"""
String... | java | private String getSubstringByte(final Object obj, final int capacity) throws CharacterCodingException,
UnsupportedEncodingException {
String str = obj == null ? "null" : obj.toString();
if (capacity < 1) {
return str;
}
CharsetEncoder ce = Charset.forName(ENCODING_SHIFT_JIS).newEncoder()
.onMalforme... | [
"private",
"String",
"getSubstringByte",
"(",
"final",
"Object",
"obj",
",",
"final",
"int",
"capacity",
")",
"throws",
"CharacterCodingException",
",",
"UnsupportedEncodingException",
"{",
"String",
"str",
"=",
"obj",
"==",
"null",
"?",
"\"null\"",
":",
"obj",
... | 指定したバイト数で文字列をカットする
@param obj 対象オブジェクト
@param capacity カットするバイト数
@return String
@throws CharacterCodingException
@throws UnsupportedEncodingException | [
"指定したバイト数で文字列をカットする"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/filter/DumpResultSqlFilter.java#L214-L245 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFactoryDataImpl.java | ChannelFactoryDataImpl.setProperties | synchronized void setProperties(Map<Object, Object> m) throws ChannelFactoryPropertyIgnoredException {
"""
internally set the properties associated with this object
@param m
@throws ChannelFactoryPropertyIgnoredException
"""
this.myProperties = m;
if (cf != null) {
cf.updatePro... | java | synchronized void setProperties(Map<Object, Object> m) throws ChannelFactoryPropertyIgnoredException {
this.myProperties = m;
if (cf != null) {
cf.updateProperties(m);
}
} | [
"synchronized",
"void",
"setProperties",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"m",
")",
"throws",
"ChannelFactoryPropertyIgnoredException",
"{",
"this",
".",
"myProperties",
"=",
"m",
";",
"if",
"(",
"cf",
"!=",
"null",
")",
"{",
"cf",
".",
"upda... | internally set the properties associated with this object
@param m
@throws ChannelFactoryPropertyIgnoredException | [
"internally",
"set",
"the",
"properties",
"associated",
"with",
"this",
"object"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFactoryDataImpl.java#L104-L110 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallApiVersionSummary | public static ApiVersionSummaryBean unmarshallApiVersionSummary(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the API version summary
"""
if (source == null) {
return null;
}
ApiVersionSummaryBean bean = new... | java | public static ApiVersionSummaryBean unmarshallApiVersionSummary(Map<String, Object> source) {
if (source == null) {
return null;
}
ApiVersionSummaryBean bean = new ApiVersionSummaryBean();
bean.setDescription(asString(source.get("apiDescription")));
bean.setId(asStrin... | [
"public",
"static",
"ApiVersionSummaryBean",
"unmarshallApiVersionSummary",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ApiVersionSummaryBean",
"bean",
"=",
"new",... | Unmarshals the given map source into a bean.
@param source the source
@return the API version summary | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1001-L1016 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.defineTurnBits | public int defineTurnBits(int index, int shift) {
"""
Defines the bits reserved for storing turn restriction and turn cost
<p>
@param shift bit offset for the first bit used by this encoder
@return incremented shift value pointing behind the last used bit
"""
if (maxTurnCosts == 0)
ret... | java | public int defineTurnBits(int index, int shift) {
if (maxTurnCosts == 0)
return shift;
// optimization for turn restrictions only
else if (maxTurnCosts == 1) {
turnRestrictionBit = 1L << shift;
return shift + 1;
}
int turnBits = Helper.co... | [
"public",
"int",
"defineTurnBits",
"(",
"int",
"index",
",",
"int",
"shift",
")",
"{",
"if",
"(",
"maxTurnCosts",
"==",
"0",
")",
"return",
"shift",
";",
"// optimization for turn restrictions only",
"else",
"if",
"(",
"maxTurnCosts",
"==",
"1",
")",
"{",
"t... | Defines the bits reserved for storing turn restriction and turn cost
<p>
@param shift bit offset for the first bit used by this encoder
@return incremented shift value pointing behind the last used bit | [
"Defines",
"the",
"bits",
"reserved",
"for",
"storing",
"turn",
"restriction",
"and",
"turn",
"cost",
"<p",
">"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L446-L468 |
metafacture/metafacture-core | metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java | SimpleRegexTrie.put | public void put(final String keys, final P value) {
"""
Enables the use of simple character classes like 'a[agt][ac]'. Calls the
method of {@link WildcardTrie} for further treatment.
@param keys pattern of keys
@param value value to associate with the key pattern
"""
if (keys.matches(".*" + SIMPLE... | java | public void put(final String keys, final P value) {
if (keys.matches(".*" + SIMPLE_CHARACTER_CLASS + ".*")) {
int charClassStart = keys.indexOf('[', 0);
final int charClassEnd = keys.indexOf(']', 1);
String begin = keys.substring(0, charClassStart);
for (; charCla... | [
"public",
"void",
"put",
"(",
"final",
"String",
"keys",
",",
"final",
"P",
"value",
")",
"{",
"if",
"(",
"keys",
".",
"matches",
"(",
"\".*\"",
"+",
"SIMPLE_CHARACTER_CLASS",
"+",
"\".*\"",
")",
")",
"{",
"int",
"charClassStart",
"=",
"keys",
".",
"in... | Enables the use of simple character classes like 'a[agt][ac]'. Calls the
method of {@link WildcardTrie} for further treatment.
@param keys pattern of keys
@param value value to associate with the key pattern | [
"Enables",
"the",
"use",
"of",
"simple",
"character",
"classes",
"like",
"a",
"[",
"agt",
"]",
"[",
"ac",
"]",
".",
"Calls",
"the",
"method",
"of",
"{",
"@link",
"WildcardTrie",
"}",
"for",
"further",
"treatment",
"."
] | train | https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java#L45-L57 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectReportType | public String buildSelectReportType(String htmlAttributes) {
"""
Builds the html for the workplace report type select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace report type select box
"""
List<String> options = new ArrayLis... | java | public String buildSelectReportType(String htmlAttributes) {
List<String> options = new ArrayList<String>(2);
options.add(key(Messages.GUI_LABEL_SIMPLE_0));
options.add(key(Messages.GUI_LABEL_EXTENDED_0));
String[] vals = new String[] {I_CmsReport.REPORT_TYPE_SIMPLE, I_CmsReport.REPORT_... | [
"public",
"String",
"buildSelectReportType",
"(",
"String",
"htmlAttributes",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"2",
")",
";",
"options",
".",
"add",
"(",
"key",
"(",
"Messages",
".",
"GUI_... | Builds the html for the workplace report type select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace report type select box | [
"Builds",
"the",
"html",
"for",
"the",
"workplace",
"report",
"type",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L828-L840 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.getSQLJContext | public Object getSQLJContext(WSRdbManagedConnectionImpl mc, Class<?> DefaultContext, WSConnectionManager connMgr) throws SQLException {
"""
This method returns a sqljConnectContext. It will go to DB2 to get the connection Context.
We need to create a new WSJccConnection to get the phsyical sqlj context.So the sql... | java | public Object getSQLJContext(WSRdbManagedConnectionImpl mc, Class<?> DefaultContext, WSConnectionManager connMgr) throws SQLException {
return null;
} | [
"public",
"Object",
"getSQLJContext",
"(",
"WSRdbManagedConnectionImpl",
"mc",
",",
"Class",
"<",
"?",
">",
"DefaultContext",
",",
"WSConnectionManager",
"connMgr",
")",
"throws",
"SQLException",
"{",
"return",
"null",
";",
"}"
] | This method returns a sqljConnectContext. It will go to DB2 to get the connection Context.
We need to create a new WSJccConnection to get the phsyical sqlj context.So the sqlj runtime
will use our WSJccConnection to do the work.
@param a managedConnection
@param DefaultContext the sqlj.runtime.ref.DefaultContext class... | [
"This",
"method",
"returns",
"a",
"sqljConnectContext",
".",
"It",
"will",
"go",
"to",
"DB2",
"to",
"get",
"the",
"connection",
"Context",
".",
"We",
"need",
"to",
"create",
"a",
"new",
"WSJccConnection",
"to",
"get",
"the",
"phsyical",
"sqlj",
"context",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L740-L742 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/retry/RetryPolicies.java | RetryPolicies.retryByRemoteException | public static final RetryPolicy retryByRemoteException(
RetryPolicy defaultPolicy,
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap) {
"""
<p>
A retry policy for RemoteException
Set a default policy with some explicit handlers for specific exceptions.
</p>
"""
return new Rem... | java | public static final RetryPolicy retryByRemoteException(
RetryPolicy defaultPolicy,
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap) {
return new RemoteExceptionDependentRetry(defaultPolicy, exceptionToPolicyMap);
} | [
"public",
"static",
"final",
"RetryPolicy",
"retryByRemoteException",
"(",
"RetryPolicy",
"defaultPolicy",
",",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
",",
"RetryPolicy",
">",
"exceptionToPolicyMap",
")",
"{",
"return",
"new",
"RemoteExceptionDe... | <p>
A retry policy for RemoteException
Set a default policy with some explicit handlers for specific exceptions.
</p> | [
"<p",
">",
"A",
"retry",
"policy",
"for",
"RemoteException",
"Set",
"a",
"default",
"policy",
"with",
"some",
"explicit",
"handlers",
"for",
"specific",
"exceptions",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/retry/RetryPolicies.java#L119-L123 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasAsset.java | BaasAsset.streamAsset | public static <R> RequestToken streamAsset(String id, int flags, DataStreamHandler<R> contentHandler, BaasHandler<R> handler) {
"""
Streams the file using the provided data stream handler.
@param id the name of the asset to download
@param flags
@param handler the completion handler
@param <R> th... | java | public static <R> RequestToken streamAsset(String id, int flags, DataStreamHandler<R> contentHandler, BaasHandler<R> handler) {
return BaasAsset.doStreamAsset(id, null, -1, flags, contentHandler, handler);
} | [
"public",
"static",
"<",
"R",
">",
"RequestToken",
"streamAsset",
"(",
"String",
"id",
",",
"int",
"flags",
",",
"DataStreamHandler",
"<",
"R",
">",
"contentHandler",
",",
"BaasHandler",
"<",
"R",
">",
"handler",
")",
"{",
"return",
"BaasAsset",
".",
"doSt... | Streams the file using the provided data stream handler.
@param id the name of the asset to download
@param flags
@param handler the completion handler
@param <R> the type to transform the bytes to.
@return a request token to handle the request | [
"Streams",
"the",
"file",
"using",
"the",
"provided",
"data",
"stream",
"handler",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasAsset.java#L126-L128 |
skuzzle/semantic-version | src/main/java/de/skuzzle/semantic/Version.java | Version.nextMinor | public Version nextMinor(String newPrelease) {
"""
Given this version, returns the next minor version. That is, the major part remains
the same and the minor version is incremented. The pre-release part will be set to
the given identifier and the build-meta-data is dropped.
@param newPrelease The pre-release ... | java | public Version nextMinor(String newPrelease) {
require(newPrelease != null, "newPreRelease is null");
final String[] preReleaseParts = parsePreRelease(newPrelease);
return new Version(this.major, this.minor + 1, 0, preReleaseParts, EMPTY_ARRAY);
} | [
"public",
"Version",
"nextMinor",
"(",
"String",
"newPrelease",
")",
"{",
"require",
"(",
"newPrelease",
"!=",
"null",
",",
"\"newPreRelease is null\"",
")",
";",
"final",
"String",
"[",
"]",
"preReleaseParts",
"=",
"parsePreRelease",
"(",
"newPrelease",
")",
";... | Given this version, returns the next minor version. That is, the major part remains
the same and the minor version is incremented. The pre-release part will be set to
the given identifier and the build-meta-data is dropped.
@param newPrelease The pre-release part for the resulting Version.
@return The incremented vers... | [
"Given",
"this",
"version",
"returns",
"the",
"next",
"minor",
"version",
".",
"That",
"is",
"the",
"major",
"part",
"remains",
"the",
"same",
"and",
"the",
"minor",
"version",
"is",
"incremented",
".",
"The",
"pre",
"-",
"release",
"part",
"will",
"be",
... | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/main/java/de/skuzzle/semantic/Version.java#L770-L774 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java | XClassUtils.getXMethod | @Nullable
public static XMethod getXMethod(final XClass xClass, final String methodName, final String methodSig) {
"""
Looks for the method up the class hierarchy.
@param xClass
the class where to look for the method
@param methodName
the name of the method to look for
@param methodSig
the signature of... | java | @Nullable
public static XMethod getXMethod(final XClass xClass, final String methodName, final String methodSig) {
if (xClass == null) {
return null;
}
XMethod xMethod = xClass.findMethod(methodName, methodSig, false);
if (xMethod == null) {
ClassDescriptor d... | [
"@",
"Nullable",
"public",
"static",
"XMethod",
"getXMethod",
"(",
"final",
"XClass",
"xClass",
",",
"final",
"String",
"methodName",
",",
"final",
"String",
"methodSig",
")",
"{",
"if",
"(",
"xClass",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Looks for the method up the class hierarchy.
@param xClass
the class where to look for the method
@param methodName
the name of the method to look for
@param methodSig
the signature of the method to look for
@return the method | [
"Looks",
"for",
"the",
"method",
"up",
"the",
"class",
"hierarchy",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java#L84-L99 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java | ActiveScanAPI.getActiveScan | private ActiveScan getActiveScan(JSONObject params) throws ApiException {
"""
Returns a {@link ActiveScan} from the available active scans or the last active scan. If a scan ID (
{@link #PARAM_SCAN_ID}) is present in the given {@code params} it will be used to the get the {@code ActiveScan} from the
available ac... | java | private ActiveScan getActiveScan(JSONObject params) throws ApiException {
int id = getParam(params, PARAM_SCAN_ID, -1);
GenericScanner2 activeScan = null;
if (id == -1) {
activeScan = controller.getLastScan();
} else {
activeScan = controller.getScan(id);
}
if (activeScan == null) {
throw new Ap... | [
"private",
"ActiveScan",
"getActiveScan",
"(",
"JSONObject",
"params",
")",
"throws",
"ApiException",
"{",
"int",
"id",
"=",
"getParam",
"(",
"params",
",",
"PARAM_SCAN_ID",
",",
"-",
"1",
")",
";",
"GenericScanner2",
"activeScan",
"=",
"null",
";",
"if",
"(... | Returns a {@link ActiveScan} from the available active scans or the last active scan. If a scan ID (
{@link #PARAM_SCAN_ID}) is present in the given {@code params} it will be used to the get the {@code ActiveScan} from the
available active scans, otherwise it's returned the last active scan.
@param params the paramete... | [
"Returns",
"a",
"{",
"@link",
"ActiveScan",
"}",
"from",
"the",
"available",
"active",
"scans",
"or",
"the",
"last",
"active",
"scan",
".",
"If",
"a",
"scan",
"ID",
"(",
"{",
"@link",
"#PARAM_SCAN_ID",
"}",
")",
"is",
"present",
"in",
"the",
"given",
"... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java#L639-L655 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/ElasticNetRegularizer.java | ElasticNetRegularizer.updateWeights | public static <K> void updateWeights(double l1, double l2, double learningRate, Map<K, Double> weights, Map<K, Double> newWeights) {
"""
Updates the weights by applying the ElasticNet regularization.
@param l1
@param l2
@param learningRate
@param weights
@param newWeights
@param <K>
"""
L2Regul... | java | public static <K> void updateWeights(double l1, double l2, double learningRate, Map<K, Double> weights, Map<K, Double> newWeights) {
L2Regularizer.updateWeights(l2, learningRate, weights, newWeights);
L1Regularizer.updateWeights(l1, learningRate, weights, newWeights);
} | [
"public",
"static",
"<",
"K",
">",
"void",
"updateWeights",
"(",
"double",
"l1",
",",
"double",
"l2",
",",
"double",
"learningRate",
",",
"Map",
"<",
"K",
",",
"Double",
">",
"weights",
",",
"Map",
"<",
"K",
",",
"Double",
">",
"newWeights",
")",
"{"... | Updates the weights by applying the ElasticNet regularization.
@param l1
@param l2
@param learningRate
@param weights
@param newWeights
@param <K> | [
"Updates",
"the",
"weights",
"by",
"applying",
"the",
"ElasticNet",
"regularization",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/ElasticNetRegularizer.java#L40-L43 |
elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Arcball1DOFAdapter.java | Arcball1DOFAdapter.mapMouseToPlane | private void mapMouseToPlane(Simple1DOFCamera camera, Point point2d, double[] vec) {
"""
Map the coordinates. Note: vec will be overwritten!
@param camera Camera
@param point2d Input point
@param vec Output vector
"""
// Far plane
camera.unproject(point2d.x, point2d.y, -100., far);
// Near pla... | java | private void mapMouseToPlane(Simple1DOFCamera camera, Point point2d, double[] vec) {
// Far plane
camera.unproject(point2d.x, point2d.y, -100., far);
// Near plane
camera.unproject(point2d.x, point2d.y, 1., near);
// Delta vector: far -= near.
VMath.minusEquals(far, near);
// Intersection wi... | [
"private",
"void",
"mapMouseToPlane",
"(",
"Simple1DOFCamera",
"camera",
",",
"Point",
"point2d",
",",
"double",
"[",
"]",
"vec",
")",
"{",
"// Far plane",
"camera",
".",
"unproject",
"(",
"point2d",
".",
"x",
",",
"point2d",
".",
"y",
",",
"-",
"100.",
... | Map the coordinates. Note: vec will be overwritten!
@param camera Camera
@param point2d Input point
@param vec Output vector | [
"Map",
"the",
"coordinates",
".",
"Note",
":",
"vec",
"will",
"be",
"overwritten!"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Arcball1DOFAdapter.java#L120-L135 |
joniles/mpxj | src/main/java/net/sf/mpxj/asta/AstaReader.java | AstaReader.processResources | public void processResources(List<Row> permanentRows, List<Row> consumableRows) {
"""
Process resources.
@param permanentRows permanent resource data
@param consumableRows consumable resource data
"""
//
// Process permanent resources
//
for (Row row : permanentRows)
{
... | java | public void processResources(List<Row> permanentRows, List<Row> consumableRows)
{
//
// Process permanent resources
//
for (Row row : permanentRows)
{
Resource resource = m_project.addResource();
resource.setType(ResourceType.WORK);
resource.setUniqueID(row.ge... | [
"public",
"void",
"processResources",
"(",
"List",
"<",
"Row",
">",
"permanentRows",
",",
"List",
"<",
"Row",
">",
"consumableRows",
")",
"{",
"//",
"// Process permanent resources",
"//",
"for",
"(",
"Row",
"row",
":",
"permanentRows",
")",
"{",
"Resource",
... | Process resources.
@param permanentRows permanent resource data
@param consumableRows consumable resource data | [
"Process",
"resources",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaReader.java#L123-L174 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/ContextManager.java | ContextManager.generateIdentifier | private StepIdentifier generateIdentifier(List<Pair<StepContextId, INodeEntry>> stack) {
"""
@param stack stack
@return Convert stack of context data into a StepIdentifier
"""
List<StepContextId> ctxs = new ArrayList<>();
int i = 0;
for (Pair<StepContextId, INodeEntry> pair : stack) ... | java | private StepIdentifier generateIdentifier(List<Pair<StepContextId, INodeEntry>> stack) {
List<StepContextId> ctxs = new ArrayList<>();
int i = 0;
for (Pair<StepContextId, INodeEntry> pair : stack) {
Map<String, String> params = null;
if (null != pair.getSecond() && i < st... | [
"private",
"StepIdentifier",
"generateIdentifier",
"(",
"List",
"<",
"Pair",
"<",
"StepContextId",
",",
"INodeEntry",
">",
">",
"stack",
")",
"{",
"List",
"<",
"StepContextId",
">",
"ctxs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"i",
"=",
"... | @param stack stack
@return Convert stack of context data into a StepIdentifier | [
"@param",
"stack",
"stack"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/ContextManager.java#L101-L118 |
Whiley/WhileyCompiler | src/main/java/wyil/check/DefiniteUnassignmentCheck.java | DefiniteUnassignmentCheck.visitFunctionOrMethod | @Override
public ControlFlow visitFunctionOrMethod(Decl.FunctionOrMethod declaration, MaybeAssignedSet dummy) {
"""
Check a function or method declaration for definite assignment.
@param declaration
@return
"""
MaybeAssignedSet environment = new MaybeAssignedSet();
// Definitely assigned variables inc... | java | @Override
public ControlFlow visitFunctionOrMethod(Decl.FunctionOrMethod declaration, MaybeAssignedSet dummy) {
MaybeAssignedSet environment = new MaybeAssignedSet();
// Definitely assigned variables includes all parameters.
environment = environment.addAll(declaration.getParameters());
// Iterate through each... | [
"@",
"Override",
"public",
"ControlFlow",
"visitFunctionOrMethod",
"(",
"Decl",
".",
"FunctionOrMethod",
"declaration",
",",
"MaybeAssignedSet",
"dummy",
")",
"{",
"MaybeAssignedSet",
"environment",
"=",
"new",
"MaybeAssignedSet",
"(",
")",
";",
"// Definitely assigned ... | 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#L93-L103 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java | JScreen.addScreenLabel | public JComponent addScreenLabel(Container parent, Converter fieldInfo) {
"""
Add this label to the first column of the grid.
@param parent The container to add the control(s) to.
@param fieldInfo The field to add a label to.
@param gridbag The screen layout.
@param c The constraint to use.
"""
JCo... | java | public JComponent addScreenLabel(Container parent, Converter fieldInfo)
{
JComponent label = new JLabel(fieldInfo.getFieldDesc());
this.setComponentConstraints(label);
parent.add(label);
fieldInfo.addComponent(label);
return label;
} | [
"public",
"JComponent",
"addScreenLabel",
"(",
"Container",
"parent",
",",
"Converter",
"fieldInfo",
")",
"{",
"JComponent",
"label",
"=",
"new",
"JLabel",
"(",
"fieldInfo",
".",
"getFieldDesc",
"(",
")",
")",
";",
"this",
".",
"setComponentConstraints",
"(",
... | Add this label to the first column of the grid.
@param parent The container to add the control(s) to.
@param fieldInfo The field to add a label to.
@param gridbag The screen layout.
@param c The constraint to use. | [
"Add",
"this",
"label",
"to",
"the",
"first",
"column",
"of",
"the",
"grid",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java#L244-L251 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java | ObjFileImporter.addUV | private void addUV(String data) {
"""
Creates a new {@link UV} from data and adds it to {@link #uvs}.
@param data the data
"""
String coords[] = data.split("\\s+");
float u = 0;
float v = 0;
if (coords.length != 2)
{
MalisisCore.log.error( "[ObjFileImporter] Wrong UV coordinates number {} at li... | java | private void addUV(String data)
{
String coords[] = data.split("\\s+");
float u = 0;
float v = 0;
if (coords.length != 2)
{
MalisisCore.log.error( "[ObjFileImporter] Wrong UV coordinates number {} at line {} : {}",
coords.length,
lineNumber,
currentLine);
}
else
{
u = F... | [
"private",
"void",
"addUV",
"(",
"String",
"data",
")",
"{",
"String",
"coords",
"[",
"]",
"=",
"data",
".",
"split",
"(",
"\"\\\\s+\"",
")",
";",
"float",
"u",
"=",
"0",
";",
"float",
"v",
"=",
"0",
";",
"if",
"(",
"coords",
".",
"length",
"!=",... | Creates a new {@link UV} from data and adds it to {@link #uvs}.
@param data the data | [
"Creates",
"a",
"new",
"{",
"@link",
"UV",
"}",
"from",
"data",
"and",
"adds",
"it",
"to",
"{",
"@link",
"#uvs",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java#L231-L250 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/clients/common/OidcClientUtil.java | OidcClientUtil.createCookie | public static Cookie createCookie(String cookieName, @Sensitive String cookieValue, HttpServletRequest req) {
"""
/*
In case, the ReferrerURLCookieHandler is dynamic in every request, then we will need to make this into
OidcClientRequest. And do not do static.
"""
return createCookie(cookieName, cook... | java | public static Cookie createCookie(String cookieName, @Sensitive String cookieValue, HttpServletRequest req) {
return createCookie(cookieName, cookieValue, -1, req);
} | [
"public",
"static",
"Cookie",
"createCookie",
"(",
"String",
"cookieName",
",",
"@",
"Sensitive",
"String",
"cookieValue",
",",
"HttpServletRequest",
"req",
")",
"{",
"return",
"createCookie",
"(",
"cookieName",
",",
"cookieValue",
",",
"-",
"1",
",",
"req",
"... | /*
In case, the ReferrerURLCookieHandler is dynamic in every request, then we will need to make this into
OidcClientRequest. And do not do static. | [
"/",
"*",
"In",
"case",
"the",
"ReferrerURLCookieHandler",
"is",
"dynamic",
"in",
"every",
"request",
"then",
"we",
"will",
"need",
"to",
"make",
"this",
"into",
"OidcClientRequest",
".",
"And",
"do",
"not",
"do",
"static",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/clients/common/OidcClientUtil.java#L286-L288 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.deleteSynonym | public JSONObject deleteSynonym(String objectID, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
"""
Delete one synonym
@param objectID The objectId of the synonym to delete
@param forwardToReplicas Forward the operation to the replica indices
@param requestOptions... | java | public JSONObject deleteSynonym(String objectID, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
if (objectID == null || objectID.length() == 0) {
throw new AlgoliaException("Invalid objectID");
}
try {
return client.deleteRequest("/1/indexes/" + encodedIndexN... | [
"public",
"JSONObject",
"deleteSynonym",
"(",
"String",
"objectID",
",",
"boolean",
"forwardToReplicas",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"if",
"(",
"objectID",
"==",
"null",
"||",
"objectID",
".",
"length",
"(",
")"... | Delete one synonym
@param objectID The objectId of the synonym to delete
@param forwardToReplicas Forward the operation to the replica indices
@param requestOptions Options to pass to this request | [
"Delete",
"one",
"synonym"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1498-L1507 |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountPatternMatcher.java | AccountPatternMatcher.matchUrl | public static boolean matchUrl(Account account, String url) {
"""
Tests all patterns in an account for a match against the url string.
@param account The account to test with.
@param url THe url to test with.
@return true if one of the
"""
for (AccountPatternData pattern : account.getPatterns(... | java | public static boolean matchUrl(Account account, String url) {
for (AccountPatternData pattern : account.getPatterns()) {
AccountPatternType type = pattern.getType();
if (type == AccountPatternType.REGEX) {
if (regexMatch(pattern.getPattern(), url))
ret... | [
"public",
"static",
"boolean",
"matchUrl",
"(",
"Account",
"account",
",",
"String",
"url",
")",
"{",
"for",
"(",
"AccountPatternData",
"pattern",
":",
"account",
".",
"getPatterns",
"(",
")",
")",
"{",
"AccountPatternType",
"type",
"=",
"pattern",
".",
"get... | Tests all patterns in an account for a match against the url string.
@param account The account to test with.
@param url THe url to test with.
@return true if one of the | [
"Tests",
"all",
"patterns",
"in",
"an",
"account",
"for",
"a",
"match",
"against",
"the",
"url",
"string",
"."
] | train | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountPatternMatcher.java#L36-L53 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.varianceDoublematrixColumn | public static double varianceDoublematrixColumn( double[][] matrix, int column, double mean ) {
"""
Return the variance of a column of a matrix.
@param matrix matrix of the value to calculate.
@param column index of the column to calculate the variance.
@param mean the mean value of the column.
@return varia... | java | public static double varianceDoublematrixColumn( double[][] matrix, int column, double mean )
{
double variance;
variance = 0;
for( int i = 0; i < matrix.length; i++ ) {
variance += (matrix[i][column] - mean) * (matrix[i][column] - mean);
}
return variance / ... | [
"public",
"static",
"double",
"varianceDoublematrixColumn",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"column",
",",
"double",
"mean",
")",
"{",
"double",
"variance",
";",
"variance",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",... | Return the variance of a column of a matrix.
@param matrix matrix of the value to calculate.
@param column index of the column to calculate the variance.
@param mean the mean value of the column.
@return variance. | [
"Return",
"the",
"variance",
"of",
"a",
"column",
"of",
"a",
"matrix",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L1419-L1433 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java | PeerEurekaNode.register | public void register(final InstanceInfo info) throws Exception {
"""
Sends the registration information of {@link InstanceInfo} receiving by
this node to the peer node represented by this class.
@param info
the instance information {@link InstanceInfo} of any instance
that is send to this instance.
@throws ... | java | public void register(final InstanceInfo info) throws Exception {
long expiryTime = System.currentTimeMillis() + getLeaseRenewalOf(info);
batchingDispatcher.process(
taskId("register", info),
new InstanceReplicationTask(targetHost, Action.Register, info, null, true) {
... | [
"public",
"void",
"register",
"(",
"final",
"InstanceInfo",
"info",
")",
"throws",
"Exception",
"{",
"long",
"expiryTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"getLeaseRenewalOf",
"(",
"info",
")",
";",
"batchingDispatcher",
".",
"process",
... | Sends the registration information of {@link InstanceInfo} receiving by
this node to the peer node represented by this class.
@param info
the instance information {@link InstanceInfo} of any instance
that is send to this instance.
@throws Exception | [
"Sends",
"the",
"registration",
"information",
"of",
"{",
"@link",
"InstanceInfo",
"}",
"receiving",
"by",
"this",
"node",
"to",
"the",
"peer",
"node",
"represented",
"by",
"this",
"class",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java#L134-L145 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/CodeVerifierUtil.java | CodeVerifierUtil.generateRandomCodeVerifier | public static String generateRandomCodeVerifier(SecureRandom entropySource, int entropyBytes) {
"""
Generates a random code verifier string using the provided entropy source and the specified
number of bytes of entropy.
@param entropySource entropy source
@param entropyBytes entropy bytes
@return String genera... | java | public static String generateRandomCodeVerifier(SecureRandom entropySource, int entropyBytes) {
byte[] randomBytes = new byte[entropyBytes];
entropySource.nextBytes(randomBytes);
return Base64.getUrlEncoder().withoutPadding().encodeToString(randomBytes);
} | [
"public",
"static",
"String",
"generateRandomCodeVerifier",
"(",
"SecureRandom",
"entropySource",
",",
"int",
"entropyBytes",
")",
"{",
"byte",
"[",
"]",
"randomBytes",
"=",
"new",
"byte",
"[",
"entropyBytes",
"]",
";",
"entropySource",
".",
"nextBytes",
"(",
"r... | Generates a random code verifier string using the provided entropy source and the specified
number of bytes of entropy.
@param entropySource entropy source
@param entropyBytes entropy bytes
@return String generated code verifier | [
"Generates",
"a",
"random",
"code",
"verifier",
"string",
"using",
"the",
"provided",
"entropy",
"source",
"and",
"the",
"specified",
"number",
"of",
"bytes",
"of",
"entropy",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/CodeVerifierUtil.java#L117-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java | ConsumerUtil.validateIatAndExp | void validateIatAndExp(JwtClaims jwtClaims, long clockSkewInMilliseconds) throws InvalidClaimException {
"""
Validates the the {@value Claims#ISSUED_AT} and {@value Claims#EXPIRATION}
claims are present and properly formed. Also verifies that the
{@value Claims#ISSUED_AT} time is after the {@value Claims#EXPIRAT... | java | void validateIatAndExp(JwtClaims jwtClaims, long clockSkewInMilliseconds) throws InvalidClaimException {
if (jwtClaims == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Missing JwtClaims object");
}
return;
}
NumericDate issueAtClaim = getIssuedAtClaim(jwtClaims);
NumericDate expirationClaim = ge... | [
"void",
"validateIatAndExp",
"(",
"JwtClaims",
"jwtClaims",
",",
"long",
"clockSkewInMilliseconds",
")",
"throws",
"InvalidClaimException",
"{",
"if",
"(",
"jwtClaims",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
... | Validates the the {@value Claims#ISSUED_AT} and {@value Claims#EXPIRATION}
claims are present and properly formed. Also verifies that the
{@value Claims#ISSUED_AT} time is after the {@value Claims#EXPIRATION} time. | [
"Validates",
"the",
"the",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java#L465-L480 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java | MsgSettingController.downloadApiJson | @GetMapping("/setting/download/api/json")
public void downloadApiJson(HttpServletRequest req, @RequestParam("method") String method, @RequestParam("url") String url, HttpServletResponse res) {
"""
Download api json.
@param req the req
@param method the method
@param url the url
@param res the re... | java | @GetMapping("/setting/download/api/json")
public void downloadApiJson(HttpServletRequest req, @RequestParam("method") String method, @RequestParam("url") String url, HttpServletResponse res) {
this.validationSessionComponent.sessionCheck(req);
url = new String(Base64.getDecoder().decode(url));
... | [
"@",
"GetMapping",
"(",
"\"/setting/download/api/json\"",
")",
"public",
"void",
"downloadApiJson",
"(",
"HttpServletRequest",
"req",
",",
"@",
"RequestParam",
"(",
"\"method\"",
")",
"String",
"method",
",",
"@",
"RequestParam",
"(",
"\"url\"",
")",
"String",
"ur... | Download api json.
@param req the req
@param method the method
@param url the url
@param res the res | [
"Download",
"api",
"json",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java#L89-L95 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java | ClassDescriptorDef.cloneReference | private ReferenceDescriptorDef cloneReference(ReferenceDescriptorDef refDef, String prefix) {
"""
Clones the given reference.
@param refDef The reference descriptor
@param prefix A prefix for the name
@return The cloned reference
"""
ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef(... | java | private ReferenceDescriptorDef cloneReference(ReferenceDescriptorDef refDef, String prefix)
{
ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef(refDef, prefix);
copyRefDef.setOwner(this);
// we remove properties that are only relevant to the class the features are declared... | [
"private",
"ReferenceDescriptorDef",
"cloneReference",
"(",
"ReferenceDescriptorDef",
"refDef",
",",
"String",
"prefix",
")",
"{",
"ReferenceDescriptorDef",
"copyRefDef",
"=",
"new",
"ReferenceDescriptorDef",
"(",
"refDef",
",",
"prefix",
")",
";",
"copyRefDef",
".",
... | Clones the given reference.
@param refDef The reference descriptor
@param prefix A prefix for the name
@return The cloned reference | [
"Clones",
"the",
"given",
"reference",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java#L479-L503 |
m-m-m/util | version/src/main/java/net/sf/mmm/util/version/base/AbstractVersionIdentifier.java | AbstractVersionIdentifier.compareToLabel | private int compareToLabel(int currentResult, VersionIdentifier otherVersion) {
"""
This method performs the part of {@link #compareTo(VersionIdentifier)} for the {@link #getLabel() label}.
@param currentResult is the current result so far.
@param otherVersion is the {@link VersionIdentifier} to compare to.
@... | java | private int compareToLabel(int currentResult, VersionIdentifier otherVersion) {
if (currentResult == COMPARE_TO_INCOMPARABLE) {
return COMPARE_TO_INCOMPARABLE;
}
int result = currentResult;
if (result == 0) {
String label = getLabel();
if (label != null) {
String otherLabel = ... | [
"private",
"int",
"compareToLabel",
"(",
"int",
"currentResult",
",",
"VersionIdentifier",
"otherVersion",
")",
"{",
"if",
"(",
"currentResult",
"==",
"COMPARE_TO_INCOMPARABLE",
")",
"{",
"return",
"COMPARE_TO_INCOMPARABLE",
";",
"}",
"int",
"result",
"=",
"currentR... | This method performs the part of {@link #compareTo(VersionIdentifier)} for the {@link #getLabel() label}.
@param currentResult is the current result so far.
@param otherVersion is the {@link VersionIdentifier} to compare to.
@return the result of comparison. | [
"This",
"method",
"performs",
"the",
"part",
"of",
"{",
"@link",
"#compareTo",
"(",
"VersionIdentifier",
")",
"}",
"for",
"the",
"{",
"@link",
"#getLabel",
"()",
"label",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/version/src/main/java/net/sf/mmm/util/version/base/AbstractVersionIdentifier.java#L277-L296 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/ParameterUtil.java | ParameterUtil.requireIntParameter | public static int requireIntParameter (HttpServletRequest req, String name, int low, int high,
String invalidDataMessage)
throws DataValidationException {
"""
Fetches the supplied parameter from the request and converts it to an integer. If the
parameter does not... | java | public static int requireIntParameter (HttpServletRequest req, String name, int low, int high,
String invalidDataMessage)
throws DataValidationException
{
return requireIntParameter(
req, name, invalidDataMessage, new IntRangeValidator(low, high... | [
"public",
"static",
"int",
"requireIntParameter",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
",",
"int",
"low",
",",
"int",
"high",
",",
"String",
"invalidDataMessage",
")",
"throws",
"DataValidationException",
"{",
"return",
"requireIntParameter",
"("... | Fetches the supplied parameter from the request and converts it to an integer. If the
parameter does not exist or is not a well-formed integer, a data validation exception is
thrown with the supplied message. | [
"Fetches",
"the",
"supplied",
"parameter",
"from",
"the",
"request",
"and",
"converts",
"it",
"to",
"an",
"integer",
".",
"If",
"the",
"parameter",
"does",
"not",
"exist",
"or",
"is",
"not",
"a",
"well",
"-",
"formed",
"integer",
"a",
"data",
"validation",... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L112-L118 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java | ResolvableType.getComponentType | public ResolvableType getComponentType() {
"""
Return the ResolvableType representing the component type of the array or {@link #NONE} if this type does not represent
an array.
@see #isArray()
"""
if (this == NONE) {
return NONE;
}
if (this.componentType != null) {
... | java | public ResolvableType getComponentType() {
if (this == NONE) {
return NONE;
}
if (this.componentType != null) {
return this.componentType;
}
if (this.type instanceof Class) {
Class<?> componentType = ((Class<?>) this.type).getComponentType();
... | [
"public",
"ResolvableType",
"getComponentType",
"(",
")",
"{",
"if",
"(",
"this",
"==",
"NONE",
")",
"{",
"return",
"NONE",
";",
"}",
"if",
"(",
"this",
".",
"componentType",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"componentType",
";",
"}",
"if... | Return the ResolvableType representing the component type of the array or {@link #NONE} if this type does not represent
an array.
@see #isArray() | [
"Return",
"the",
"ResolvableType",
"representing",
"the",
"component",
"type",
"of",
"the",
"array",
"or",
"{",
"@link",
"#NONE",
"}",
"if",
"this",
"type",
"does",
"not",
"represent",
"an",
"array",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java#L293-L308 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/TraceOptions.java | TraceOptions.fromLowerBase16 | public static TraceOptions fromLowerBase16(CharSequence src, int srcOffset) {
"""
Returns a {@code TraceOption} built from a lowercase base16 representation.
@param src the lowercase base16 representation.
@param srcOffset the offset in the buffer where the representation of the {@code TraceOptions}
begins.
... | java | public static TraceOptions fromLowerBase16(CharSequence src, int srcOffset) {
return new TraceOptions(BigendianEncoding.byteFromBase16String(src, srcOffset));
} | [
"public",
"static",
"TraceOptions",
"fromLowerBase16",
"(",
"CharSequence",
"src",
",",
"int",
"srcOffset",
")",
"{",
"return",
"new",
"TraceOptions",
"(",
"BigendianEncoding",
".",
"byteFromBase16String",
"(",
"src",
",",
"srcOffset",
")",
")",
";",
"}"
] | Returns a {@code TraceOption} built from a lowercase base16 representation.
@param src the lowercase base16 representation.
@param srcOffset the offset in the buffer where the representation of the {@code TraceOptions}
begins.
@return a {@code TraceOption} built from a lowercase base16 representation.
@throws NullPoin... | [
"Returns",
"a",
"{",
"@code",
"TraceOption",
"}",
"built",
"from",
"a",
"lowercase",
"base16",
"representation",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/TraceOptions.java#L131-L133 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java | BackupService.createBackupActivity | public BackupActivity createBackupActivity( File backupDirectory,
BackupOptions options ) {
"""
Create a new {@link BackupActivity activity} instance that can back up the content of the repository as it exists at the
time the activity is executed.
@param backupDi... | java | public BackupActivity createBackupActivity( File backupDirectory,
BackupOptions options ) {
return new BackupActivity(backupDirectory, documentStore, binaryStore, repositoryCache, options);
} | [
"public",
"BackupActivity",
"createBackupActivity",
"(",
"File",
"backupDirectory",
",",
"BackupOptions",
"options",
")",
"{",
"return",
"new",
"BackupActivity",
"(",
"backupDirectory",
",",
"documentStore",
",",
"binaryStore",
",",
"repositoryCache",
",",
"options",
... | Create a new {@link BackupActivity activity} instance that can back up the content of the repository as it exists at the
time the activity is executed.
@param backupDirectory the directory on the file system into which the backup should be placed; this directory should
typically not exist
@param options the {@link org... | [
"Create",
"a",
"new",
"{",
"@link",
"BackupActivity",
"activity",
"}",
"instance",
"that",
"can",
"back",
"up",
"the",
"content",
"of",
"the",
"repository",
"as",
"it",
"exists",
"at",
"the",
"time",
"the",
"activity",
"is",
"executed",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java#L193-L196 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarNewButton.java | CmsToolbarNewButton.makeNavigationLevelItem | private CmsCreatableListItem makeNavigationLevelItem() {
"""
Creates a list item representing a redirect.<p>
@return the new list item
"""
CmsNewResourceInfo typeInfo = getController().getData().getNewNavigationLevelElementInfo();
CmsListItemWidget widget = new CmsListItemWidget(typeInfo);
... | java | private CmsCreatableListItem makeNavigationLevelItem() {
CmsNewResourceInfo typeInfo = getController().getData().getNewNavigationLevelElementInfo();
CmsListItemWidget widget = new CmsListItemWidget(typeInfo);
CmsCreatableListItem listItem = new CmsCreatableListItem(widget, typeInfo, NewEntryTyp... | [
"private",
"CmsCreatableListItem",
"makeNavigationLevelItem",
"(",
")",
"{",
"CmsNewResourceInfo",
"typeInfo",
"=",
"getController",
"(",
")",
".",
"getData",
"(",
")",
".",
"getNewNavigationLevelElementInfo",
"(",
")",
";",
"CmsListItemWidget",
"widget",
"=",
"new",
... | Creates a list item representing a redirect.<p>
@return the new list item | [
"Creates",
"a",
"list",
"item",
"representing",
"a",
"redirect",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsToolbarNewButton.java#L176-L183 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.assumeVectorField | public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation) {
"""
Get the vector field type information from a relation.
@param relation relation
@param <V> Vector type
@return Vector field type information
"""
try {
return ((VectorFieldTypeIn... | java | public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation) {
try {
return ((VectorFieldTypeInformation<V>) relation.getDataTypeInformation());
}
catch(Exception e) {
throw new UnsupportedOperationException("Expected a vector field, got type i... | [
"public",
"static",
"<",
"V",
"extends",
"FeatureVector",
"<",
"?",
">",
">",
"VectorFieldTypeInformation",
"<",
"V",
">",
"assumeVectorField",
"(",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"try",
"{",
"return",
"(",
"(",
"VectorFieldTypeInformation",
... | Get the vector field type information from a relation.
@param relation relation
@param <V> Vector type
@return Vector field type information | [
"Get",
"the",
"vector",
"field",
"type",
"information",
"from",
"a",
"relation",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L66-L73 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/ColumnText.java | ColumnText.setColumns | public void setColumns(float leftLine[], float rightLine[]) {
"""
Sets the columns bounds. Each column bound is described by a
<CODE>float[]</CODE> with the line points [x1,y1,x2,y2,...].
The array must have at least 4 elements.
@param leftLine the left column bound
@param rightLine the right column bound
... | java | public void setColumns(float leftLine[], float rightLine[]) {
maxY = -10e20f;
minY = 10e20f;
setYLine(Math.max(leftLine[1], leftLine[leftLine.length - 1]));
rightWall = convertColumn(rightLine);
leftWall = convertColumn(leftLine);
rectangularWidth = -1;
rectangula... | [
"public",
"void",
"setColumns",
"(",
"float",
"leftLine",
"[",
"]",
",",
"float",
"rightLine",
"[",
"]",
")",
"{",
"maxY",
"=",
"-",
"10e20f",
";",
"minY",
"=",
"10e20f",
";",
"setYLine",
"(",
"Math",
".",
"max",
"(",
"leftLine",
"[",
"1",
"]",
","... | Sets the columns bounds. Each column bound is described by a
<CODE>float[]</CODE> with the line points [x1,y1,x2,y2,...].
The array must have at least 4 elements.
@param leftLine the left column bound
@param rightLine the right column bound | [
"Sets",
"the",
"columns",
"bounds",
".",
"Each",
"column",
"bound",
"is",
"described",
"by",
"a",
"<CODE",
">",
"float",
"[]",
"<",
"/",
"CODE",
">",
"with",
"the",
"line",
"points",
"[",
"x1",
"y1",
"x2",
"y2",
"...",
"]",
".",
"The",
"array",
"mu... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/ColumnText.java#L588-L596 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java | Util.forwardExecutionControl | public static void forwardExecutionControl(ExecutionControl ec,
ObjectInput in, ObjectOutput out) {
"""
Forward commands from the input to the specified {@link ExecutionControl}
instance, then responses back on the output.
@param ec the direct instance of {@link ExecutionControl} to process commands
... | java | public static void forwardExecutionControl(ExecutionControl ec,
ObjectInput in, ObjectOutput out) {
new ExecutionControlForwarder(ec, in, out).commandLoop();
} | [
"public",
"static",
"void",
"forwardExecutionControl",
"(",
"ExecutionControl",
"ec",
",",
"ObjectInput",
"in",
",",
"ObjectOutput",
"out",
")",
"{",
"new",
"ExecutionControlForwarder",
"(",
"ec",
",",
"in",
",",
"out",
")",
".",
"commandLoop",
"(",
")",
";",
... | Forward commands from the input to the specified {@link ExecutionControl}
instance, then responses back on the output.
@param ec the direct instance of {@link ExecutionControl} to process commands
@param in the command input
@param out the command response output | [
"Forward",
"commands",
"from",
"the",
"input",
"to",
"the",
"specified",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java#L74-L77 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java | DatumWriterGenerator.encodeInt | private void encodeInt(GeneratorAdapter mg, int intValue, int encoder) {
"""
Generates method body for encoding an compile time int value.
@param mg Method body generator
@param intValue The integer constant value to encode
@param encoder Method argument index of the encoder
"""
mg.loadArg(encoder);
... | java | private void encodeInt(GeneratorAdapter mg, int intValue, int encoder) {
mg.loadArg(encoder);
mg.push(intValue);
mg.invokeInterface(Type.getType(Encoder.class), getMethod(Encoder.class, "writeInt", int.class));
mg.pop();
} | [
"private",
"void",
"encodeInt",
"(",
"GeneratorAdapter",
"mg",
",",
"int",
"intValue",
",",
"int",
"encoder",
")",
"{",
"mg",
".",
"loadArg",
"(",
"encoder",
")",
";",
"mg",
".",
"push",
"(",
"intValue",
")",
";",
"mg",
".",
"invokeInterface",
"(",
"Ty... | Generates method body for encoding an compile time int value.
@param mg Method body generator
@param intValue The integer constant value to encode
@param encoder Method argument index of the encoder | [
"Generates",
"method",
"body",
"for",
"encoding",
"an",
"compile",
"time",
"int",
"value",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L381-L386 |
chalup/microorm | library/src/main/java/org/chalup/microorm/MicroOrm.java | MicroOrm.fromCursor | @SuppressWarnings("unchecked")
public <T> T fromCursor(Cursor c, T object) {
"""
Fills the field in the provided object with data from the current row in
{@link Cursor}.
@param <T> the type of the provided object
@param c an open {@link Cursor} with position set to valid row
@param object the instance to b... | java | @SuppressWarnings("unchecked")
public <T> T fromCursor(Cursor c, T object) {
return ((DaoAdapter<T>) getAdapter(object.getClass())).fromCursor(c, object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"fromCursor",
"(",
"Cursor",
"c",
",",
"T",
"object",
")",
"{",
"return",
"(",
"(",
"DaoAdapter",
"<",
"T",
">",
")",
"getAdapter",
"(",
"object",
".",
"getClass",
"(",
... | Fills the field in the provided object with data from the current row in
{@link Cursor}.
@param <T> the type of the provided object
@param c an open {@link Cursor} with position set to valid row
@param object the instance to be filled with data
@return the same object for easy chaining | [
"Fills",
"the",
"field",
"in",
"the",
"provided",
"object",
"with",
"data",
"from",
"the",
"current",
"row",
"in",
"{",
"@link",
"Cursor",
"}",
"."
] | train | https://github.com/chalup/microorm/blob/54c437608c4563daa207950d6a7af663f820da89/library/src/main/java/org/chalup/microorm/MicroOrm.java#L71-L74 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/MethodInvocation.java | MethodInvocation.newMethodInvocation | public static MethodInvocation newMethodInvocation(Object target, Method method, Object... args) {
"""
Factory method used to construct a new instance of {@link MethodInvocation} initialized with
the given target {@link Object}, instance {@link Method} and array of {@link Object arguments}
passed to the {@link M... | java | public static MethodInvocation newMethodInvocation(Object target, Method method, Object... args) {
return new MethodInvocation(target, method, args);
} | [
"public",
"static",
"MethodInvocation",
"newMethodInvocation",
"(",
"Object",
"target",
",",
"Method",
"method",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"MethodInvocation",
"(",
"target",
",",
"method",
",",
"args",
")",
";",
"}"
] | Factory method used to construct a new instance of {@link MethodInvocation} initialized with
the given target {@link Object}, instance {@link Method} and array of {@link Object arguments}
passed to the {@link Method} during invocation.
The {@link Method} represents a {@link java.lang.reflect.Modifier#STATIC non-static... | [
"Factory",
"method",
"used",
"to",
"construct",
"a",
"new",
"instance",
"of",
"{",
"@link",
"MethodInvocation",
"}",
"initialized",
"with",
"the",
"given",
"target",
"{",
"@link",
"Object",
"}",
"instance",
"{",
"@link",
"Method",
"}",
"and",
"array",
"of",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/MethodInvocation.java#L78-L80 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.newEntry | private static AuditEntryBean newEntry(String orgId, AuditEntityType type, ISecurityContext securityContext) {
"""
Creates an audit entry.
@param orgId the organization id
@param type
@param securityContext the security context
@return the audit entry
"""
// Wait for 1 ms to guarantee that two audi... | java | private static AuditEntryBean newEntry(String orgId, AuditEntityType type, ISecurityContext securityContext) {
// Wait for 1 ms to guarantee that two audit entries are never created at the same moment in time (which would
// result in non-deterministic sorting by the storage layer)
try { Thread.... | [
"private",
"static",
"AuditEntryBean",
"newEntry",
"(",
"String",
"orgId",
",",
"AuditEntityType",
"type",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"// Wait for 1 ms to guarantee that two audit entries are never created at the same moment in time (which would",
"// resul... | Creates an audit entry.
@param orgId the organization id
@param type
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L788-L799 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.setLastInstanceActiveTime | protected void setLastInstanceActiveTime(String instanceId, long time, T jedis) {
"""
Set the last time at which this instance was active
@param time a unix timestamp in milliseconds
@param jedis a thread-safe Redis connection
"""
jedis.hset(redisSchema.lastInstanceActiveTime(), instanceId, Long.toSt... | java | protected void setLastInstanceActiveTime(String instanceId, long time, T jedis){
jedis.hset(redisSchema.lastInstanceActiveTime(), instanceId, Long.toString(time));
} | [
"protected",
"void",
"setLastInstanceActiveTime",
"(",
"String",
"instanceId",
",",
"long",
"time",
",",
"T",
"jedis",
")",
"{",
"jedis",
".",
"hset",
"(",
"redisSchema",
".",
"lastInstanceActiveTime",
"(",
")",
",",
"instanceId",
",",
"Long",
".",
"toString",... | Set the last time at which this instance was active
@param time a unix timestamp in milliseconds
@param jedis a thread-safe Redis connection | [
"Set",
"the",
"last",
"time",
"at",
"which",
"this",
"instance",
"was",
"active"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L749-L751 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java | RobustResilienceStrategy.replaceFailure | @Override
public boolean replaceFailure(K key, V value, V newValue, StoreAccessException e) {
"""
Do nothing and return false.
@param key the key being replaced
@param value the expected value
@param newValue the replacement value
@param e the triggered failure
@return false
"""
cleanup(key, e);
... | java | @Override
public boolean replaceFailure(K key, V value, V newValue, StoreAccessException e) {
cleanup(key, e);
return false;
} | [
"@",
"Override",
"public",
"boolean",
"replaceFailure",
"(",
"K",
"key",
",",
"V",
"value",
",",
"V",
"newValue",
",",
"StoreAccessException",
"e",
")",
"{",
"cleanup",
"(",
"key",
",",
"e",
")",
";",
"return",
"false",
";",
"}"
] | Do nothing and return false.
@param key the key being replaced
@param value the expected value
@param newValue the replacement value
@param e the triggered failure
@return false | [
"Do",
"nothing",
"and",
"return",
"false",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L157-L161 |
albfernandez/javadbf | src/main/java/com/linuxense/javadbf/Utils.java | Utils.doubleFormating | @Deprecated
public static byte[] doubleFormating(Double doubleNum, String characterSetName, int fieldLength, int sizeDecimalPart)
throws UnsupportedEncodingException {
"""
Obtains the data to store in file for a double number
@param doubleNum number to convert
@param characterSetName charset to use (ignored)... | java | @Deprecated
public static byte[] doubleFormating(Double doubleNum, String characterSetName, int fieldLength, int sizeDecimalPart)
throws UnsupportedEncodingException {
return doubleFormating(doubleNum, Charset.forName(characterSetName), fieldLength, sizeDecimalPart);
} | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"doubleFormating",
"(",
"Double",
"doubleNum",
",",
"String",
"characterSetName",
",",
"int",
"fieldLength",
",",
"int",
"sizeDecimalPart",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"double... | Obtains the data to store in file for a double number
@param doubleNum number to convert
@param characterSetName charset to use (ignored)
@param fieldLength field size
@param sizeDecimalPart sizeDecimalPart
@return byte[] to store in the file
@throws UnsupportedEncodingException since no charset is used, no excpetion i... | [
"Obtains",
"the",
"data",
"to",
"store",
"in",
"file",
"for",
"a",
"double",
"number"
] | train | https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/Utils.java#L353-L357 |
Waikato/moa | moa/src/main/java/moa/gui/GUIDefaults.java | GUIDefaults.getObject | protected static Object getObject(String property, String defaultValue, Class cls) {
"""
Tries to instantiate the class stored for this property, optional
options will be set as well. Returns null if unsuccessful.
@param property the property to get the object for
@param defaultValue the default object ... | java | protected static Object getObject(String property, String defaultValue, Class cls) {
Object result;
String tmpStr;
String[] tmpOptions;
result = null;
try {
tmpStr = get(property, defaultValue);
tmpOptions = Utils.splitOptions(tmpStr);
if (tm... | [
"protected",
"static",
"Object",
"getObject",
"(",
"String",
"property",
",",
"String",
"defaultValue",
",",
"Class",
"cls",
")",
"{",
"Object",
"result",
";",
"String",
"tmpStr",
";",
"String",
"[",
"]",
"tmpOptions",
";",
"result",
"=",
"null",
";",
"try... | Tries to instantiate the class stored for this property, optional
options will be set as well. Returns null if unsuccessful.
@param property the property to get the object for
@param defaultValue the default object spec string
@param cls the class the object must be derived from
@return if... | [
"Tries",
"to",
"instantiate",
"the",
"class",
"stored",
"for",
"this",
"property",
"optional",
"options",
"will",
"be",
"set",
"as",
"well",
".",
"Returns",
"null",
"if",
"unsuccessful",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/GUIDefaults.java#L105-L126 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.getMappedFieldName | protected String getMappedFieldName(Field field, @Nullable Class<?> domainType) {
"""
Get the mapped field name using meta information derived from the given domain type.
@param field
@param domainType
@return
@since 4.0
"""
return getMappedFieldName(field.getName(), domainType);
} | java | protected String getMappedFieldName(Field field, @Nullable Class<?> domainType) {
return getMappedFieldName(field.getName(), domainType);
} | [
"protected",
"String",
"getMappedFieldName",
"(",
"Field",
"field",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"return",
"getMappedFieldName",
"(",
"field",
".",
"getName",
"(",
")",
",",
"domainType",
")",
";",
"}"
] | Get the mapped field name using meta information derived from the given domain type.
@param field
@param domainType
@return
@since 4.0 | [
"Get",
"the",
"mapped",
"field",
"name",
"using",
"meta",
"information",
"derived",
"from",
"the",
"given",
"domain",
"type",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L315-L317 |
ebourgeois/common-java | src/main/java/ca/jeb/common/infra/JStringUtils.java | JStringUtils.convertInputStreamToString | public static String convertInputStreamToString(InputStream is, String charset) throws IOException {
"""
To convert the InputStream to String we use the BufferedReader.readLine()
method. We iterate until the BufferedReader return null which means
there's no more data to read. Each line will appended to a StringB... | java | public static String convertInputStreamToString(InputStream is, String charset) throws IOException
{
if (is == null)
{
return EMPTY;
}
final StringBuilder sb = new StringBuilder();
BufferedReader reader = null;
try
{
if (charset != null)
{
reader = new BufferedR... | [
"public",
"static",
"String",
"convertInputStreamToString",
"(",
"InputStream",
"is",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"{",
"return",
"EMPTY",
";",
"}",
"final",
"StringBuilder",
"sb",
"=",
"new... | To convert the InputStream to String we use the BufferedReader.readLine()
method. We iterate until the BufferedReader return null which means
there's no more data to read. Each line will appended to a StringBuilder
and returned as String.
@param is - InputStream
@param charset - String, the character set
@return Strin... | [
"To",
"convert",
"the",
"InputStream",
"to",
"String",
"we",
"use",
"the",
"BufferedReader",
".",
"readLine",
"()",
"method",
".",
"We",
"iterate",
"until",
"the",
"BufferedReader",
"return",
"null",
"which",
"means",
"there",
"s",
"no",
"more",
"data",
"to"... | train | https://github.com/ebourgeois/common-java/blob/8ba7e05b1228aad1ec2949b5707ac4b5e8889f92/src/main/java/ca/jeb/common/infra/JStringUtils.java#L183-L219 |
b3log/latke | latke-core/src/main/java/org/json/JSONArray.java | JSONArray.optDouble | public double optDouble(int index, double defaultValue) {
"""
Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param index
subscript
@param defaultValue
The default ... | java | public double optDouble(int index, double defaultValue) {
final Number val = this.optNumber(index, null);
if (val == null) {
return defaultValue;
}
final double doubleValue = val.doubleValue();
// if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) {
... | [
"public",
"double",
"optDouble",
"(",
"int",
"index",
",",
"double",
"defaultValue",
")",
"{",
"final",
"Number",
"val",
"=",
"this",
".",
"optNumber",
"(",
"index",
",",
"null",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultVal... | Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param index
subscript
@param defaultValue
The default value.
@return The value. | [
"Get",
"the",
"optional",
"double",
"value",
"associated",
"with",
"an",
"index",
".",
"The",
"defaultValue",
"is",
"returned",
"if",
"there",
"is",
"no",
"value",
"for",
"the",
"index",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
"and",
"can... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L569-L579 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.listAsync | public Observable<Page<GenericResourceInner>> listAsync(final String filter, final String expand, final Integer top) {
"""
Get all the resources in a subscription.
@param filter The filter to apply on the operation.
@param expand The $expand query parameter.
@param top The number of results to return. If null... | java | public Observable<Page<GenericResourceInner>> listAsync(final String filter, final String expand, final Integer top) {
return listWithServiceResponseAsync(filter, expand, top)
.map(new Func1<ServiceResponse<Page<GenericResourceInner>>, Page<GenericResourceInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"GenericResourceInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"filter",
",",
"final",
"String",
"expand",
",",
"final",
"Integer",
"top",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"filter",
",",
... | Get all the resources in a subscription.
@param filter The filter to apply on the operation.
@param expand The $expand query parameter.
@param top The number of results to return. If null is passed, returns all resource groups.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obser... | [
"Get",
"all",
"the",
"resources",
"in",
"a",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L892-L900 |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/FileUtil.java | FileUtil.setFileContents | public static void setFileContents(File file, ByteBuffer contents) throws IOException {
"""
Writes the specified byte array to a file.
@param file The <code>File</code> to write.
@param contents The byte array to write to the file.
@throws IOException If the file could not be written.
"""
setFileContent... | java | public static void setFileContents(File file, ByteBuffer contents) throws IOException {
setFileContents(file, contents, false);
} | [
"public",
"static",
"void",
"setFileContents",
"(",
"File",
"file",
",",
"ByteBuffer",
"contents",
")",
"throws",
"IOException",
"{",
"setFileContents",
"(",
"file",
",",
"contents",
",",
"false",
")",
";",
"}"
] | Writes the specified byte array to a file.
@param file The <code>File</code> to write.
@param contents The byte array to write to the file.
@throws IOException If the file could not be written. | [
"Writes",
"the",
"specified",
"byte",
"array",
"to",
"a",
"file",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/FileUtil.java#L129-L131 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java | DscNodeConfigurationsInner.createOrUpdate | public DscNodeConfigurationInner createOrUpdate(String resourceGroupName, String automationAccountName, String nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters) {
"""
Create the node configuration identified by node configuration name.
@param resourceGroupName Name of an Azure Reso... | java | public DscNodeConfigurationInner createOrUpdate(String resourceGroupName, String automationAccountName, String nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeConfigurationName, paramete... | [
"public",
"DscNodeConfigurationInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"nodeConfigurationName",
",",
"DscNodeConfigurationCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithS... | Create the node configuration identified by node configuration name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeConfigurationName The create or update parameters for configuration.
@param parameters The create or update paramete... | [
"Create",
"the",
"node",
"configuration",
"identified",
"by",
"node",
"configuration",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodeConfigurationsInner.java#L280-L282 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/NotEmptyAfterStripValidator.java | NotEmptyAfterStripValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given string is a not empty after strip.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
"""
final Strin... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
final String valueAsString = StringUtils.strip(Objects.toString(pvalue, null), stripcharacters);
return StringUtils.isNotEmpty(valueAsString);
} | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"final",
"String",
"valueAsString",
"=",
"StringUtils",
".",
"strip",
"(",
"Objects",
".",
"toString",
"... | {@inheritDoc} check if given string is a not empty after strip.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"string",
"is",
"a",
"not",
"empty",
"after",
"strip",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/NotEmptyAfterStripValidator.java#L57-L62 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletRendererImpl.java | PortletRendererImpl.doAction | @Override
public long doAction(
IPortletWindowId portletWindowId,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
"""
/*
PLT 22.1 If the content of a portlet is cached and the portlet is target of request
with an action-type semantic (e.g.... | java | @Override
public long doAction(
IPortletWindowId portletWindowId,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {
this.portletCacheControlService.purgeCachedPortletData(portletWindowId, httpServletRequest);
final IPortletWindow p... | [
"@",
"Override",
"public",
"long",
"doAction",
"(",
"IPortletWindowId",
"portletWindowId",
",",
"HttpServletRequest",
"httpServletRequest",
",",
"HttpServletResponse",
"httpServletResponse",
")",
"{",
"this",
".",
"portletCacheControlService",
".",
"purgeCachedPortletData",
... | /*
PLT 22.1 If the content of a portlet is cached and the portlet is target of request
with an action-type semantic (e.g. an action or event call), the portlet container should discard the cache and
invoke the corresponding request handling methods of the portlet like processAction,or processEvent. | [
"/",
"*",
"PLT",
"22",
".",
"1",
"If",
"the",
"content",
"of",
"a",
"portlet",
"is",
"cached",
"and",
"the",
"portlet",
"is",
"target",
"of",
"request",
"with",
"an",
"action",
"-",
"type",
"semantic",
"(",
"e",
".",
"g",
".",
"an",
"action",
"or",... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/portlet/rendering/PortletRendererImpl.java#L120-L172 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMOptional.java | JMOptional.getValueAsOptIfExist | public static <K, V, R> Optional<R> getValueAsOptIfExist(Map<K, V> map,
K key, Function<V, R> returnBuilderFunction) {
"""
Gets value as opt if exist.
@param <K> the type parameter
@param <V> the type parameter
@param <R> the type parameter
@p... | java | public static <K, V, R> Optional<R> getValueAsOptIfExist(Map<K, V> map,
K key, Function<V, R> returnBuilderFunction) {
return getOptional(map, key).map(returnBuilderFunction::apply);
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"R",
">",
"Optional",
"<",
"R",
">",
"getValueAsOptIfExist",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"Function",
"<",
"V",
",",
"R",
">",
"returnBuilderFunction",
")",
"{",
"r... | Gets value as opt if exist.
@param <K> the type parameter
@param <V> the type parameter
@param <R> the type parameter
@param map the map
@param key the key
@param returnBuilderFunction the return builder function
@return the valu... | [
"Gets",
"value",
"as",
"opt",
"if",
"exist",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMOptional.java#L126-L129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.