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 |
|---|---|---|---|---|---|---|---|---|---|---|
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.unprotectedRenameTo | boolean unprotectedRenameTo(String src, String dst, long timestamp)
throws QuotaExceededException {
"""
Change a path name
@param src source path
@param dst destination path
@return true if rename succeeds; false otherwise
@throws QuotaExceededException if the operation violates any quota limit
"""
... | java | boolean unprotectedRenameTo(String src, String dst, long timestamp)
throws QuotaExceededException {
return unprotectedRenameTo(src, null, null, null, dst, null, null, timestamp);
} | [
"boolean",
"unprotectedRenameTo",
"(",
"String",
"src",
",",
"String",
"dst",
",",
"long",
"timestamp",
")",
"throws",
"QuotaExceededException",
"{",
"return",
"unprotectedRenameTo",
"(",
"src",
",",
"null",
",",
"null",
",",
"null",
",",
"dst",
",",
"null",
... | Change a path name
@param src source path
@param dst destination path
@return true if rename succeeds; false otherwise
@throws QuotaExceededException if the operation violates any quota limit | [
"Change",
"a",
"path",
"name"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L849-L852 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/filter/Filters.java | Filters.replaceInString | public static Filter replaceInString(
final Pattern regexp,
final String replacement,
final int overlap) {
"""
Creates a filter which replaces every substring in the input string that matches the given
regular expression
and replaces it with given replacement.
<p/>
The metho... | java | public static Filter replaceInString(
final Pattern regexp,
final String replacement,
final int overlap) {
return new FilterAdapter() {
private String string;
@Override
protected String doBeforeAppend(String string, StringBuilder buffer) {... | [
"public",
"static",
"Filter",
"replaceInString",
"(",
"final",
"Pattern",
"regexp",
",",
"final",
"String",
"replacement",
",",
"final",
"int",
"overlap",
")",
"{",
"return",
"new",
"FilterAdapter",
"(",
")",
"{",
"private",
"String",
"string",
";",
"@",
"Ov... | Creates a filter which replaces every substring in the input string that matches the given
regular expression
and replaces it with given replacement.
<p/>
The method just calls {@link String#replaceAll(String, String)} for the input string.
@param regexp the regular expression
@param replacement the string to be ... | [
"Creates",
"a",
"filter",
"which",
"replaces",
"every",
"substring",
"in",
"the",
"input",
"string",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"and",
"replaces",
"it",
"with",
"given",
"replacement",
".",
"<p",
"/",
">",
"The",
"method",
"j... | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/filter/Filters.java#L77-L103 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/DatesHelper.java | DatesHelper.addDerivedDates | public void addDerivedDates(Map<String, Object> values) {
"""
Adds derived values for dates in map.
@param values values as provided.
"""
Map<String, Object> valuesToAdd = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
String key = entry... | java | public void addDerivedDates(Map<String, Object> values) {
Map<String, Object> valuesToAdd = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
String key = entry.getKey();
Object object = entry.getValue();
if (object != null) {... | [
"public",
"void",
"addDerivedDates",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"valuesToAdd",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Map... | Adds derived values for dates in map.
@param values values as provided. | [
"Adds",
"derived",
"values",
"for",
"dates",
"in",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/DatesHelper.java#L22-L42 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/ArtifactHandler.java | ArtifactHandler.updateDoNotUse | public void updateDoNotUse(final String gavc, final Boolean doNotUse) {
"""
Add "DO_NOT_USE" flag to an artifact
@param gavc String
@param doNotUse Boolean
"""
final DbArtifact artifact = getArtifact(gavc);
repositoryHandler.updateDoNotUse(artifact, doNotUse);
} | java | public void updateDoNotUse(final String gavc, final Boolean doNotUse) {
final DbArtifact artifact = getArtifact(gavc);
repositoryHandler.updateDoNotUse(artifact, doNotUse);
} | [
"public",
"void",
"updateDoNotUse",
"(",
"final",
"String",
"gavc",
",",
"final",
"Boolean",
"doNotUse",
")",
"{",
"final",
"DbArtifact",
"artifact",
"=",
"getArtifact",
"(",
"gavc",
")",
";",
"repositoryHandler",
".",
"updateDoNotUse",
"(",
"artifact",
",",
"... | Add "DO_NOT_USE" flag to an artifact
@param gavc String
@param doNotUse Boolean | [
"Add",
"DO_NOT_USE",
"flag",
"to",
"an",
"artifact"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/ArtifactHandler.java#L244-L247 |
janus-project/guava.janusproject.io | guava/src/com/google/common/primitives/Ints.java | Ints.fromBytes | @GwtIncompatible("doesn't work")
public static int fromBytes(byte b1, byte b2, byte b3, byte b4) {
"""
Returns the {@code int} value whose byte representation is the given 4
bytes, in big-endian order; equivalent to {@code Ints.fromByteArray(new
byte[] {b1, b2, b3, b4})}.
@since 7.0
"""
return b1 <<... | java | @GwtIncompatible("doesn't work")
public static int fromBytes(byte b1, byte b2, byte b3, byte b4) {
return b1 << 24 | (b2 & 0xFF) << 16 | (b3 & 0xFF) << 8 | (b4 & 0xFF);
} | [
"@",
"GwtIncompatible",
"(",
"\"doesn't work\"",
")",
"public",
"static",
"int",
"fromBytes",
"(",
"byte",
"b1",
",",
"byte",
"b2",
",",
"byte",
"b3",
",",
"byte",
"b4",
")",
"{",
"return",
"b1",
"<<",
"24",
"|",
"(",
"b2",
"&",
"0xFF",
")",
"<<",
... | Returns the {@code int} value whose byte representation is the given 4
bytes, in big-endian order; equivalent to {@code Ints.fromByteArray(new
byte[] {b1, b2, b3, b4})}.
@since 7.0 | [
"Returns",
"the",
"{",
"@code",
"int",
"}",
"value",
"whose",
"byte",
"representation",
"is",
"the",
"given",
"4",
"bytes",
"in",
"big",
"-",
"endian",
"order",
";",
"equivalent",
"to",
"{",
"@code",
"Ints",
".",
"fromByteArray",
"(",
"new",
"byte",
"[]"... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/primitives/Ints.java#L333-L336 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfDate.java | PdfDate.setLength | private String setLength(int i, int length) {
"""
Adds a number of leading zeros to a given <CODE>String</CODE> in order to get a <CODE>String</CODE>
of a certain length.
@param i a given number
@param length the length of the resulting <CODE>String</CODE>
@return the resulting <CODE>String</CODE>
... | java | private String setLength(int i, int length) { // 1.3-1.4 problem fixed by Finn Bock
StringBuffer tmp = new StringBuffer();
tmp.append(i);
while (tmp.length() < length) {
tmp.insert(0, "0");
}
tmp.setLength(length);
return tmp.toString();
} | [
"private",
"String",
"setLength",
"(",
"int",
"i",
",",
"int",
"length",
")",
"{",
"// 1.3-1.4 problem fixed by Finn Bock",
"StringBuffer",
"tmp",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"tmp",
".",
"append",
"(",
"i",
")",
";",
"while",
"(",
"tmp",
"."... | Adds a number of leading zeros to a given <CODE>String</CODE> in order to get a <CODE>String</CODE>
of a certain length.
@param i a given number
@param length the length of the resulting <CODE>String</CODE>
@return the resulting <CODE>String</CODE> | [
"Adds",
"a",
"number",
"of",
"leading",
"zeros",
"to",
"a",
"given",
"<CODE",
">",
"String<",
"/",
"CODE",
">",
"in",
"order",
"to",
"get",
"a",
"<CODE",
">",
"String<",
"/",
"CODE",
">",
"of",
"a",
"certain",
"length",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDate.java#L130-L138 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/json/JsonWriter.java | JsonWriter.stringify | public static String stringify(Object object, boolean prettyPrint) throws IOException {
"""
Converts an object to a JSON formatted string.
If pretty-printing is enabled, includes spaces, tabs and new-lines to make the format more readable.
The default indentation string is a tab character.
@param object an ob... | java | public static String stringify(Object object, boolean prettyPrint) throws IOException {
if (prettyPrint) {
return stringify(object, DEFAULT_INDENT_STRING);
} else {
return stringify(object, null);
}
} | [
"public",
"static",
"String",
"stringify",
"(",
"Object",
"object",
",",
"boolean",
"prettyPrint",
")",
"throws",
"IOException",
"{",
"if",
"(",
"prettyPrint",
")",
"{",
"return",
"stringify",
"(",
"object",
",",
"DEFAULT_INDENT_STRING",
")",
";",
"}",
"else",... | Converts an object to a JSON formatted string.
If pretty-printing is enabled, includes spaces, tabs and new-lines to make the format more readable.
The default indentation string is a tab character.
@param object an object to convert to a JSON formatted string
@param prettyPrint enables or disables pretty-printing
@re... | [
"Converts",
"an",
"object",
"to",
"a",
"JSON",
"formatted",
"string",
".",
"If",
"pretty",
"-",
"printing",
"is",
"enabled",
"includes",
"spaces",
"tabs",
"and",
"new",
"-",
"lines",
"to",
"make",
"the",
"format",
"more",
"readable",
".",
"The",
"default",... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/json/JsonWriter.java#L497-L503 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/NumberFormatter.java | NumberFormatter.parseFormatter | private NumberFormat parseFormatter(Context context, Arguments args) {
"""
Parses the {@link NumberFormat} to use from the context arguments.
@param context The context.
@param args The arguments of the macro.
@return the {@link NumberFormat}.
"""
final String format = args.get(FORMAT_PARAM_NAME... | java | private NumberFormat parseFormatter(Context context, Arguments args)
{
final String format = args.get(FORMAT_PARAM_NAME);
final Locale locale = context.get(LOCALE);
if (format != null)
{
return new DecimalFormat(format, DecimalFormatSymbols.getInstance(locale));
}... | [
"private",
"NumberFormat",
"parseFormatter",
"(",
"Context",
"context",
",",
"Arguments",
"args",
")",
"{",
"final",
"String",
"format",
"=",
"args",
".",
"get",
"(",
"FORMAT_PARAM_NAME",
")",
";",
"final",
"Locale",
"locale",
"=",
"context",
".",
"get",
"("... | Parses the {@link NumberFormat} to use from the context arguments.
@param context The context.
@param args The arguments of the macro.
@return the {@link NumberFormat}. | [
"Parses",
"the",
"{",
"@link",
"NumberFormat",
"}",
"to",
"use",
"from",
"the",
"context",
"arguments",
"."
] | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/NumberFormatter.java#L134-L157 |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/tools/xml/XMLTileSetParser.java | XMLTileSetParser.addRuleSet | public void addRuleSet (String prefix, TileSetRuleSet ruleset) {
"""
Adds a ruleset to be used when parsing tiles. This should be an
instance of a class derived from {@link TileSetRuleSet}. The prefix
will be used to configure the ruleset so that it matches elements
at a particular point in the XML hierarchy. F... | java | public void addRuleSet (String prefix, TileSetRuleSet ruleset)
{
// configure the ruleset with the appropriate prefix
ruleset.setPrefix(prefix);
// and have it set itself up with the digester
_digester.addRuleSet(ruleset);
// add a set next rule which will put tilesets with... | [
"public",
"void",
"addRuleSet",
"(",
"String",
"prefix",
",",
"TileSetRuleSet",
"ruleset",
")",
"{",
"// configure the ruleset with the appropriate prefix",
"ruleset",
".",
"setPrefix",
"(",
"prefix",
")",
";",
"// and have it set itself up with the digester",
"_digester",
... | Adds a ruleset to be used when parsing tiles. This should be an
instance of a class derived from {@link TileSetRuleSet}. The prefix
will be used to configure the ruleset so that it matches elements
at a particular point in the XML hierarchy. For example:
<pre>
_parser.addRuleSet("tilesets", new UniformTileSetRuleSet()... | [
"Adds",
"a",
"ruleset",
"to",
"be",
"used",
"when",
"parsing",
"tiles",
".",
"This",
"should",
"be",
"an",
"instance",
"of",
"a",
"class",
"derived",
"from",
"{",
"@link",
"TileSetRuleSet",
"}",
".",
"The",
"prefix",
"will",
"be",
"used",
"to",
"configur... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/xml/XMLTileSetParser.java#L71-L84 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java | ConstantsSummaryWriterImpl.addConstantMember | private void addConstantMember(FieldDoc member, HtmlTree trTree) {
"""
Add the row for the constant summary table.
@param member the field to be documented.
@param trTree an htmltree object for the table row
"""
trTree.addContent(getTypeColumn(member));
trTree.addContent(getNameColumn(membe... | java | private void addConstantMember(FieldDoc member, HtmlTree trTree) {
trTree.addContent(getTypeColumn(member));
trTree.addContent(getNameColumn(member));
trTree.addContent(getValue(member));
} | [
"private",
"void",
"addConstantMember",
"(",
"FieldDoc",
"member",
",",
"HtmlTree",
"trTree",
")",
"{",
"trTree",
".",
"addContent",
"(",
"getTypeColumn",
"(",
"member",
")",
")",
";",
"trTree",
".",
"addContent",
"(",
"getNameColumn",
"(",
"member",
")",
")... | Add the row for the constant summary table.
@param member the field to be documented.
@param trTree an htmltree object for the table row | [
"Add",
"the",
"row",
"for",
"the",
"constant",
"summary",
"table",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java#L289-L293 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsSitemapEditorConfiguration.java | CmsSitemapEditorConfiguration.getPath | private String getPath(CmsObject cms, HttpSession session) {
"""
Returns the page editor path to open.<p>
@param cms the cms context
@param session the user session
@return the path or <code>null</code>
"""
CmsQuickLaunchLocationCache locationCache = CmsQuickLaunchLocationCache.getLocationCache... | java | private String getPath(CmsObject cms, HttpSession session) {
CmsQuickLaunchLocationCache locationCache = CmsQuickLaunchLocationCache.getLocationCache(session);
String page = locationCache.getFileExplorerLocation(cms.getRequestContext().getSiteRoot());
if (page != null) {
CmsADEConfi... | [
"private",
"String",
"getPath",
"(",
"CmsObject",
"cms",
",",
"HttpSession",
"session",
")",
"{",
"CmsQuickLaunchLocationCache",
"locationCache",
"=",
"CmsQuickLaunchLocationCache",
".",
"getLocationCache",
"(",
"session",
")",
";",
"String",
"page",
"=",
"locationCac... | Returns the page editor path to open.<p>
@param cms the cms context
@param session the user session
@return the path or <code>null</code> | [
"Returns",
"the",
"page",
"editor",
"path",
"to",
"open",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsSitemapEditorConfiguration.java#L228-L246 |
ModeShape/modeshape | modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrMetaData.java | JcrMetaData.getExportedKeys | @Override
public ResultSet getExportedKeys( String catalog,
String schema,
String table ) throws SQLException {
"""
{@inheritDoc}
<p>
This driver maps REFERENCE properties as keys, and therefore it represents as imported keys those R... | java | @Override
public ResultSet getExportedKeys( String catalog,
String schema,
String table ) throws SQLException {
return getImportedKeys(catalog, schema, table); // empty, but same resultsetmetadata
} | [
"@",
"Override",
"public",
"ResultSet",
"getExportedKeys",
"(",
"String",
"catalog",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"return",
"getImportedKeys",
"(",
"catalog",
",",
"schema",
",",
"table",
")",
";",
"// em... | {@inheritDoc}
<p>
This driver maps REFERENCE properties as keys, and therefore it represents as imported keys those REFERENCE properties on
the type identified by the table name.
</p>
@see java.sql.DatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String, java.lang.String) | [
"{",
"@inheritDoc",
"}",
"<p",
">",
"This",
"driver",
"maps",
"REFERENCE",
"properties",
"as",
"keys",
"and",
"therefore",
"it",
"represents",
"as",
"imported",
"keys",
"those",
"REFERENCE",
"properties",
"on",
"the",
"type",
"identified",
"by",
"the",
"table"... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrMetaData.java#L523-L528 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/PathMatchers.java | PathMatchers.getPathMatcher | public static PathMatcher getPathMatcher(
String syntaxAndPattern, String separators, ImmutableSet<PathNormalization> normalizations) {
"""
Perhaps so, assuming Path always canonicalizes its separators
"""
int syntaxSeparator = syntaxAndPattern.indexOf(':');
checkArgument(
syntaxSeparator... | java | public static PathMatcher getPathMatcher(
String syntaxAndPattern, String separators, ImmutableSet<PathNormalization> normalizations) {
int syntaxSeparator = syntaxAndPattern.indexOf(':');
checkArgument(
syntaxSeparator > 0, "Must be of the form 'syntax:pattern': %s", syntaxAndPattern);
Strin... | [
"public",
"static",
"PathMatcher",
"getPathMatcher",
"(",
"String",
"syntaxAndPattern",
",",
"String",
"separators",
",",
"ImmutableSet",
"<",
"PathNormalization",
">",
"normalizations",
")",
"{",
"int",
"syntaxSeparator",
"=",
"syntaxAndPattern",
".",
"indexOf",
"(",... | Perhaps so, assuming Path always canonicalizes its separators | [
"Perhaps",
"so",
"assuming",
"Path",
"always",
"canonicalizes",
"its",
"separators"
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathMatchers.java#L49-L67 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java | Calcites.jodaToCalciteTimestamp | public static long jodaToCalciteTimestamp(final DateTime dateTime, final DateTimeZone timeZone) {
"""
Calcite expects "TIMESTAMP" types to be an instant that has the expected local time fields if printed as UTC.
@param dateTime joda timestamp
@param timeZone session time zone
@return Calcite style millis
... | java | public static long jodaToCalciteTimestamp(final DateTime dateTime, final DateTimeZone timeZone)
{
return dateTime.withZone(timeZone).withZoneRetainFields(DateTimeZone.UTC).getMillis();
} | [
"public",
"static",
"long",
"jodaToCalciteTimestamp",
"(",
"final",
"DateTime",
"dateTime",
",",
"final",
"DateTimeZone",
"timeZone",
")",
"{",
"return",
"dateTime",
".",
"withZone",
"(",
"timeZone",
")",
".",
"withZoneRetainFields",
"(",
"DateTimeZone",
".",
"UTC... | Calcite expects "TIMESTAMP" types to be an instant that has the expected local time fields if printed as UTC.
@param dateTime joda timestamp
@param timeZone session time zone
@return Calcite style millis | [
"Calcite",
"expects",
"TIMESTAMP",
"types",
"to",
"be",
"an",
"instant",
"that",
"has",
"the",
"expected",
"local",
"time",
"fields",
"if",
"printed",
"as",
"UTC",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java#L224-L227 |
petergeneric/stdlib | service-manager/service-manager-api/src/main/java/com/peterphi/servicemanager/service/rest/resource/helper/ResourceInstanceHelper.java | ResourceInstanceHelper.countActiveInstances | public int countActiveInstances(ServiceManagerResourceRestService service, String templateName) {
"""
Returns the number of active instances of the given template name
@param service
@param templateName
@return
"""
List<ResourceInstanceDTO> instances = activeInstances(service, templateName);
return... | java | public int countActiveInstances(ServiceManagerResourceRestService service, String templateName)
{
List<ResourceInstanceDTO> instances = activeInstances(service, templateName);
return instances.size();
} | [
"public",
"int",
"countActiveInstances",
"(",
"ServiceManagerResourceRestService",
"service",
",",
"String",
"templateName",
")",
"{",
"List",
"<",
"ResourceInstanceDTO",
">",
"instances",
"=",
"activeInstances",
"(",
"service",
",",
"templateName",
")",
";",
"return"... | Returns the number of active instances of the given template name
@param service
@param templateName
@return | [
"Returns",
"the",
"number",
"of",
"active",
"instances",
"of",
"the",
"given",
"template",
"name"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/service-manager/service-manager-api/src/main/java/com/peterphi/servicemanager/service/rest/resource/helper/ResourceInstanceHelper.java#L25-L30 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.updateByModel | public <S extends Model> int updateByModel(S model) {
"""
Update a model
@param model model instance
@param <S>
@return affect the number of rows
"""
this.beforeCheck();
Object primaryKey = AnimaUtils.getAndRemovePrimaryKey(model);
StringBuilder sql = new StringBuilder(this.build... | java | public <S extends Model> int updateByModel(S model) {
this.beforeCheck();
Object primaryKey = AnimaUtils.getAndRemovePrimaryKey(model);
StringBuilder sql = new StringBuilder(this.buildUpdateSQL(model, null));
List<Object> columnValueList = AnimaUtils.toColumnValues(model, false);
... | [
"public",
"<",
"S",
"extends",
"Model",
">",
"int",
"updateByModel",
"(",
"S",
"model",
")",
"{",
"this",
".",
"beforeCheck",
"(",
")",
";",
"Object",
"primaryKey",
"=",
"AnimaUtils",
".",
"getAndRemovePrimaryKey",
"(",
"model",
")",
";",
"StringBuilder",
... | Update a model
@param model model instance
@param <S>
@return affect the number of rows | [
"Update",
"a",
"model"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L1333-L1348 |
kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/buffer/AbstractIoBufferEx.java | AbstractIoBufferEx.autoExpand | private AbstractIoBufferEx autoExpand(int pos, int expectedRemaining) {
"""
This method forwards the call to {@link #expand(int)} only when
<tt>autoExpand</tt> property is <tt>true</tt>.
"""
if (isAutoExpand()) {
expand(pos, expectedRemaining, true, autoExpander);
}
return ... | java | private AbstractIoBufferEx autoExpand(int pos, int expectedRemaining) {
if (isAutoExpand()) {
expand(pos, expectedRemaining, true, autoExpander);
}
return this;
} | [
"private",
"AbstractIoBufferEx",
"autoExpand",
"(",
"int",
"pos",
",",
"int",
"expectedRemaining",
")",
"{",
"if",
"(",
"isAutoExpand",
"(",
")",
")",
"{",
"expand",
"(",
"pos",
",",
"expectedRemaining",
",",
"true",
",",
"autoExpander",
")",
";",
"}",
"re... | This method forwards the call to {@link #expand(int)} only when
<tt>autoExpand</tt> property is <tt>true</tt>. | [
"This",
"method",
"forwards",
"the",
"call",
"to",
"{"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/buffer/AbstractIoBufferEx.java#L2680-L2685 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java | ValueMap.withNumber | public ValueMap withNumber(String key, Number val) {
"""
Sets the value of the specified key in the current ValueMap to the
given value.
"""
super.put(key, InternalUtils.toBigDecimal(val));
return this;
} | java | public ValueMap withNumber(String key, Number val) {
super.put(key, InternalUtils.toBigDecimal(val));
return this;
} | [
"public",
"ValueMap",
"withNumber",
"(",
"String",
"key",
",",
"Number",
"val",
")",
"{",
"super",
".",
"put",
"(",
"key",
",",
"InternalUtils",
".",
"toBigDecimal",
"(",
"val",
")",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of the specified key in the current ValueMap to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"key",
"in",
"the",
"current",
"ValueMap",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L59-L62 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/model/dynaform/DynaFormRow.java | DynaFormRow.addControl | public DynaFormControl addControl(final Object data, final String type, final int colspan, final int rowspan) {
"""
Adds control with given data, type, colspan and rowspan.
@param data data object
@param type type to match the type attribute in pe:dynaFormControl
@param colspan colspan
@param rowspan rowspan... | java | public DynaFormControl addControl(final Object data, final String type, final int colspan, final int rowspan) {
final DynaFormControl dynaFormControl = new DynaFormControl(data,
type,
colspan,
rowspan,
row,
eleme... | [
"public",
"DynaFormControl",
"addControl",
"(",
"final",
"Object",
"data",
",",
"final",
"String",
"type",
",",
"final",
"int",
"colspan",
",",
"final",
"int",
"rowspan",
")",
"{",
"final",
"DynaFormControl",
"dynaFormControl",
"=",
"new",
"DynaFormControl",
"("... | Adds control with given data, type, colspan and rowspan.
@param data data object
@param type type to match the type attribute in pe:dynaFormControl
@param colspan colspan
@param rowspan rowspan
@return DynaFormControl added control | [
"Adds",
"control",
"with",
"given",
"data",
"type",
"colspan",
"and",
"rowspan",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/model/dynaform/DynaFormRow.java#L95-L110 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.startUploadFileChunked | public Uploader startUploadFileChunked(String targetPath, DbxWriteMode writeMode, long numBytes) {
"""
Similar to {@link #startUploadFile}, except always uses the chunked upload API.
"""
return startUploadFileChunked(ChunkedUploadChunkSize, targetPath, writeMode, numBytes);
} | java | public Uploader startUploadFileChunked(String targetPath, DbxWriteMode writeMode, long numBytes)
{
return startUploadFileChunked(ChunkedUploadChunkSize, targetPath, writeMode, numBytes);
} | [
"public",
"Uploader",
"startUploadFileChunked",
"(",
"String",
"targetPath",
",",
"DbxWriteMode",
"writeMode",
",",
"long",
"numBytes",
")",
"{",
"return",
"startUploadFileChunked",
"(",
"ChunkedUploadChunkSize",
",",
"targetPath",
",",
"writeMode",
",",
"numBytes",
"... | Similar to {@link #startUploadFile}, except always uses the chunked upload API. | [
"Similar",
"to",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1230-L1233 |
icode/ameba-utils | src/main/java/ameba/util/Assert.java | Assert.isEmpty | public static void isEmpty(String text, String message) {
"""
Assert that the given String has valid text content; that is, it must not
be {@code null} and must contain at least one non-whitespace character.
<pre class="code">Assert.hasText(name, "'name' must not be empty");</pre>
@param text the String to ch... | java | public static void isEmpty(String text, String message) {
if (StringUtils.isEmpty(text)) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"isEmpty",
"(",
"String",
"text",
",",
"String",
"message",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"text",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"}",
"}"
] | Assert that the given String has valid text content; that is, it must not
be {@code null} and must contain at least one non-whitespace character.
<pre class="code">Assert.hasText(name, "'name' must not be empty");</pre>
@param text the String to check
@param message the exception message to use if the assertion fails
... | [
"Assert",
"that",
"the",
"given",
"String",
"has",
"valid",
"text",
"content",
";",
"that",
"is",
"it",
"must",
"not",
"be",
"{",
"@code",
"null",
"}",
"and",
"must",
"contain",
"at",
"least",
"one",
"non",
"-",
"whitespace",
"character",
".",
"<pre",
... | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/Assert.java#L156-L160 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.getFirstRootFileByName | public static AbstractFile getFirstRootFileByName(final SecurityContext securityContext, final String name) {
"""
Find the first file with given name on root level (without parent folder).
@param securityContext
@param name
@return file
"""
logger.debug("Search for file with name: {}", name);
try {
... | java | public static AbstractFile getFirstRootFileByName(final SecurityContext securityContext, final String name) {
logger.debug("Search for file with name: {}", name);
try {
final List<AbstractFile> files = StructrApp.getInstance(securityContext).nodeQuery(AbstractFile.class).andName(name).getAsList();
for (fin... | [
"public",
"static",
"AbstractFile",
"getFirstRootFileByName",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"String",
"name",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Search for file with name: {}\"",
",",
"name",
")",
";",
"try",
"{",
"final",
... | Find the first file with given name on root level (without parent folder).
@param securityContext
@param name
@return file | [
"Find",
"the",
"first",
"file",
"with",
"given",
"name",
"on",
"root",
"level",
"(",
"without",
"parent",
"folder",
")",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L686-L707 |
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.getSessionObject | @Nullable
public <T> T getSessionObject(@Nonnull final String key, @Nonnull final Class<T> klazz, @Nullable final T def) {
"""
Get saved session object. Object is presented and saved only for the
current panel and only in memory.
@param <T> type of object
@param key key of object, must not be null
@param k... | java | @Nullable
public <T> T getSessionObject(@Nonnull final String key, @Nonnull final Class<T> klazz, @Nullable final T def) {
this.lock();
try {
T result = klazz.cast(this.sessionObjects.get(key));
return result == null ? def : result;
} finally {
this.unlock();
}
} | [
"@",
"Nullable",
"public",
"<",
"T",
">",
"T",
"getSessionObject",
"(",
"@",
"Nonnull",
"final",
"String",
"key",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"klazz",
",",
"@",
"Nullable",
"final",
"T",
"def",
")",
"{",
"this",
".",
"lock",... | Get saved session object. Object is presented and saved only for the
current panel and only in memory.
@param <T> type of object
@param key key of object, must not be null
@param klazz object type, must not be null
@param def default value will be returned as result if object not
presented, can be null
@return null if... | [
"Get",
"saved",
"session",
"object",
".",
"Object",
"is",
"presented",
"and",
"saved",
"only",
"for",
"the",
"current",
"panel",
"and",
"only",
"in",
"memory",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L1264-L1273 |
phax/ph-datetime | ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java | XMLHolidayManager._unmarshallConfiguration | @Nonnull
private static Configuration _unmarshallConfiguration (@WillClose @Nonnull final InputStream aIS) {
"""
Unmarshals the configuration from the stream. Uses <code>JAXB</code> for
this.
@param aIS
@return The unmarshalled configuration.
"""
ValueEnforcer.notNull (aIS, "InputStream");
try
... | java | @Nonnull
private static Configuration _unmarshallConfiguration (@WillClose @Nonnull final InputStream aIS)
{
ValueEnforcer.notNull (aIS, "InputStream");
try
{
final JAXBContext ctx = JAXBContextCache.getInstance ()
.getFromCache (com.helger.holiday.ja... | [
"@",
"Nonnull",
"private",
"static",
"Configuration",
"_unmarshallConfiguration",
"(",
"@",
"WillClose",
"@",
"Nonnull",
"final",
"InputStream",
"aIS",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aIS",
",",
"\"InputStream\"",
")",
";",
"try",
"{",
"final",
... | Unmarshals the configuration from the stream. Uses <code>JAXB</code> for
this.
@param aIS
@return The unmarshalled configuration. | [
"Unmarshals",
"the",
"configuration",
"from",
"the",
"stream",
".",
"Uses",
"<code",
">",
"JAXB<",
"/",
"code",
">",
"for",
"this",
"."
] | train | https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L80-L101 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTypeUtil.java | VoltTypeUtil.getObjectFromString | public static Object getObjectFromString(VoltType type, String value)
throws ParseException {
"""
Returns a casted object of the input value string based on the given type
@throws ParseException
"""
Object ret = null;
switch (type) {
// NOTE: All runtime integer parameters are ... | java | public static Object getObjectFromString(VoltType type, String value)
throws ParseException
{
Object ret = null;
switch (type) {
// NOTE: All runtime integer parameters are actually Longs,so we will have problems
// if we actually try to convert the object to one of the s... | [
"public",
"static",
"Object",
"getObjectFromString",
"(",
"VoltType",
"type",
",",
"String",
"value",
")",
"throws",
"ParseException",
"{",
"Object",
"ret",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"// NOTE: All runtime integer parameters are actually Longs,... | Returns a casted object of the input value string based on the given type
@throws ParseException | [
"Returns",
"a",
"casted",
"object",
"of",
"the",
"input",
"value",
"string",
"based",
"on",
"the",
"given",
"type"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTypeUtil.java#L220-L286 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java | SimpleSubItem.bindView | @Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
"""
binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item
"""
super.bindView(viewHolder, payloads);
//get the context
Context ctx = viewHolder.itemView.getConte... | java | @Override
public void bindView(ViewHolder viewHolder, List<Object> payloads) {
super.bindView(viewHolder, payloads);
//get the context
Context ctx = viewHolder.itemView.getContext();
//set the background for the item
viewHolder.view.clearAnimation();
ViewCompat.setB... | [
"@",
"Override",
"public",
"void",
"bindView",
"(",
"ViewHolder",
"viewHolder",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"super",
".",
"bindView",
"(",
"viewHolder",
",",
"payloads",
")",
";",
"//get the context",
"Context",
"ctx",
"=",
"viewHo... | binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item | [
"binds",
"the",
"data",
"of",
"this",
"item",
"onto",
"the",
"viewHolder"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/expandable/SimpleSubItem.java#L95-L109 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/user/screen/UserEntryScreen.java | UserEntryScreen.addToolbars | public ToolScreen addToolbars() {
"""
Add the toolbars that belong with this screen.
@return The new toolbar.
"""
return new MaintToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null)
{
public void setupMiddleSFields()
{
String strSubm... | java | public ToolScreen addToolbars()
{
return new MaintToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null)
{
public void setupMiddleSFields()
{
String strSubmitText = MenuConstants.SUBMIT;
if (this.getTask() != null)
... | [
"public",
"ToolScreen",
"addToolbars",
"(",
")",
"{",
"return",
"new",
"MaintToolbar",
"(",
"null",
",",
"this",
",",
"null",
",",
"ScreenConstants",
".",
"DONT_DISPLAY_FIELD_DESC",
",",
"null",
")",
"{",
"public",
"void",
"setupMiddleSFields",
"(",
")",
"{",
... | Add the toolbars that belong with this screen.
@return The new toolbar. | [
"Add",
"the",
"toolbars",
"that",
"belong",
"with",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/user/screen/UserEntryScreen.java#L113-L127 |
flavioarfaria/KenBurnsView | library/src/main/java/com/flaviofaria/kenburnsview/RandomTransitionGenerator.java | RandomTransitionGenerator.generateRandomRect | private RectF generateRandomRect(RectF drawableBounds, RectF viewportRect) {
"""
Generates a random rect that can be fully contained within {@code drawableBounds} and
has the same aspect ratio of {@code viewportRect}. The dimensions of this random rect
won't be higher than the largest rect with the same aspect r... | java | private RectF generateRandomRect(RectF drawableBounds, RectF viewportRect) {
float drawableRatio = MathUtils.getRectRatio(drawableBounds);
float viewportRectRatio = MathUtils.getRectRatio(viewportRect);
RectF maxCrop;
if (drawableRatio > viewportRectRatio) {
float r = (drawa... | [
"private",
"RectF",
"generateRandomRect",
"(",
"RectF",
"drawableBounds",
",",
"RectF",
"viewportRect",
")",
"{",
"float",
"drawableRatio",
"=",
"MathUtils",
".",
"getRectRatio",
"(",
"drawableBounds",
")",
";",
"float",
"viewportRectRatio",
"=",
"MathUtils",
".",
... | Generates a random rect that can be fully contained within {@code drawableBounds} and
has the same aspect ratio of {@code viewportRect}. The dimensions of this random rect
won't be higher than the largest rect with the same aspect ratio of {@code viewportRect}
that {@code drawableBounds} can contain. They also won't be... | [
"Generates",
"a",
"random",
"rect",
"that",
"can",
"be",
"fully",
"contained",
"within",
"{"
] | train | https://github.com/flavioarfaria/KenBurnsView/blob/57a0fd7a586759c5c2e18fda51a3fcb09b48f388/library/src/main/java/com/flaviofaria/kenburnsview/RandomTransitionGenerator.java#L104-L129 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java | SPSMMappingFilter.filterMappingsOfSiblingsByRelation | private void filterMappingsOfSiblingsByRelation(List<INode> source, List<INode> target, char semanticRelation) {
"""
Filters the mappings of two siblings node list for which the parents are also supposed to
be related. Checks whether in the two given node list there is a pair of nodes related
by the given relati... | java | private void filterMappingsOfSiblingsByRelation(List<INode> source, List<INode> target, char semanticRelation) {
int sourceDepth = (source.get(0).getLevel() - 1);
int targetDepth = (target.get(0).getLevel() - 1);
int sourceSize = source.size();
int targetSize = target.size();
... | [
"private",
"void",
"filterMappingsOfSiblingsByRelation",
"(",
"List",
"<",
"INode",
">",
"source",
",",
"List",
"<",
"INode",
">",
"target",
",",
"char",
"semanticRelation",
")",
"{",
"int",
"sourceDepth",
"=",
"(",
"source",
".",
"get",
"(",
"0",
")",
"."... | Filters the mappings of two siblings node list for which the parents are also supposed to
be related. Checks whether in the two given node list there is a pair of nodes related
by the given relation and if so, if deletes all the other relations for the given 2
nodes setting the current one as strongest.
@param source ... | [
"Filters",
"the",
"mappings",
"of",
"two",
"siblings",
"node",
"list",
"for",
"which",
"the",
"parents",
"are",
"also",
"supposed",
"to",
"be",
"related",
".",
"Checks",
"whether",
"in",
"the",
"two",
"given",
"node",
"list",
"there",
"is",
"a",
"pair",
... | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/filters/SPSMMappingFilter.java#L149-L192 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/Engine.java | Engine.setInputValue | public void setInputValue(String name, double value) {
"""
Sets the value of the given input variable. The cost of this method is
O(n), where n is the number of input variables in the engine. For
performance, please get the variables by index.
@param name is the name of the input variable
@param value is the... | java | public void setInputValue(String name, double value) {
InputVariable inputVariable = getInputVariable(name);
inputVariable.setValue(value);
} | [
"public",
"void",
"setInputValue",
"(",
"String",
"name",
",",
"double",
"value",
")",
"{",
"InputVariable",
"inputVariable",
"=",
"getInputVariable",
"(",
"name",
")",
";",
"inputVariable",
".",
"setValue",
"(",
"value",
")",
";",
"}"
] | Sets the value of the given input variable. The cost of this method is
O(n), where n is the number of input variables in the engine. For
performance, please get the variables by index.
@param name is the name of the input variable
@param value is the value for the input variable | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"input",
"variable",
".",
"The",
"cost",
"of",
"this",
"method",
"is",
"O",
"(",
"n",
")",
"where",
"n",
"is",
"the",
"number",
"of",
"input",
"variables",
"in",
"the",
"engine",
".",
"For",
"performance",
... | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/Engine.java#L636-L639 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/ApplicationUrl.java | ApplicationUrl.getAppVersionsUrl | public static MozuUrl getAppVersionsUrl(String nsAndAppId, String responseFields) {
"""
Get Resource Url for GetAppVersions
@param nsAndAppId The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.... | java | public static MozuUrl getAppVersionsUrl(String nsAndAppId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/developer/applications/versions/{nsAndAppId}?responseFields={responseFields}");
formatter.formatUrl("nsAndAppId", nsAndAppId);
formatter.formatUrl("responseFields", res... | [
"public",
"static",
"MozuUrl",
"getAppVersionsUrl",
"(",
"String",
"nsAndAppId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/developer/applications/versions/{nsAndAppId}?responseFields={responseFields}\... | Get Resource Url for GetAppVersions
@param nsAndAppId The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param responseFields Filtering syntax appended to an AP... | [
"Get",
"Resource",
"Url",
"for",
"GetAppVersions"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/ApplicationUrl.java#L36-L42 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Utils.java | Utils.escapeIdentifier | public static StringBuilder escapeIdentifier(StringBuilder sbuf, String value)
throws SQLException {
"""
Escape the given identifier <tt>value</tt> and append it to the string builder <tt>sbuf</tt>.
If <tt>sbuf</tt> is <tt>null</tt>, a new StringBuilder will be returned. This method is
different from appen... | java | public static StringBuilder escapeIdentifier(StringBuilder sbuf, String value)
throws SQLException {
if (sbuf == null) {
sbuf = new StringBuilder(2 + (value.length() + 10) / 10 * 11); // Add 10% for escaping.
}
doAppendEscapedIdentifier(sbuf, value);
return sbuf;
} | [
"public",
"static",
"StringBuilder",
"escapeIdentifier",
"(",
"StringBuilder",
"sbuf",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"sbuf",
"==",
"null",
")",
"{",
"sbuf",
"=",
"new",
"StringBuilder",
"(",
"2",
"+",
"(",
"value",
... | Escape the given identifier <tt>value</tt> and append it to the string builder <tt>sbuf</tt>.
If <tt>sbuf</tt> is <tt>null</tt>, a new StringBuilder will be returned. This method is
different from appendEscapedLiteral in that it includes the quoting required for the identifier
while {@link #escapeLiteral(StringBuilder,... | [
"Escape",
"the",
"given",
"identifier",
"<tt",
">",
"value<",
"/",
"tt",
">",
"and",
"append",
"it",
"to",
"the",
"string",
"builder",
"<tt",
">",
"sbuf<",
"/",
"tt",
">",
".",
"If",
"<tt",
">",
"sbuf<",
"/",
"tt",
">",
"is",
"<tt",
">",
"null<",
... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Utils.java#L136-L143 |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java | ConfigReferenceHolder.getObjectReference | public Object getObjectReference(String field, String schemaName) {
"""
'
Called by a proxy to lookup single object reference. The proxy knows
the schema name so the hold does not need to bother storing it.
"""
List<String> instanceIds = references.get(field);
if(instanceIds == null || instan... | java | public Object getObjectReference(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
String instanceId = instanceIds.get(0);
if(instanceId == null) {
retur... | [
"public",
"Object",
"getObjectReference",
"(",
"String",
"field",
",",
"String",
"schemaName",
")",
"{",
"List",
"<",
"String",
">",
"instanceIds",
"=",
"references",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"instanceIds",
"==",
"null",
"||",
"instan... | '
Called by a proxy to lookup single object reference. The proxy knows
the schema name so the hold does not need to bother storing it. | [
"Called",
"by",
"a",
"proxy",
"to",
"lookup",
"single",
"object",
"reference",
".",
"The",
"proxy",
"knows",
"the",
"schema",
"name",
"so",
"the",
"hold",
"does",
"not",
"need",
"to",
"bother",
"storing",
"it",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java#L67-L84 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/utils/StringUtils.java | StringUtils.join | public static String join(String[] array, String sep) {
"""
以指定的分隔符来进行字符串元素连接
<p>
例如有字符串数组array和连接符为逗号(,)
<code>
String[] array = new String[] { "hello", "world", "qiniu", "cloud","storage" };
</code>
那么得到的结果是:
<code>
hello,world,qiniu,cloud,storage
</code>
</p>
@param array 需要连接的字符串数组
@param sep 元... | java | public static String join(String[] array, String sep) {
if (array == null) {
return null;
}
int arraySize = array.length;
int sepSize = 0;
if (sep != null && !sep.equals("")) {
sepSize = sep.length();
}
int bufSize = (arraySize == 0 ? 0 :... | [
"public",
"static",
"String",
"join",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"sep",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"arraySize",
"=",
"array",
".",
"length",
";",
"int",
"sepSize",
... | 以指定的分隔符来进行字符串元素连接
<p>
例如有字符串数组array和连接符为逗号(,)
<code>
String[] array = new String[] { "hello", "world", "qiniu", "cloud","storage" };
</code>
那么得到的结果是:
<code>
hello,world,qiniu,cloud,storage
</code>
</p>
@param array 需要连接的字符串数组
@param sep 元素连接之间的分隔符
@return 连接好的新字符串 | [
"以指定的分隔符来进行字符串元素连接",
"<p",
">",
"例如有字符串数组array和连接符为逗号",
"(",
")",
"<code",
">",
"String",
"[]",
"array",
"=",
"new",
"String",
"[]",
"{",
"hello",
"world",
"qiniu",
"cloud",
"storage",
"}",
";",
"<",
"/",
"code",
">",
"那么得到的结果是",
":",
"<code",
">",
"hell... | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/utils/StringUtils.java#L29-L52 |
autermann/yaml | src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java | YamlMappingNode.put | public T put(YamlNode key, Float value) {
"""
Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this}
"""
return put(key, getNodeFactory().floatNode(value));
} | java | public T put(YamlNode key, Float value) {
return put(key, getNodeFactory().floatNode(value));
} | [
"public",
"T",
"put",
"(",
"YamlNode",
"key",
",",
"Float",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"getNodeFactory",
"(",
")",
".",
"floatNode",
"(",
"value",
")",
")",
";",
"}"
] | Adds the specified {@code key}/{@code value} pair to this mapping.
@param key the key
@param value the value
@return {@code this} | [
"Adds",
"the",
"specified",
"{",
"@code",
"key",
"}",
"/",
"{",
"@code",
"value",
"}",
"pair",
"to",
"this",
"mapping",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/nodes/YamlMappingNode.java#L612-L614 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/AltBeaconParser.java | AltBeaconParser.fromScanData | @Override
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
"""
Construct an AltBeacon from a Bluetooth LE packet collected by Android's Bluetooth APIs,
including the raw Bluetooth device info
@param scanData The actual packet bytes
@param rssi The measured signal strength of... | java | @Override
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
return fromScanData(scanData, rssi, device, new AltBeacon());
} | [
"@",
"Override",
"public",
"Beacon",
"fromScanData",
"(",
"byte",
"[",
"]",
"scanData",
",",
"int",
"rssi",
",",
"BluetoothDevice",
"device",
")",
"{",
"return",
"fromScanData",
"(",
"scanData",
",",
"rssi",
",",
"device",
",",
"new",
"AltBeacon",
"(",
")"... | Construct an AltBeacon from a Bluetooth LE packet collected by Android's Bluetooth APIs,
including the raw Bluetooth device info
@param scanData The actual packet bytes
@param rssi The measured signal strength of the packet
@param device The Bluetooth device that was detected
@return An instance of an <code>Beacon</co... | [
"Construct",
"an",
"AltBeacon",
"from",
"a",
"Bluetooth",
"LE",
"packet",
"collected",
"by",
"Android",
"s",
"Bluetooth",
"APIs",
"including",
"the",
"raw",
"Bluetooth",
"device",
"info"
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/AltBeaconParser.java#L65-L68 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.setIntVec | public void setIntVec(String attributeName, IntBuffer data, int stride, int offset) {
"""
Updates a vertex attribute from an integer buffer.
All of the entries of the input buffer are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be o... | java | public void setIntVec(String attributeName, IntBuffer data, int stride, int offset)
{
if (!NativeVertexBuffer.setIntVec(getNative(), attributeName, data, stride, offset))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated");
}
} | [
"public",
"void",
"setIntVec",
"(",
"String",
"attributeName",
",",
"IntBuffer",
"data",
",",
"int",
"stride",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"!",
"NativeVertexBuffer",
".",
"setIntVec",
"(",
"getNative",
"(",
")",
",",
"attributeName",
",",
"d... | Updates a vertex attribute from an integer buffer.
All of the entries of the input buffer are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be one of the attributes named
in the descriptor passed to the constructor.
<p>
All vertex attributes h... | [
"Updates",
"a",
"vertex",
"attribute",
"from",
"an",
"integer",
"buffer",
".",
"All",
"of",
"the",
"entries",
"of",
"the",
"input",
"buffer",
"are",
"copied",
"into",
"the",
"storage",
"for",
"the",
"named",
"vertex",
"attribute",
".",
"Other",
"vertex",
"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L493-L499 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/CopyToModule.java | CopyToModule.isOutFile | private static boolean isOutFile(final URI filePathName, final URI inputMap) {
"""
Check if path falls outside start document directory
@param filePathName absolute path to test
@param inputMap absolute input map path
@return {@code true} if outside start directory, otherwise {@code false}
"""
... | java | private static boolean isOutFile(final URI filePathName, final URI inputMap) {
final URI relativePath = URLUtils.getRelativePath(inputMap, filePathName);
return !(relativePath.getPath().length() == 0 || !relativePath.getPath().startsWith(".."));
} | [
"private",
"static",
"boolean",
"isOutFile",
"(",
"final",
"URI",
"filePathName",
",",
"final",
"URI",
"inputMap",
")",
"{",
"final",
"URI",
"relativePath",
"=",
"URLUtils",
".",
"getRelativePath",
"(",
"inputMap",
",",
"filePathName",
")",
";",
"return",
"!",... | Check if path falls outside start document directory
@param filePathName absolute path to test
@param inputMap absolute input map path
@return {@code true} if outside start directory, otherwise {@code false} | [
"Check",
"if",
"path",
"falls",
"outside",
"start",
"document",
"directory"
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/CopyToModule.java#L383-L386 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/sender/GelfBuffers.java | GelfBuffers.toTCPBuffer | protected static ByteBuffer toTCPBuffer(GelfMessage message, ThreadLocal<ByteBuffer> writeBuffers) {
"""
Create TCP buffer and apply auto-buffer-enlarging, if necessary.
@param message
@param writeBuffers
@return
"""
while (true) {
try {
return message.toTCPBuffer(get... | java | protected static ByteBuffer toTCPBuffer(GelfMessage message, ThreadLocal<ByteBuffer> writeBuffers) {
while (true) {
try {
return message.toTCPBuffer(getBuffer(writeBuffers));
} catch (BufferOverflowException e) {
enlargeBuffer(writeBuffers);
... | [
"protected",
"static",
"ByteBuffer",
"toTCPBuffer",
"(",
"GelfMessage",
"message",
",",
"ThreadLocal",
"<",
"ByteBuffer",
">",
"writeBuffers",
")",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"return",
"message",
".",
"toTCPBuffer",
"(",
"getBuffer",
"(",... | Create TCP buffer and apply auto-buffer-enlarging, if necessary.
@param message
@param writeBuffers
@return | [
"Create",
"TCP",
"buffer",
"and",
"apply",
"auto",
"-",
"buffer",
"-",
"enlarging",
"if",
"necessary",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/sender/GelfBuffers.java#L46-L56 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/operations/ArcSort.java | ArcSort.isSorted | public static boolean isSorted(State state, Comparator<Arc> comparator) {
"""
Returns true if the given state is sorted by the comparator
@param state
@param comparator
@return
"""
return Ordering.from(comparator).isOrdered(state.getArcs());
} | java | public static boolean isSorted(State state, Comparator<Arc> comparator) {
return Ordering.from(comparator).isOrdered(state.getArcs());
} | [
"public",
"static",
"boolean",
"isSorted",
"(",
"State",
"state",
",",
"Comparator",
"<",
"Arc",
">",
"comparator",
")",
"{",
"return",
"Ordering",
".",
"from",
"(",
"comparator",
")",
".",
"isOrdered",
"(",
"state",
".",
"getArcs",
"(",
")",
")",
";",
... | Returns true if the given state is sorted by the comparator
@param state
@param comparator
@return | [
"Returns",
"true",
"if",
"the",
"given",
"state",
"is",
"sorted",
"by",
"the",
"comparator"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/ArcSort.java#L73-L75 |
baratine/baratine | core/src/main/java/com/caucho/v5/util/LruCache.java | LruCache.compareAndPut | public boolean compareAndPut(V testValue, K key, V value) {
"""
Puts a new item in the cache if the current value matches oldValue.
@param key the key
@param value the new value
@param testValue the value to test against the current
@return true if the put succeeds
"""
V result = compareAndPut(test... | java | public boolean compareAndPut(V testValue, K key, V value)
{
V result = compareAndPut(testValue, key, value, true);
return testValue == result;
} | [
"public",
"boolean",
"compareAndPut",
"(",
"V",
"testValue",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"result",
"=",
"compareAndPut",
"(",
"testValue",
",",
"key",
",",
"value",
",",
"true",
")",
";",
"return",
"testValue",
"==",
"result",
";... | Puts a new item in the cache if the current value matches oldValue.
@param key the key
@param value the new value
@param testValue the value to test against the current
@return true if the put succeeds | [
"Puts",
"a",
"new",
"item",
"in",
"the",
"cache",
"if",
"the",
"current",
"value",
"matches",
"oldValue",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/LruCache.java#L302-L307 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/MetadataAwareClassVisitor.java | MetadataAwareClassVisitor.onVisitTypeAnnotation | protected AnnotationVisitor onVisitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible) {
"""
An order-sensitive invocation of {@link ClassVisitor#visitTypeAnnotation(int, TypePath, String, boolean)}.
@param typeReference The type reference of the type annotation.
@param typ... | java | protected AnnotationVisitor onVisitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible) {
return super.visitTypeAnnotation(typeReference, typePath, descriptor, visible);
} | [
"protected",
"AnnotationVisitor",
"onVisitTypeAnnotation",
"(",
"int",
"typeReference",
",",
"TypePath",
"typePath",
",",
"String",
"descriptor",
",",
"boolean",
"visible",
")",
"{",
"return",
"super",
".",
"visitTypeAnnotation",
"(",
"typeReference",
",",
"typePath",... | An order-sensitive invocation of {@link ClassVisitor#visitTypeAnnotation(int, TypePath, String, boolean)}.
@param typeReference The type reference of the type annotation.
@param typePath The type path of the type annotation.
@param descriptor The descriptor of the annotation type.
@param visible {@code t... | [
"An",
"order",
"-",
"sensitive",
"invocation",
"of",
"{",
"@link",
"ClassVisitor#visitTypeAnnotation",
"(",
"int",
"TypePath",
"String",
"boolean",
")",
"}",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/MetadataAwareClassVisitor.java#L165-L167 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java | DiscreteDistributions.negativeBinomialCdf | public static double negativeBinomialCdf(int n, int r, double p) {
"""
Returns the cumulative probability of negativeBinomial
@param n
@param r
@param p
@return
"""
if(n<0 || r<0 || p<0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
n ... | java | public static double negativeBinomialCdf(int n, int r, double p) {
if(n<0 || r<0 || p<0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
n = Math.max(n,r);
double probabilitySum = 0.0;
for(int i=0;i<=r;++i) {
probab... | [
"public",
"static",
"double",
"negativeBinomialCdf",
"(",
"int",
"n",
",",
"int",
"r",
",",
"double",
"p",
")",
"{",
"if",
"(",
"n",
"<",
"0",
"||",
"r",
"<",
"0",
"||",
"p",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A... | Returns the cumulative probability of negativeBinomial
@param n
@param r
@param p
@return | [
"Returns",
"the",
"cumulative",
"probability",
"of",
"negativeBinomial"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L211-L223 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java | WTable.addActionConstraint | public void addActionConstraint(final WButton button, final ActionConstraint constraint) {
"""
Adds a constraint to when the given action can be used.
@param button the button which the constraint applies to.
@param constraint the constraint to add.
"""
if (button.getParent() != actions) {
throw new I... | java | public void addActionConstraint(final WButton button, final ActionConstraint constraint) {
if (button.getParent() != actions) {
throw new IllegalArgumentException(
"Can only add a constraint to a button which is in this table's actions");
}
getOrCreateComponentModel().addActionConstraint(button, constrai... | [
"public",
"void",
"addActionConstraint",
"(",
"final",
"WButton",
"button",
",",
"final",
"ActionConstraint",
"constraint",
")",
"{",
"if",
"(",
"button",
".",
"getParent",
"(",
")",
"!=",
"actions",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Adds a constraint to when the given action can be used.
@param button the button which the constraint applies to.
@param constraint the constraint to add. | [
"Adds",
"a",
"constraint",
"to",
"when",
"the",
"given",
"action",
"can",
"be",
"used",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L1222-L1229 |
ops4j/org.ops4j.pax.web | pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebAppParser.java | WebAppParser.parseWelcomeFiles | private static void parseWelcomeFiles(final WelcomeFileListType welcomeFileList, final WebApp webApp) {
"""
Parses welcome files out of web.xml.
@param welcomeFileList welcomeFileList element from web.xml
@param webApp model for web.xml
"""
if (welcomeFileList != null && welcomeFileList.getWelcom... | java | private static void parseWelcomeFiles(final WelcomeFileListType welcomeFileList, final WebApp webApp) {
if (welcomeFileList != null && welcomeFileList.getWelcomeFile() != null
&& !welcomeFileList.getWelcomeFile().isEmpty()) {
welcomeFileList.getWelcomeFile().forEach(webApp::addWelcomeFile);
}
} | [
"private",
"static",
"void",
"parseWelcomeFiles",
"(",
"final",
"WelcomeFileListType",
"welcomeFileList",
",",
"final",
"WebApp",
"webApp",
")",
"{",
"if",
"(",
"welcomeFileList",
"!=",
"null",
"&&",
"welcomeFileList",
".",
"getWelcomeFile",
"(",
")",
"!=",
"null"... | Parses welcome files out of web.xml.
@param welcomeFileList welcomeFileList element from web.xml
@param webApp model for web.xml | [
"Parses",
"welcome",
"files",
"out",
"of",
"web",
".",
"xml",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebAppParser.java#L778-L783 |
Netflix/conductor | grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java | WorkflowClient.getWorkflow | public Workflow getWorkflow(String workflowId, boolean includeTasks) {
"""
Retrieve a workflow by workflow id
@param workflowId the id of the workflow
@param includeTasks specify if the tasks in the workflow need to be returned
@return the requested workflow
"""
Preconditions.checkArgument(Strin... | java | public Workflow getWorkflow(String workflowId, boolean includeTasks) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
WorkflowPb.Workflow workflow = stub.getWorkflowStatus(
WorkflowServicePb.GetWorkflowStatusRequest.newBuilder()
... | [
"public",
"Workflow",
"getWorkflow",
"(",
"String",
"workflowId",
",",
"boolean",
"includeTasks",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"workflow id cannot be blank\"",
")",
";",
"Workf... | Retrieve a workflow by workflow id
@param workflowId the id of the workflow
@param includeTasks specify if the tasks in the workflow need to be returned
@return the requested workflow | [
"Retrieve",
"a",
"workflow",
"by",
"workflow",
"id"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java#L48-L57 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addNodeName | protected void addNodeName(Document doc, String namespaceURI, String localName) throws RepositoryException {
"""
Depending on the index format version adds one or two fields to the
document for the node name.
@param doc the lucene document.
@param namespaceURI the namespace URI of the node name.
@param local... | java | protected void addNodeName(Document doc, String namespaceURI, String localName) throws RepositoryException
{
String name = mappings.getNamespacePrefixByURI(namespaceURI) + ":" + localName;
doc.add(new Field(FieldNames.LABEL, name, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
// as of versio... | [
"protected",
"void",
"addNodeName",
"(",
"Document",
"doc",
",",
"String",
"namespaceURI",
",",
"String",
"localName",
")",
"throws",
"RepositoryException",
"{",
"String",
"name",
"=",
"mappings",
".",
"getNamespacePrefixByURI",
"(",
"namespaceURI",
")",
"+",
"\":... | Depending on the index format version adds one or two fields to the
document for the node name.
@param doc the lucene document.
@param namespaceURI the namespace URI of the node name.
@param localName the local name of the node.
@throws RepositoryException | [
"Depending",
"on",
"the",
"index",
"format",
"version",
"adds",
"one",
"or",
"two",
"fields",
"to",
"the",
"document",
"for",
"the",
"node",
"name",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L1052-L1062 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/SpiUtil.java | SpiUtil.urlEncode | public static String urlEncode(String text) {
"""
This function URL encodes the given text.
@param text
The text to encode
@return The encoded text
"""
String urlEncodedString=text;
if(text!=null)
{
try
{
urlEncodedString=URLEncoder.encode... | java | public static String urlEncode(String text)
{
String urlEncodedString=text;
if(text!=null)
{
try
{
urlEncodedString=URLEncoder.encode(text,SpiUtil.UTF_8_ENCODING_NAME);
}
catch(UnsupportedEncodingException exception)
... | [
"public",
"static",
"String",
"urlEncode",
"(",
"String",
"text",
")",
"{",
"String",
"urlEncodedString",
"=",
"text",
";",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"try",
"{",
"urlEncodedString",
"=",
"URLEncoder",
".",
"encode",
"(",
"text",
",",
"Sp... | This function URL encodes the given text.
@param text
The text to encode
@return The encoded text | [
"This",
"function",
"URL",
"encodes",
"the",
"given",
"text",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/SpiUtil.java#L210-L226 |
jenkinsci/jenkins | core/src/main/java/hudson/util/DescribableList.java | DescribableList.rebuildHetero | public void rebuildHetero(StaplerRequest req, JSONObject formData, Collection<? extends Descriptor<T>> descriptors, String key) throws FormException, IOException {
"""
Rebuilds the list by creating a fresh instances from the submitted form.
<p>
This version works with the {@code <f:hetero-list>} UI tag, where ... | java | public void rebuildHetero(StaplerRequest req, JSONObject formData, Collection<? extends Descriptor<T>> descriptors, String key) throws FormException, IOException {
replaceBy(Descriptor.newInstancesFromHeteroList(req,formData,key,descriptors));
} | [
"public",
"void",
"rebuildHetero",
"(",
"StaplerRequest",
"req",
",",
"JSONObject",
"formData",
",",
"Collection",
"<",
"?",
"extends",
"Descriptor",
"<",
"T",
">",
">",
"descriptors",
",",
"String",
"key",
")",
"throws",
"FormException",
",",
"IOException",
"... | Rebuilds the list by creating a fresh instances from the submitted form.
<p>
This version works with the {@code <f:hetero-list>} UI tag, where the user
is allowed to create multiple instances of the same descriptor. Order is also
significant. | [
"Rebuilds",
"the",
"list",
"by",
"creating",
"a",
"fresh",
"instances",
"from",
"the",
"submitted",
"form",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/DescribableList.java#L207-L209 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/permissions/CmsPermissionBean.java | CmsPermissionBean.getBeanForPrincipal | public static CmsPermissionBean getBeanForPrincipal(Set<CmsPermissionBean> beans, String principalName) {
"""
Gets the bean for principal from list of beans.<p>
@param beans to look principal up
@param principalName name of principal to get bean of
@return CmsPermissionBean
"""
for (CmsPermission... | java | public static CmsPermissionBean getBeanForPrincipal(Set<CmsPermissionBean> beans, String principalName) {
for (CmsPermissionBean bean : beans) {
if (bean.getPrincipalName().equals(principalName)) {
return bean;
}
}
return null;
} | [
"public",
"static",
"CmsPermissionBean",
"getBeanForPrincipal",
"(",
"Set",
"<",
"CmsPermissionBean",
">",
"beans",
",",
"String",
"principalName",
")",
"{",
"for",
"(",
"CmsPermissionBean",
"bean",
":",
"beans",
")",
"{",
"if",
"(",
"bean",
".",
"getPrincipalNa... | Gets the bean for principal from list of beans.<p>
@param beans to look principal up
@param principalName name of principal to get bean of
@return CmsPermissionBean | [
"Gets",
"the",
"bean",
"for",
"principal",
"from",
"list",
"of",
"beans",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/permissions/CmsPermissionBean.java#L120-L128 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/JMStats.java | JMStats.calPercent | public static String calPercent(Number target, Number total, int digit) {
"""
Cal percent string.
@param target the target
@param total the total
@param digit the digit
@return the string
"""
return JMString.roundedNumberFormat(calPercentPrecisely(target, total),
digit);
} | java | public static String calPercent(Number target, Number total, int digit) {
return JMString.roundedNumberFormat(calPercentPrecisely(target, total),
digit);
} | [
"public",
"static",
"String",
"calPercent",
"(",
"Number",
"target",
",",
"Number",
"total",
",",
"int",
"digit",
")",
"{",
"return",
"JMString",
".",
"roundedNumberFormat",
"(",
"calPercentPrecisely",
"(",
"target",
",",
"total",
")",
",",
"digit",
")",
";"... | Cal percent string.
@param target the target
@param total the total
@param digit the digit
@return the string | [
"Cal",
"percent",
"string",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/JMStats.java#L244-L247 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/ReadHandler.java | ReadHandler.doHandleRequest | @Override
public Object doHandleRequest(MBeanServerConnection pServer, JmxReadRequest pRequest)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException {
"""
Used for a request to a single attribute from a single MBean. Merging of MBeanServers ... | java | @Override
public Object doHandleRequest(MBeanServerConnection pServer, JmxReadRequest pRequest)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException {
checkRestriction(pRequest.getObjectName(), pRequest.getAttributeName());
return... | [
"@",
"Override",
"public",
"Object",
"doHandleRequest",
"(",
"MBeanServerConnection",
"pServer",
",",
"JmxReadRequest",
"pRequest",
")",
"throws",
"InstanceNotFoundException",
",",
"AttributeNotFoundException",
",",
"ReflectionException",
",",
"MBeanException",
",",
"IOExce... | Used for a request to a single attribute from a single MBean. Merging of MBeanServers is done
one layer above.
@param pServer server on which to request the attribute
@param pRequest the request itself.
@return the attribute's value | [
"Used",
"for",
"a",
"request",
"to",
"a",
"single",
"attribute",
"from",
"a",
"single",
"MBean",
".",
"Merging",
"of",
"MBeanServers",
"is",
"done",
"one",
"layer",
"above",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/ReadHandler.java#L102-L107 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/VerificationCodeImage.java | VerificationCodeImage.output | public static void output(BufferedImage image, OutputStream out)
throws IOException {
"""
将指定的图片输出到指定位置
@param image 指定图片
@param out 输出位置
@throws IOException
"""
ImageIO.write(image, "JPEG", out);
} | java | public static void output(BufferedImage image, OutputStream out)
throws IOException {
ImageIO.write(image, "JPEG", out);
} | [
"public",
"static",
"void",
"output",
"(",
"BufferedImage",
"image",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"ImageIO",
".",
"write",
"(",
"image",
",",
"\"JPEG\"",
",",
"out",
")",
";",
"}"
] | 将指定的图片输出到指定位置
@param image 指定图片
@param out 输出位置
@throws IOException | [
"将指定的图片输出到指定位置"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/VerificationCodeImage.java#L325-L328 |
icode/ameba | src/main/java/ameba/websocket/internal/EndpointMeta.java | EndpointMeta.onClose | public void onClose(Session session, CloseReason closeReason) {
"""
<p>onClose.</p>
@param session a {@link javax.websocket.Session} object.
@param closeReason a {@link javax.websocket.CloseReason} object.
"""
if (getOnCloseHandle() != null) {
callMethod(getOnCloseHandle(), getOnClosePa... | java | public void onClose(Session session, CloseReason closeReason) {
if (getOnCloseHandle() != null) {
callMethod(getOnCloseHandle(), getOnCloseParameters(), session, true, closeReason);
}
} | [
"public",
"void",
"onClose",
"(",
"Session",
"session",
",",
"CloseReason",
"closeReason",
")",
"{",
"if",
"(",
"getOnCloseHandle",
"(",
")",
"!=",
"null",
")",
"{",
"callMethod",
"(",
"getOnCloseHandle",
"(",
")",
",",
"getOnCloseParameters",
"(",
")",
",",... | <p>onClose.</p>
@param session a {@link javax.websocket.Session} object.
@param closeReason a {@link javax.websocket.CloseReason} object. | [
"<p",
">",
"onClose",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/internal/EndpointMeta.java#L195-L199 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_timeConditions_conditions_POST | public OvhEasyHuntingTimeConditions billingAccount_easyHunting_serviceName_timeConditions_conditions_POST(String billingAccount, String serviceName, OvhTimeConditionsPolicyEnum policy, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IOException {
"""
Create a new tim... | java | public OvhEasyHuntingTimeConditions billingAccount_easyHunting_serviceName_timeConditions_conditions_POST(String billingAccount, String serviceName, OvhTimeConditionsPolicyEnum policy, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IOException {
String qPath = "/teleph... | [
"public",
"OvhEasyHuntingTimeConditions",
"billingAccount_easyHunting_serviceName_timeConditions_conditions_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhTimeConditionsPolicyEnum",
"policy",
",",
"Date",
"timeFrom",
",",
"Date",
"timeTo",
",",
"... | Create a new time condition
REST: POST /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions
@param timeFrom [required] The time of the day when the extension will start to be executed
@param weekDay [required] The day of the week when the extension will be executed
@param policy [required] T... | [
"Create",
"a",
"new",
"time",
"condition"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3388-L3398 |
craftercms/core | src/main/java/org/craftercms/core/cache/impl/store/EhCacheStoreAdapter.java | EhCacheStoreAdapter.addScope | @Override
public void addScope(String scope, int maxItemsInMemory) throws Exception {
"""
Adds a new scope. The scope is an instance of EhCache's {@link Cache}.
@param scope the name of the scope
@param maxItemsInMemory the maximum number of items in memory, before they are evicted
@throws Exce... | java | @Override
public void addScope(String scope, int maxItemsInMemory) throws Exception {
CacheConfiguration scopeConfig = new CacheConfiguration(scope, maxItemsInMemory);
scopeManager.addCache(new Cache(scopeConfig));
} | [
"@",
"Override",
"public",
"void",
"addScope",
"(",
"String",
"scope",
",",
"int",
"maxItemsInMemory",
")",
"throws",
"Exception",
"{",
"CacheConfiguration",
"scopeConfig",
"=",
"new",
"CacheConfiguration",
"(",
"scope",
",",
"maxItemsInMemory",
")",
";",
"scopeMa... | Adds a new scope. The scope is an instance of EhCache's {@link Cache}.
@param scope the name of the scope
@param maxItemsInMemory the maximum number of items in memory, before they are evicted
@throws Exception | [
"Adds",
"a",
"new",
"scope",
".",
"The",
"scope",
"is",
"an",
"instance",
"of",
"EhCache",
"s",
"{",
"@link",
"Cache",
"}",
"."
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/cache/impl/store/EhCacheStoreAdapter.java#L104-L109 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java | JpaControllerManagement.updateTargetStatus | private Target updateTargetStatus(final JpaTarget toUpdate, final URI address) {
"""
Stores target directly to DB in case either {@link Target#getAddress()}
or {@link Target#getUpdateStatus()} changes or the buffer queue is full.
"""
boolean storeEager = isStoreEager(toUpdate, address);
if (T... | java | private Target updateTargetStatus(final JpaTarget toUpdate, final URI address) {
boolean storeEager = isStoreEager(toUpdate, address);
if (TargetUpdateStatus.UNKNOWN.equals(toUpdate.getUpdateStatus())) {
toUpdate.setUpdateStatus(TargetUpdateStatus.REGISTERED);
storeEager = true;... | [
"private",
"Target",
"updateTargetStatus",
"(",
"final",
"JpaTarget",
"toUpdate",
",",
"final",
"URI",
"address",
")",
"{",
"boolean",
"storeEager",
"=",
"isStoreEager",
"(",
"toUpdate",
",",
"address",
")",
";",
"if",
"(",
"TargetUpdateStatus",
".",
"UNKNOWN",
... | Stores target directly to DB in case either {@link Target#getAddress()}
or {@link Target#getUpdateStatus()} changes or the buffer queue is full. | [
"Stores",
"target",
"directly",
"to",
"DB",
"in",
"case",
"either",
"{",
"@link",
"Target#getAddress",
"()",
"}",
"or",
"{",
"@link",
"Target#getUpdateStatus",
"()",
"}",
"changes",
"or",
"the",
"buffer",
"queue",
"is",
"full",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java#L483-L501 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/inject/dagger/Util.java | Util.hasAnyParameter | private static Matcher<AnnotationTree> hasAnyParameter(String... parameters) {
"""
Matches an annotation that has an argument for at least one of the given parameters.
"""
return anyOf(
transform(
asList(parameters),
new Function<String, Matcher<AnnotationTree>>() {
... | java | private static Matcher<AnnotationTree> hasAnyParameter(String... parameters) {
return anyOf(
transform(
asList(parameters),
new Function<String, Matcher<AnnotationTree>>() {
@Override
public Matcher<AnnotationTree> apply(String parameter) {
... | [
"private",
"static",
"Matcher",
"<",
"AnnotationTree",
">",
"hasAnyParameter",
"(",
"String",
"...",
"parameters",
")",
"{",
"return",
"anyOf",
"(",
"transform",
"(",
"asList",
"(",
"parameters",
")",
",",
"new",
"Function",
"<",
"String",
",",
"Matcher",
"<... | Matches an annotation that has an argument for at least one of the given parameters. | [
"Matches",
"an",
"annotation",
"that",
"has",
"an",
"argument",
"for",
"at",
"least",
"one",
"of",
"the",
"given",
"parameters",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/inject/dagger/Util.java#L95-L105 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_activeMonthlyBilling_POST | public OvhInstanceDetail project_serviceName_instance_instanceId_activeMonthlyBilling_POST(String serviceName, String instanceId) throws IOException {
"""
Active monthly billing on instance
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/activeMonthlyBilling
@param instanceId [required] Instance ... | java | public OvhInstanceDetail project_serviceName_instance_instanceId_activeMonthlyBilling_POST(String serviceName, String instanceId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/activeMonthlyBilling";
StringBuilder sb = path(qPath, serviceName, instanceId);
String resp = ex... | [
"public",
"OvhInstanceDetail",
"project_serviceName_instance_instanceId_activeMonthlyBilling_POST",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/{instanceId}/activeMonthl... | Active monthly billing on instance
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/activeMonthlyBilling
@param instanceId [required] Instance id
@param serviceName [required] Service name | [
"Active",
"monthly",
"billing",
"on",
"instance"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2049-L2054 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Analyzer.java | Analyzer.visitDependences | void visitDependences(Archive source, Visitor v, Type level) {
"""
Visit the dependencies of the given source.
If the requested level is SUMMARY, it will visit the required archives list.
"""
if (level == Type.SUMMARY) {
final Dependences result = results.get(source);
final Set... | java | void visitDependences(Archive source, Visitor v, Type level) {
if (level == Type.SUMMARY) {
final Dependences result = results.get(source);
final Set<Archive> reqs = result.requires();
Stream<Archive> stream = reqs.stream();
if (reqs.isEmpty()) {
i... | [
"void",
"visitDependences",
"(",
"Archive",
"source",
",",
"Visitor",
"v",
",",
"Type",
"level",
")",
"{",
"if",
"(",
"level",
"==",
"Type",
".",
"SUMMARY",
")",
"{",
"final",
"Dependences",
"result",
"=",
"results",
".",
"get",
"(",
"source",
")",
";"... | Visit the dependencies of the given source.
If the requested level is SUMMARY, it will visit the required archives list. | [
"Visit",
"the",
"dependencies",
"of",
"the",
"given",
"source",
".",
"If",
"the",
"requested",
"level",
"is",
"SUMMARY",
"it",
"will",
"visit",
"the",
"required",
"archives",
"list",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Analyzer.java#L164-L196 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deserializeWriterFilePermissions | public static FsPermission deserializeWriterFilePermissions(State state, int numBranches, int branchId) {
"""
Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is writing a file.
"""
return new FsPermission(state.getPropAsShortWithRadix(
ForkOperatorUtils.get... | java | public static FsPermission deserializeWriterFilePermissions(State state, int numBranches, int branchId) {
return new FsPermission(state.getPropAsShortWithRadix(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PERMISSIONS, numBranches, branchId),
FsPermission.getDefault().toS... | [
"public",
"static",
"FsPermission",
"deserializeWriterFilePermissions",
"(",
"State",
"state",
",",
"int",
"numBranches",
",",
"int",
"branchId",
")",
"{",
"return",
"new",
"FsPermission",
"(",
"state",
".",
"getPropAsShortWithRadix",
"(",
"ForkOperatorUtils",
".",
... | Deserializes a {@link FsPermission}s object that should be used when a {@link DataWriter} is writing a file. | [
"Deserializes",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L885-L889 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotationTowards | public Matrix4x3d rotationTowards(Vector3dc dir, Vector3dc up) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>dir</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@l... | java | public Matrix4x3d rotationTowards(Vector3dc dir, Vector3dc up) {
return rotationTowards(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4x3d",
"rotationTowards",
"(",
"Vector3dc",
"dir",
",",
"Vector3dc",
"up",
")",
"{",
"return",
"rotationTowards",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
... | Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>dir</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@link #rotateTowards(double, double, double, double, double, double) rotateTowar... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"dir<",
"/",
"code",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L9731-L9733 |
soarcn/COCOQuery | query/src/main/java/com/cocosw/query/AbstractViewQuery.java | AbstractViewQuery.getTypeface | private static Typeface getTypeface(final String name, final Context context) {
"""
Get typeface with name
@param name
@param context
@return typeface, either cached or loaded from the assets
"""
Typeface typeface = TYPEFACES.get(name);
if (typeface == null) {
typeface = Typefa... | java | private static Typeface getTypeface(final String name, final Context context) {
Typeface typeface = TYPEFACES.get(name);
if (typeface == null) {
typeface = Typeface.createFromAsset(context.getAssets(), name);
TYPEFACES.put(name, typeface);
}
return typeface;
} | [
"private",
"static",
"Typeface",
"getTypeface",
"(",
"final",
"String",
"name",
",",
"final",
"Context",
"context",
")",
"{",
"Typeface",
"typeface",
"=",
"TYPEFACES",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"typeface",
"==",
"null",
")",
"{",
"typ... | Get typeface with name
@param name
@param context
@return typeface, either cached or loaded from the assets | [
"Get",
"typeface",
"with",
"name"
] | train | https://github.com/soarcn/COCOQuery/blob/712eac37ab65ef3dbdf55dbfae28750edfc36608/query/src/main/java/com/cocosw/query/AbstractViewQuery.java#L1084-L1091 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java | MajorCompactionTask.compactGroup | private void compactGroup(List<Segment> segments, List<OffsetPredicate> predicates, Segment compactSegment) {
"""
Compacts segments in a group sequentially.
@param segments The segments to compact.
@param compactSegment The compact segment.
"""
// Iterate through all segments being compacted and write ... | java | private void compactGroup(List<Segment> segments, List<OffsetPredicate> predicates, Segment compactSegment) {
// Iterate through all segments being compacted and write entries to a single compact segment.
for (int i = 0; i < segments.size(); i++) {
compactSegment(segments.get(i), predicates.get(i), compac... | [
"private",
"void",
"compactGroup",
"(",
"List",
"<",
"Segment",
">",
"segments",
",",
"List",
"<",
"OffsetPredicate",
">",
"predicates",
",",
"Segment",
"compactSegment",
")",
"{",
"// Iterate through all segments being compacted and write entries to a single compact segment.... | Compacts segments in a group sequentially.
@param segments The segments to compact.
@param compactSegment The compact segment. | [
"Compacts",
"segments",
"in",
"a",
"group",
"sequentially",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/compaction/MajorCompactionTask.java#L174-L179 |
iipc/webarchive-commons | src/main/java/org/archive/util/LaxHttpParser.java | LaxHttpParser.parseHeaders | public static Header[] parseHeaders(InputStream is) throws IOException, HttpException {
"""
Parses headers from the given stream. Headers with the same name are not
combined.
@param is the stream to read headers from
@return an array of headers in the order in which they were parsed
@throws IOException ... | java | public static Header[] parseHeaders(InputStream is) throws IOException, HttpException {
LOG.trace("enter HeaderParser.parseHeaders(InputStream, String)");
return parseHeaders(is, "US-ASCII");
} | [
"public",
"static",
"Header",
"[",
"]",
"parseHeaders",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HeaderParser.parseHeaders(InputStream, String)\"",
")",
";",
"return",
"parseHeaders",
"(",
... | Parses headers from the given stream. Headers with the same name are not
combined.
@param is the stream to read headers from
@return an array of headers in the order in which they were parsed
@throws IOException if an IO error occurs while reading from the stream
@throws HttpException if there is an error parsing a... | [
"Parses",
"headers",
"from",
"the",
"given",
"stream",
".",
"Headers",
"with",
"the",
"same",
"name",
"are",
"not",
"combined",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/LaxHttpParser.java#L238-L241 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ResourceCopy.java | ResourceCopy.computeRelativeFile | public static File computeRelativeFile(File file, File rel, File dir) {
"""
Gets a File object representing a File in the directory <tt>dir</tt> which has the same path as the file
<tt>file</tt> from the directory <tt>rel</tt>.
<p>
For example, copying root/foo/bar.txt to out with rel set to root returns the fi... | java | public static File computeRelativeFile(File file, File rel, File dir) {
String path = file.getAbsolutePath();
String relativePath = path.substring(rel.getAbsolutePath().length());
return new File(dir, relativePath);
} | [
"public",
"static",
"File",
"computeRelativeFile",
"(",
"File",
"file",
",",
"File",
"rel",
",",
"File",
"dir",
")",
"{",
"String",
"path",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"relativePath",
"=",
"path",
".",
"substring",
"(",
... | Gets a File object representing a File in the directory <tt>dir</tt> which has the same path as the file
<tt>file</tt> from the directory <tt>rel</tt>.
<p>
For example, copying root/foo/bar.txt to out with rel set to root returns the file out/foo/bar.txt.
@param file the file to copy
@param rel the base 'relative'
@p... | [
"Gets",
"a",
"File",
"object",
"representing",
"a",
"File",
"in",
"the",
"directory",
"<tt",
">",
"dir<",
"/",
"tt",
">",
"which",
"has",
"the",
"same",
"path",
"as",
"the",
"file",
"<tt",
">",
"file<",
"/",
"tt",
">",
"from",
"the",
"directory",
"<t... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ResourceCopy.java#L176-L180 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getSessionCookie | @SuppressWarnings("unchecked")
protected Session getSessionCookie(HttpServerExchange exchange) {
"""
Retrieves the current session from the HttpServerExchange
@param exchange The Undertow HttpServerExchange
"""
Session session = Session.create()
.withContent(new HashMap<>())
... | java | @SuppressWarnings("unchecked")
protected Session getSessionCookie(HttpServerExchange exchange) {
Session session = Session.create()
.withContent(new HashMap<>())
.withAuthenticity(MangooUtils.randomString(STRING_LENGTH));
if (this.config.getSessionCookieExpires() > 0) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Session",
"getSessionCookie",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Session",
"session",
"=",
"Session",
".",
"create",
"(",
")",
".",
"withContent",
"(",
"new",
"HashMap",
"<>",
"(",
... | Retrieves the current session from the HttpServerExchange
@param exchange The Undertow HttpServerExchange | [
"Retrieves",
"the",
"current",
"session",
"from",
"the",
"HttpServerExchange"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L75-L116 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java | AbstractConnectProtocol.versionGreaterOrEqual | public boolean versionGreaterOrEqual(int major, int minor, int patch) {
"""
Utility method to check if database version is greater than parameters.
@param major major version
@param minor minor version
@param patch patch version
@return true if version is greater than parameters
"""
if (this.majorVer... | java | public boolean versionGreaterOrEqual(int major, int minor, int patch) {
if (this.majorVersion > major) {
return true;
}
if (this.majorVersion < major) {
return false;
}
/*
* Major versions are equal, compare minor versions
*/
if (this.minorVersion > minor) {
return ... | [
"public",
"boolean",
"versionGreaterOrEqual",
"(",
"int",
"major",
",",
"int",
"minor",
",",
"int",
"patch",
")",
"{",
"if",
"(",
"this",
".",
"majorVersion",
">",
"major",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"this",
".",
"majorVersion",
"... | Utility method to check if database version is greater than parameters.
@param major major version
@param minor minor version
@param patch patch version
@return true if version is greater than parameters | [
"Utility",
"method",
"to",
"check",
"if",
"database",
"version",
"is",
"greater",
"than",
"parameters",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractConnectProtocol.java#L1287-L1308 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.removeTimer | public boolean removeTimer(VacuumTimer timer) throws CommandExecutionException {
"""
Delete a scheduled cleanup.
@param timer The timer to remove.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was inv... | java | public boolean removeTimer(VacuumTimer timer) throws CommandExecutionException {
if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
JSONArray payload = new JSONArray();
payload.put(timer.getID());
return sendOk("del_timer", payload... | [
"public",
"boolean",
"removeTimer",
"(",
"VacuumTimer",
"timer",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"timer",
"==",
"null",
")",
"throw",
"new",
"CommandExecutionException",
"(",
"CommandExecutionException",
".",
"Error",
".",
"INVALID_PARAMETE... | Delete a scheduled cleanup.
@param timer The timer to remove.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was invalid. | [
"Delete",
"a",
"scheduled",
"cleanup",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L235-L240 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseDate.java | JapaneseDate.withYear | private JapaneseDate withYear(JapaneseEra era, int yearOfEra) {
"""
Returns a copy of this date with the year altered.
<p>
This method changes the year of the date.
If the month-day is invalid for the year, then the previous valid day
will be selected instead.
<p>
This instance is immutable and unaffected by... | java | private JapaneseDate withYear(JapaneseEra era, int yearOfEra) {
int year = JapaneseChronology.INSTANCE.prolepticYear(era, yearOfEra);
return with(isoDate.withYear(year));
} | [
"private",
"JapaneseDate",
"withYear",
"(",
"JapaneseEra",
"era",
",",
"int",
"yearOfEra",
")",
"{",
"int",
"year",
"=",
"JapaneseChronology",
".",
"INSTANCE",
".",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
";",
"return",
"with",
"(",
"isoDate",
".... | Returns a copy of this date with the year altered.
<p>
This method changes the year of the date.
If the month-day is invalid for the year, then the previous valid day
will be selected instead.
<p>
This instance is immutable and unaffected by this method call.
@param era the era to set in the result, not null
@param y... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"year",
"altered",
".",
"<p",
">",
"This",
"method",
"changes",
"the",
"year",
"of",
"the",
"date",
".",
"If",
"the",
"month",
"-",
"day",
"is",
"invalid",
"for",
"the",
"year",
"then",
"th... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseDate.java#L510-L513 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.setToolbar | public void setToolbar(@NonNull Activity activity, @NonNull Toolbar toolbar) {
"""
Sets the toolbar which should be used in combination with the drawer
This will handle the ActionBarDrawerToggle for you.
Do not set this if you are in a sub activity and want to handle the back arrow on your own
@param activity... | java | public void setToolbar(@NonNull Activity activity, @NonNull Toolbar toolbar) {
setToolbar(activity, toolbar, false);
} | [
"public",
"void",
"setToolbar",
"(",
"@",
"NonNull",
"Activity",
"activity",
",",
"@",
"NonNull",
"Toolbar",
"toolbar",
")",
"{",
"setToolbar",
"(",
"activity",
",",
"toolbar",
",",
"false",
")",
";",
"}"
] | Sets the toolbar which should be used in combination with the drawer
This will handle the ActionBarDrawerToggle for you.
Do not set this if you are in a sub activity and want to handle the back arrow on your own
@param activity
@param toolbar the toolbar which is used in combination with the drawer | [
"Sets",
"the",
"toolbar",
"which",
"should",
"be",
"used",
"in",
"combination",
"with",
"the",
"drawer",
"This",
"will",
"handle",
"the",
"ActionBarDrawerToggle",
"for",
"you",
".",
"Do",
"not",
"set",
"this",
"if",
"you",
"are",
"in",
"a",
"sub",
"activit... | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L100-L102 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_firewall_ipOnFirewall_rule_GET | public ArrayList<Long> ip_firewall_ipOnFirewall_rule_GET(String ip, String ipOnFirewall, OvhFirewallRuleStateEnum state) throws IOException {
"""
Rules for this IP
REST: GET /ip/{ip}/firewall/{ipOnFirewall}/rule
@param state [required] Filter the value of state property (=)
@param ip [required]
@param ipOnFi... | java | public ArrayList<Long> ip_firewall_ipOnFirewall_rule_GET(String ip, String ipOnFirewall, OvhFirewallRuleStateEnum state) throws IOException {
String qPath = "/ip/{ip}/firewall/{ipOnFirewall}/rule";
StringBuilder sb = path(qPath, ip, ipOnFirewall);
query(sb, "state", state);
String resp = exec(qPath, "GET", sb.t... | [
"public",
"ArrayList",
"<",
"Long",
">",
"ip_firewall_ipOnFirewall_rule_GET",
"(",
"String",
"ip",
",",
"String",
"ipOnFirewall",
",",
"OvhFirewallRuleStateEnum",
"state",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/firewall/{ipOnFirewall}/rule\... | Rules for this IP
REST: GET /ip/{ip}/firewall/{ipOnFirewall}/rule
@param state [required] Filter the value of state property (=)
@param ip [required]
@param ipOnFirewall [required] | [
"Rules",
"for",
"this",
"IP"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1078-L1084 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractArrayFieldValidator.java | AbstractArrayFieldValidator.error | public void error(final ArrayCellField<E> cellField, final String messageKey) {
"""
メッセージキーを指定して、エラー情報を追加します。
<p>エラーメッセージ中の変数は、{@link #getMessageVariables(ArrayCellField)}の値を使用します。</p>
@param cellField フィールド情報
@param messageKey メッセージキー
@throws IllegalArgumentException {@literal cellField == null or messageKey ... | java | public void error(final ArrayCellField<E> cellField, final String messageKey) {
error(cellField, messageKey, getMessageVariables(cellField));
} | [
"public",
"void",
"error",
"(",
"final",
"ArrayCellField",
"<",
"E",
">",
"cellField",
",",
"final",
"String",
"messageKey",
")",
"{",
"error",
"(",
"cellField",
",",
"messageKey",
",",
"getMessageVariables",
"(",
"cellField",
")",
")",
";",
"}"
] | メッセージキーを指定して、エラー情報を追加します。
<p>エラーメッセージ中の変数は、{@link #getMessageVariables(ArrayCellField)}の値を使用します。</p>
@param cellField フィールド情報
@param messageKey メッセージキー
@throws IllegalArgumentException {@literal cellField == null or messageKey == null}
@throws IllegalArgumentException {@literal messageKey.length() == 0} | [
"メッセージキーを指定して、エラー情報を追加します。",
"<p",
">",
"エラーメッセージ中の変数は、",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractArrayFieldValidator.java#L102-L104 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/IdGenerator.java | IdGenerator.extractTimestamp48Ascii | public static long extractTimestamp48Ascii(String id48ascii) throws NumberFormatException {
"""
Extracts the (UNIX) timestamp from a 48-bit ASCII id (radix
{@link Character#MAX_RADIX}).
@param id48ascii
@return the UNIX timestamp (milliseconds)
@throws NumberFormatException
"""
return extractTime... | java | public static long extractTimestamp48Ascii(String id48ascii) throws NumberFormatException {
return extractTimestamp48(Long.parseLong(id48ascii, Character.MAX_RADIX));
} | [
"public",
"static",
"long",
"extractTimestamp48Ascii",
"(",
"String",
"id48ascii",
")",
"throws",
"NumberFormatException",
"{",
"return",
"extractTimestamp48",
"(",
"Long",
".",
"parseLong",
"(",
"id48ascii",
",",
"Character",
".",
"MAX_RADIX",
")",
")",
";",
"}"
... | Extracts the (UNIX) timestamp from a 48-bit ASCII id (radix
{@link Character#MAX_RADIX}).
@param id48ascii
@return the UNIX timestamp (milliseconds)
@throws NumberFormatException | [
"Extracts",
"the",
"(",
"UNIX",
")",
"timestamp",
"from",
"a",
"48",
"-",
"bit",
"ASCII",
"id",
"(",
"radix",
"{",
"@link",
"Character#MAX_RADIX",
"}",
")",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/IdGenerator.java#L338-L340 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.qrcodeGet | public static QrcodeGetResult qrcodeGet(String accessToken, QrcodeGet qrcodeGet) {
"""
配置连网方式-获取物料二维码
添加设备后,通过此接口可以获取物料,包括二维码和桌贴两种样式。将物料铺设在线下门店里,可供用户扫码上网。
注:只有门店下已添加Wi-Fi网络信息,才能调用此接口获取二维码
@param accessToken accessToken
@param qrcodeGet qrcodeGet
@return QrcodeGetResult
"""
return qrcodeGet(ac... | java | public static QrcodeGetResult qrcodeGet(String accessToken, QrcodeGet qrcodeGet) {
return qrcodeGet(accessToken, JsonUtil.toJSONString(qrcodeGet));
} | [
"public",
"static",
"QrcodeGetResult",
"qrcodeGet",
"(",
"String",
"accessToken",
",",
"QrcodeGet",
"qrcodeGet",
")",
"{",
"return",
"qrcodeGet",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"qrcodeGet",
")",
")",
";",
"}"
] | 配置连网方式-获取物料二维码
添加设备后,通过此接口可以获取物料,包括二维码和桌贴两种样式。将物料铺设在线下门店里,可供用户扫码上网。
注:只有门店下已添加Wi-Fi网络信息,才能调用此接口获取二维码
@param accessToken accessToken
@param qrcodeGet qrcodeGet
@return QrcodeGetResult | [
"配置连网方式",
"-",
"获取物料二维码",
"添加设备后,通过此接口可以获取物料,包括二维码和桌贴两种样式。将物料铺设在线下门店里,可供用户扫码上网。",
"注:只有门店下已添加Wi",
"-",
"Fi网络信息,才能调用此接口获取二维码"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L444-L446 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java | PdfContentStreamProcessor.invokeOperator | public void invokeOperator(PdfLiteral operator, ArrayList operands) {
"""
Invokes an operator.
@param operator the PDF Syntax of the operator
@param operands a list with operands
"""
ContentOperator op = operators.get(operator.toString());
if (op == null) {
// skipping unssupported operator
ret... | java | public void invokeOperator(PdfLiteral operator, ArrayList operands) {
ContentOperator op = operators.get(operator.toString());
if (op == null) {
// skipping unssupported operator
return;
}
op.invoke(this, operator, operands);
} | [
"public",
"void",
"invokeOperator",
"(",
"PdfLiteral",
"operator",
",",
"ArrayList",
"operands",
")",
"{",
"ContentOperator",
"op",
"=",
"operators",
".",
"get",
"(",
"operator",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"op",
"==",
"null",
")",
"{... | Invokes an operator.
@param operator the PDF Syntax of the operator
@param operands a list with operands | [
"Invokes",
"an",
"operator",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java#L191-L198 |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.configurationString | private static String configurationString(Properties properties, String key, String defaultValue) {
"""
Get configuration string
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value
"""
if (properties != null)
{
return properties.g... | java | private static String configurationString(Properties properties, String key, String defaultValue)
{
if (properties != null)
{
return properties.getProperty(key, defaultValue);
}
return defaultValue;
} | [
"private",
"static",
"String",
"configurationString",
"(",
"Properties",
"properties",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"return",
"properties",
".",
"getProperty",
"(",
"key",
",",
... | Get configuration string
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value | [
"Get",
"configuration",
"string"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L428-L436 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsBurstEventManager.java | CmsBurstEventManager.schedule | public void schedule(final String name, final Command command, final int delayMsec) {
"""
Adds an 'burst' event to the manager.<p>
@param name the unique name, which identifies the event
@param command command to execute when the timer expires
@param delayMsec the timer delay (it's reseted if multiple events ... | java | public void schedule(final String name, final Command command, final int delayMsec) {
BurstEvent e = m_memory.remove(name);
if (e != null) {
// disable the old event
e.getTimer().cancel();
}
// put the new event and schedule it
e = new BurstEvent(name, co... | [
"public",
"void",
"schedule",
"(",
"final",
"String",
"name",
",",
"final",
"Command",
"command",
",",
"final",
"int",
"delayMsec",
")",
"{",
"BurstEvent",
"e",
"=",
"m_memory",
".",
"remove",
"(",
"name",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
... | Adds an 'burst' event to the manager.<p>
@param name the unique name, which identifies the event
@param command command to execute when the timer expires
@param delayMsec the timer delay (it's reseted if multiple events are added) | [
"Adds",
"an",
"burst",
"event",
"to",
"the",
"manager",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsBurstEventManager.java#L136-L147 |
Harium/keel | src/main/java/com/harium/keel/catalano/core/FloatPoint.java | FloatPoint.Multiply | public FloatPoint Multiply(FloatPoint point1, FloatPoint point2) {
"""
Multiply values of two points.
@param point1 FloatPoint.
@param point2 FloatPoint.
@return A new FloatPoint with the multiplication operation.
"""
FloatPoint result = new FloatPoint(point1);
result.Multiply(point2);
... | java | public FloatPoint Multiply(FloatPoint point1, FloatPoint point2) {
FloatPoint result = new FloatPoint(point1);
result.Multiply(point2);
return result;
} | [
"public",
"FloatPoint",
"Multiply",
"(",
"FloatPoint",
"point1",
",",
"FloatPoint",
"point2",
")",
"{",
"FloatPoint",
"result",
"=",
"new",
"FloatPoint",
"(",
"point1",
")",
";",
"result",
".",
"Multiply",
"(",
"point2",
")",
";",
"return",
"result",
";",
... | Multiply values of two points.
@param point1 FloatPoint.
@param point2 FloatPoint.
@return A new FloatPoint with the multiplication operation. | [
"Multiply",
"values",
"of",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/FloatPoint.java#L203-L207 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.parseUnicodeIdentifier | public static String parseUnicodeIdentifier(String str, int[] pos) {
"""
Parse a Unicode identifier from the given string at the given
position. Return the identifier, or null if there is no
identifier.
@param str the string to parse
@param pos INPUT-OUPUT parameter. On INPUT, pos[0] is the
first character ... | java | public static String parseUnicodeIdentifier(String str, int[] pos) {
// assert(pos[0] < str.length());
StringBuilder buf = new StringBuilder();
int p = pos[0];
while (p < str.length()) {
int ch = Character.codePointAt(str, p);
if (buf.length() == 0) {
... | [
"public",
"static",
"String",
"parseUnicodeIdentifier",
"(",
"String",
"str",
",",
"int",
"[",
"]",
"pos",
")",
"{",
"// assert(pos[0] < str.length());",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"p",
"=",
"pos",
"[",
"0",
"]... | Parse a Unicode identifier from the given string at the given
position. Return the identifier, or null if there is no
identifier.
@param str the string to parse
@param pos INPUT-OUPUT parameter. On INPUT, pos[0] is the
first character to examine. It must be less than str.length(),
and it must not point to a whitespa... | [
"Parse",
"a",
"Unicode",
"identifier",
"from",
"the",
"given",
"string",
"at",
"the",
"given",
"position",
".",
"Return",
"the",
"identifier",
"or",
"null",
"if",
"there",
"is",
"no",
"identifier",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L1333-L1356 |
googleads/googleads-java-lib | examples/adwords_axis/src/main/java/adwords/axis/v201809/basicoperations/UpdateKeyword.java | UpdateKeyword.runExample | public static void runExample(
AdWordsServicesInterface adWordsServices,
AdWordsSession session,
Long adGroupId,
Long keywordId)
throws RemoteException {
"""
Runs the example.
@param adWordsServices the services factory.
@param session the session.
@param adGroupId the ID of the ... | java | public static void runExample(
AdWordsServicesInterface adWordsServices,
AdWordsSession session,
Long adGroupId,
Long keywordId)
throws RemoteException {
// Get the AdGroupCriterionService.
AdGroupCriterionServiceInterface adGroupCriterionService =
adWordsServices.get(sessi... | [
"public",
"static",
"void",
"runExample",
"(",
"AdWordsServicesInterface",
"adWordsServices",
",",
"AdWordsSession",
"session",
",",
"Long",
"adGroupId",
",",
"Long",
"keywordId",
")",
"throws",
"RemoteException",
"{",
"// Get the AdGroupCriterionService.",
"AdGroupCriterio... | Runs the example.
@param adWordsServices the services factory.
@param session the session.
@param adGroupId the ID of the ad group for the criterion.
@param keywordId the ID of the criterion to update.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API re... | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/basicoperations/UpdateKeyword.java#L139-L198 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/ChatChannelManager.java | ChatChannelManager.resolutionComplete | protected void resolutionComplete (ChatChannel channel, Set<Integer> parts) {
"""
This should be called when a channel's participant set has been resolved.
"""
// map the participants of our now resolved channel
ChannelInfo info = new ChannelInfo();
info.channel = channel;
info.... | java | protected void resolutionComplete (ChatChannel channel, Set<Integer> parts)
{
// map the participants of our now resolved channel
ChannelInfo info = new ChannelInfo();
info.channel = channel;
info.participants = parts;
_channels.put(channel, info);
// dispatch any pe... | [
"protected",
"void",
"resolutionComplete",
"(",
"ChatChannel",
"channel",
",",
"Set",
"<",
"Integer",
">",
"parts",
")",
"{",
"// map the participants of our now resolved channel",
"ChannelInfo",
"info",
"=",
"new",
"ChannelInfo",
"(",
")",
";",
"info",
".",
"channe... | This should be called when a channel's participant set has been resolved. | [
"This",
"should",
"be",
"called",
"when",
"a",
"channel",
"s",
"participant",
"set",
"has",
"been",
"resolved",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatChannelManager.java#L253-L265 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.3/src/com/ibm/ws/microprofile/config13/sources/OSGiConfigUtils.java | OSGiConfigUtils.getApplicationName | public static String getApplicationName(BundleContext bundleContext) {
"""
Get the j2ee name of the application. If the ComponentMetaData is available on the thread then that can be used, otherwise fallback
to asking the CDIService for the name ... the CDI context ID is the same as the j2ee name.
@param bundle... | java | public static String getApplicationName(BundleContext bundleContext) {
String applicationName = null;
if (FrameworkState.isValid()) {
ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
if (cmd == null) {
/... | [
"public",
"static",
"String",
"getApplicationName",
"(",
"BundleContext",
"bundleContext",
")",
"{",
"String",
"applicationName",
"=",
"null",
";",
"if",
"(",
"FrameworkState",
".",
"isValid",
"(",
")",
")",
"{",
"ComponentMetaData",
"cmd",
"=",
"ComponentMetaData... | Get the j2ee name of the application. If the ComponentMetaData is available on the thread then that can be used, otherwise fallback
to asking the CDIService for the name ... the CDI context ID is the same as the j2ee name.
@param bundleContext The bundle context to use when looking up the CDIService
@return the applic... | [
"Get",
"the",
"j2ee",
"name",
"of",
"the",
"application",
".",
"If",
"the",
"ComponentMetaData",
"is",
"available",
"on",
"the",
"thread",
"then",
"that",
"can",
"be",
"used",
"otherwise",
"fallback",
"to",
"asking",
"the",
"CDIService",
"for",
"the",
"name"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.3/src/com/ibm/ws/microprofile/config13/sources/OSGiConfigUtils.java#L64-L86 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfPKCS7.java | PdfPKCS7.loadCacertsKeyStore | public static KeyStore loadCacertsKeyStore(String provider) {
"""
Loads the default root certificates at <java.home>/lib/security/cacerts.
@param provider the provider or <code>null</code> for the default provider
@return a <CODE>KeyStore</CODE>
"""
File file = new File(System.getProperty("java... | java | public static KeyStore loadCacertsKeyStore(String provider) {
File file = new File(System.getProperty("java.home"), "lib");
file = new File(file, "security");
file = new File(file, "cacerts");
FileInputStream fin = null;
try {
fin = new FileInputStream(file);
... | [
"public",
"static",
"KeyStore",
"loadCacertsKeyStore",
"(",
"String",
"provider",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"System",
".",
"getProperty",
"(",
"\"java.home\"",
")",
",",
"\"lib\"",
")",
";",
"file",
"=",
"new",
"File",
"(",
"file",... | Loads the default root certificates at <java.home>/lib/security/cacerts.
@param provider the provider or <code>null</code> for the default provider
@return a <CODE>KeyStore</CODE> | [
"Loads",
"the",
"default",
"root",
"certificates",
"at",
"<",
";",
"java",
".",
"home>",
";",
"/",
"lib",
"/",
"security",
"/",
"cacerts",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfPKCS7.java#L786-L807 |
anotheria/moskito | moskito-integration/moskito-ehcache/src/main/java/net/anotheria/moskito/integration/ehcache/PeriodicStatsUpdater.java | PeriodicStatsUpdater.addTask | public static void addTask(final TimerTask task, final long delay, final long period) {
"""
Adds a new task.
@param task {@link java.util.TimerTask} to add
@param delay delay in milliseconds before task is to be executed.
@param period period of task execution starts in milliseconds.
"""
timer.... | java | public static void addTask(final TimerTask task, final long delay, final long period) {
timer.scheduleAtFixedRate(task, delay, period);
} | [
"public",
"static",
"void",
"addTask",
"(",
"final",
"TimerTask",
"task",
",",
"final",
"long",
"delay",
",",
"final",
"long",
"period",
")",
"{",
"timer",
".",
"scheduleAtFixedRate",
"(",
"task",
",",
"delay",
",",
"period",
")",
";",
"}"
] | Adds a new task.
@param task {@link java.util.TimerTask} to add
@param delay delay in milliseconds before task is to be executed.
@param period period of task execution starts in milliseconds. | [
"Adds",
"a",
"new",
"task",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-ehcache/src/main/java/net/anotheria/moskito/integration/ehcache/PeriodicStatsUpdater.java#L47-L49 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.getStringProperty | private static String getStringProperty(Function function, String propertyKey) {
"""
Return a string property of the function
@param function
@param propertyKey
@return
"""
Object value = function.getProperty(propertyKey);
return value instanceof String ? (String)value : "";
} | java | private static String getStringProperty(Function function, String propertyKey) {
Object value = function.getProperty(propertyKey);
return value instanceof String ? (String)value : "";
} | [
"private",
"static",
"String",
"getStringProperty",
"(",
"Function",
"function",
",",
"String",
"propertyKey",
")",
"{",
"Object",
"value",
"=",
"function",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"return",
"value",
"instanceof",
"String",
"?",
"(",
... | Return a string property of the function
@param function
@param propertyKey
@return | [
"Return",
"a",
"string",
"property",
"of",
"the",
"function"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L417-L420 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/reflect/ReflectionUtil.java | ReflectionUtil.getMethod | public static Method getMethod(final Class<?> clazz, final String methodName, Class<?>... parameterTypes) {
"""
循环向上转型, 获取对象的DeclaredMethod, 并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
匹配函数名+参数类型.
方法需要被多次调用时,先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
因为getMethod() 不能获取父类的private函数, 因此采用循环向... | java | public static Method getMethod(final Class<?> clazz, final String methodName, Class<?>... parameterTypes) {
Method method = MethodUtils.getMatchingMethod(clazz, methodName, parameterTypes);
if (method != null) {
makeAccessible(method);
}
return method;
} | [
"public",
"static",
"Method",
"getMethod",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"Method",
"method",
"=",
"MethodUtils",
".",
"getMatchingMethod",
... | 循环向上转型, 获取对象的DeclaredMethod, 并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
匹配函数名+参数类型.
方法需要被多次调用时,先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
因为getMethod() 不能获取父类的private函数, 因此采用循环向上的getDeclaredMethod(); | [
"循环向上转型",
"获取对象的DeclaredMethod",
"并强制设置为可访问",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/reflect/ReflectionUtil.java#L75-L81 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java | MetadataBuilder.addTags | public MetadataBuilder addTags(String tag, String... tags) {
"""
Add to the {@link Set} of tags by which this {@link RulesetMetadata} is classified.
<p>
Inherits from {@link RulesetMetadata#getTags()} if available.
"""
if (!StringUtils.isBlank(tag))
this.tags.add(tag.trim());
if ... | java | public MetadataBuilder addTags(String tag, String... tags)
{
if (!StringUtils.isBlank(tag))
this.tags.add(tag.trim());
if (tags != null)
{
for (String t : tags)
{
if (!StringUtils.isBlank(t))
this.tags.add(t.trim());
... | [
"public",
"MetadataBuilder",
"addTags",
"(",
"String",
"tag",
",",
"String",
"...",
"tags",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isBlank",
"(",
"tag",
")",
")",
"this",
".",
"tags",
".",
"add",
"(",
"tag",
".",
"trim",
"(",
")",
")",
";",... | Add to the {@link Set} of tags by which this {@link RulesetMetadata} is classified.
<p>
Inherits from {@link RulesetMetadata#getTags()} if available. | [
"Add",
"to",
"the",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java#L417-L432 |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/utils/AdminToolMenuUtils.java | AdminToolMenuUtils.getListItemClass | public String getListItemClass(MenuEntry activeMenu, MenuEntry actualEntry) {
"""
checks {@link #isActiveInMenuTree(String, MenuEntry)} and if the
actualEntry has sub entries and returns the html class name
@param activeMenuName
name of the active MenuEntry (set in controller)
@param actualEntry
current ite... | java | public String getListItemClass(MenuEntry activeMenu, MenuEntry actualEntry) {
if (LOGGER.isTraceEnabled())LOGGER.trace("[getListItemClass]" + actualEntry);
StringBuilder sb = new StringBuilder();
if (!CollectionUtils.isEmpty(actualEntry.getSubmenu()))
sb.append(CSS_TREEVIEW);
if (isActiveInMenuTree(activeMen... | [
"public",
"String",
"getListItemClass",
"(",
"MenuEntry",
"activeMenu",
",",
"MenuEntry",
"actualEntry",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isTraceEnabled",
"(",
")",
")",
"LOGGER",
".",
"trace",
"(",
"\"[getListItemClass]\"",
"+",
"actualEntry",
")",
";",
"... | checks {@link #isActiveInMenuTree(String, MenuEntry)} and if the
actualEntry has sub entries and returns the html class name
@param activeMenuName
name of the active MenuEntry (set in controller)
@param actualEntry
current iterated object
@return empty string, "active", "treeview", "treeview active" | [
"checks",
"{",
"@link",
"#isActiveInMenuTree",
"(",
"String",
"MenuEntry",
")",
"}",
"and",
"if",
"the",
"actualEntry",
"has",
"sub",
"entries",
"and",
"returns",
"the",
"html",
"class",
"name"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/utils/AdminToolMenuUtils.java#L101-L109 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java | LinkedConverter.setState | public int setState(boolean state, boolean bDisplayOption, int iMoveMode) {
"""
For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
""" // M... | java | public int setState(boolean state, boolean bDisplayOption, int iMoveMode)
{ // Must be overidden
if (this.getNextConverter() != null)
return this.getNextConverter().setState(state, bDisplayOption, iMoveMode);
else
return super.setState(state, bDisplayOption, iMoveMode);... | [
"public",
"int",
"setState",
"(",
"boolean",
"state",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"// Must be overidden",
"if",
"(",
"this",
".",
"getNextConverter",
"(",
")",
"!=",
"null",
")",
"return",
"this",
".",
"getNextConverter... | For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"For",
"binary",
"fields",
"set",
"the",
"current",
"state",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java#L250-L256 |
SeleniumJT/seleniumjt-core | src/main/java/com/jt/selenium/SeleniumJT.java | SeleniumJT.verifyImageSource | @LogExecTime
public void verifyImageSource(String locator, String src) {
"""
Verify that the src of the image [identified by it's id] is correct
@param locator
@param src
"""
jtImage.verifyImageSource(locator, src);
} | java | @LogExecTime
public void verifyImageSource(String locator, String src)
{
jtImage.verifyImageSource(locator, src);
} | [
"@",
"LogExecTime",
"public",
"void",
"verifyImageSource",
"(",
"String",
"locator",
",",
"String",
"src",
")",
"{",
"jtImage",
".",
"verifyImageSource",
"(",
"locator",
",",
"src",
")",
";",
"}"
] | Verify that the src of the image [identified by it's id] is correct
@param locator
@param src | [
"Verify",
"that",
"the",
"src",
"of",
"the",
"image",
"[",
"identified",
"by",
"it",
"s",
"id",
"]",
"is",
"correct"
] | train | https://github.com/SeleniumJT/seleniumjt-core/blob/8e972f69adc4846a3f1d7b8ca9c3f8d953a2d0f3/src/main/java/com/jt/selenium/SeleniumJT.java#L171-L175 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.getTableAliasForPath | private TableAlias getTableAliasForPath(String aPath, List hintClasses) {
"""
Answer the TableAlias for aPath
@param aPath
@param hintClasses
@return TableAlias, null if none
"""
return (TableAlias) m_pathToAlias.get(buildAliasKey(aPath, hintClasses));
} | java | private TableAlias getTableAliasForPath(String aPath, List hintClasses)
{
return (TableAlias) m_pathToAlias.get(buildAliasKey(aPath, hintClasses));
} | [
"private",
"TableAlias",
"getTableAliasForPath",
"(",
"String",
"aPath",
",",
"List",
"hintClasses",
")",
"{",
"return",
"(",
"TableAlias",
")",
"m_pathToAlias",
".",
"get",
"(",
"buildAliasKey",
"(",
"aPath",
",",
"hintClasses",
")",
")",
";",
"}"
] | Answer the TableAlias for aPath
@param aPath
@param hintClasses
@return TableAlias, null if none | [
"Answer",
"the",
"TableAlias",
"for",
"aPath"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1359-L1362 |
paymill/paymill-java | src/main/java/com/paymill/services/TransactionService.java | TransactionService.createWithTokenAndFee | public Transaction createWithTokenAndFee( String token, Integer amount, String currency, String description, Fee fee ) {
"""
Executes a {@link Transaction} with token for the given amount in the given currency.
@param token
Token generated by PAYMILL Bridge, which represents a credit card or direct debit.
@para... | java | public Transaction createWithTokenAndFee( String token, Integer amount, String currency, String description, Fee fee ) {
ValidationUtils.validatesToken( token );
ValidationUtils.validatesAmount( amount );
ValidationUtils.validatesCurrency( currency );
ValidationUtils.validatesFee( fee );
ParameterM... | [
"public",
"Transaction",
"createWithTokenAndFee",
"(",
"String",
"token",
",",
"Integer",
"amount",
",",
"String",
"currency",
",",
"String",
"description",
",",
"Fee",
"fee",
")",
"{",
"ValidationUtils",
".",
"validatesToken",
"(",
"token",
")",
";",
"Validatio... | Executes a {@link Transaction} with token for the given amount in the given currency.
@param token
Token generated by PAYMILL Bridge, which represents a credit card or direct debit.
@param amount
Amount (in cents) which will be charged.
@param currency
ISO 4217 formatted currency code.
@param description
A short descri... | [
"Executes",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/TransactionService.java#L161-L181 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.sendMessage | public void sendMessage(@NonNull final String conversationId, @NonNull final String body, @Nullable Callback<ComapiResult<MessageSentResponse>> callback) {
"""
Send message to the chanel.
@param conversationId ID of a conversation to send a message to.
@param body Message body to be send.
@param cal... | java | public void sendMessage(@NonNull final String conversationId, @NonNull final String body, @Nullable Callback<ComapiResult<MessageSentResponse>> callback) {
SessionData session = dataMgr.getSessionDAO().session();
adapter.adapt(sendMessage(conversationId, APIHelper.createMessage(conversationId, body, ses... | [
"public",
"void",
"sendMessage",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"NonNull",
"final",
"String",
"body",
",",
"@",
"Nullable",
"Callback",
"<",
"ComapiResult",
"<",
"MessageSentResponse",
">",
">",
"callback",
")",
"{",
"Sessi... | Send message to the chanel.
@param conversationId ID of a conversation to send a message to.
@param body Message body to be send.
@param callback Callback to deliver new session instance. | [
"Send",
"message",
"to",
"the",
"chanel",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L728-L731 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Translation.java | Translation.doTransform | @Override
protected void doTransform(ITransformable.Translate transformable, float comp) {
"""
Calculates the transformation.
@param transformable the transformable
@param comp the comp
"""
float fromX = reversed ? this.toX : this.fromX;
float toX = reversed ? this.fromX : this.toX;
float fromY = re... | java | @Override
protected void doTransform(ITransformable.Translate transformable, float comp)
{
float fromX = reversed ? this.toX : this.fromX;
float toX = reversed ? this.fromX : this.toX;
float fromY = reversed ? this.toY : this.fromY;
float toY = reversed ? this.fromY : this.toY;
float fromZ = reversed ? this... | [
"@",
"Override",
"protected",
"void",
"doTransform",
"(",
"ITransformable",
".",
"Translate",
"transformable",
",",
"float",
"comp",
")",
"{",
"float",
"fromX",
"=",
"reversed",
"?",
"this",
".",
"toX",
":",
"this",
".",
"fromX",
";",
"float",
"toX",
"=",
... | Calculates the transformation.
@param transformable the transformable
@param comp the comp | [
"Calculates",
"the",
"transformation",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Translation.java#L111-L122 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java | JawrApplicationConfigManager.areEquals | public boolean areEquals(String str1, String str2) {
"""
Returns true if the 2 string are equals.
@param str1
the first string
@param str2
the 2nd string
@return true if the 2 string are equals.
"""
return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
} | java | public boolean areEquals(String str1, String str2) {
return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
} | [
"public",
"boolean",
"areEquals",
"(",
"String",
"str1",
",",
"String",
"str2",
")",
"{",
"return",
"(",
"str1",
"==",
"null",
"&&",
"str2",
"==",
"null",
"||",
"str1",
"!=",
"null",
"&&",
"str2",
"!=",
"null",
"&&",
"str1",
".",
"equals",
"(",
"str2... | Returns true if the 2 string are equals.
@param str1
the first string
@param str2
the 2nd string
@return true if the 2 string are equals. | [
"Returns",
"true",
"if",
"the",
"2",
"string",
"are",
"equals",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java#L606-L609 |
xerial/snappy-java | src/main/java/org/xerial/snappy/Snappy.java | Snappy.isValidCompressedBuffer | public static boolean isValidCompressedBuffer(byte[] input, int offset, int length)
throws IOException {
"""
Returns true iff the contents of compressed buffer [offset,
offset+length) can be uncompressed successfully. Does not return the
uncompressed data. Takes time proportional to the input length,... | java | public static boolean isValidCompressedBuffer(byte[] input, int offset, int length)
throws IOException
{
if (input == null) {
throw new NullPointerException("input is null");
}
return impl.isValidCompressedBuffer(input, offset, length);
} | [
"public",
"static",
"boolean",
"isValidCompressedBuffer",
"(",
"byte",
"[",
"]",
"input",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
... | Returns true iff the contents of compressed buffer [offset,
offset+length) can be uncompressed successfully. Does not return the
uncompressed data. Takes time proportional to the input length, but is
usually at least a factor of four faster than actual decompression. | [
"Returns",
"true",
"iff",
"the",
"contents",
"of",
"compressed",
"buffer",
"[",
"offset",
"offset",
"+",
"length",
")",
"can",
"be",
"uncompressed",
"successfully",
".",
"Does",
"not",
"return",
"the",
"uncompressed",
"data",
".",
"Takes",
"time",
"proportiona... | train | https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/Snappy.java#L321-L328 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/resource/ClassPathResource.java | ClassPathResource.getInputStream | @Nullable
public static InputStream getInputStream (@Nonnull @Nonempty final String sPath,
@Nonnull final ClassLoader aClassLoader) {
"""
Get the input stream of the passed resource using the specified class
loader only.
@param sPath
The path to be resolved. May n... | java | @Nullable
public static InputStream getInputStream (@Nonnull @Nonempty final String sPath,
@Nonnull final ClassLoader aClassLoader)
{
final URL aURL = ClassLoaderHelper.getResource (aClassLoader, sPath);
return _getInputStream (sPath, aURL, (ClassLoader) null);
... | [
"@",
"Nullable",
"public",
"static",
"InputStream",
"getInputStream",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sPath",
",",
"@",
"Nonnull",
"final",
"ClassLoader",
"aClassLoader",
")",
"{",
"final",
"URL",
"aURL",
"=",
"ClassLoaderHelper",
".",
... | Get the input stream of the passed resource using the specified class
loader only.
@param sPath
The path to be resolved. May neither be <code>null</code> nor empty.
@param aClassLoader
The class loader to be used. May not be <code>null</code>.
@return <code>null</code> if the path could not be resolved using the
speci... | [
"Get",
"the",
"input",
"stream",
"of",
"the",
"passed",
"resource",
"using",
"the",
"specified",
"class",
"loader",
"only",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/resource/ClassPathResource.java#L250-L256 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java | ElemTemplateElement.setPrefixes | public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl)
throws TransformerException {
"""
Copy the namespace declarations from the NamespaceSupport object.
Take care to call resolveInheritedNamespaceDecls.
after all namespace declarations have been added.
@param nsSupport non-nul... | java | public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl)
throws TransformerException
{
Enumeration decls = nsSupport.getDeclaredPrefixes();
while (decls.hasMoreElements())
{
String prefix = (String) decls.nextElement();
if (null == m_declaredPrefixes)
m_... | [
"public",
"void",
"setPrefixes",
"(",
"NamespaceSupport",
"nsSupport",
",",
"boolean",
"excludeXSLDecl",
")",
"throws",
"TransformerException",
"{",
"Enumeration",
"decls",
"=",
"nsSupport",
".",
"getDeclaredPrefixes",
"(",
")",
";",
"while",
"(",
"decls",
".",
"h... | Copy the namespace declarations from the NamespaceSupport object.
Take care to call resolveInheritedNamespaceDecls.
after all namespace declarations have been added.
@param nsSupport non-null reference to NamespaceSupport from
the ContentHandler.
@param excludeXSLDecl true if XSLT namespaces should be ignored.
@throw... | [
"Copy",
"the",
"namespace",
"declarations",
"from",
"the",
"NamespaceSupport",
"object",
".",
"Take",
"care",
"to",
"call",
"resolveInheritedNamespaceDecls",
".",
"after",
"all",
"namespace",
"declarations",
"have",
"been",
"added",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java#L852-L875 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newObjectNotFoundException | public static ObjectNotFoundException newObjectNotFoundException(String message, Object... args) {
"""
Constructs and initializes a new {@link ObjectNotFoundException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ... | java | public static ObjectNotFoundException newObjectNotFoundException(String message, Object... args) {
return newObjectNotFoundException(null, message, args);
} | [
"public",
"static",
"ObjectNotFoundException",
"newObjectNotFoundException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newObjectNotFoundException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link ObjectNotFoundException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ObjectNotFoundException exception}.
@param args {@link Object[] arguments} used to replace format placeholders ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ObjectNotFoundException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L467-L469 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.