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 |
|---|---|---|---|---|---|---|---|---|---|---|
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.stringOrDefault | public static String stringOrDefault(String str, String defaultValue) {
"""
Get the string if is not null or empty,
otherwise return the default value
@param str
@param defaultValue
@return
"""
if(isStringValued(str)) return str;
return defaultValue;
} | java | public static String stringOrDefault(String str, String defaultValue) {
if(isStringValued(str)) return str;
return defaultValue;
} | [
"public",
"static",
"String",
"stringOrDefault",
"(",
"String",
"str",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"isStringValued",
"(",
"str",
")",
")",
"return",
"str",
";",
"return",
"defaultValue",
";",
"}"
] | Get the string if is not null or empty,
otherwise return the default value
@param str
@param defaultValue
@return | [
"Get",
"the",
"string",
"if",
"is",
"not",
"null",
"or",
"empty",
"otherwise",
"return",
"the",
"default",
"value"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L100-L103 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java | CmsPublishSelectPanel.setGroupList | public void setGroupList(CmsPublishGroupList groups, boolean newData, String defaultWorkflow) {
"""
Sets the publish groups used by this widget.<p>
@param groups the new publish groups
@param newData true if the groups are new data which has been loaded
@param defaultWorkflow if not null, selects the given wo... | java | public void setGroupList(CmsPublishGroupList groups, boolean newData, String defaultWorkflow) {
if (groups.getToken() == null) {
setGroups(groups.getGroups(), newData, defaultWorkflow);
setShowResources(true, "");
} else {
setShowResources(false, groups.getTooManyRes... | [
"public",
"void",
"setGroupList",
"(",
"CmsPublishGroupList",
"groups",
",",
"boolean",
"newData",
",",
"String",
"defaultWorkflow",
")",
"{",
"if",
"(",
"groups",
".",
"getToken",
"(",
")",
"==",
"null",
")",
"{",
"setGroups",
"(",
"groups",
".",
"getGroups... | Sets the publish groups used by this widget.<p>
@param groups the new publish groups
@param newData true if the groups are new data which has been loaded
@param defaultWorkflow if not null, selects the given workflow | [
"Sets",
"the",
"publish",
"groups",
"used",
"by",
"this",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java#L655-L665 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/AbstractExpression.java | AbstractExpression.isValidExprForIndexesAndMVs | public boolean isValidExprForIndexesAndMVs(StringBuffer msg, boolean isMV) {
"""
Return true if the given expression usable as part of an index or MV's
group by and where clause expression.
If false, put the tail of an error message in the string buffer. The
string buffer will be initialized with the name of th... | java | public boolean isValidExprForIndexesAndMVs(StringBuffer msg, boolean isMV) {
if (containsFunctionById(FunctionSQL.voltGetCurrentTimestampId())) {
msg.append("cannot include the function NOW or CURRENT_TIMESTAMP.");
return false;
} else if (hasAnySubexpressionOfClass(AggregateExpr... | [
"public",
"boolean",
"isValidExprForIndexesAndMVs",
"(",
"StringBuffer",
"msg",
",",
"boolean",
"isMV",
")",
"{",
"if",
"(",
"containsFunctionById",
"(",
"FunctionSQL",
".",
"voltGetCurrentTimestampId",
"(",
")",
")",
")",
"{",
"msg",
".",
"append",
"(",
"\"cann... | Return true if the given expression usable as part of an index or MV's
group by and where clause expression.
If false, put the tail of an error message in the string buffer. The
string buffer will be initialized with the name of the index.
@param expr The expression to check
@param msg The StringBuffer to pack with t... | [
"Return",
"true",
"if",
"the",
"given",
"expression",
"usable",
"as",
"part",
"of",
"an",
"index",
"or",
"MV",
"s",
"group",
"by",
"and",
"where",
"clause",
"expression",
".",
"If",
"false",
"put",
"the",
"tail",
"of",
"an",
"error",
"message",
"in",
"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/AbstractExpression.java#L1301-L1324 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/tools/BTools.java | BTools.getSInt | public static String getSInt( int Value, int CharsCount, char LeadingChar ) {
"""
<b>getSInt</b><br>
public static String getSInt( int Value, int CharsCount, char LeadingChar )<br>
Returns int converted to string.<br>
If CharsCount > base int string length<br>
before base int string adds relevant leading chars... | java | public static String getSInt( int Value, int CharsCount, char LeadingChar ) {
//
String Result = "";
//
if ( CharsCount <= 0 ) {
return getSInt( Value );
}
//
String FormatS = "";
if ( LeadingChar == '0' ) {
FormatS = "%" + LeadingChar + Integer.toString( CharsCount ) + "d";
}
else {
Format... | [
"public",
"static",
"String",
"getSInt",
"(",
"int",
"Value",
",",
"int",
"CharsCount",
",",
"char",
"LeadingChar",
")",
"{",
"//",
"String",
"Result",
"=",
"\"\"",
";",
"//",
"if",
"(",
"CharsCount",
"<=",
"0",
")",
"{",
"return",
"getSInt",
"(",
"Val... | <b>getSInt</b><br>
public static String getSInt( int Value, int CharsCount, char LeadingChar )<br>
Returns int converted to string.<br>
If CharsCount > base int string length<br>
before base int string adds relevant leading chars.<br>
If CharsCount <= base int string length<br>
returns base int string.<br>
@param Valu... | [
"<b",
">",
"getSInt<",
"/",
"b",
">",
"<br",
">",
"public",
"static",
"String",
"getSInt",
"(",
"int",
"Value",
"int",
"CharsCount",
"char",
"LeadingChar",
")",
"<br",
">",
"Returns",
"int",
"converted",
"to",
"string",
".",
"<br",
">",
"If",
"CharsCount... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/tools/BTools.java#L269-L288 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/MilestonesApi.java | MilestonesApi.getGroupMilestone | public Milestone getGroupMilestone(Object groupIdOrPath, Integer milestoneId) throws GitLabApiException {
"""
Get the specified group milestone.
@param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
@param milestoneId the ID of the milestone tp get
@return a Milestone i... | java | public Milestone getGroupMilestone(Object groupIdOrPath, Integer milestoneId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"groups", getGroupIdOrPath(groupIdOrPath), "milestones", milestoneId);
return (response.readEntity(Milestone.cla... | [
"public",
"Milestone",
"getGroupMilestone",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"milestoneId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
... | Get the specified group milestone.
@param groupIdOrPath the group in the form of an Integer(ID), String(path), or Group instance
@param milestoneId the ID of the milestone tp get
@return a Milestone instance for the specified IDs
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"specified",
"group",
"milestone",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MilestonesApi.java#L131-L135 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isLessThanOrEqual | public static StringIsLessThanOrEqual isLessThanOrEqual(StringExpression left, Object constant) {
"""
Creates an StringIsLessThanOrEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a String).
@throws IllegalArgumentEx... | java | public static StringIsLessThanOrEqual isLessThanOrEqual(StringExpression left, Object constant) {
if (!(constant instanceof String))
throw new IllegalArgumentException("constant is not a String");
return new StringIsLessThanOrEqual(left, constant((String)constant));
} | [
"public",
"static",
"StringIsLessThanOrEqual",
"isLessThanOrEqual",
"(",
"StringExpression",
"left",
",",
"Object",
"constant",
")",
"{",
"if",
"(",
"!",
"(",
"constant",
"instanceof",
"String",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"constant ... | Creates an StringIsLessThanOrEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a String).
@throws IllegalArgumentException If the constant is not a String
@return A new is less than binary expression. | [
"Creates",
"an",
"StringIsLessThanOrEqual",
"expression",
"from",
"the",
"given",
"expression",
"and",
"constant",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L445-L451 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassScrollBarUI.java | SeaGlassScrollBarUI.getPreferredSize | public Dimension getPreferredSize(JComponent c) {
"""
A vertical scrollbar's preferred width is the maximum of preferred widths
of the (non <code>null</code>) increment/decrement buttons, and the
minimum width of the thumb. The preferred height is the sum of the
preferred heights of the same parts. The basis fo... | java | public Dimension getPreferredSize(JComponent c) {
Insets insets = c.getInsets();
return (scrollbar.getOrientation() == JScrollBar.VERTICAL) ? new Dimension(scrollBarWidth + insets.left + insets.right, 48)
: new Dimension(48, scrollBarWidth + insets.top + insets.bottom);
} | [
"public",
"Dimension",
"getPreferredSize",
"(",
"JComponent",
"c",
")",
"{",
"Insets",
"insets",
"=",
"c",
".",
"getInsets",
"(",
")",
";",
"return",
"(",
"scrollbar",
".",
"getOrientation",
"(",
")",
"==",
"JScrollBar",
".",
"VERTICAL",
")",
"?",
"new",
... | A vertical scrollbar's preferred width is the maximum of preferred widths
of the (non <code>null</code>) increment/decrement buttons, and the
minimum width of the thumb. The preferred height is the sum of the
preferred heights of the same parts. The basis for the preferred size of
a horizontal scrollbar is similar.
<p>... | [
"A",
"vertical",
"scrollbar",
"s",
"preferred",
"width",
"is",
"the",
"maximum",
"of",
"preferred",
"widths",
"of",
"the",
"(",
"non",
"<code",
">",
"null<",
"/",
"code",
">",
")",
"increment",
"/",
"decrement",
"buttons",
"and",
"the",
"minimum",
"width",... | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassScrollBarUI.java#L351-L355 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.batchSynonyms | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas) throws AlgoliaException {
"""
Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operation to the replica indices
"""
return batchSynonyms(objects, forwardT... | java | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas) throws AlgoliaException {
return batchSynonyms(objects, forwardToReplicas, false);
} | [
"public",
"JSONObject",
"batchSynonyms",
"(",
"List",
"<",
"JSONObject",
">",
"objects",
",",
"boolean",
"forwardToReplicas",
")",
"throws",
"AlgoliaException",
"{",
"return",
"batchSynonyms",
"(",
"objects",
",",
"forwardToReplicas",
",",
"false",
")",
";",
"}"
] | Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operation to the replica indices | [
"Add",
"or",
"Replace",
"a",
"list",
"of",
"synonyms"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1598-L1600 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.readStringFromFile | public static String readStringFromFile(String path, JavaSparkContext sc) throws IOException {
"""
Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param sc Spark context
"""
return readStringFromFile(path, sc.sc());
} | java | public static String readStringFromFile(String path, JavaSparkContext sc) throws IOException {
return readStringFromFile(path, sc.sc());
} | [
"public",
"static",
"String",
"readStringFromFile",
"(",
"String",
"path",
",",
"JavaSparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"return",
"readStringFromFile",
"(",
"path",
",",
"sc",
".",
"sc",
"(",
")",
")",
";",
"}"
] | Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param sc Spark context | [
"Read",
"a",
"UTF",
"-",
"8",
"format",
"String",
"from",
"HDFS",
"(",
"or",
"local",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L109-L111 |
saxsys/SynchronizeFX | synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/executors/lists/AddToListRepairer.java | AddToListRepairer.repairLocalCommand | public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) {
"""
Repairs a remote {@link AddToList} in relation to an local {@link AddToList} command.
@param toRepair
The command to repair.
@param repairAgainst
The command to repair against.
@return The repaired command.
... | java | public AddToList repairLocalCommand(final AddToList toRepair, final AddToList repairAgainst) {
if (toRepair.getPosition() == repairAgainst.getPosition()) {
return createCommand(toRepair, toRepair.getPosition() + 1);
}
return repairRemoteCommand(toRepair, repairAgainst);
} | [
"public",
"AddToList",
"repairLocalCommand",
"(",
"final",
"AddToList",
"toRepair",
",",
"final",
"AddToList",
"repairAgainst",
")",
"{",
"if",
"(",
"toRepair",
".",
"getPosition",
"(",
")",
"==",
"repairAgainst",
".",
"getPosition",
"(",
")",
")",
"{",
"retur... | Repairs a remote {@link AddToList} in relation to an local {@link AddToList} command.
@param toRepair
The command to repair.
@param repairAgainst
The command to repair against.
@return The repaired command. | [
"Repairs",
"a",
"remote",
"{",
"@link",
"AddToList",
"}",
"in",
"relation",
"to",
"an",
"local",
"{",
"@link",
"AddToList",
"}",
"command",
"."
] | train | https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/executors/lists/AddToListRepairer.java#L44-L49 |
weld/core | impl/src/main/java/org/jboss/weld/metadata/Selectors.java | Selectors.matchPath | public static boolean matchPath(String pattern, String str, boolean isCaseSensitive) {
"""
Tests whether or not a given path matches a given pattern.
<p/>
If you need to call this method multiple times with the same pattern you
should rather use TokenizedPattern
@param pattern The pattern to match ag... | java | public static boolean matchPath(String pattern, String str, boolean isCaseSensitive) {
String[] patDirs = tokenize(pattern);
return matchPath(patDirs, tokenize(str), isCaseSensitive);
} | [
"public",
"static",
"boolean",
"matchPath",
"(",
"String",
"pattern",
",",
"String",
"str",
",",
"boolean",
"isCaseSensitive",
")",
"{",
"String",
"[",
"]",
"patDirs",
"=",
"tokenize",
"(",
"pattern",
")",
";",
"return",
"matchPath",
"(",
"patDirs",
",",
"... | Tests whether or not a given path matches a given pattern.
<p/>
If you need to call this method multiple times with the same pattern you
should rather use TokenizedPattern
@param pattern The pattern to match against. Must not be <code>null</code>
.
@param str The path to match, as a String. Must no... | [
"Tests",
"whether",
"or",
"not",
"a",
"given",
"path",
"matches",
"a",
"given",
"pattern",
".",
"<p",
"/",
">",
"If",
"you",
"need",
"to",
"call",
"this",
"method",
"multiple",
"times",
"with",
"the",
"same",
"pattern",
"you",
"should",
"rather",
"use",
... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/metadata/Selectors.java#L72-L75 |
probedock/probedock-java | src/main/java/io/probedock/client/common/model/v1/ModelFactory.java | ModelFactory.createFingerprint | public static String createFingerprint(Class cl, Method m) {
"""
Create fingerprint for java test method
@param cl The test class
@param m The test method
@return The fingerprint generated
"""
return FingerprintGenerator.fingerprint(cl, m);
} | java | public static String createFingerprint(Class cl, Method m) {
return FingerprintGenerator.fingerprint(cl, m);
} | [
"public",
"static",
"String",
"createFingerprint",
"(",
"Class",
"cl",
",",
"Method",
"m",
")",
"{",
"return",
"FingerprintGenerator",
".",
"fingerprint",
"(",
"cl",
",",
"m",
")",
";",
"}"
] | Create fingerprint for java test method
@param cl The test class
@param m The test method
@return The fingerprint generated | [
"Create",
"fingerprint",
"for",
"java",
"test",
"method"
] | train | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/model/v1/ModelFactory.java#L32-L34 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java | TypedQuery.withRowAsyncListeners | public TypedQuery<ENTITY> withRowAsyncListeners(List<Function<Row, Row>> rowAsyncListeners) {
"""
Add the given list of async listeners on the {@link com.datastax.driver.core.Row} object.
Example of usage:
<pre class="code"><code class="java">
.withRowAsyncListeners(Arrays.asList(row -> {
//Do something with... | java | public TypedQuery<ENTITY> withRowAsyncListeners(List<Function<Row, Row>> rowAsyncListeners) {
this.options.setRowAsyncListeners(Optional.of(rowAsyncListeners));
return this;
} | [
"public",
"TypedQuery",
"<",
"ENTITY",
">",
"withRowAsyncListeners",
"(",
"List",
"<",
"Function",
"<",
"Row",
",",
"Row",
">",
">",
"rowAsyncListeners",
")",
"{",
"this",
".",
"options",
".",
"setRowAsyncListeners",
"(",
"Optional",
".",
"of",
"(",
"rowAsyn... | Add the given list of async listeners on the {@link com.datastax.driver.core.Row} object.
Example of usage:
<pre class="code"><code class="java">
.withRowAsyncListeners(Arrays.asList(row -> {
//Do something with the row object here
}))
</code></pre>
Remark: <strong>You can inspect and read values from the row object... | [
"Add",
"the",
"given",
"list",
"of",
"async",
"listeners",
"on",
"the",
"{",
"@link",
"com",
".",
"datastax",
".",
"driver",
".",
"core",
".",
"Row",
"}",
"object",
".",
"Example",
"of",
"usage",
":",
"<pre",
"class",
"=",
"code",
">",
"<code",
"clas... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java#L119-L122 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.ofMajor | public static BigMoney ofMajor(CurrencyUnit currency, long amountMajor) {
"""
Obtains an instance of {@code BigMoney} from an amount in major units.
<p>
This allows you to create an instance with a specific currency and amount.
The scale of the money will be zero.
<p>
The amount is a whole number only. Thus y... | java | public static BigMoney ofMajor(CurrencyUnit currency, long amountMajor) {
MoneyUtils.checkNotNull(currency, "CurrencyUnit must not be null");
return BigMoney.of(currency, BigDecimal.valueOf(amountMajor));
} | [
"public",
"static",
"BigMoney",
"ofMajor",
"(",
"CurrencyUnit",
"currency",
",",
"long",
"amountMajor",
")",
"{",
"MoneyUtils",
".",
"checkNotNull",
"(",
"currency",
",",
"\"CurrencyUnit must not be null\"",
")",
";",
"return",
"BigMoney",
".",
"of",
"(",
"currenc... | Obtains an instance of {@code BigMoney} from an amount in major units.
<p>
This allows you to create an instance with a specific currency and amount.
The scale of the money will be zero.
<p>
The amount is a whole number only. Thus you can initialise the value
'USD 20', but not the value 'USD 20.32'.
For example, {@code... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"BigMoney",
"}",
"from",
"an",
"amount",
"in",
"major",
"units",
".",
"<p",
">",
"This",
"allows",
"you",
"to",
"create",
"an",
"instance",
"with",
"a",
"specific",
"currency",
"and",
"amount",
".",
"The",... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L193-L196 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/Phenotype.java | Phenotype.newInstance | @Deprecated
public Phenotype<G, C> newInstance(final Genotype<G> genotype) {
"""
Create a new {@code Phenotype} with a different {@code Genotype} but the
same {@code generation}, fitness {@code function} and fitness
{@code scaler}.
@since 3.1
@param genotype the new genotype
@return a new {@code phenotyp... | java | @Deprecated
public Phenotype<G, C> newInstance(final Genotype<G> genotype) {
return of(genotype, _generation, _function, _scaler);
} | [
"@",
"Deprecated",
"public",
"Phenotype",
"<",
"G",
",",
"C",
">",
"newInstance",
"(",
"final",
"Genotype",
"<",
"G",
">",
"genotype",
")",
"{",
"return",
"of",
"(",
"genotype",
",",
"_generation",
",",
"_function",
",",
"_scaler",
")",
";",
"}"
] | Create a new {@code Phenotype} with a different {@code Genotype} but the
same {@code generation}, fitness {@code function} and fitness
{@code scaler}.
@since 3.1
@param genotype the new genotype
@return a new {@code phenotype} with replaced {@code genotype}
@throws NullPointerException if the given {@code genotype} i... | [
"Create",
"a",
"new",
"{",
"@code",
"Phenotype",
"}",
"with",
"a",
"different",
"{",
"@code",
"Genotype",
"}",
"but",
"the",
"same",
"{",
"@code",
"generation",
"}",
"fitness",
"{",
"@code",
"function",
"}",
"and",
"fitness",
"{",
"@code",
"scaler",
"}",... | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/Phenotype.java#L308-L311 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java | RTFEmbeddedObject.skipEndOfLine | private static int skipEndOfLine(String text, int offset) {
"""
This method skips the end-of-line markers in the RTF document.
It also indicates if the end of the embedded object has been reached.
@param text RTF document test
@param offset offset into the RTF document
@return new offset
"""
char c... | java | private static int skipEndOfLine(String text, int offset)
{
char c;
boolean finished = false;
while (finished == false)
{
c = text.charAt(offset);
switch (c)
{
case ' ': // found that OBJDATA could be followed by a space the EOL
case '\r':
... | [
"private",
"static",
"int",
"skipEndOfLine",
"(",
"String",
"text",
",",
"int",
"offset",
")",
"{",
"char",
"c",
";",
"boolean",
"finished",
"=",
"false",
";",
"while",
"(",
"finished",
"==",
"false",
")",
"{",
"c",
"=",
"text",
".",
"charAt",
"(",
"... | This method skips the end-of-line markers in the RTF document.
It also indicates if the end of the embedded object has been reached.
@param text RTF document test
@param offset offset into the RTF document
@return new offset | [
"This",
"method",
"skips",
"the",
"end",
"-",
"of",
"-",
"line",
"markers",
"in",
"the",
"RTF",
"document",
".",
"It",
"also",
"indicates",
"if",
"the",
"end",
"of",
"the",
"embedded",
"object",
"has",
"been",
"reached",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L285-L319 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Streams.java | Streams.copyWriterCount | public static int copyWriterCount(final Reader in, final Writer out) throws IOException {
"""
Read the data from the reader and copy to the writer.
@param in inputstream
@param out outpustream
@return number of bytes copied
@throws java.io.IOException if thrown by underlying io operations
"""
... | java | public static int copyWriterCount(final Reader in, final Writer out) throws IOException {
final char[] buffer = new char[10240];
int tot=0;
int c;
c = in.read(buffer);
while (c >= 0) {
if (c > 0) {
out.write(buffer, 0, c);
tot += c;
... | [
"public",
"static",
"int",
"copyWriterCount",
"(",
"final",
"Reader",
"in",
",",
"final",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"final",
"char",
"[",
"]",
"buffer",
"=",
"new",
"char",
"[",
"10240",
"]",
";",
"int",
"tot",
"=",
"0",
";",
... | Read the data from the reader and copy to the writer.
@param in inputstream
@param out outpustream
@return number of bytes copied
@throws java.io.IOException if thrown by underlying io operations | [
"Read",
"the",
"data",
"from",
"the",
"reader",
"and",
"copy",
"to",
"the",
"writer",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Streams.java#L83-L96 |
duraspace/fcrepo-cloudsync | fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/util/StringUtil.java | StringUtil.validate | public static String validate(String name, String value, String[] validValues)
throws IllegalArgumentException {
"""
Checks that the given value's normalized form is one of the allowed
values.
@param name the name of the property being checked, for error reporting.
@param value the value.
@param ... | java | public static String validate(String name, String value, String[] validValues)
throws IllegalArgumentException {
String normVal = validate(name, value, Integer.MAX_VALUE);
StringBuilder s = new StringBuilder();
for (int i = 0; i < validValues.length; i++) {
if (i > 0) {
... | [
"public",
"static",
"String",
"validate",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"[",
"]",
"validValues",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"normVal",
"=",
"validate",
"(",
"name",
",",
"value",
",",
"Integer",
... | Checks that the given value's normalized form is one of the allowed
values.
@param name the name of the property being checked, for error reporting.
@param value the value.
@param validValues the allowed values.
@return the normalized value.
@throws IllegalArgumentException if the normalized value is null,
zero-length... | [
"Checks",
"that",
"the",
"given",
"value",
"s",
"normalized",
"form",
"is",
"one",
"of",
"the",
"allowed",
"values",
"."
] | train | https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/util/StringUtil.java#L54-L70 |
alkacon/opencms-core | src/org/opencms/cache/CmsMemoryObjectCache.java | CmsMemoryObjectCache.getCachedObject | public Object getCachedObject(Class<?> owner, String key) {
"""
Returns an object from the cache.<p>
@param owner the owner class of the cached object (used to ensure keys don't overlap)
@param key the key to lookup the object for
@return an object from the cache, or <code>null</code> if no object matches t... | java | public Object getCachedObject(Class<?> owner, String key) {
key = owner.getName().concat(key);
return OpenCms.getMemoryMonitor().getCachedMemObject(key);
} | [
"public",
"Object",
"getCachedObject",
"(",
"Class",
"<",
"?",
">",
"owner",
",",
"String",
"key",
")",
"{",
"key",
"=",
"owner",
".",
"getName",
"(",
")",
".",
"concat",
"(",
"key",
")",
";",
"return",
"OpenCms",
".",
"getMemoryMonitor",
"(",
")",
"... | Returns an object from the cache.<p>
@param owner the owner class of the cached object (used to ensure keys don't overlap)
@param key the key to lookup the object for
@return an object from the cache, or <code>null</code> if no object matches the given key | [
"Returns",
"an",
"object",
"from",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsMemoryObjectCache.java#L103-L107 |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/MetadataBundlerTask.java | MetadataBundlerTask.nextEntry | protected OutputStream nextEntry (OutputStream lastEntry, String path)
throws IOException {
"""
Advances to the next named entry in the bundle and returns the stream to which to write
that entry.
"""
((JarOutputStream)lastEntry).putNextEntry(new JarEntry(path));
return lastEntry;
} | java | protected OutputStream nextEntry (OutputStream lastEntry, String path)
throws IOException
{
((JarOutputStream)lastEntry).putNextEntry(new JarEntry(path));
return lastEntry;
} | [
"protected",
"OutputStream",
"nextEntry",
"(",
"OutputStream",
"lastEntry",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"(",
"(",
"JarOutputStream",
")",
"lastEntry",
")",
".",
"putNextEntry",
"(",
"new",
"JarEntry",
"(",
"path",
")",
")",
";",
... | Advances to the next named entry in the bundle and returns the stream to which to write
that entry. | [
"Advances",
"to",
"the",
"next",
"named",
"entry",
"in",
"the",
"bundle",
"and",
"returns",
"the",
"stream",
"to",
"which",
"to",
"write",
"that",
"entry",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/MetadataBundlerTask.java#L164-L169 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_PUT | public void billingAccount_ovhPabx_serviceName_PUT(String billingAccount, String serviceName, OvhOvhPabx body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The nam... | java | public void billingAccount_ovhPabx_serviceName_PUT(String billingAccount, String serviceName, OvhOvhPabx body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_ovhPabx_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhOvhPabx",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/ovhPabx/{serviceName}\"",
";",
"St... | Alter this object properties
REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7019-L7023 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/util/ArgUtils.java | ArgUtils.notEmpty | public static void notEmpty(final Object[] arg, final String name) {
"""
配列のサイズが0または、nullでないかどうか検証する。
@param arg 検証対象の値
@param name 検証対象の引数の名前
@throws NullPointerException {@literal arg == null}
@throws IllegalArgumentException {@literal arg.length == 0.}
"""
if(arg == null) {
throw n... | java | public static void notEmpty(final Object[] arg, final String name) {
if(arg == null) {
throw new NullPointerException(String.format("%s should not be null.", name));
}
if(arg.length == 0) {
throw new IllegalArgumentException(String.format("%s should has len... | [
"public",
"static",
"void",
"notEmpty",
"(",
"final",
"Object",
"[",
"]",
"arg",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"arg",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"String",
".",
"format",
"(",
"\"%s should n... | 配列のサイズが0または、nullでないかどうか検証する。
@param arg 検証対象の値
@param name 検証対象の引数の名前
@throws NullPointerException {@literal arg == null}
@throws IllegalArgumentException {@literal arg.length == 0.} | [
"配列のサイズが0または、nullでないかどうか検証する。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/util/ArgUtils.java#L51-L59 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.getWorkspaceFile | public void getWorkspaceFile(String accountId, String workspaceId, String folderId, String fileId) throws ApiException {
"""
Get Workspace File
Retrieves a workspace file (the binary).
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID... | java | public void getWorkspaceFile(String accountId, String workspaceId, String folderId, String fileId) throws ApiException {
getWorkspaceFile(accountId, workspaceId, folderId, fileId, null);
} | [
"public",
"void",
"getWorkspaceFile",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
",",
"String",
"fileId",
")",
"throws",
"ApiException",
"{",
"getWorkspaceFile",
"(",
"accountId",
",",
"workspaceId",
",",
"folderId",
",",
... | Get Workspace File
Retrieves a workspace file (the binary).
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@param fileId Specifies the room file ID GUID. (req... | [
"Get",
"Workspace",
"File",
"Retrieves",
"a",
"workspace",
"file",
"(",
"the",
"binary",
")",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L336-L338 |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/AbstractMutableTimecode.java | AbstractMutableTimecode.setHMSF | public void setHMSF(int hours, int minutes, int seconds, int frames) {
"""
Sets the timecode to the provided hours, minutes, seconds and frames
@param hours
@param minutes
@param seconds
@param frames
"""
innerSetHMSF(hours, minutes, seconds, frames);
} | java | public void setHMSF(int hours, int minutes, int seconds, int frames)
{
innerSetHMSF(hours, minutes, seconds, frames);
} | [
"public",
"void",
"setHMSF",
"(",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
",",
"int",
"frames",
")",
"{",
"innerSetHMSF",
"(",
"hours",
",",
"minutes",
",",
"seconds",
",",
"frames",
")",
";",
"}"
] | Sets the timecode to the provided hours, minutes, seconds and frames
@param hours
@param minutes
@param seconds
@param frames | [
"Sets",
"the",
"timecode",
"to",
"the",
"provided",
"hours",
"minutes",
"seconds",
"and",
"frames"
] | train | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/AbstractMutableTimecode.java#L98-L101 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java | RangeSelectorHelper.onLongClick | public boolean onLongClick(int index, boolean selectItem) {
"""
will take care to save the long pressed index
or to select all items in the range between the current long pressed item and the last long pressed item
@param index the index of the long pressed item
@param selectItem true, if the item at the inde... | java | public boolean onLongClick(int index, boolean selectItem) {
if (mLastLongPressIndex == null) {
// we only consider long presses on not selected items
if (mFastAdapter.getAdapterItem(index).isSelectable()) {
mLastLongPressIndex = index;
// we select this it... | [
"public",
"boolean",
"onLongClick",
"(",
"int",
"index",
",",
"boolean",
"selectItem",
")",
"{",
"if",
"(",
"mLastLongPressIndex",
"==",
"null",
")",
"{",
"// we only consider long presses on not selected items",
"if",
"(",
"mFastAdapter",
".",
"getAdapterItem",
"(",
... | will take care to save the long pressed index
or to select all items in the range between the current long pressed item and the last long pressed item
@param index the index of the long pressed item
@param selectItem true, if the item at the index should be selected, false if this was already done outside of this help... | [
"will",
"take",
"care",
"to",
"save",
"the",
"long",
"pressed",
"index",
"or",
"to",
"select",
"all",
"items",
"in",
"the",
"range",
"between",
"the",
"current",
"long",
"pressed",
"item",
"and",
"the",
"last",
"long",
"pressed",
"item"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java#L95-L114 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/BinaryProtoNetworkExternalizer.java | BinaryProtoNetworkExternalizer.writeProtoNetwork | @Override
public ProtoNetworkDescriptor writeProtoNetwork(ProtoNetwork protoNetwork,
String protoNetworkRootPath) throws ProtoNetworkError {
"""
Writes a binary-based proto network and produces a descriptor including
the binary file.
@param protoNetwork {@link ProtoNetwork}, the proto network, ... | java | @Override
public ProtoNetworkDescriptor writeProtoNetwork(ProtoNetwork protoNetwork,
String protoNetworkRootPath) throws ProtoNetworkError {
final String filename = PROTO_NETWORK_FILENAME;
final File file = new File(asPath(protoNetworkRootPath, filename));
ObjectOutputStream oos... | [
"@",
"Override",
"public",
"ProtoNetworkDescriptor",
"writeProtoNetwork",
"(",
"ProtoNetwork",
"protoNetwork",
",",
"String",
"protoNetworkRootPath",
")",
"throws",
"ProtoNetworkError",
"{",
"final",
"String",
"filename",
"=",
"PROTO_NETWORK_FILENAME",
";",
"final",
"File... | Writes a binary-based proto network and produces a descriptor including
the binary file.
@param protoNetwork {@link ProtoNetwork}, the proto network, which cannot
be null
@param protoNetworkRootPath {@link String}, the root path where proto
network files should be created
@return {@link ProtoNetworkDescriptor}, the pr... | [
"Writes",
"a",
"binary",
"-",
"based",
"proto",
"network",
"and",
"produces",
"a",
"descriptor",
"including",
"the",
"binary",
"file",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/BinaryProtoNetworkExternalizer.java#L126-L146 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java | WriterUtils.getWriterStagingDir | public static Path getWriterStagingDir(State state, int numBranches, int branchId) {
"""
Get the {@link Path} corresponding the to the directory a given {@link org.apache.gobblin.writer.DataWriter} should be writing
its staging data. The staging data directory is determined by combining the
{@link ConfigurationK... | java | public static Path getWriterStagingDir(State state, int numBranches, int branchId) {
String writerStagingDirKey =
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_STAGING_DIR, numBranches, branchId);
Preconditions.checkArgument(state.contains(writerStagingDirKey),
"Missing req... | [
"public",
"static",
"Path",
"getWriterStagingDir",
"(",
"State",
"state",
",",
"int",
"numBranches",
",",
"int",
"branchId",
")",
"{",
"String",
"writerStagingDirKey",
"=",
"ForkOperatorUtils",
".",
"getPropertyNameForBranch",
"(",
"ConfigurationKeys",
".",
"WRITER_ST... | Get the {@link Path} corresponding the to the directory a given {@link org.apache.gobblin.writer.DataWriter} should be writing
its staging data. The staging data directory is determined by combining the
{@link ConfigurationKeys#WRITER_STAGING_DIR} and the {@link ConfigurationKeys#WRITER_FILE_PATH}.
@param state is the ... | [
"Get",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java#L82-L92 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeSequence | public static int encodeSequence(int contentLength, ByteBuffer buf) {
"""
Encode an ASN.1 SEQUENCE.
@param contentLength
the length of the SEQUENCE
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data
"""
int head... | java | public static int encodeSequence(int contentLength, ByteBuffer buf) {
int headerLength = DerUtils.encodeIdAndLength(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED,
ASN1_SEQUENCE_TAG_NUM, contentLength, buf);
return headerLength + contentLength;
} | [
"public",
"static",
"int",
"encodeSequence",
"(",
"int",
"contentLength",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"headerLength",
"=",
"DerUtils",
".",
"encodeIdAndLength",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
".",
"EncodingType",
... | Encode an ASN.1 SEQUENCE.
@param contentLength
the length of the SEQUENCE
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"SEQUENCE",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L378-L382 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/lib/LibLoader.java | LibLoader.loadLibrary | public void loadLibrary(Class<?> clazz, String name, LoadPolicy policy) {
"""
Loads a native library with the given {@link LoadPolicy load policy}.
@param clazz
The class whose classloader should be used to resolve shipped libraries
@param name
The name of the class.
@param policy
The load policy.
"""
... | java | public void loadLibrary(Class<?> clazz, String name, LoadPolicy policy) {
if (loaded.contains(name)) {
return;
}
switch (policy) {
case PREFER_SHIPPED:
try {
loadShippedLibrary(clazz, name);
} catch (LoadLibraryExceptio... | [
"public",
"void",
"loadLibrary",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
",",
"LoadPolicy",
"policy",
")",
"{",
"if",
"(",
"loaded",
".",
"contains",
"(",
"name",
")",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"policy",
")",
... | Loads a native library with the given {@link LoadPolicy load policy}.
@param clazz
The class whose classloader should be used to resolve shipped libraries
@param name
The name of the class.
@param policy
The load policy. | [
"Loads",
"a",
"native",
"library",
"with",
"the",
"given",
"{",
"@link",
"LoadPolicy",
"load",
"policy",
"}",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/lib/LibLoader.java#L105-L144 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/SyncRemoteTable.java | SyncRemoteTable.get | public Object get(int iRowIndex, int iRowCount) throws DBException, RemoteException {
"""
Receive this relative record in the table.
<p>Note: This is usually used only by thin clients, as thick clients have the code to
fake absolute access.
@param iRowIndex The row to retrieve.
@param iRowCount The number of r... | java | public Object get(int iRowIndex, int iRowCount) throws DBException, RemoteException
{
synchronized(m_objSync)
{
return m_tableRemote.get(iRowIndex, iRowCount);
}
} | [
"public",
"Object",
"get",
"(",
"int",
"iRowIndex",
",",
"int",
"iRowCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"synchronized",
"(",
"m_objSync",
")",
"{",
"return",
"m_tableRemote",
".",
"get",
"(",
"iRowIndex",
",",
"iRowCount",
")",
... | Receive this relative record in the table.
<p>Note: This is usually used only by thin clients, as thick clients have the code to
fake absolute access.
@param iRowIndex The row to retrieve.
@param iRowCount The number of rows to retrieve (Used only by EjbCachedTable).
@return The record(s) or an error code as an Integer... | [
"Receive",
"this",
"relative",
"record",
"in",
"the",
"table",
".",
"<p",
">",
"Note",
":",
"This",
"is",
"usually",
"used",
"only",
"by",
"thin",
"clients",
"as",
"thick",
"clients",
"have",
"the",
"code",
"to",
"fake",
"absolute",
"access",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/SyncRemoteTable.java#L216-L222 |
biezhi/anima | src/main/java/org/sql2o/reflection/PojoMetadata.java | PojoMetadata.readAnnotatedColumnName | private String readAnnotatedColumnName(AnnotatedElement classMember, boolean isJpaColumnInClasspath) {
"""
Try to read the {@link io.github.biezhi.anima.annotation.Column} annotation and return the name of the column.
Returns null if no {@link io.github.biezhi.anima.annotation.Column} annotation is present or if ... | java | private String readAnnotatedColumnName(AnnotatedElement classMember, boolean isJpaColumnInClasspath) {
if (isJpaColumnInClasspath) {
Column columnInformation = classMember.getAnnotation(Column.class);
if (columnInformation != null && !columnInformation.name().isEmpty()) {
... | [
"private",
"String",
"readAnnotatedColumnName",
"(",
"AnnotatedElement",
"classMember",
",",
"boolean",
"isJpaColumnInClasspath",
")",
"{",
"if",
"(",
"isJpaColumnInClasspath",
")",
"{",
"Column",
"columnInformation",
"=",
"classMember",
".",
"getAnnotation",
"(",
"Colu... | Try to read the {@link io.github.biezhi.anima.annotation.Column} annotation and return the name of the column.
Returns null if no {@link io.github.biezhi.anima.annotation.Column} annotation is present or if the name of the column is empty | [
"Try",
"to",
"read",
"the",
"{"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/org/sql2o/reflection/PojoMetadata.java#L221-L229 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateXYZ | public Matrix4d rotateXYZ(Vector3d angles) {
"""
Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate s... | java | public Matrix4d rotateXYZ(Vector3d angles) {
return rotateXYZ(angles.x, angles.y, angles.z);
} | [
"public",
"Matrix4d",
"rotateXYZ",
"(",
"Vector3d",
"angles",
")",
"{",
"return",
"rotateXYZ",
"(",
"angles",
".",
"x",
",",
"angles",
".",
"y",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L6255-L6257 |
aws/aws-sdk-java | aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/GetSigningProfileResult.java | GetSigningProfileResult.withSigningParameters | public GetSigningProfileResult withSigningParameters(java.util.Map<String, String> signingParameters) {
"""
<p>
A map of key-value pairs for signing operations that is attached to the target signing profile.
</p>
@param signingParameters
A map of key-value pairs for signing operations that is attached to the... | java | public GetSigningProfileResult withSigningParameters(java.util.Map<String, String> signingParameters) {
setSigningParameters(signingParameters);
return this;
} | [
"public",
"GetSigningProfileResult",
"withSigningParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"signingParameters",
")",
"{",
"setSigningParameters",
"(",
"signingParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of key-value pairs for signing operations that is attached to the target signing profile.
</p>
@param signingParameters
A map of key-value pairs for signing operations that is attached to the target signing profile.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"key",
"-",
"value",
"pairs",
"for",
"signing",
"operations",
"that",
"is",
"attached",
"to",
"the",
"target",
"signing",
"profile",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/GetSigningProfileResult.java#L258-L261 |
haifengl/smile | nlp/src/main/java/smile/nlp/pos/HMMPOSTagger.java | HMMPOSTagger.walkin | public static void walkin(File dir, List<File> files) {
"""
Recursive function to descend into the directory tree and find all the files
that end with ".POS"
@param dir a file object defining the top directory
"""
String pattern = ".POS";
File[] listFile = dir.listFiles();
if (listFil... | java | public static void walkin(File dir, List<File> files) {
String pattern = ".POS";
File[] listFile = dir.listFiles();
if (listFile != null) {
for (File file : listFile) {
if (file.isDirectory()) {
walkin(file, files);
... | [
"public",
"static",
"void",
"walkin",
"(",
"File",
"dir",
",",
"List",
"<",
"File",
">",
"files",
")",
"{",
"String",
"pattern",
"=",
"\".POS\"",
";",
"File",
"[",
"]",
"listFile",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"if",
"(",
"listFile",
... | Recursive function to descend into the directory tree and find all the files
that end with ".POS"
@param dir a file object defining the top directory | [
"Recursive",
"function",
"to",
"descend",
"into",
"the",
"directory",
"tree",
"and",
"find",
"all",
"the",
"files",
"that",
"end",
"with",
".",
"POS"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/nlp/src/main/java/smile/nlp/pos/HMMPOSTagger.java#L400-L414 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java | ProxyHandler.sendForbid | protected void sendForbid(HttpRequest request, HttpResponse response, URI uri) throws IOException {
"""
Send Forbidden. Method called to send forbidden response. Default implementation calls
sendError(403)
"""
response.sendError(HttpResponse.__403_Forbidden, "Forbidden for Proxy");
} | java | protected void sendForbid(HttpRequest request, HttpResponse response, URI uri) throws IOException
{
response.sendError(HttpResponse.__403_Forbidden, "Forbidden for Proxy");
} | [
"protected",
"void",
"sendForbid",
"(",
"HttpRequest",
"request",
",",
"HttpResponse",
"response",
",",
"URI",
"uri",
")",
"throws",
"IOException",
"{",
"response",
".",
"sendError",
"(",
"HttpResponse",
".",
"__403_Forbidden",
",",
"\"Forbidden for Proxy\"",
")",
... | Send Forbidden. Method called to send forbidden response. Default implementation calls
sendError(403) | [
"Send",
"Forbidden",
".",
"Method",
"called",
"to",
"send",
"forbidden",
"response",
".",
"Default",
"implementation",
"calls",
"sendError",
"(",
"403",
")"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L616-L619 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_subServices_domain_keepServiceTerms_GET | public OvhUnpackTerms packName_subServices_domain_keepServiceTerms_GET(String packName, String domain) throws IOException {
"""
Give the condition to unpack service from pack
REST: GET /pack/xdsl/{packName}/subServices/{domain}/keepServiceTerms
@param packName [required] The internal name of your pack
@param ... | java | public OvhUnpackTerms packName_subServices_domain_keepServiceTerms_GET(String packName, String domain) throws IOException {
String qPath = "/pack/xdsl/{packName}/subServices/{domain}/keepServiceTerms";
StringBuilder sb = path(qPath, packName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
retur... | [
"public",
"OvhUnpackTerms",
"packName_subServices_domain_keepServiceTerms_GET",
"(",
"String",
"packName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/subServices/{domain}/keepServiceTerms\"",
";",
"StringBuilder",
... | Give the condition to unpack service from pack
REST: GET /pack/xdsl/{packName}/subServices/{domain}/keepServiceTerms
@param packName [required] The internal name of your pack
@param domain [required] | [
"Give",
"the",
"condition",
"to",
"unpack",
"service",
"from",
"pack"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L716-L721 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java | StaticAnalysis.getFreeVariable | private static String getFreeVariable(Expression2 expression, int index, Scope scope) {
"""
If {@code index} points to a free variable in {@code expression},
return its name. Otherwise, returns null.
@param expression
@param index
@param scope
@return
"""
Expression2 sub = expression.getSubexpressio... | java | private static String getFreeVariable(Expression2 expression, int index, Scope scope) {
Expression2 sub = expression.getSubexpression(index);
if (sub.isConstant()) {
String constant = sub.getConstant();
if (!constant.equals(LAMBDA) && !scope.isBound(constant)) {
return sub.getConstant();
... | [
"private",
"static",
"String",
"getFreeVariable",
"(",
"Expression2",
"expression",
",",
"int",
"index",
",",
"Scope",
"scope",
")",
"{",
"Expression2",
"sub",
"=",
"expression",
".",
"getSubexpression",
"(",
"index",
")",
";",
"if",
"(",
"sub",
".",
"isCons... | If {@code index} points to a free variable in {@code expression},
return its name. Otherwise, returns null.
@param expression
@param index
@param scope
@return | [
"If",
"{",
"@code",
"index",
"}",
"points",
"to",
"a",
"free",
"variable",
"in",
"{",
"@code",
"expression",
"}",
"return",
"its",
"name",
".",
"Otherwise",
"returns",
"null",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java#L63-L72 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/permissions7/PermissionsDescriptorImpl.java | PermissionsDescriptorImpl.addNamespace | public PermissionsDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>PermissionsDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public PermissionsDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"PermissionsDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>PermissionsDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/permissions7/PermissionsDescriptorImpl.java#L83-L87 |
alkacon/opencms-core | src/org/opencms/db/CmsDbContext.java | CmsDbContext.throwException | public void throwException(CmsMessageContainer message, Throwable throwable) throws CmsVfsException, CmsException {
"""
Returns an exception of the same type as <code>throwable</code>, if <code>throwable</code> is an OpenCms Exception
with the message as a {@link CmsMessageContainer} and the <code>throwable</code... | java | public void throwException(CmsMessageContainer message, Throwable throwable) throws CmsVfsException, CmsException {
if (throwable instanceof CmsException) {
throw ((CmsException)throwable).createException(message, throwable);
} else if (throwable instanceof CmsRuntimeException) {
... | [
"public",
"void",
"throwException",
"(",
"CmsMessageContainer",
"message",
",",
"Throwable",
"throwable",
")",
"throws",
"CmsVfsException",
",",
"CmsException",
"{",
"if",
"(",
"throwable",
"instanceof",
"CmsException",
")",
"{",
"throw",
"(",
"(",
"CmsException",
... | Returns an exception of the same type as <code>throwable</code>, if <code>throwable</code> is an OpenCms Exception
with the message as a {@link CmsMessageContainer} and the <code>throwable</code> as a cause.<p>
@param message the message container for the exception to create
@param throwable the cause of the exception... | [
"Returns",
"an",
"exception",
"of",
"the",
"same",
"type",
"as",
"<code",
">",
"throwable<",
"/",
"code",
">",
"if",
"<code",
">",
"throwable<",
"/",
"code",
">",
"is",
"an",
"OpenCms",
"Exception",
"with",
"the",
"message",
"as",
"a",
"{",
"@link",
"C... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDbContext.java#L332-L341 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.mult | private static void mult(int[] src, int srcLen, int value, int[] dst) {
"""
/*@
@ requires src.length >= srcLen && dst.length >= srcLen + 1;
@ assignable dst[0 .. srcLen];
@ ensures AP(dst, srcLen + 1) == \old(AP(src, srcLen) * UNSIGNED(value));
@
"""
long val = value & LONG_MASK;
long carr... | java | private static void mult(int[] src, int srcLen, int value, int[] dst) {
long val = value & LONG_MASK;
long carry = 0;
for (int i = 0; i < srcLen; i++) {
long product = (src[i] & LONG_MASK) * val + carry;
dst[i] = (int) product;
carry = product >>> 32;
... | [
"private",
"static",
"void",
"mult",
"(",
"int",
"[",
"]",
"src",
",",
"int",
"srcLen",
",",
"int",
"value",
",",
"int",
"[",
"]",
"dst",
")",
"{",
"long",
"val",
"=",
"value",
"&",
"LONG_MASK",
";",
"long",
"carry",
"=",
"0",
";",
"for",
"(",
... | /*@
@ requires src.length >= srcLen && dst.length >= srcLen + 1;
@ assignable dst[0 .. srcLen];
@ ensures AP(dst, srcLen + 1) == \old(AP(src, srcLen) * UNSIGNED(value));
@ | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L1367-L1376 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java | ComponentSupport.createFacetUIPanel | private static UIComponent createFacetUIPanel(FaceletContext ctx, UIComponent parent, String facetName) {
"""
Create a new UIPanel for the use as a dynamically
created container for multiple children in a facet.
Duplicate in javax.faces.webapp.UIComponentClassicTagBase.
@param facesContext
@return
"""
... | java | private static UIComponent createFacetUIPanel(FaceletContext ctx, UIComponent parent, String facetName)
{
FacesContext facesContext = ctx.getFacesContext();
UIComponent panel = facesContext.getApplication().createComponent(facesContext, UIPanel.COMPONENT_TYPE, null);
// The panel cr... | [
"private",
"static",
"UIComponent",
"createFacetUIPanel",
"(",
"FaceletContext",
"ctx",
",",
"UIComponent",
"parent",
",",
"String",
"facetName",
")",
"{",
"FacesContext",
"facesContext",
"=",
"ctx",
".",
"getFacesContext",
"(",
")",
";",
"UIComponent",
"panel",
"... | Create a new UIPanel for the use as a dynamically
created container for multiple children in a facet.
Duplicate in javax.faces.webapp.UIComponentClassicTagBase.
@param facesContext
@return | [
"Create",
"a",
"new",
"UIPanel",
"for",
"the",
"use",
"as",
"a",
"dynamically",
"created",
"container",
"for",
"multiple",
"children",
"in",
"a",
"facet",
".",
"Duplicate",
"in",
"javax",
".",
"faces",
".",
"webapp",
".",
"UIComponentClassicTagBase",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java#L577-L618 |
apereo/cas | webapp/cas-server-webapp-config/src/main/java/org/apereo/cas/web/security/CasWebSecurityConfigurerAdapter.java | CasWebSecurityConfigurerAdapter.configureLdapAuthenticationProvider | protected void configureLdapAuthenticationProvider(final AuthenticationManagerBuilder auth, final MonitorProperties.Endpoints.LdapSecurity ldap) {
"""
Configure ldap authentication provider.
@param auth the auth
@param ldap the ldap
"""
if (isLdapAuthorizationActive()) {
val p = new Mon... | java | protected void configureLdapAuthenticationProvider(final AuthenticationManagerBuilder auth, final MonitorProperties.Endpoints.LdapSecurity ldap) {
if (isLdapAuthorizationActive()) {
val p = new MonitorEndpointLdapAuthenticationProvider(ldap, securityProperties);
auth.authenticationProvid... | [
"protected",
"void",
"configureLdapAuthenticationProvider",
"(",
"final",
"AuthenticationManagerBuilder",
"auth",
",",
"final",
"MonitorProperties",
".",
"Endpoints",
".",
"LdapSecurity",
"ldap",
")",
"{",
"if",
"(",
"isLdapAuthorizationActive",
"(",
")",
")",
"{",
"v... | Configure ldap authentication provider.
@param auth the auth
@param ldap the ldap | [
"Configure",
"ldap",
"authentication",
"provider",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/webapp/cas-server-webapp-config/src/main/java/org/apereo/cas/web/security/CasWebSecurityConfigurerAdapter.java#L142-L149 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.dedicated_nasha_model_modelName_GET | public OvhPrice dedicated_nasha_model_modelName_GET(net.minidev.ovh.api.price.dedicated.nasha.OvhModelEnum modelName) throws IOException {
"""
Get the price of Nas HA offers
REST: GET /price/dedicated/nasha/model/{modelName}
@param modelName [required] capacity in gigabit of Nas Ha
"""
String qPath = "/p... | java | public OvhPrice dedicated_nasha_model_modelName_GET(net.minidev.ovh.api.price.dedicated.nasha.OvhModelEnum modelName) throws IOException {
String qPath = "/price/dedicated/nasha/model/{modelName}";
StringBuilder sb = path(qPath, modelName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo... | [
"public",
"OvhPrice",
"dedicated_nasha_model_modelName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"dedicated",
".",
"nasha",
".",
"OvhModelEnum",
"modelName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/... | Get the price of Nas HA offers
REST: GET /price/dedicated/nasha/model/{modelName}
@param modelName [required] capacity in gigabit of Nas Ha | [
"Get",
"the",
"price",
"of",
"Nas",
"HA",
"offers"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L154-L159 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPOptionValueUtil.java | CPOptionValueUtil.removeByUUID_G | public static CPOptionValue removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPOptionValueException {
"""
Removes the cp option value where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp option ... | java | public static CPOptionValue removeByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPOptionValueException {
return getPersistence().removeByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPOptionValue",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPOptionValueException",
"{",
"return",
"getPersistence",
"("... | Removes the cp option value where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp option value that was removed | [
"Removes",
"the",
"cp",
"option",
"value",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPOptionValueUtil.java#L313-L316 |
google/closure-templates | java/src/com/google/template/soy/internal/i18n/BidiFormatter.java | BidiFormatter.unicodeWrap | public String unicodeWrap(@Nullable Dir dir, String str, boolean isHtml) {
"""
Formats a string of given directionality for use in plain-text output of the context
directionality, so an opposite-directionality string is neither garbled nor garbles its
surroundings. As opposed to {@link #spanWrap}, this makes use... | java | public String unicodeWrap(@Nullable Dir dir, String str, boolean isHtml) {
BidiWrappingText wrappingText = unicodeWrappingText(dir, str, isHtml);
return wrappingText.beforeText() + str + wrappingText.afterText();
} | [
"public",
"String",
"unicodeWrap",
"(",
"@",
"Nullable",
"Dir",
"dir",
",",
"String",
"str",
",",
"boolean",
"isHtml",
")",
"{",
"BidiWrappingText",
"wrappingText",
"=",
"unicodeWrappingText",
"(",
"dir",
",",
"str",
",",
"isHtml",
")",
";",
"return",
"wrapp... | Formats a string of given directionality for use in plain-text output of the context
directionality, so an opposite-directionality string is neither garbled nor garbles its
surroundings. As opposed to {@link #spanWrap}, this makes use of Unicode bidi formatting
characters. In HTML, its *only* valid use is inside of ele... | [
"Formats",
"a",
"string",
"of",
"given",
"directionality",
"for",
"use",
"in",
"plain",
"-",
"text",
"output",
"of",
"the",
"context",
"directionality",
"so",
"an",
"opposite",
"-",
"directionality",
"string",
"is",
"neither",
"garbled",
"nor",
"garbles",
"its... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L181-L184 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsElementUtil.java | CmsElementUtil.getBaseElementData | private CmsContainerElementData getBaseElementData(CmsResource page, CmsContainerElementBean element)
throws CmsException {
"""
Returns the base element data for the given element bean, without content or formatter info.<p>
@param page the current container page
@param element the resource
@return base ... | java | private CmsContainerElementData getBaseElementData(CmsResource page, CmsContainerElementBean element)
throws CmsException {
CmsResourceUtil resUtil = new CmsResourceUtil(m_cms, element.getResource());
CmsContainerElementData elementData = new CmsContainerElementData();
setElementInfo(elemen... | [
"private",
"CmsContainerElementData",
"getBaseElementData",
"(",
"CmsResource",
"page",
",",
"CmsContainerElementBean",
"element",
")",
"throws",
"CmsException",
"{",
"CmsResourceUtil",
"resUtil",
"=",
"new",
"CmsResourceUtil",
"(",
"m_cms",
",",
"element",
".",
"getRes... | Returns the base element data for the given element bean, without content or formatter info.<p>
@param page the current container page
@param element the resource
@return base element data
@throws CmsException in case reading the data fails | [
"Returns",
"the",
"base",
"element",
"data",
"for",
"the",
"given",
"element",
"bean",
"without",
"content",
"or",
"formatter",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsElementUtil.java#L926-L946 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addNotEqualTo | public void addNotEqualTo(Object attribute, Object value) {
"""
Adds NotEqualTo (<>) criteria,
customer_id <> 10034
@param attribute The field name to be used
@param value An object representing the value of the field
"""
// PAW
// addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria... | java | public void addNotEqualTo(Object attribute, Object value)
{
// PAW
// addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria(attribute, value, getAlias()));
addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria(attribute, value, getUserAlias(attribute)));
} | [
"public",
"void",
"addNotEqualTo",
"(",
"Object",
"attribute",
",",
"Object",
"value",
")",
"{",
"// PAW\r",
"// addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria(attribute, value, getAlias()));\r",
"addSelectionCriteria",
"(",
"ValueCriteria",
".",
"buildNotEqualToCriteri... | Adds NotEqualTo (<>) criteria,
customer_id <> 10034
@param attribute The field name to be used
@param value An object representing the value of the field | [
"Adds",
"NotEqualTo",
"(",
"<",
">",
")",
"criteria",
"customer_id",
"<",
">",
"10034"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L493-L498 |
aws/aws-sdk-java | aws-java-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/model/LaunchConfiguration.java | LaunchConfiguration.getClassicLinkVPCSecurityGroups | public java.util.List<String> getClassicLinkVPCSecurityGroups() {
"""
<p>
The IDs of one or more security groups for the VPC specified in <code>ClassicLinkVPCId</code>. For more
information, see <a
href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html">ClassicLink</a> in the <i>Amazon
... | java | public java.util.List<String> getClassicLinkVPCSecurityGroups() {
if (classicLinkVPCSecurityGroups == null) {
classicLinkVPCSecurityGroups = new com.amazonaws.internal.SdkInternalList<String>();
}
return classicLinkVPCSecurityGroups;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getClassicLinkVPCSecurityGroups",
"(",
")",
"{",
"if",
"(",
"classicLinkVPCSecurityGroups",
"==",
"null",
")",
"{",
"classicLinkVPCSecurityGroups",
"=",
"new",
"com",
".",
"amazonaws",
".",
"intern... | <p>
The IDs of one or more security groups for the VPC specified in <code>ClassicLinkVPCId</code>. For more
information, see <a
href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html">ClassicLink</a> in the <i>Amazon
EC2 User Guide for Linux Instances</i> and <a
href="https://docs.aws.amazon.com... | [
"<p",
">",
"The",
"IDs",
"of",
"one",
"or",
"more",
"security",
"groups",
"for",
"the",
"VPC",
"specified",
"in",
"<code",
">",
"ClassicLinkVPCId<",
"/",
"code",
">",
".",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"doc... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/model/LaunchConfiguration.java#L486-L491 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/automata/minimizer/hopcroft/HopcroftMinimization.java | HopcroftMinimization.minimizeMealy | public static <I, O> CompactMealy<I, O> minimizeMealy(MealyMachine<?, I, ?, O> mealy,
Alphabet<I> alphabet,
PruningMode pruningMode) {
"""
Minimizes the given Mealy machine. The result is returned in... | java | public static <I, O> CompactMealy<I, O> minimizeMealy(MealyMachine<?, I, ?, O> mealy,
Alphabet<I> alphabet,
PruningMode pruningMode) {
return doMinimizeMealy(mealy, alphabet, new CompactMealy.Crea... | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"CompactMealy",
"<",
"I",
",",
"O",
">",
"minimizeMealy",
"(",
"MealyMachine",
"<",
"?",
",",
"I",
",",
"?",
",",
"O",
">",
"mealy",
",",
"Alphabet",
"<",
"I",
">",
"alphabet",
",",
"PruningMode",
"pruni... | Minimizes the given Mealy machine. The result is returned in the form of a {@link CompactMealy}.
@param mealy
the Mealy machine to minimize
@param alphabet
the input alphabet (this will be the input alphabet of the resulting Mealy machine)
@param pruningMode
the pruning mode (see above)
@return a minimized version of... | [
"Minimizes",
"the",
"given",
"Mealy",
"machine",
".",
"The",
"result",
"is",
"returned",
"in",
"the",
"form",
"of",
"a",
"{",
"@link",
"CompactMealy",
"}",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/automata/minimizer/hopcroft/HopcroftMinimization.java#L87-L91 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java | CompressionUtil.encodeBZ | public static byte[] encodeBZ(byte[] data) {
"""
Encode bz byte [ ].
@param data the data
@return the byte [ ]
"""
try {
int blockSize = 4;
ByteArrayOutputStream output = new ByteArrayOutputStream();
BZip2CompressorOutputStream compresser = new BZip2CompressorOutputStream(output, bloc... | java | public static byte[] encodeBZ(byte[] data) {
try {
int blockSize = 4;
ByteArrayOutputStream output = new ByteArrayOutputStream();
BZip2CompressorOutputStream compresser = new BZip2CompressorOutputStream(output, blockSize);
compresser.write(data);
compresser.close();
byte[] bytes ... | [
"public",
"static",
"byte",
"[",
"]",
"encodeBZ",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"try",
"{",
"int",
"blockSize",
"=",
"4",
";",
"ByteArrayOutputStream",
"output",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"BZip2CompressorOutputStream",
"c... | Encode bz byte [ ].
@param data the data
@return the byte [ ] | [
"Encode",
"bz",
"byte",
"[",
"]",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java#L227-L239 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpServerConversation | private void dumpServerConversation(IncidentStream is, Conversation conv) {
"""
Dumps the details of a particular server conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump.
"""
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())... | java | private void dumpServerConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpServerConversation", new Object[]{is, conv});
final ConversationState convState = (ConversationState) conv.getAttachment();
... | [
"private",
"void",
"dumpServerConversation",
"(",
"IncidentStream",
"is",
",",
"Conversation",
"conv",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
... | Dumps the details of a particular server conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump. | [
"Dumps",
"the",
"details",
"of",
"a",
"particular",
"server",
"conversation",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L216-L243 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineDurationText | public void setBaselineDurationText(int baselineNumber, String value) {
"""
Sets the baseline duration text value.
@param baselineNumber baseline number
@param value baseline duration text value
"""
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | java | public void setBaselineDurationText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineDurationText",
"(",
"int",
"baselineNumber",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_DURATIONS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Sets the baseline duration text value.
@param baselineNumber baseline number
@param value baseline duration text value | [
"Sets",
"the",
"baseline",
"duration",
"text",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4088-L4091 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/impl/JdbcTemplateJdbcHelper.java | JdbcTemplateJdbcHelper.jdbcTemplate | protected JdbcTemplate jdbcTemplate(Connection conn) {
"""
Get {@link JdbcTemplate} instance for a given {@link Connection}.
Note: the returned {@link JdbcTemplate} will not automatically close the
{@link Connection}.
@param conn
@return
"""
DataSource ds = new SingleConnectionDataSource(conn, ... | java | protected JdbcTemplate jdbcTemplate(Connection conn) {
DataSource ds = new SingleConnectionDataSource(conn, true);
return new JdbcTemplate(ds);
} | [
"protected",
"JdbcTemplate",
"jdbcTemplate",
"(",
"Connection",
"conn",
")",
"{",
"DataSource",
"ds",
"=",
"new",
"SingleConnectionDataSource",
"(",
"conn",
",",
"true",
")",
";",
"return",
"new",
"JdbcTemplate",
"(",
"ds",
")",
";",
"}"
] | Get {@link JdbcTemplate} instance for a given {@link Connection}.
Note: the returned {@link JdbcTemplate} will not automatically close the
{@link Connection}.
@param conn
@return | [
"Get",
"{",
"@link",
"JdbcTemplate",
"}",
"instance",
"for",
"a",
"given",
"{",
"@link",
"Connection",
"}",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/impl/JdbcTemplateJdbcHelper.java#L43-L46 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java | VersionNumber.parseOperatingSystemVersion | public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) {
"""
Try to determine the version number of the operating system by parsing the user agent string.
@param family
family of the operating system
@param userAgent
user agent ... | java | public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) {
Check.notNull(family, "family");
Check.notNull(userAgent, "userAgent");
return VersionParser.parseOperatingSystemVersion(family, userAgent);
} | [
"public",
"static",
"VersionNumber",
"parseOperatingSystemVersion",
"(",
"@",
"Nonnull",
"final",
"OperatingSystemFamily",
"family",
",",
"@",
"Nonnull",
"final",
"String",
"userAgent",
")",
"{",
"Check",
".",
"notNull",
"(",
"family",
",",
"\"family\"",
")",
";",... | Try to determine the version number of the operating system by parsing the user agent string.
@param family
family of the operating system
@param userAgent
user agent string
@return extracted version number | [
"Try",
"to",
"determine",
"the",
"version",
"number",
"of",
"the",
"operating",
"system",
"by",
"parsing",
"the",
"user",
"agent",
"string",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/VersionNumber.java#L109-L113 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java | BaseDataPublisher.publishMultiTaskData | private void publishMultiTaskData(WorkUnitState state, int branchId, Set<Path> writerOutputPathsMoved)
throws IOException {
"""
This method publishes task output data for the given {@link WorkUnitState}, but if there are output data of
other tasks in the same folder, it may also publish those data.
"""
... | java | private void publishMultiTaskData(WorkUnitState state, int branchId, Set<Path> writerOutputPathsMoved)
throws IOException {
publishData(state, branchId, false, writerOutputPathsMoved);
addLineageInfo(state, branchId);
} | [
"private",
"void",
"publishMultiTaskData",
"(",
"WorkUnitState",
"state",
",",
"int",
"branchId",
",",
"Set",
"<",
"Path",
">",
"writerOutputPathsMoved",
")",
"throws",
"IOException",
"{",
"publishData",
"(",
"state",
",",
"branchId",
",",
"false",
",",
"writerO... | This method publishes task output data for the given {@link WorkUnitState}, but if there are output data of
other tasks in the same folder, it may also publish those data. | [
"This",
"method",
"publishes",
"task",
"output",
"data",
"for",
"the",
"given",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L380-L384 |
pardom-zz/Ollie | core/src/main/java/ollie/OllieProvider.java | OllieProvider.createUri | public static Uri createUri(Class<? extends Model> type, Long id) {
"""
Create a Uri for a model row.
@param type The model type.
@param id The row Id.
@return The Uri for the model row.
"""
final StringBuilder uri = new StringBuilder();
uri.append("content://");
uri.append(sAuthority);
uri.appe... | java | public static Uri createUri(Class<? extends Model> type, Long id) {
final StringBuilder uri = new StringBuilder();
uri.append("content://");
uri.append(sAuthority);
uri.append("/");
uri.append(Ollie.getTableName(type).toLowerCase());
if (id != null) {
uri.append("/");
uri.append(id.toString());
}
... | [
"public",
"static",
"Uri",
"createUri",
"(",
"Class",
"<",
"?",
"extends",
"Model",
">",
"type",
",",
"Long",
"id",
")",
"{",
"final",
"StringBuilder",
"uri",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"uri",
".",
"append",
"(",
"\"content://\"",
")",
... | Create a Uri for a model row.
@param type The model type.
@param id The row Id.
@return The Uri for the model row. | [
"Create",
"a",
"Uri",
"for",
"a",
"model",
"row",
"."
] | train | https://github.com/pardom-zz/Ollie/blob/9d20468ca78064002187f2c5db3be06d1d29e310/core/src/main/java/ollie/OllieProvider.java#L77-L90 |
h2oai/h2o-3 | h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java | OrcParserProvider.createParserSetup | @Override
public ParseSetup createParserSetup(Key[] inputs, ParseSetup requiredSetup) {
"""
Use only the first file to setup everything.
@param inputs input keys
@param requiredSetup user given parser setup
@return
"""
FileVec f;
Object frameOrVec = DKV.getGet(inputs[0]);
if (frameOrVec ... | java | @Override
public ParseSetup createParserSetup(Key[] inputs, ParseSetup requiredSetup) {
FileVec f;
Object frameOrVec = DKV.getGet(inputs[0]);
if (frameOrVec instanceof water.fvec.Frame)
f = (FileVec) ((Frame) frameOrVec).vec(0);
else
f = (FileVec) frameOrVec;
return readSetup(f, requ... | [
"@",
"Override",
"public",
"ParseSetup",
"createParserSetup",
"(",
"Key",
"[",
"]",
"inputs",
",",
"ParseSetup",
"requiredSetup",
")",
"{",
"FileVec",
"f",
";",
"Object",
"frameOrVec",
"=",
"DKV",
".",
"getGet",
"(",
"inputs",
"[",
"0",
"]",
")",
";",
"i... | Use only the first file to setup everything.
@param inputs input keys
@param requiredSetup user given parser setup
@return | [
"Use",
"only",
"the",
"first",
"file",
"to",
"setup",
"everything",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java#L68-L79 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.executeSiteAnalysisAsync | public Observable<DiagnosticAnalysisInner> executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) {
"""
Execute Analysis.
Execute Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
... | java | public Observable<DiagnosticAnalysisInner> executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) {
return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1<ServiceResponse<Diagnos... | [
"public",
"Observable",
"<",
"DiagnosticAnalysisInner",
">",
"executeSiteAnalysisAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"analysisName",
")",
"{",
"return",
"executeSiteAnalysisWithServiceRes... | Execute Analysis.
Execute Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Category Name
@param analysisName Analysis Resource Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obser... | [
"Execute",
"Analysis",
".",
"Execute",
"Analysis",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L669-L676 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.getDefaultProfile | protected static JSONObject getDefaultProfile() throws Exception {
"""
get the default profile
@return representation of default profile
@throws Exception exception
"""
String uri = DEFAULT_BASE_URL + BASE_PROFILE;
try {
JSONObject response = new JSONObject(doGet(uri, 60000));
... | java | protected static JSONObject getDefaultProfile() throws Exception {
String uri = DEFAULT_BASE_URL + BASE_PROFILE;
try {
JSONObject response = new JSONObject(doGet(uri, 60000));
JSONArray profiles = response.getJSONArray("profiles");
if (profiles.length() > 0) {
... | [
"protected",
"static",
"JSONObject",
"getDefaultProfile",
"(",
")",
"throws",
"Exception",
"{",
"String",
"uri",
"=",
"DEFAULT_BASE_URL",
"+",
"BASE_PROFILE",
";",
"try",
"{",
"JSONObject",
"response",
"=",
"new",
"JSONObject",
"(",
"doGet",
"(",
"uri",
",",
"... | get the default profile
@return representation of default profile
@throws Exception exception | [
"get",
"the",
"default",
"profile"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L902-L917 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java | WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse | public static ChannelFuture sendUnsupportedVersionResponse(Channel channel, ChannelPromise promise) {
"""
Return that we need cannot not support the web socket version
"""
HttpResponse res = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1,
HttpResponseStatus.UPGRADE_RE... | java | public static ChannelFuture sendUnsupportedVersionResponse(Channel channel, ChannelPromise promise) {
HttpResponse res = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1,
HttpResponseStatus.UPGRADE_REQUIRED);
res.headers().set(HttpHeaderNames.SEC_WEBSOCKET_VERSION, WebSo... | [
"public",
"static",
"ChannelFuture",
"sendUnsupportedVersionResponse",
"(",
"Channel",
"channel",
",",
"ChannelPromise",
"promise",
")",
"{",
"HttpResponse",
"res",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HttpVersion",
".",
"HTTP_1_1",
",",
"HttpResponseStatus",
".... | Return that we need cannot not support the web socket version | [
"Return",
"that",
"we",
"need",
"cannot",
"not",
"support",
"the",
"web",
"socket",
"version"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java#L157-L164 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java | CommonHelper.toNiceString | public static String toNiceString(final Class<?> clazz, final Object... args) {
"""
Build a "nice toString" for an object.
@param clazz class
@param args arguments
@return a "nice toString" text
"""
final StringBuilder sb = new StringBuilder();
sb.append("#");
sb.append(clazz.getS... | java | public static String toNiceString(final Class<?> clazz, final Object... args) {
final StringBuilder sb = new StringBuilder();
sb.append("#");
sb.append(clazz.getSimpleName());
sb.append("# |");
boolean b = true;
for (final Object arg : args) {
if (b) {
... | [
"public",
"static",
"String",
"toNiceString",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"#\"",
... | Build a "nice toString" for an object.
@param clazz class
@param args arguments
@return a "nice toString" text | [
"Build",
"a",
"nice",
"toString",
"for",
"an",
"object",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java#L208-L227 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ScoreNode.java | ScoreNode.getDoc | public int getDoc(IndexReader reader) throws IOException {
"""
Returns the document number for this score node.
@param reader the current index reader to look up the document if
needed.
@return the document number.
@throws IOException if an error occurs while reading from the index or
the node is not presen... | java | public int getDoc(IndexReader reader) throws IOException {
if (doc == -1) {
TermDocs docs = reader.termDocs(new Term(FieldNames.UUID, id.toString()));
try {
if (docs.next()) {
return docs.doc();
} else {
throw new IO... | [
"public",
"int",
"getDoc",
"(",
"IndexReader",
"reader",
")",
"throws",
"IOException",
"{",
"if",
"(",
"doc",
"==",
"-",
"1",
")",
"{",
"TermDocs",
"docs",
"=",
"reader",
".",
"termDocs",
"(",
"new",
"Term",
"(",
"FieldNames",
".",
"UUID",
",",
"id",
... | Returns the document number for this score node.
@param reader the current index reader to look up the document if
needed.
@return the document number.
@throws IOException if an error occurs while reading from the index or
the node is not present in the index. | [
"Returns",
"the",
"document",
"number",
"for",
"this",
"score",
"node",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ScoreNode.java#L93-L108 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionImpl.java | SshConnectionImpl.executeCommandChannel | @Override
public synchronized ChannelExec executeCommandChannel(String command, Boolean establishConnection)
throws SshException, IOException {
"""
This version takes a command to run, and then returns a wrapper instance
that exposes all the standard state of the channel (stdin, stdout,
stderr, e... | java | @Override
public synchronized ChannelExec executeCommandChannel(String command, Boolean establishConnection)
throws SshException, IOException {
if (!isConnected()) {
throw new IOException("Not connected!");
}
try {
ChannelExec channel = (ChannelExec)connec... | [
"@",
"Override",
"public",
"synchronized",
"ChannelExec",
"executeCommandChannel",
"(",
"String",
"command",
",",
"Boolean",
"establishConnection",
")",
"throws",
"SshException",
",",
"IOException",
"{",
"if",
"(",
"!",
"isConnected",
"(",
")",
")",
"{",
"throw",
... | This version takes a command to run, and then returns a wrapper instance
that exposes all the standard state of the channel (stdin, stdout,
stderr, exit status, etc). Channel connection is established if establishConnection
is true.
@param command the command to execute.
@param establishConnection true if establish ch... | [
"This",
"version",
"takes",
"a",
"command",
"to",
"run",
"and",
"then",
"returns",
"a",
"wrapper",
"instance",
"that",
"exposes",
"all",
"the",
"standard",
"state",
"of",
"the",
"channel",
"(",
"stdin",
"stdout",
"stderr",
"exit",
"status",
"etc",
")",
"."... | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionImpl.java#L376-L392 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java | MessagePacker.writePayload | public MessagePacker writePayload(byte[] src, int off, int len)
throws IOException {
"""
Writes a byte array to the output.
<p>
This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods.
@param src the data to add
@param off the start offset in the data
... | java | public MessagePacker writePayload(byte[] src, int off, int len)
throws IOException
{
if (buffer == null || buffer.size() - position < len || len > bufferFlushThreshold) {
flush(); // call flush before write
// Directly write payload to the output without using the buffer... | [
"public",
"MessagePacker",
"writePayload",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
"==",
"null",
"||",
"buffer",
".",
"size",
"(",
")",
"-",
"position",
"<",
"len",
"... | Writes a byte array to the output.
<p>
This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods.
@param src the data to add
@param off the start offset in the data
@param len the number of bytes to add
@return this
@throws IOException when underlying output throws IOExceptio... | [
"Writes",
"a",
"byte",
"array",
"to",
"the",
"output",
".",
"<p",
">",
"This",
"method",
"is",
"used",
"with",
"{",
"@link",
"#packRawStringHeader",
"(",
"int",
")",
"}",
"or",
"{",
"@link",
"#packBinaryHeader",
"(",
"int",
")",
"}",
"methods",
"."
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java#L1009-L1023 |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java | XidFactoryImpl.createBranch | public Xid createBranch(Xid globalId, int branch) {
"""
Create a branch Xid.
@param globalId the global Xid
@param branch the branch number
@return the new Xid.
"""
byte[] branchId = baseId.clone();
branchId[0] = (byte) branch;
branchId[1] = (byte) (branch >>> 8);
branchId[2]... | java | public Xid createBranch(Xid globalId, int branch) {
byte[] branchId = baseId.clone();
branchId[0] = (byte) branch;
branchId[1] = (byte) (branch >>> 8);
branchId[2] = (byte) (branch >>> 16);
branchId[3] = (byte) (branch >>> 24);
insertLong(start, branchId, 4);
retu... | [
"public",
"Xid",
"createBranch",
"(",
"Xid",
"globalId",
",",
"int",
"branch",
")",
"{",
"byte",
"[",
"]",
"branchId",
"=",
"baseId",
".",
"clone",
"(",
")",
";",
"branchId",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"branch",
";",
"branchId",
"[",
"1"... | Create a branch Xid.
@param globalId the global Xid
@param branch the branch number
@return the new Xid. | [
"Create",
"a",
"branch",
"Xid",
"."
] | train | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java#L70-L78 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/OsgiPropertyUtils.java | OsgiPropertyUtils.getLong | public static long getLong(String propertyName, long defaultValue) {
"""
Retrieve the value of the specified property from framework/system properties.
Value is converted and returned as an long.
@param propertyName Name of property
@param defaultValue Default value to return if property is not set
@return P... | java | public static long getLong(String propertyName, long defaultValue) {
String tmpObj = get(propertyName);
if (tmpObj != null) {
try {
return Long.parseLong(tmpObj);
} catch (NumberFormatException e) {
}
}
return defaultValue;
} | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"propertyName",
",",
"long",
"defaultValue",
")",
"{",
"String",
"tmpObj",
"=",
"get",
"(",
"propertyName",
")",
";",
"if",
"(",
"tmpObj",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Long",
".",
... | Retrieve the value of the specified property from framework/system properties.
Value is converted and returned as an long.
@param propertyName Name of property
@param defaultValue Default value to return if property is not set
@return Property or default value as an long | [
"Retrieve",
"the",
"value",
"of",
"the",
"specified",
"property",
"from",
"framework",
"/",
"system",
"properties",
".",
"Value",
"is",
"converted",
"and",
"returned",
"as",
"an",
"long",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/OsgiPropertyUtils.java#L117-L127 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobCredentialsInner.java | JobCredentialsInner.getAsync | public Observable<JobCredentialInner> getAsync(String resourceGroupName, String serverName, String jobAgentName, String credentialName) {
"""
Gets a jobs credential.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API ... | java | public Observable<JobCredentialInner> getAsync(String resourceGroupName, String serverName, String jobAgentName, String credentialName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, credentialName).map(new Func1<ServiceResponse<JobCredentialInner>, JobCredentialInner>() {
... | [
"public",
"Observable",
"<",
"JobCredentialInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"String",
"credentialName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupNam... | Gets a jobs credential.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param credentialName The name of the credent... | [
"Gets",
"a",
"jobs",
"credential",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobCredentialsInner.java#L258-L265 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java | UnifiedResponse.setStrictTransportSecurity | @Nonnull
public final UnifiedResponse setStrictTransportSecurity (final int nMaxAgeSeconds, final boolean bIncludeSubdomains) {
"""
When specifying <code>false</code>, this method uses a special response
header to prevent certain browsers from MIME-sniffing a response away from
the declared content-type. When ... | java | @Nonnull
public final UnifiedResponse setStrictTransportSecurity (final int nMaxAgeSeconds, final boolean bIncludeSubdomains)
{
setCustomResponseHeader (CHttpHeader.STRICT_TRANSPORT_SECURITY,
new CacheControlBuilder ().setMaxAgeSeconds (nMaxAgeSeconds).getAsHTTPHeaderValue () +
... | [
"@",
"Nonnull",
"public",
"final",
"UnifiedResponse",
"setStrictTransportSecurity",
"(",
"final",
"int",
"nMaxAgeSeconds",
",",
"final",
"boolean",
"bIncludeSubdomains",
")",
"{",
"setCustomResponseHeader",
"(",
"CHttpHeader",
".",
"STRICT_TRANSPORT_SECURITY",
",",
"new",... | When specifying <code>false</code>, this method uses a special response
header to prevent certain browsers from MIME-sniffing a response away from
the declared content-type. When passing <code>true</code>, that header is
removed.
@param nMaxAgeSeconds
number of seconds, after the reception of the STS header field,
dur... | [
"When",
"specifying",
"<code",
">",
"false<",
"/",
"code",
">",
"this",
"method",
"uses",
"a",
"special",
"response",
"header",
"to",
"prevent",
"certain",
"browsers",
"from",
"MIME",
"-",
"sniffing",
"a",
"response",
"away",
"from",
"the",
"declared",
"cont... | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java#L1085-L1094 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java | EnumUtil.fromString | public static <T extends Enum<T>> T fromString(Class<T> enumClass, String value) {
"""
字符串转枚举,调用{@link Enum#valueOf(Class, String)}
@param <T> 枚举类型泛型
@param enumClass 枚举类
@param value 值
@return 枚举值
@since 4.1.13
"""
return Enum.valueOf(enumClass, value);
} | java | public static <T extends Enum<T>> T fromString(Class<T> enumClass, String value) {
return Enum.valueOf(enumClass, value);
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"fromString",
"(",
"Class",
"<",
"T",
">",
"enumClass",
",",
"String",
"value",
")",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"enumClass",
",",
"value",
")",
";",
"}"
] | 字符串转枚举,调用{@link Enum#valueOf(Class, String)}
@param <T> 枚举类型泛型
@param enumClass 枚举类
@param value 值
@return 枚举值
@since 4.1.13 | [
"字符串转枚举,调用",
"{",
"@link",
"Enum#valueOf",
"(",
"Class",
"String",
")",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java#L62-L64 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java | EasyPredictModelWrapper.predictBinomial | public BinomialModelPrediction predictBinomial(RowData data, double offset) throws PredictException {
"""
Make a prediction on a new data point using a Binomial model.
@param data A new data point.
@param offset An offset for the prediction.
@return The prediction.
@throws PredictException
"""
double... | java | public BinomialModelPrediction predictBinomial(RowData data, double offset) throws PredictException {
double[] preds = preamble(ModelCategory.Binomial, data, offset);
BinomialModelPrediction p = new BinomialModelPrediction();
if (enableLeafAssignment) { // only get leaf node assignment if enabled
Sha... | [
"public",
"BinomialModelPrediction",
"predictBinomial",
"(",
"RowData",
"data",
",",
"double",
"offset",
")",
"throws",
"PredictException",
"{",
"double",
"[",
"]",
"preds",
"=",
"preamble",
"(",
"ModelCategory",
".",
"Binomial",
",",
"data",
",",
"offset",
")",... | Make a prediction on a new data point using a Binomial model.
@param data A new data point.
@param offset An offset for the prediction.
@return The prediction.
@throws PredictException | [
"Make",
"a",
"prediction",
"on",
"a",
"new",
"data",
"point",
"using",
"a",
"Binomial",
"model",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java#L537-L569 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.mergeEntity | public <E extends Identifiable> E mergeEntity(EntityManager em, E entity) {
"""
Persists an entity to the database.
@param <E> The entity type.
@param em The entity manager to use. Cannot be null.
@param entity The entity to persist. Cannot be null.
@return The persisted entity having all ... | java | public <E extends Identifiable> E mergeEntity(EntityManager em, E entity) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(entity != null, "The entity cannot be null.");
E ret = em.merge(entity);
return ret;
} | [
"public",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"mergeEntity",
"(",
"EntityManager",
"em",
",",
"E",
"entity",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager cannot be null.\"",
")",
";",
"requireArgument",
"(",
"entity... | Persists an entity to the database.
@param <E> The entity type.
@param em The entity manager to use. Cannot be null.
@param entity The entity to persist. Cannot be null.
@return The persisted entity having all updates applied. | [
"Persists",
"an",
"entity",
"to",
"the",
"database",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L88-L93 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/TypeCache.java | TypeCache.findOrInsert | public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy) {
"""
Finds an existing type or inserts a new one if the previous type was not found.
@param classLoader The class loader for which this type is stored.
@param key The key for the type in question.
@param lazy ... | java | public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy) {
Class<?> type = find(classLoader, key);
if (type != null) {
return type;
} else {
try {
return insert(classLoader, key, lazy.call());
} catch (Throwable thr... | [
"public",
"Class",
"<",
"?",
">",
"findOrInsert",
"(",
"ClassLoader",
"classLoader",
",",
"T",
"key",
",",
"Callable",
"<",
"Class",
"<",
"?",
">",
">",
"lazy",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"find",
"(",
"classLoader",
",",
"key",
... | Finds an existing type or inserts a new one if the previous type was not found.
@param classLoader The class loader for which this type is stored.
@param key The key for the type in question.
@param lazy A lazy creator for the type to insert of no previous type was stored in the cache.
@return The lazil... | [
"Finds",
"an",
"existing",
"type",
"or",
"inserts",
"a",
"new",
"one",
"if",
"the",
"previous",
"type",
"was",
"not",
"found",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/TypeCache.java#L146-L157 |
apereo/cas | support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/BaseSamlRegisteredServiceMetadataResolver.java | BaseSamlRegisteredServiceMetadataResolver.addMetadataFiltersToMetadataResolver | protected void addMetadataFiltersToMetadataResolver(final AbstractMetadataResolver metadataProvider, final List<MetadataFilter> metadataFilterList) {
"""
Add metadata filters to metadata resolver.
@param metadataProvider the metadata provider
@param metadataFilterList the metadata filter list
"""
... | java | protected void addMetadataFiltersToMetadataResolver(final AbstractMetadataResolver metadataProvider, final List<MetadataFilter> metadataFilterList) {
val metadataFilterChain = new MetadataFilterChain();
metadataFilterChain.setFilters(metadataFilterList);
LOGGER.debug("Metadata filter chain init... | [
"protected",
"void",
"addMetadataFiltersToMetadataResolver",
"(",
"final",
"AbstractMetadataResolver",
"metadataProvider",
",",
"final",
"List",
"<",
"MetadataFilter",
">",
"metadataFilterList",
")",
"{",
"val",
"metadataFilterChain",
"=",
"new",
"MetadataFilterChain",
"(",... | Add metadata filters to metadata resolver.
@param metadataProvider the metadata provider
@param metadataFilterList the metadata filter list | [
"Add",
"metadata",
"filters",
"to",
"metadata",
"resolver",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/BaseSamlRegisteredServiceMetadataResolver.java#L192-L198 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.Bits | public JBBPOut Bits(final JBBPBitNumber numberOfBits, final int value) throws IOException {
"""
Write bits from a value into the output stream
@param numberOfBits the number of bits to be saved
@param value the value which bits must be saved
@return the DSL session
@throws IOException it will be throw... | java | public JBBPOut Bits(final JBBPBitNumber numberOfBits, final int value) throws IOException {
assertNotEnded();
JBBPUtils.assertNotNull(numberOfBits, "Number of bits must not be null");
if (this.processCommands) {
_writeBits(numberOfBits, value);
}
return this;
} | [
"public",
"JBBPOut",
"Bits",
"(",
"final",
"JBBPBitNumber",
"numberOfBits",
",",
"final",
"int",
"value",
")",
"throws",
"IOException",
"{",
"assertNotEnded",
"(",
")",
";",
"JBBPUtils",
".",
"assertNotNull",
"(",
"numberOfBits",
",",
"\"Number of bits must not be n... | Write bits from a value into the output stream
@param numberOfBits the number of bits to be saved
@param value the value which bits must be saved
@return the DSL session
@throws IOException it will be thrown for transport errors | [
"Write",
"bits",
"from",
"a",
"value",
"into",
"the",
"output",
"stream"
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L380-L387 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getRoleContainerForUser | public static IndexedContainer getRoleContainerForUser(CmsObject cms, CmsUser user, String captionPropertyName) {
"""
Returns the roles available for a given user.<p>
@param cms CmsObject
@param user to get available roles for
@param captionPropertyName name of caption property
@return indexed container
... | java | public static IndexedContainer getRoleContainerForUser(CmsObject cms, CmsUser user, String captionPropertyName) {
IndexedContainer result = new IndexedContainer();
result.addContainerProperty(captionPropertyName, String.class, "");
try {
List<CmsRole> roles = OpenCms.getRoleManager(... | [
"public",
"static",
"IndexedContainer",
"getRoleContainerForUser",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
",",
"String",
"captionPropertyName",
")",
"{",
"IndexedContainer",
"result",
"=",
"new",
"IndexedContainer",
"(",
")",
";",
"result",
".",
"addContai... | Returns the roles available for a given user.<p>
@param cms CmsObject
@param user to get available roles for
@param captionPropertyName name of caption property
@return indexed container | [
"Returns",
"the",
"roles",
"available",
"for",
"a",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L873-L888 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java | JournalCreator.setDatastreamVersionable | public Date setDatastreamVersionable(Context context,
String pid,
String dsID,
boolean versionable,
String logMessage)
throws ServerException {
... | java | public Date setDatastreamVersionable(Context context,
String pid,
String dsID,
boolean versionable,
String logMessage)
throws ServerException {
... | [
"public",
"Date",
"setDatastreamVersionable",
"(",
"Context",
"context",
",",
"String",
"pid",
",",
"String",
"dsID",
",",
"boolean",
"versionable",
",",
"String",
"logMessage",
")",
"throws",
"ServerException",
"{",
"try",
"{",
"CreatorJournalEntry",
"cje",
"=",
... | Create a journal entry, add the arguments, and invoke the method. | [
"Create",
"a",
"journal",
"entry",
"add",
"the",
"arguments",
"and",
"invoke",
"the",
"method",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java#L299-L317 |
centic9/commons-dost | src/main/java/org/dstadler/commons/graphviz/DotUtils.java | DotUtils.renderGraph | public static void renderGraph(File dotfile, File resultfile) throws IOException {
"""
Call graphviz-dot to convert the .dot-file to a rendered graph.
The file extension of the specified result file is being used as the filetype
of the rendering.
@param dotfile The dot {@code File} used for the graph gener... | java | public static void renderGraph(File dotfile, File resultfile) throws IOException {
// call graphviz-dot via commons-exec
CommandLine cmdLine = new CommandLine(DOT_EXE);
cmdLine.addArgument("-T" + StringUtils.substringAfterLast(resultfile.getAbsolutePath(), "."));
cmdLine.addArgument(dotfile.getAbsolutePath());
... | [
"public",
"static",
"void",
"renderGraph",
"(",
"File",
"dotfile",
",",
"File",
"resultfile",
")",
"throws",
"IOException",
"{",
"// call graphviz-dot via commons-exec",
"CommandLine",
"cmdLine",
"=",
"new",
"CommandLine",
"(",
"DOT_EXE",
")",
";",
"cmdLine",
".",
... | Call graphviz-dot to convert the .dot-file to a rendered graph.
The file extension of the specified result file is being used as the filetype
of the rendering.
@param dotfile The dot {@code File} used for the graph generation
@param resultfile The {@code File} to which should be written
@throws IOException if writi... | [
"Call",
"graphviz",
"-",
"dot",
"to",
"convert",
"the",
".",
"dot",
"-",
"file",
"to",
"a",
"rendered",
"graph",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/graphviz/DotUtils.java#L109-L134 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaGetMipmappedArrayLevel | public static int cudaGetMipmappedArrayLevel(cudaArray levelArray, cudaMipmappedArray mipmappedArray, int level) {
"""
Gets a mipmap level of a CUDA mipmapped array.
<pre>
cudaError_t cudaGetMipmappedArrayLevel (
cudaArray_t* levelArray,
cudaMipmappedArray_const_t mipmappedArray,
unsigned int level )
</pr... | java | public static int cudaGetMipmappedArrayLevel(cudaArray levelArray, cudaMipmappedArray mipmappedArray, int level)
{
return checkResult(cudaGetMipmappedArrayLevelNative(levelArray, mipmappedArray, level));
} | [
"public",
"static",
"int",
"cudaGetMipmappedArrayLevel",
"(",
"cudaArray",
"levelArray",
",",
"cudaMipmappedArray",
"mipmappedArray",
",",
"int",
"level",
")",
"{",
"return",
"checkResult",
"(",
"cudaGetMipmappedArrayLevelNative",
"(",
"levelArray",
",",
"mipmappedArray",... | Gets a mipmap level of a CUDA mipmapped array.
<pre>
cudaError_t cudaGetMipmappedArrayLevel (
cudaArray_t* levelArray,
cudaMipmappedArray_const_t mipmappedArray,
unsigned int level )
</pre>
<div>
<p>Gets a mipmap level of a CUDA mipmapped
array. Returns in <tt>*levelArray</tt> a CUDA array that represents
a single m... | [
"Gets",
"a",
"mipmap",
"level",
"of",
"a",
"CUDA",
"mipmapped",
"array",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L2790-L2793 |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/meta/MetaDataServiceImpl.java | MetaDataServiceImpl.hasNewMappedByAttrs | private static boolean hasNewMappedByAttrs(EntityType entityType, EntityType existingEntityType) {
"""
Returns true if entity meta contains mapped by attributes that do not exist in the existing
entity meta.
@param entityType entity meta data
@param existingEntityType existing entity meta data
@return true i... | java | private static boolean hasNewMappedByAttrs(EntityType entityType, EntityType existingEntityType) {
Set<String> mappedByAttrs =
entityType.getOwnMappedByAttributes().map(Attribute::getName).collect(toSet());
Set<String> existingMappedByAttrs =
existingEntityType.getOwnMappedByAttributes().map(At... | [
"private",
"static",
"boolean",
"hasNewMappedByAttrs",
"(",
"EntityType",
"entityType",
",",
"EntityType",
"existingEntityType",
")",
"{",
"Set",
"<",
"String",
">",
"mappedByAttrs",
"=",
"entityType",
".",
"getOwnMappedByAttributes",
"(",
")",
".",
"map",
"(",
"A... | Returns true if entity meta contains mapped by attributes that do not exist in the existing
entity meta.
@param entityType entity meta data
@param existingEntityType existing entity meta data
@return true if entity meta contains mapped by attributes that do not exist in the existing
entity meta. | [
"Returns",
"true",
"if",
"entity",
"meta",
"contains",
"mapped",
"by",
"attributes",
"that",
"do",
"not",
"exist",
"in",
"the",
"existing",
"entity",
"meta",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/meta/MetaDataServiceImpl.java#L261-L268 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.setComboBoxModel | public <E> void setComboBoxModel(String fieldLabel, ComboBoxModel<E> comboBoxModel) {
"""
Sets the given combo box model into the combo box with the given label.
<p>
Control of selection state (i.e. set/get selected item) is done through the combo box model.
@param <E> the type of the elements of the combo bo... | java | public <E> void setComboBoxModel(String fieldLabel, ComboBoxModel<E> comboBoxModel) {
Component c = this.fieldMap.get(fieldLabel);
if (c instanceof JComboBox) {
@SuppressWarnings("unchecked")
JComboBox<E> comboBox = (JComboBox<E>) c;
comboBox.setModel(comboBoxModel);
} else if (c == null) {
// Ignore ... | [
"public",
"<",
"E",
">",
"void",
"setComboBoxModel",
"(",
"String",
"fieldLabel",
",",
"ComboBoxModel",
"<",
"E",
">",
"comboBoxModel",
")",
"{",
"Component",
"c",
"=",
"this",
".",
"fieldMap",
".",
"get",
"(",
"fieldLabel",
")",
";",
"if",
"(",
"c",
"... | Sets the given combo box model into the combo box with the given label.
<p>
Control of selection state (i.e. set/get selected item) is done through the combo box model.
@param <E> the type of the elements of the combo box model.
@param fieldLabel the name of the label of the combo box field
@param comboBoxModel the mo... | [
"Sets",
"the",
"given",
"combo",
"box",
"model",
"into",
"the",
"combo",
"box",
"with",
"the",
"given",
"label",
".",
"<p",
">",
"Control",
"of",
"selection",
"state",
"(",
"i",
".",
"e",
".",
"set",
"/",
"get",
"selected",
"item",
")",
"is",
"done",... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L1055-L1067 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java | ApiOvhVrack.serviceName_cloudProject_project_GET | public OvhCloudProject serviceName_cloudProject_project_GET(String serviceName, String project) throws IOException {
"""
Get this object properties
REST: GET /vrack/{serviceName}/cloudProject/{project}
@param serviceName [required] The internal name of your vrack
@param project [required] publicCloud project
... | java | public OvhCloudProject serviceName_cloudProject_project_GET(String serviceName, String project) throws IOException {
String qPath = "/vrack/{serviceName}/cloudProject/{project}";
StringBuilder sb = path(qPath, serviceName, project);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, O... | [
"public",
"OvhCloudProject",
"serviceName_cloudProject_project_GET",
"(",
"String",
"serviceName",
",",
"String",
"project",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vrack/{serviceName}/cloudProject/{project}\"",
";",
"StringBuilder",
"sb",
"=",
"path"... | Get this object properties
REST: GET /vrack/{serviceName}/cloudProject/{project}
@param serviceName [required] The internal name of your vrack
@param project [required] publicCloud project | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L684-L689 |
aol/cyclops | cyclops/src/main/java/cyclops/function/Predicates.java | Predicates.iterablePresent | public static <T> Predicate<T> iterablePresent() {
"""
<pre>
{@code
import static cyclops2.function.Predicates.valuePresent;
Seq.of(Arrays.asList(),Arrays.asList(1),null)
.filter(iterablePresent());
//Seq[List[1]]
}
</pre>
@return A Predicate that checks if it's input is an Iterable with at least one v... | java | public static <T> Predicate<T> iterablePresent() {
return t -> t instanceof Iterable ? ((Iterable) t).iterator()
.hasNext()
: false;
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"iterablePresent",
"(",
")",
"{",
"return",
"t",
"->",
"t",
"instanceof",
"Iterable",
"?",
"(",
"(",
"Iterable",
")",
"t",
")",
".",
"iterator",
"(",
")",
".",
"hasNext",
"(",
")",
":",... | <pre>
{@code
import static cyclops2.function.Predicates.valuePresent;
Seq.of(Arrays.asList(),Arrays.asList(1),null)
.filter(iterablePresent());
//Seq[List[1]]
}
</pre>
@return A Predicate that checks if it's input is an Iterable with at least one value | [
"<pre",
">",
"{",
"@code",
"import",
"static",
"cyclops2",
".",
"function",
".",
"Predicates",
".",
"valuePresent",
";"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/function/Predicates.java#L138-L142 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isVariable | public static boolean isVariable(ASTNode expression, String pattern) {
"""
Tells you if the given ASTNode is a VariableExpression with the given name.
@param expression
any AST Node
@param pattern
a string pattern to match
@return
true if the node is a variable with the specified name
"""
return... | java | public static boolean isVariable(ASTNode expression, String pattern) {
return (expression instanceof VariableExpression && ((VariableExpression) expression).getName().matches(pattern));
} | [
"public",
"static",
"boolean",
"isVariable",
"(",
"ASTNode",
"expression",
",",
"String",
"pattern",
")",
"{",
"return",
"(",
"expression",
"instanceof",
"VariableExpression",
"&&",
"(",
"(",
"VariableExpression",
")",
"expression",
")",
".",
"getName",
"(",
")"... | Tells you if the given ASTNode is a VariableExpression with the given name.
@param expression
any AST Node
@param pattern
a string pattern to match
@return
true if the node is a variable with the specified name | [
"Tells",
"you",
"if",
"the",
"given",
"ASTNode",
"is",
"a",
"VariableExpression",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L874-L876 |
apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java | MesosEntrypointUtils.createMesosSchedulerConfiguration | public static MesosConfiguration createMesosSchedulerConfiguration(Configuration flinkConfig, String hostname) {
"""
Loads and validates the Mesos scheduler configuration.
@param flinkConfig the global configuration.
@param hostname the hostname to advertise to the Mesos master.
"""
Protos.FrameworkInfo.B... | java | public static MesosConfiguration createMesosSchedulerConfiguration(Configuration flinkConfig, String hostname) {
Protos.FrameworkInfo.Builder frameworkInfo = Protos.FrameworkInfo.newBuilder()
.setHostname(hostname);
Protos.Credential.Builder credential = null;
if (!flinkConfig.contains(MesosOptions.MASTER_UR... | [
"public",
"static",
"MesosConfiguration",
"createMesosSchedulerConfiguration",
"(",
"Configuration",
"flinkConfig",
",",
"String",
"hostname",
")",
"{",
"Protos",
".",
"FrameworkInfo",
".",
"Builder",
"frameworkInfo",
"=",
"Protos",
".",
"FrameworkInfo",
".",
"newBuilde... | Loads and validates the Mesos scheduler configuration.
@param flinkConfig the global configuration.
@param hostname the hostname to advertise to the Mesos master. | [
"Loads",
"and",
"validates",
"the",
"Mesos",
"scheduler",
"configuration",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/entrypoint/MesosEntrypointUtils.java#L58-L103 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/AbstractNumberPrefsTransform.java | AbstractNumberPrefsTransform.generateWriteProperty | @Override
public void generateWriteProperty(Builder methodBuilder, String editorName, TypeName beanClass, String beanName, PrefsProperty property) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.sharedprefs.transform.PrefsTransform#generateWriteProperty(com.squareup.javapoet.MethodSpec.Builder, java.... | java | @Override
public void generateWriteProperty(Builder methodBuilder, String editorName, TypeName beanClass, String beanName, PrefsProperty property) {
if (beanClass!=null)
{
methodBuilder.addCode("if ($L!=null) ", getter(beanName, beanClass, property));
methodBuilder.addCode("$L.putString($S,$L.$L() );", edit... | [
"@",
"Override",
"public",
"void",
"generateWriteProperty",
"(",
"Builder",
"methodBuilder",
",",
"String",
"editorName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"PrefsProperty",
"property",
")",
"{",
"if",
"(",
"beanClass",
"!=",
"null",
"... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.sharedprefs.transform.PrefsTransform#generateWriteProperty(com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.sharedprefs.model.PrefsProperty) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/AbstractNumberPrefsTransform.java#L99-L115 |
redkale/redkale | src/org/redkale/source/ColumnValue.java | ColumnValue.inc | public static ColumnValue inc(String column, Serializable value) {
"""
返回 {column} = {column} + {value} 操作
@param column 字段名
@param value 字段值
@return ColumnValue
"""
return new ColumnValue(column, INC, value);
} | java | public static ColumnValue inc(String column, Serializable value) {
return new ColumnValue(column, INC, value);
} | [
"public",
"static",
"ColumnValue",
"inc",
"(",
"String",
"column",
",",
"Serializable",
"value",
")",
"{",
"return",
"new",
"ColumnValue",
"(",
"column",
",",
"INC",
",",
"value",
")",
";",
"}"
] | 返回 {column} = {column} + {value} 操作
@param column 字段名
@param value 字段值
@return ColumnValue | [
"返回",
"{",
"column",
"}",
"=",
"{",
"column",
"}",
"+",
"{",
"value",
"}",
"操作"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/ColumnValue.java#L73-L75 |
xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/XHTMLParser.java | XHTMLParser.getPushBackReader | private Reader getPushBackReader(Reader source) throws ParseException {
"""
In order to handle empty content we use a {@link PushbackReader} to try to read one character from the stream
and if we get -1 it means that the stream is empty and in this case we return an empty XDOM.
"""
PushbackReader push... | java | private Reader getPushBackReader(Reader source) throws ParseException
{
PushbackReader pushbackReader = new PushbackReader(source);
int c;
try {
c = pushbackReader.read();
if (c == -1) {
return null;
}
pushbackReader.unread(c);
... | [
"private",
"Reader",
"getPushBackReader",
"(",
"Reader",
"source",
")",
"throws",
"ParseException",
"{",
"PushbackReader",
"pushbackReader",
"=",
"new",
"PushbackReader",
"(",
"source",
")",
";",
"int",
"c",
";",
"try",
"{",
"c",
"=",
"pushbackReader",
".",
"r... | In order to handle empty content we use a {@link PushbackReader} to try to read one character from the stream
and if we get -1 it means that the stream is empty and in this case we return an empty XDOM. | [
"In",
"order",
"to",
"handle",
"empty",
"content",
"we",
"use",
"a",
"{"
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/XHTMLParser.java#L225-L239 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java | BaseImageDownloader.getStreamFromOtherSource | protected InputStream getStreamFromOtherSource(String imageUri, Object extra) throws IOException {
"""
Retrieves {@link InputStream} of image by URI from other source with unsupported scheme. Should be overriden by
successors to implement image downloading from special sources.<br />
This method is called only i... | java | protected InputStream getStreamFromOtherSource(String imageUri, Object extra) throws IOException {
throw new UnsupportedOperationException(String.format(ERROR_UNSUPPORTED_SCHEME, imageUri));
} | [
"protected",
"InputStream",
"getStreamFromOtherSource",
"(",
"String",
"imageUri",
",",
"Object",
"extra",
")",
"throws",
"IOException",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"String",
".",
"format",
"(",
"ERROR_UNSUPPORTED_SCHEME",
",",
"imageUri",... | Retrieves {@link InputStream} of image by URI from other source with unsupported scheme. Should be overriden by
successors to implement image downloading from special sources.<br />
This method is called only if image URI has unsupported scheme. Throws {@link UnsupportedOperationException} by
default.
@param imageUri ... | [
"Retrieves",
"{",
"@link",
"InputStream",
"}",
"of",
"image",
"by",
"URI",
"from",
"other",
"source",
"with",
"unsupported",
"scheme",
".",
"Should",
"be",
"overriden",
"by",
"successors",
"to",
"implement",
"image",
"downloading",
"from",
"special",
"sources",
... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java#L279-L281 |
groundupworks/wings | wings/src/main/java/com/groundupworks/wings/core/WingsDbHelper.java | WingsDbHelper.checkoutShareRequests | public synchronized List<ShareRequest> checkoutShareRequests(Destination destination) {
"""
Checks out a list of {@link ShareRequest} that need to be processed, filtered by destination. The list is sorted
by time of creation, from the earliest to most recent. This method internally changes the checked out records... | java | public synchronized List<ShareRequest> checkoutShareRequests(Destination destination) {
List<ShareRequest> shareRequests = new ArrayList<ShareRequest>();
SQLiteDatabase db = null;
Cursor cursor = null;
try {
db = getWritableDatabase();
// Get all records for the... | [
"public",
"synchronized",
"List",
"<",
"ShareRequest",
">",
"checkoutShareRequests",
"(",
"Destination",
"destination",
")",
"{",
"List",
"<",
"ShareRequest",
">",
"shareRequests",
"=",
"new",
"ArrayList",
"<",
"ShareRequest",
">",
"(",
")",
";",
"SQLiteDatabase",... | Checks out a list of {@link ShareRequest} that need to be processed, filtered by destination. The list is sorted
by time of creation, from the earliest to most recent. This method internally changes the checked out records to
a processing state, so a call to {@link #markSuccessful(int)} or {@link #markFailed(int)} is e... | [
"Checks",
"out",
"a",
"list",
"of",
"{",
"@link",
"ShareRequest",
"}",
"that",
"need",
"to",
"be",
"processed",
"filtered",
"by",
"destination",
".",
"The",
"list",
"is",
"sorted",
"by",
"time",
"of",
"creation",
"from",
"the",
"earliest",
"to",
"most",
... | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings/src/main/java/com/groundupworks/wings/core/WingsDbHelper.java#L197-L243 |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponents | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
"""
but we do in the most common case that the Iterable is a Collection)
"""
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go t... | java | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go to addComponent(ByteBuf).
return addComponent(increaseIndex, cIndex, (ByteB... | [
"private",
"CompositeByteBuf",
"addComponents",
"(",
"boolean",
"increaseIndex",
",",
"int",
"cIndex",
",",
"Iterable",
"<",
"ByteBuf",
">",
"buffers",
")",
"{",
"if",
"(",
"buffers",
"instanceof",
"ByteBuf",
")",
"{",
"// If buffers also implements ByteBuf (e.g. Comp... | but we do in the most common case that the Iterable is a Collection) | [
"but",
"we",
"do",
"in",
"the",
"most",
"common",
"case",
"that",
"the",
"Iterable",
"is",
"a",
"Collection",
")"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L488-L514 |
samskivert/samskivert | src/main/java/com/samskivert/util/Calendars.java | Calendars.at | public static Builder at (int year, int month, int day) {
"""
Returns a fluent wrapper around a calendar configured to zero milliseconds after midnight on
the specified day in the specified month and year.
@param year a regular year value, like 1900
@param month a 0-based month value, like {@link Calendar#JAN... | java | public static Builder at (int year, int month, int day)
{
Calendar calendar = Calendar.getInstance();
calendar.set(year, month, day);
return with(calendar).zeroTime();
} | [
"public",
"static",
"Builder",
"at",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
".",
"set",
"(",
"year",
",",
"month",
",",
"day",
")",... | Returns a fluent wrapper around a calendar configured to zero milliseconds after midnight on
the specified day in the specified month and year.
@param year a regular year value, like 1900
@param month a 0-based month value, like {@link Calendar#JANUARY}
@param day a regular day of the month value, like 31 | [
"Returns",
"a",
"fluent",
"wrapper",
"around",
"a",
"calendar",
"configured",
"to",
"zero",
"milliseconds",
"after",
"midnight",
"on",
"the",
"specified",
"day",
"in",
"the",
"specified",
"month",
"and",
"year",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Calendars.java#L199-L204 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByThumbnailUrl | public Iterable<DOAuth2User> queryByThumbnailUrl(java.lang.String thumbnailUrl) {
"""
query-by method for field thumbnailUrl
@param thumbnailUrl the specified attribute
@return an Iterable of DOAuth2Users for the specified thumbnailUrl
"""
return queryByField(null, DOAuth2UserMapper.Field.THUMBNAILURL.ge... | java | public Iterable<DOAuth2User> queryByThumbnailUrl(java.lang.String thumbnailUrl) {
return queryByField(null, DOAuth2UserMapper.Field.THUMBNAILURL.getFieldName(), thumbnailUrl);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByThumbnailUrl",
"(",
"java",
".",
"lang",
".",
"String",
"thumbnailUrl",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"THUMBNAILURL",
".",
"getFieldName",
"(",... | query-by method for field thumbnailUrl
@param thumbnailUrl the specified attribute
@return an Iterable of DOAuth2Users for the specified thumbnailUrl | [
"query",
"-",
"by",
"method",
"for",
"field",
"thumbnailUrl"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L133-L135 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/CmsSelectBox.java | CmsSelectBox.addOption | public void addOption(String value, String text) {
"""
Adds a new selection cell.<p>
@param value the value of the select option
@param text the text to be displayed for the select option
"""
String title = getTitle(value, text);
CmsLabelSelectCell cell = new CmsLabelSelectCell(value, text... | java | public void addOption(String value, String text) {
String title = getTitle(value, text);
CmsLabelSelectCell cell = new CmsLabelSelectCell(value, text, title);
addOption(cell);
} | [
"public",
"void",
"addOption",
"(",
"String",
"value",
",",
"String",
"text",
")",
"{",
"String",
"title",
"=",
"getTitle",
"(",
"value",
",",
"text",
")",
";",
"CmsLabelSelectCell",
"cell",
"=",
"new",
"CmsLabelSelectCell",
"(",
"value",
",",
"text",
",",... | Adds a new selection cell.<p>
@param value the value of the select option
@param text the text to be displayed for the select option | [
"Adds",
"a",
"new",
"selection",
"cell",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/CmsSelectBox.java#L173-L178 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java | CopyFileExtensions.copyDirectory | public static boolean copyDirectory(final File source, final File destination,
final boolean lastModified) throws FileIsSecurityRestrictedException, IOException,
FileIsADirectoryException, FileIsNotADirectoryException, DirectoryAlreadyExistsException {
"""
Copies the given source directory to the given destina... | java | public static boolean copyDirectory(final File source, final File destination,
final boolean lastModified) throws FileIsSecurityRestrictedException, IOException,
FileIsADirectoryException, FileIsNotADirectoryException, DirectoryAlreadyExistsException
{
return copyDirectoryWithFileFilter(source, destination, null... | [
"public",
"static",
"boolean",
"copyDirectory",
"(",
"final",
"File",
"source",
",",
"final",
"File",
"destination",
",",
"final",
"boolean",
"lastModified",
")",
"throws",
"FileIsSecurityRestrictedException",
",",
"IOException",
",",
"FileIsADirectoryException",
",",
... | Copies the given source directory to the given destination directory with the option to set
the lastModified time from the given destination file or directory.
@param source
The source directory.
@param destination
The destination directory.
@param lastModified
Flag the tells if the attribute lastModified has to be se... | [
"Copies",
"the",
"given",
"source",
"directory",
"to",
"the",
"given",
"destination",
"directory",
"with",
"the",
"option",
"to",
"set",
"the",
"lastModified",
"time",
"from",
"the",
"given",
"destination",
"file",
"or",
"directory",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java#L112-L117 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolRequest.java | CreateIdentityPoolRequest.withSupportedLoginProviders | public CreateIdentityPoolRequest withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
"""
<p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return ... | java | public CreateIdentityPoolRequest withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
setSupportedLoginProviders(supportedLoginProviders);
return this;
} | [
"public",
"CreateIdentityPoolRequest",
"withSupportedLoginProviders",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"supportedLoginProviders",
")",
"{",
"setSupportedLoginProviders",
"(",
"supportedLoginProviders",
")",
";",
"return",
"this",
... | <p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Optional",
"key",
":",
"value",
"pairs",
"mapping",
"provider",
"names",
"to",
"provider",
"app",
"IDs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolRequest.java#L213-L216 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/transform/AckEventUnmarshaller.java | AckEventUnmarshaller.getIntegerField | private Integer getIntegerField(JsonNode json, String fieldName) {
"""
Get an Integer field from the JSON.
@param json JSON document.
@param fieldName Field name to get.
@return Integer value of field or null if not present.
"""
if (!json.has(fieldName)) {
return null;
}
... | java | private Integer getIntegerField(JsonNode json, String fieldName) {
if (!json.has(fieldName)) {
return null;
}
return json.get(fieldName).intValue();
} | [
"private",
"Integer",
"getIntegerField",
"(",
"JsonNode",
"json",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"!",
"json",
".",
"has",
"(",
"fieldName",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"json",
".",
"get",
"(",
"fieldName",
")"... | Get an Integer field from the JSON.
@param json JSON document.
@param fieldName Field name to get.
@return Integer value of field or null if not present. | [
"Get",
"an",
"Integer",
"field",
"from",
"the",
"JSON",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/model/transform/AckEventUnmarshaller.java#L85-L90 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java | ServletUtil.fillBean | public static <T> T fillBean(ServletRequest request, T bean, boolean isIgnoreError) {
"""
ServletRequest 参数转Bean
@param <T> Bean类型
@param request {@link ServletRequest}
@param bean Bean
@param isIgnoreError 是否忽略注入错误
@return Bean
"""
return fillBean(request, bean, CopyOptions.create().setIgnoreError(i... | java | public static <T> T fillBean(ServletRequest request, T bean, boolean isIgnoreError) {
return fillBean(request, bean, CopyOptions.create().setIgnoreError(isIgnoreError));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fillBean",
"(",
"ServletRequest",
"request",
",",
"T",
"bean",
",",
"boolean",
"isIgnoreError",
")",
"{",
"return",
"fillBean",
"(",
"request",
",",
"bean",
",",
"CopyOptions",
".",
"create",
"(",
")",
".",
"setIg... | ServletRequest 参数转Bean
@param <T> Bean类型
@param request {@link ServletRequest}
@param bean Bean
@param isIgnoreError 是否忽略注入错误
@return Bean | [
"ServletRequest",
"参数转Bean"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L159-L161 |
lecousin/java-compression | lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java | Optimum.set2 | void set2(int newPrice, int optCur, int back) {
"""
Sets to indicate two LZMA symbols of which the first one is a literal.
"""
price = newPrice;
optPrev = optCur + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = false;
} | java | void set2(int newPrice, int optCur, int back) {
price = newPrice;
optPrev = optCur + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = false;
} | [
"void",
"set2",
"(",
"int",
"newPrice",
",",
"int",
"optCur",
",",
"int",
"back",
")",
"{",
"price",
"=",
"newPrice",
";",
"optPrev",
"=",
"optCur",
"+",
"1",
";",
"backPrev",
"=",
"back",
";",
"prev1IsLiteral",
"=",
"true",
";",
"hasPrev2",
"=",
"fa... | Sets to indicate two LZMA symbols of which the first one is a literal. | [
"Sets",
"to",
"indicate",
"two",
"LZMA",
"symbols",
"of",
"which",
"the",
"first",
"one",
"is",
"a",
"literal",
"."
] | train | https://github.com/lecousin/java-compression/blob/19c8001fb3655817a52a3b8ab69501e3df7a2b4a/lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java#L42-L48 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java | IntFloatHashMap.putAndGet | public float putAndGet(final int key, final float value) {
"""
Put a value associated with a key in the map.
@param key key to which value is associated
@param value value to put in the map
@return previous value associated with the key
"""
int index = findInsertionIndex(key);
float previous... | java | public float putAndGet(final int key, final float value) {
int index = findInsertionIndex(key);
float previous = missingEntries;
boolean newMapping = true;
if (index < 0) {
index = changeIndexSign(index);
previous = values[index];
newMapping = false;
... | [
"public",
"float",
"putAndGet",
"(",
"final",
"int",
"key",
",",
"final",
"float",
"value",
")",
"{",
"int",
"index",
"=",
"findInsertionIndex",
"(",
"key",
")",
";",
"float",
"previous",
"=",
"missingEntries",
";",
"boolean",
"newMapping",
"=",
"true",
";... | Put a value associated with a key in the map.
@param key key to which value is associated
@param value value to put in the map
@return previous value associated with the key | [
"Put",
"a",
"value",
"associated",
"with",
"a",
"key",
"in",
"the",
"map",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/map/IntFloatHashMap.java#L452-L472 |
kiegroup/jbpm | jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/SimpleRuntimeEnvironment.java | SimpleRuntimeEnvironment.addToEnvironment | public void addToEnvironment(String name, Object value) {
"""
Adds element to the drools/jbpm environment - the value must be thread save as it will be shared between all
<code>RuntimeEngine</code> instances
@param name name of the environment entry
@param value value of the environment entry
"""
th... | java | public void addToEnvironment(String name, Object value) {
this.environment.set(name, value);
this.environmentEntries.put(name, value);
} | [
"public",
"void",
"addToEnvironment",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"this",
".",
"environment",
".",
"set",
"(",
"name",
",",
"value",
")",
";",
"this",
".",
"environmentEntries",
".",
"put",
"(",
"name",
",",
"value",
")",
"... | Adds element to the drools/jbpm environment - the value must be thread save as it will be shared between all
<code>RuntimeEngine</code> instances
@param name name of the environment entry
@param value value of the environment entry | [
"Adds",
"element",
"to",
"the",
"drools",
"/",
"jbpm",
"environment",
"-",
"the",
"value",
"must",
"be",
"thread",
"save",
"as",
"it",
"will",
"be",
"shared",
"between",
"all",
"<code",
">",
"RuntimeEngine<",
"/",
"code",
">",
"instances"
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/SimpleRuntimeEnvironment.java#L183-L186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.