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 |
|---|---|---|---|---|---|---|---|---|---|---|
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/support/ConvertingPropertyEditorAdapter.java | ConvertingPropertyEditorAdapter.setAsText | @Override
public void setAsText(String text) throws IllegalArgumentException {
"""
Converts the given {@link String text} into an {@link Object}.
@param text {@link String} to convert.
@throws IllegalArgumentException if the given {@link String text}
cannot be {@link Converter#convert(Object) converted} int... | java | @Override
public void setAsText(String text) throws IllegalArgumentException {
try {
setValue(getConverter().convert(text));
}
catch (ConversionException cause) {
throw newIllegalArgumentException(cause, "Could not set text [%s] as value", text);
}
} | [
"@",
"Override",
"public",
"void",
"setAsText",
"(",
"String",
"text",
")",
"throws",
"IllegalArgumentException",
"{",
"try",
"{",
"setValue",
"(",
"getConverter",
"(",
")",
".",
"convert",
"(",
"text",
")",
")",
";",
"}",
"catch",
"(",
"ConversionException"... | Converts the given {@link String text} into an {@link Object}.
@param text {@link String} to convert.
@throws IllegalArgumentException if the given {@link String text}
cannot be {@link Converter#convert(Object) converted} into an {@link Object}.
@see org.cp.elements.data.conversion.Converter#convert(Object)
@see #getC... | [
"Converts",
"the",
"given",
"{",
"@link",
"String",
"text",
"}",
"into",
"an",
"{",
"@link",
"Object",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/support/ConvertingPropertyEditorAdapter.java#L91-L100 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java | PolicyNodeImpl.getPolicyNodes | private void getPolicyNodes(int depth, Set<PolicyNodeImpl> set) {
"""
Add all nodes at depth depth to set and return the Set.
Internal recursion helper.
"""
// if we've reached the desired depth, then return ourself
if (mDepth == depth) {
set.add(this);
} else {
... | java | private void getPolicyNodes(int depth, Set<PolicyNodeImpl> set) {
// if we've reached the desired depth, then return ourself
if (mDepth == depth) {
set.add(this);
} else {
for (PolicyNodeImpl node : mChildren) {
node.getPolicyNodes(depth, set);
... | [
"private",
"void",
"getPolicyNodes",
"(",
"int",
"depth",
",",
"Set",
"<",
"PolicyNodeImpl",
">",
"set",
")",
"{",
"// if we've reached the desired depth, then return ourself",
"if",
"(",
"mDepth",
"==",
"depth",
")",
"{",
"set",
".",
"add",
"(",
"this",
")",
... | Add all nodes at depth depth to set and return the Set.
Internal recursion helper. | [
"Add",
"all",
"nodes",
"at",
"depth",
"depth",
"to",
"set",
"and",
"return",
"the",
"Set",
".",
"Internal",
"recursion",
"helper",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L312-L321 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java | JBBPBitOutputStream.writeDouble | public void writeDouble(final double value, final JBBPByteOrder byteOrder) throws IOException {
"""
Write a double value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will... | java | public void writeDouble(final double value, final JBBPByteOrder byteOrder) throws IOException {
final long longValue = Double.doubleToLongBits(value);
if (byteOrder == JBBPByteOrder.BIG_ENDIAN) {
this.writeInt((int) (longValue >>> 32), byteOrder);
this.writeInt((int) longValue, byteOrder);
} els... | [
"public",
"void",
"writeDouble",
"(",
"final",
"double",
"value",
",",
"final",
"JBBPByteOrder",
"byteOrder",
")",
"throws",
"IOException",
"{",
"final",
"long",
"longValue",
"=",
"Double",
".",
"doubleToLongBits",
"(",
"value",
")",
";",
"if",
"(",
"byteOrder... | Write a double value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be thrown for transport errors
@see JBBPByteOrder#BIG_ENDIAN
@see JBBPByteOrder#LITTLE_ENDIAN
@since 1.4.0 | [
"Write",
"a",
"double",
"value",
"into",
"the",
"output",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java#L171-L180 |
jenkinsci/jenkins | core/src/main/java/hudson/diagnosis/OldDataMonitor.java | OldDataMonitor.doUpgrade | @RequirePOST
public HttpResponse doUpgrade(StaplerRequest req, StaplerResponse rsp) {
"""
Save all or some of the files to persist data in the new forms.
Remove those items from the data map.
"""
final String thruVerParam = req.getParameter("thruVer");
final VersionNumber thruVer = thruVer... | java | @RequirePOST
public HttpResponse doUpgrade(StaplerRequest req, StaplerResponse rsp) {
final String thruVerParam = req.getParameter("thruVer");
final VersionNumber thruVer = thruVerParam.equals("all") ? null : new VersionNumber(thruVerParam);
saveAndRemoveEntries(new Predicate<Map.Entry<Save... | [
"@",
"RequirePOST",
"public",
"HttpResponse",
"doUpgrade",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"{",
"final",
"String",
"thruVerParam",
"=",
"req",
".",
"getParameter",
"(",
"\"thruVer\"",
")",
";",
"final",
"VersionNumber",
"thruVer",... | Save all or some of the files to persist data in the new forms.
Remove those items from the data map. | [
"Save",
"all",
"or",
"some",
"of",
"the",
"files",
"to",
"persist",
"data",
"in",
"the",
"new",
"forms",
".",
"Remove",
"those",
"items",
"from",
"the",
"data",
"map",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/diagnosis/OldDataMonitor.java#L323-L337 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java | ProfileHelper.isTypedIdOf | public static boolean isTypedIdOf(final String id, final Class<? extends CommonProfile> clazz) {
"""
Indicate if the user identifier matches this kind of profile.
@param id user identifier
@param clazz profile class
@return if the user identifier matches this kind of profile
"""
if (id != null && ... | java | public static boolean isTypedIdOf(final String id, final Class<? extends CommonProfile> clazz) {
if (id != null && clazz != null) {
return id.startsWith(clazz.getName() + CommonProfile.SEPARATOR);
}
return false;
} | [
"public",
"static",
"boolean",
"isTypedIdOf",
"(",
"final",
"String",
"id",
",",
"final",
"Class",
"<",
"?",
"extends",
"CommonProfile",
">",
"clazz",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
"&&",
"clazz",
"!=",
"null",
")",
"{",
"return",
"id",
".",
... | Indicate if the user identifier matches this kind of profile.
@param id user identifier
@param clazz profile class
@return if the user identifier matches this kind of profile | [
"Indicate",
"if",
"the",
"user",
"identifier",
"matches",
"this",
"kind",
"of",
"profile",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java#L34-L39 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Join.java | Join.leftOuterJoin | @NonNull
public static On leftOuterJoin(@NonNull DataSource datasource) {
"""
Create a LEFT OUTER JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The On object used for specifying join ... | java | @NonNull
public static On leftOuterJoin(@NonNull DataSource datasource) {
if (datasource == null) {
throw new IllegalArgumentException("datasource cannot be null.");
}
return new On(Type.LEFT_OUTER, datasource);
} | [
"@",
"NonNull",
"public",
"static",
"On",
"leftOuterJoin",
"(",
"@",
"NonNull",
"DataSource",
"datasource",
")",
"{",
"if",
"(",
"datasource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"datasource cannot be null.\"",
")",
";",
"}... | Create a LEFT OUTER JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The On object used for specifying join conditions. | [
"Create",
"a",
"LEFT",
"OUTER",
"JOIN",
"component",
"with",
"the",
"given",
"data",
"source",
".",
"Use",
"the",
"returned",
"On",
"component",
"to",
"specify",
"join",
"conditions",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Join.java#L139-L145 |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/TransformationHandler.java | TransformationHandler.findTargetMethod | protected static Method findTargetMethod(final Method sourceMethod, Class<?> target) throws NoSuchElementException {
"""
tries to find a method that method in the class {@code target} with the same name and the same number of
arguments. It's assumed that the arguments can then be transformed.
@throws java.util... | java | protected static Method findTargetMethod(final Method sourceMethod, Class<?> target) throws NoSuchElementException {
return Iterables.find(Arrays.asList(target.getMethods()), new Predicate<Method>() {
@Override
public boolean apply(Method element) {
if (!sourceMethod.getN... | [
"protected",
"static",
"Method",
"findTargetMethod",
"(",
"final",
"Method",
"sourceMethod",
",",
"Class",
"<",
"?",
">",
"target",
")",
"throws",
"NoSuchElementException",
"{",
"return",
"Iterables",
".",
"find",
"(",
"Arrays",
".",
"asList",
"(",
"target",
"... | tries to find a method that method in the class {@code target} with the same name and the same number of
arguments. It's assumed that the arguments can then be transformed.
@throws java.util.NoSuchElementException
if no matching method can be found | [
"tries",
"to",
"find",
"a",
"method",
"that",
"method",
"in",
"the",
"class",
"{",
"@code",
"target",
"}",
"with",
"the",
"same",
"name",
"and",
"the",
"same",
"number",
"of",
"arguments",
".",
"It",
"s",
"assumed",
"that",
"the",
"arguments",
"can",
"... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/TransformationHandler.java#L69-L82 |
elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingConfiguration.java | LoggingConfiguration.setLevelFor | public static void setLevelFor(String pkg, String level) throws IllegalArgumentException {
"""
Set the logging level for a particular package/class.
@param pkg Package
@param level Level name
@throws IllegalArgumentException thrown when logger or level was not found
"""
Logger logr = Logger.getLogger(... | java | public static void setLevelFor(String pkg, String level) throws IllegalArgumentException {
Logger logr = Logger.getLogger(pkg);
if(logr == null) {
throw new IllegalArgumentException("Logger not found.");
}
// Can also throw an IllegalArgumentException
java.util.logging.Level lev = Level.parse(... | [
"public",
"static",
"void",
"setLevelFor",
"(",
"String",
"pkg",
",",
"String",
"level",
")",
"throws",
"IllegalArgumentException",
"{",
"Logger",
"logr",
"=",
"Logger",
".",
"getLogger",
"(",
"pkg",
")",
";",
"if",
"(",
"logr",
"==",
"null",
")",
"{",
"... | Set the logging level for a particular package/class.
@param pkg Package
@param level Level name
@throws IllegalArgumentException thrown when logger or level was not found | [
"Set",
"the",
"logging",
"level",
"for",
"a",
"particular",
"package",
"/",
"class",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingConfiguration.java#L273-L281 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.getXML | @SuppressWarnings( {
"""
Convert this value to a XML string.
@param This value's tag.
@param objValue The raw data value.
@return The XML string for this value.
""" "rawtypes", "unchecked" })
public static StringBuffer getXML(StringBuffer sbXML, String strParam, Object objValue)
{
Util.addStart... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static StringBuffer getXML(StringBuffer sbXML, String strParam, Object objValue)
{
Util.addStartTag(sbXML, strParam);
if (objValue instanceof Map)
{
Util.addXMLMap(sbXML, (Map)objValue);
}
else
{
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"StringBuffer",
"getXML",
"(",
"StringBuffer",
"sbXML",
",",
"String",
"strParam",
",",
"Object",
"objValue",
")",
"{",
"Util",
".",
"addStartTag",
"(",
"sbX... | Convert this value to a XML string.
@param This value's tag.
@param objValue The raw data value.
@return The XML string for this value. | [
"Convert",
"this",
"value",
"to",
"a",
"XML",
"string",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L318-L336 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.createFieldWithoutNorms | protected Field createFieldWithoutNorms(String fieldName, String internalValue, int propertyType) {
"""
Creates a field of name <code>fieldName</code> with the value of <code>
internalValue</code>. The created field is indexed without norms.
@param fieldName The name of the field to add
@param internalVal... | java | protected Field createFieldWithoutNorms(String fieldName, String internalValue, int propertyType)
{
if (indexFormatVersion.getVersion() >= IndexFormatVersion.V3.getVersion())
{
Field field =
new Field(FieldNames.PROPERTIES, new SingletonTokenStream(FieldNames.createNamedValue(fieldNa... | [
"protected",
"Field",
"createFieldWithoutNorms",
"(",
"String",
"fieldName",
",",
"String",
"internalValue",
",",
"int",
"propertyType",
")",
"{",
"if",
"(",
"indexFormatVersion",
".",
"getVersion",
"(",
")",
">=",
"IndexFormatVersion",
".",
"V3",
".",
"getVersion... | Creates a field of name <code>fieldName</code> with the value of <code>
internalValue</code>. The created field is indexed without norms.
@param fieldName The name of the field to add
@param internalValue The value for the field to add to the document.
@param propertyType the property type. | [
"Creates",
"a",
"field",
"of",
"name",
"<code",
">",
"fieldName<",
"/",
"code",
">",
"with",
"the",
"value",
"of",
"<code",
">",
"internalValue<",
"/",
"code",
">",
".",
"The",
"created",
"field",
"is",
"indexed",
"without",
"norms",
"."
] | 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#L708-L723 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.deleteByQuery | @Deprecated
public void deleteByQuery(Query query, RequestOptions requestOptions) throws AlgoliaException {
"""
Delete all objects matching a query
@param query the query string
@param requestOptions Options to pass to this request
@deprecated use deleteBy
"""
this.deleteByQuery(query, 1000... | java | @Deprecated
public void deleteByQuery(Query query, RequestOptions requestOptions) throws AlgoliaException {
this.deleteByQuery(query, 100000, requestOptions);
} | [
"@",
"Deprecated",
"public",
"void",
"deleteByQuery",
"(",
"Query",
"query",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"this",
".",
"deleteByQuery",
"(",
"query",
",",
"100000",
",",
"requestOptions",
")",
";",
"}"
] | Delete all objects matching a query
@param query the query string
@param requestOptions Options to pass to this request
@deprecated use deleteBy | [
"Delete",
"all",
"objects",
"matching",
"a",
"query"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L628-L631 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZonedDateTime.java | ZonedDateTime.ofInstant | public static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) {
"""
Obtains an instance of {@code ZonedDateTime} from the instant formed by combining
the local date-time and offset.
<p>
This creates a zoned date-time by {@link LocalDateTime#toInstant(ZoneOffset) combining}
... | java | public static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) {
Jdk8Methods.requireNonNull(localDateTime, "localDateTime");
Jdk8Methods.requireNonNull(offset, "offset");
Jdk8Methods.requireNonNull(zone, "zone");
return create(localDateTime.toEpochSeco... | [
"public",
"static",
"ZonedDateTime",
"ofInstant",
"(",
"LocalDateTime",
"localDateTime",
",",
"ZoneOffset",
"offset",
",",
"ZoneId",
"zone",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"localDateTime",
",",
"\"localDateTime\"",
")",
";",
"Jdk8Methods",
".",... | Obtains an instance of {@code ZonedDateTime} from the instant formed by combining
the local date-time and offset.
<p>
This creates a zoned date-time by {@link LocalDateTime#toInstant(ZoneOffset) combining}
the {@code LocalDateTime} and {@code ZoneOffset}.
This combination uniquely specifies an instant without ambiguity... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ZonedDateTime",
"}",
"from",
"the",
"instant",
"formed",
"by",
"combining",
"the",
"local",
"date",
"-",
"time",
"and",
"offset",
".",
"<p",
">",
"This",
"creates",
"a",
"zoned",
"date",
"-",
"time",
"by"... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/ZonedDateTime.java#L401-L406 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java | TemperatureConversion.convertToCelsius | public static double convertToCelsius (TemperatureScale from, double temperature) {
"""
Convert a temperature value from another temperature scale into the Celsius temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees centigrad... | java | public static double convertToCelsius (TemperatureScale from, double temperature) {
switch(from) {
case FARENHEIT:
return convertFarenheitToCelsius(temperature);
case CELSIUS:
return temperature;
case KELVIN:
return convertKel... | [
"public",
"static",
"double",
"convertToCelsius",
"(",
"TemperatureScale",
"from",
",",
"double",
"temperature",
")",
"{",
"switch",
"(",
"from",
")",
"{",
"case",
"FARENHEIT",
":",
"return",
"convertFarenheitToCelsius",
"(",
"temperature",
")",
";",
"case",
"CE... | Convert a temperature value from another temperature scale into the Celsius temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees centigrade | [
"Convert",
"a",
"temperature",
"value",
"from",
"another",
"temperature",
"scale",
"into",
"the",
"Celsius",
"temperature",
"scale",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java#L145-L160 |
toddfast/typeconverter | src/main/java/com/toddfast/util/convert/TypeConverter.java | TypeConverter.asInt | public static int asInt(Object value, int nullValue) {
"""
Return the value converted to an int
or the specified alternate value if the original value is null. Note,
this method still throws {@link IllegalArgumentException} if the value
is not null and could not be converted.
@param value
The value to be co... | java | public static int asInt(Object value, int nullValue) {
value=convert(Integer.class,value);
if (value!=null) {
return ((Integer)value).intValue();
}
else {
return nullValue;
}
} | [
"public",
"static",
"int",
"asInt",
"(",
"Object",
"value",
",",
"int",
"nullValue",
")",
"{",
"value",
"=",
"convert",
"(",
"Integer",
".",
"class",
",",
"value",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"(",
"(",
"Integer",
... | Return the value converted to an int
or the specified alternate value if the original value is null. Note,
this method still throws {@link IllegalArgumentException} if the value
is not null and could not be converted.
@param value
The value to be converted
@param nullValue
The value to be returned if {@link value} is ... | [
"Return",
"the",
"value",
"converted",
"to",
"an",
"int",
"or",
"the",
"specified",
"alternate",
"value",
"if",
"the",
"original",
"value",
"is",
"null",
".",
"Note",
"this",
"method",
"still",
"throws",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
"... | train | https://github.com/toddfast/typeconverter/blob/44efa352254faa49edaba5c5935389705aa12b90/src/main/java/com/toddfast/util/convert/TypeConverter.java#L525-L533 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.addElement | private void addElement(String key, String value) {
"""
Add the given key=value pair into storage. Both key and value must be
in lowercase form. If this key already exists, then this value will be
appended to the existing values.
@param key
@param value - if null then an empty string value is stored
"""
... | java | private void addElement(String key, String value) {
this.num_items++;
List<String> vals = this.values.get(key);
if (null == vals) {
vals = new LinkedList<String>();
}
if (null == value) {
vals.add("\"\"");
} else {
vals.add(value);
... | [
"private",
"void",
"addElement",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"num_items",
"++",
";",
"List",
"<",
"String",
">",
"vals",
"=",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",... | Add the given key=value pair into storage. Both key and value must be
in lowercase form. If this key already exists, then this value will be
appended to the existing values.
@param key
@param value - if null then an empty string value is stored | [
"Add",
"the",
"given",
"key",
"=",
"value",
"pair",
"into",
"storage",
".",
"Both",
"key",
"and",
"value",
"must",
"be",
"in",
"lowercase",
"form",
".",
"If",
"this",
"key",
"already",
"exists",
"then",
"this",
"value",
"will",
"be",
"appended",
"to",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L113-L128 |
libgdx/gdx-ai | gdx-ai/src/com/badlogic/gdx/ai/sched/LoadBalancingScheduler.java | LoadBalancingScheduler.addWithAutomaticPhasing | @Override
public void addWithAutomaticPhasing (Schedulable schedulable, int frequency) {
"""
Adds the {@code schedulable} to the list using the given {@code frequency} and a phase calculated by a dry run of the
scheduler.
@param schedulable the task to schedule
@param frequency the frequency
"""
// Calcu... | java | @Override
public void addWithAutomaticPhasing (Schedulable schedulable, int frequency) {
// Calculate the phase and add the schedulable to the list
add(schedulable, frequency, calculatePhase(frequency));
} | [
"@",
"Override",
"public",
"void",
"addWithAutomaticPhasing",
"(",
"Schedulable",
"schedulable",
",",
"int",
"frequency",
")",
"{",
"// Calculate the phase and add the schedulable to the list",
"add",
"(",
"schedulable",
",",
"frequency",
",",
"calculatePhase",
"(",
"freq... | Adds the {@code schedulable} to the list using the given {@code frequency} and a phase calculated by a dry run of the
scheduler.
@param schedulable the task to schedule
@param frequency the frequency | [
"Adds",
"the",
"{"
] | train | https://github.com/libgdx/gdx-ai/blob/2d1523a97193a45e18e11a4837c6800d08f177c5/gdx-ai/src/com/badlogic/gdx/ai/sched/LoadBalancingScheduler.java#L67-L71 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/listener/jms/ExternalEventMessageListener.java | ExternalEventMessageListener.onMessage | @Override
public void onMessage(Message message, Session session) throws JMSException {
"""
/*
<p>
Calls the ListenerHelper to process the event
and sends back a message to the reply queue
</p>
@see
org.springframework.jms.listener.SessionAwareMessageListener#onMessage
(javax.jms.Message, javax.jms.Se... | java | @Override
public void onMessage(Message message, Session session) throws JMSException {
StandardLogger logger = LoggerUtil.getStandardLogger();
try {
String txt = ((TextMessage) message).getText();
if (logger.isDebugEnabled()) {
logger.debug("JMS Spring Exter... | [
"@",
"Override",
"public",
"void",
"onMessage",
"(",
"Message",
"message",
",",
"Session",
"session",
")",
"throws",
"JMSException",
"{",
"StandardLogger",
"logger",
"=",
"LoggerUtil",
".",
"getStandardLogger",
"(",
")",
";",
"try",
"{",
"String",
"txt",
"=",
... | /*
<p>
Calls the ListenerHelper to process the event
and sends back a message to the reply queue
</p>
@see
org.springframework.jms.listener.SessionAwareMessageListener#onMessage
(javax.jms.Message, javax.jms.Session) | [
"/",
"*",
"<p",
">",
"Calls",
"the",
"ListenerHelper",
"to",
"process",
"the",
"event",
"and",
"sends",
"back",
"a",
"message",
"to",
"the",
"reply",
"queue",
"<",
"/",
"p",
">"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/listener/jms/ExternalEventMessageListener.java#L65-L103 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java | AbstractSearchStructure.computeNearestNeighbors | public Answer computeNearestNeighbors(int k, double[] queryVector) throws Exception {
"""
This method returns an {@link Answer} object, which contains the k nearest neighbors along with their
ids and distances from the query vector, ordered by lowest distance. The methods calls
{@link #computeNearestNeighborsInt... | java | public Answer computeNearestNeighbors(int k, double[] queryVector) throws Exception {
if (!loadIndexInMemory) {
throw new Exception("Cannot execute query because the index is not loaded in memory!");
}
long start = System.nanoTime();
BoundedPriorityQueue<Result> nnQueue = computeNearestNeighborsInternal... | [
"public",
"Answer",
"computeNearestNeighbors",
"(",
"int",
"k",
",",
"double",
"[",
"]",
"queryVector",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"loadIndexInMemory",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Cannot execute query because the index is not... | This method returns an {@link Answer} object, which contains the k nearest neighbors along with their
ids and distances from the query vector, ordered by lowest distance. The methods calls
{@link #computeNearestNeighborsInternal(int, double[])} and then performs name lookup.
@param k
The number of nearest neighbors to... | [
"This",
"method",
"returns",
"an",
"{",
"@link",
"Answer",
"}",
"object",
"which",
"contains",
"the",
"k",
"nearest",
"neighbors",
"along",
"with",
"their",
"ids",
"and",
"distances",
"from",
"the",
"query",
"vector",
"ordered",
"by",
"lowest",
"distance",
"... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java#L281-L291 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/complex/CmsDataViewValueAccessor.java | CmsDataViewValueAccessor.writeValueToEntity | private void writeValueToEntity(CmsDataViewValue val, CmsEntity entity) {
"""
Writes the value to the given entity.<p>
@param val the value
@param entity the entity
"""
String prefix = entity.getTypeName() + "/";
entity.setAttributeValue(prefix + CmsDataViewConstants.VALUE_ID, val.getId())... | java | private void writeValueToEntity(CmsDataViewValue val, CmsEntity entity) {
String prefix = entity.getTypeName() + "/";
entity.setAttributeValue(prefix + CmsDataViewConstants.VALUE_ID, val.getId());
entity.setAttributeValue(prefix + CmsDataViewConstants.VALUE_TITLE, val.getTitle());
entit... | [
"private",
"void",
"writeValueToEntity",
"(",
"CmsDataViewValue",
"val",
",",
"CmsEntity",
"entity",
")",
"{",
"String",
"prefix",
"=",
"entity",
".",
"getTypeName",
"(",
")",
"+",
"\"/\"",
";",
"entity",
".",
"setAttributeValue",
"(",
"prefix",
"+",
"CmsDataV... | Writes the value to the given entity.<p>
@param val the value
@param entity the entity | [
"Writes",
"the",
"value",
"to",
"the",
"given",
"entity",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/complex/CmsDataViewValueAccessor.java#L175-L182 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.extractMulti | public static String extractMulti(String regex, CharSequence content, String template) {
"""
从content中匹配出多个值并根据template生成新的字符串<br>
匹配结束后会删除匹配内容之前的内容(包括匹配内容)<br>
例如:<br>
content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5
@param regex 匹配正则字符串
@param content 被匹配的内容
@param template 生成内容模板,变量 $1... | java | public static String extractMulti(String regex, CharSequence content, String template) {
if (null == content || null == regex || null == template) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
return ext... | [
"public",
"static",
"String",
"extractMulti",
"(",
"String",
"regex",
",",
"CharSequence",
"content",
",",
"String",
"template",
")",
"{",
"if",
"(",
"null",
"==",
"content",
"||",
"null",
"==",
"regex",
"||",
"null",
"==",
"template",
")",
"{",
"return",
... | 从content中匹配出多个值并根据template生成新的字符串<br>
匹配结束后会删除匹配内容之前的内容(包括匹配内容)<br>
例如:<br>
content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5
@param regex 匹配正则字符串
@param content 被匹配的内容
@param template 生成内容模板,变量 $1 表示group1的内容,以此类推
@return 按照template拼接后的字符串 | [
"从content中匹配出多个值并根据template生成新的字符串<br",
">",
"匹配结束后会删除匹配内容之前的内容(包括匹配内容)<br",
">",
"例如:<br",
">",
"content",
"2013年5月",
"pattern",
"(",
".",
"*",
"?",
")",
"年",
"(",
".",
"*",
"?",
")",
"月",
"template:",
"$1",
"-",
"$2",
"return",
"2013",
"-",
"5"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L209-L217 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotateZYX | public Matrix4x3f rotateZYX(Vector3f angles) {
"""
Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.x</code> radians about the X axis.
<p>
When used with a right-handed coordinate... | java | public Matrix4x3f rotateZYX(Vector3f angles) {
return rotateZYX(angles.z, angles.y, angles.x);
} | [
"public",
"Matrix4x3f",
"rotateZYX",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateZYX",
"(",
"angles",
".",
"z",
",",
"angles",
".",
"y",
",",
"angles",
".",
"x",
")",
";",
"}"
] | Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.x</code> radians about the X axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"z<",
"/",
"code",
">",
"radians",
"about",
"the",
"Z",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L3617-L3619 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasStartedBy | public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter) {
"""
A factory method to create an instance of a start {@link WasStartedBy}
@param id
@param activity an identifier for the started <a href="http://www.w3.org/TR/prov-dm/#start.activity">a... | java | public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter) {
WasStartedBy res=newWasStartedBy(id,activity,trigger);
res.setStarter(starter);
return res;
} | [
"public",
"WasStartedBy",
"newWasStartedBy",
"(",
"QualifiedName",
"id",
",",
"QualifiedName",
"activity",
",",
"QualifiedName",
"trigger",
",",
"QualifiedName",
"starter",
")",
"{",
"WasStartedBy",
"res",
"=",
"newWasStartedBy",
"(",
"id",
",",
"activity",
",",
"... | A factory method to create an instance of a start {@link WasStartedBy}
@param id
@param activity an identifier for the started <a href="http://www.w3.org/TR/prov-dm/#start.activity">activity</a>
@param trigger an optional identifier for the <a href="http://www.w3.org/TR/prov-dm/#start.trigger">entity triggering</a> the... | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"a",
"start",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1517-L1521 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java | ModuleSummaryBuilder.buildModuleDescription | public void buildModuleDescription(XMLNode node, Content moduleContentTree) {
"""
Build the description for the module.
@param node the XML element that specifies which components to document
@param moduleContentTree the tree to which the module description will
be added
"""
if (!configuration.noc... | java | public void buildModuleDescription(XMLNode node, Content moduleContentTree) {
if (!configuration.nocomment) {
moduleWriter.addModuleDescription(moduleContentTree);
}
} | [
"public",
"void",
"buildModuleDescription",
"(",
"XMLNode",
"node",
",",
"Content",
"moduleContentTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"moduleWriter",
".",
"addModuleDescription",
"(",
"moduleContentTree",
")",
";",
"}",
... | Build the description for the module.
@param node the XML element that specifies which components to document
@param moduleContentTree the tree to which the module description will
be added | [
"Build",
"the",
"description",
"for",
"the",
"module",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java#L207-L211 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/MatchParserImpl.java | MatchParserImpl.BetweenPredicate | final public Selector BetweenPredicate() throws ParseException {
"""
BetweenPredicate ::= Expression ( <NOT> )? <BETWEEN> Expression <AND> Expression
"""
Selector expr1, expr2, expr3; boolean neg=false;
expr1 = Expression();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
ca... | java | final public Selector BetweenPredicate() throws ParseException {
Selector expr1, expr2, expr3; boolean neg=false;
expr1 = Expression();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NOT:
jj_consume_token(NOT);
neg = true;
break;
... | [
"final",
"public",
"Selector",
"BetweenPredicate",
"(",
")",
"throws",
"ParseException",
"{",
"Selector",
"expr1",
",",
"expr2",
",",
"expr3",
";",
"boolean",
"neg",
"=",
"false",
";",
"expr1",
"=",
"Expression",
"(",
")",
";",
"switch",
"(",
"(",
"jj_ntk"... | BetweenPredicate ::= Expression ( <NOT> )? <BETWEEN> Expression <AND> Expression | [
"BetweenPredicate",
"::",
"=",
"Expression",
"(",
"<NOT",
">",
")",
"?",
"<BETWEEN",
">",
"Expression",
"<AND",
">",
"Expression"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/MatchParserImpl.java#L521-L541 |
knightliao/disconf | disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java | ReloadingPropertyPlaceholderConfigurer.parseStringValue | protected String parseStringValue(String strVal, Properties props, Set visitedPlaceholders)
throws BeanDefinitionStoreException {
"""
对于被标记为动态的,进行 构造 property dependency
非动态的,则由原来的spring进行处理
@param strVal
@param props
@param visitedPlaceholders
@return
@throws BeanDefinitionStoreException
... | java | protected String parseStringValue(String strVal, Properties props, Set visitedPlaceholders)
throws BeanDefinitionStoreException {
DynamicProperty dynamic = null;
// replace reloading prefix and suffix by "normal" prefix and suffix.
// remember all the "dynamic" placeholders encount... | [
"protected",
"String",
"parseStringValue",
"(",
"String",
"strVal",
",",
"Properties",
"props",
",",
"Set",
"visitedPlaceholders",
")",
"throws",
"BeanDefinitionStoreException",
"{",
"DynamicProperty",
"dynamic",
"=",
"null",
";",
"// replace reloading prefix and suffix by ... | 对于被标记为动态的,进行 构造 property dependency
非动态的,则由原来的spring进行处理
@param strVal
@param props
@param visitedPlaceholders
@return
@throws BeanDefinitionStoreException | [
"对于被标记为动态的,进行",
"构造",
"property",
"dependency",
"非动态的,则由原来的spring进行处理"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/addons/properties/ReloadingPropertyPlaceholderConfigurer.java#L67-L98 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java | FileUtilsV2_2.copyDirectory | public static void copyDirectory(File srcDir, File destDir) throws IOException {
"""
Copies a whole directory to a new location preserving the file dates.
<p>
This method copies the specified directory and all its child
directories and files to the specified destination.
The destination is the new location and... | java | public static void copyDirectory(File srcDir, File destDir) throws IOException {
copyDirectory(srcDir, destDir, true);
} | [
"public",
"static",
"void",
"copyDirectory",
"(",
"File",
"srcDir",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"copyDirectory",
"(",
"srcDir",
",",
"destDir",
",",
"true",
")",
";",
"}"
] | Copies a whole directory to a new location preserving the file dates.
<p>
This method copies the specified directory and all its child
directories and files to the specified destination.
The destination is the new location and name of the directory.
<p>
The destination directory is created if it does not exist.
If the ... | [
"Copies",
"a",
"whole",
"directory",
"to",
"a",
"new",
"location",
"preserving",
"the",
"file",
"dates",
".",
"<p",
">",
"This",
"method",
"copies",
"the",
"specified",
"directory",
"and",
"all",
"its",
"child",
"directories",
"and",
"files",
"to",
"the",
... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java#L478-L480 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.getLength | public int getLength(ResidueNumber start, ResidueNumber end) {
"""
Calculates the number of atoms between two ResidueNumbers, inclusive. Both residues
must belong to the same chain.
@param start First residue
@param end Last residue
@return The number of atoms from A to B inclusive
@throws IllegalArgumentExce... | java | public int getLength(ResidueNumber start, ResidueNumber end) {
if( ! start.getChainName().equals(end.getChainName())) {
throw new IllegalArgumentException(String.format(
"Chains differ between %s and %s. Unable to calculate length.",
start,end));
}
Integer startPos = getPosition(start);
Integer end... | [
"public",
"int",
"getLength",
"(",
"ResidueNumber",
"start",
",",
"ResidueNumber",
"end",
")",
"{",
"if",
"(",
"!",
"start",
".",
"getChainName",
"(",
")",
".",
"equals",
"(",
"end",
".",
"getChainName",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Illega... | Calculates the number of atoms between two ResidueNumbers, inclusive. Both residues
must belong to the same chain.
@param start First residue
@param end Last residue
@return The number of atoms from A to B inclusive
@throws IllegalArgumentException if start and end are on different chains,
or if either of the residues ... | [
"Calculates",
"the",
"number",
"of",
"atoms",
"between",
"two",
"ResidueNumbers",
"inclusive",
".",
"Both",
"residues",
"must",
"belong",
"to",
"the",
"same",
"chain",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L238-L253 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/util/EnumUtils.java | EnumUtils.readEnum | public static <T extends Enum<T>> T readEnum(final DataInput in, final Class<T> enumType) throws IOException {
"""
Reads a value from the given enumeration from the specified input stream.
@param <T>
the type of the enumeration
@param in
the input stream to read from
@param enumType
the class of the enumer... | java | public static <T extends Enum<T>> T readEnum(final DataInput in, final Class<T> enumType) throws IOException {
if (!in.readBoolean()) {
return null;
}
return T.valueOf(enumType, StringRecord.readString(in));
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"readEnum",
"(",
"final",
"DataInput",
"in",
",",
"final",
"Class",
"<",
"T",
">",
"enumType",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"in",
".",
"readBoolean",
"(",... | Reads a value from the given enumeration from the specified input stream.
@param <T>
the type of the enumeration
@param in
the input stream to read from
@param enumType
the class of the enumeration
@return the value of the given enumeration read from the input stream
@throws IOException
thrown if any error occurred wh... | [
"Reads",
"a",
"value",
"from",
"the",
"given",
"enumeration",
"from",
"the",
"specified",
"input",
"stream",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/util/EnumUtils.java#L47-L54 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.compareFloatingPoint | public <T extends Number> void compareFloatingPoint(
Local<Integer> target, Local<T> a, Local<T> b, int nanValue) {
"""
Compare floats or doubles. This stores -1 in {@code target} if {@code
a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code
a > b}. This stores {@code nanValue} in... | java | public <T extends Number> void compareFloatingPoint(
Local<Integer> target, Local<T> a, Local<T> b, int nanValue) {
Rop rop;
if (nanValue == 1) {
rop = Rops.opCmpg(a.type.ropType);
} else if (nanValue == -1) {
rop = Rops.opCmpl(a.type.ropType);
} else ... | [
"public",
"<",
"T",
"extends",
"Number",
">",
"void",
"compareFloatingPoint",
"(",
"Local",
"<",
"Integer",
">",
"target",
",",
"Local",
"<",
"T",
">",
"a",
",",
"Local",
"<",
"T",
">",
"b",
",",
"int",
"nanValue",
")",
"{",
"Rop",
"rop",
";",
"if"... | Compare floats or doubles. This stores -1 in {@code target} if {@code
a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code
a > b}. This stores {@code nanValue} in {@code target} if either value
is {@code NaN}. | [
"Compare",
"floats",
"or",
"doubles",
".",
"This",
"stores",
"-",
"1",
"in",
"{"
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L560-L572 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.getLong | public static long getLong(@NotNull ServletRequest request, @NotNull String param) {
"""
Returns a request parameter as long.
@param request Request.
@param param Parameter name.
@return Parameter value or 0 if it does not exist or is not a number.
"""
return getLong(request, param, 0L);
} | java | public static long getLong(@NotNull ServletRequest request, @NotNull String param) {
return getLong(request, param, 0L);
} | [
"public",
"static",
"long",
"getLong",
"(",
"@",
"NotNull",
"ServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"param",
")",
"{",
"return",
"getLong",
"(",
"request",
",",
"param",
",",
"0L",
")",
";",
"}"
] | Returns a request parameter as long.
@param request Request.
@param param Parameter name.
@return Parameter value or 0 if it does not exist or is not a number. | [
"Returns",
"a",
"request",
"parameter",
"as",
"long",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L167-L169 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/utils/MpJwtAppSetupUtils.java | MpJwtAppSetupUtils.genericCreateArchiveWithJsps | public WebArchive genericCreateArchiveWithJsps(String baseWarName, List<String> classList) throws Exception {
"""
Create a new war with "standard" content for tests using these utils. Add the extra jsps that some apps need.
Finally add the classes that are specific to this war (they come from the classList passed... | java | public WebArchive genericCreateArchiveWithJsps(String baseWarName, List<String> classList) throws Exception {
try {
String warName = getWarName(baseWarName);
WebArchive newWar = genericCreateArchiveWithoutJsps(warName, classList);
addDefaultJspsForAppsToWar(warName, newWar);
... | [
"public",
"WebArchive",
"genericCreateArchiveWithJsps",
"(",
"String",
"baseWarName",
",",
"List",
"<",
"String",
">",
"classList",
")",
"throws",
"Exception",
"{",
"try",
"{",
"String",
"warName",
"=",
"getWarName",
"(",
"baseWarName",
")",
";",
"WebArchive",
"... | Create a new war with "standard" content for tests using these utils. Add the extra jsps that some apps need.
Finally add the classes that are specific to this war (they come from the classList passed in)
@param baseWarName - the base name of the war
@param classList - the list of classes specific to this war
@return ... | [
"Create",
"a",
"new",
"war",
"with",
"standard",
"content",
"for",
"tests",
"using",
"these",
"utils",
".",
"Add",
"the",
"extra",
"jsps",
"that",
"some",
"apps",
"need",
".",
"Finally",
"add",
"the",
"classes",
"that",
"are",
"specific",
"to",
"this",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/utils/MpJwtAppSetupUtils.java#L233-L243 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java | HubVirtualNetworkConnectionsInner.get | public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) {
"""
Retrieves the details of a HubVirtualNetworkConnection.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param connect... | java | public HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) {
return getWithServiceResponseAsync(resourceGroupName, virtualHubName, connectionName).toBlocking().single().body();
} | [
"public",
"HubVirtualNetworkConnectionInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"String",
"connectionName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualHubName",
",",
"connectionNam... | Retrieves the details of a HubVirtualNetworkConnection.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param connectionName The name of the vpn connection.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorExce... | [
"Retrieves",
"the",
"details",
"of",
"a",
"HubVirtualNetworkConnection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java#L85-L87 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartTitle.java | ChartTitle.getBoundsHint | private Rectangle2D getBoundsHint() {
"""
get the height of the chart title including the chart title padding
@return a Rectangle2D defining the height of the chart title including the chart title padding
"""
if (chart.getStyler().isChartTitleVisible() && chart.getTitle().length() > 0) {
Tex... | java | private Rectangle2D getBoundsHint() {
if (chart.getStyler().isChartTitleVisible() && chart.getTitle().length() > 0) {
TextLayout textLayout =
new TextLayout(
chart.getTitle(),
chart.getStyler().getChartTitleFont(),
new FontRenderContext(null, true,... | [
"private",
"Rectangle2D",
"getBoundsHint",
"(",
")",
"{",
"if",
"(",
"chart",
".",
"getStyler",
"(",
")",
".",
"isChartTitleVisible",
"(",
")",
"&&",
"chart",
".",
"getTitle",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"TextLayout",
"textLa... | get the height of the chart title including the chart title padding
@return a Rectangle2D defining the height of the chart title including the chart title padding | [
"get",
"the",
"height",
"of",
"the",
"chart",
"title",
"including",
"the",
"chart",
"title",
"padding"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/ChartTitle.java#L102-L122 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.replacePattern | public static String replacePattern(final String source, final String regex, final String replacement) {
"""
<p>Replaces each substring of the source String that matches the given regular expression with the given
replacement using the {@link Pattern#DOTALL} option. DOTALL is also known as single-line mode in Per... | java | public static String replacePattern(final String source, final String regex, final String replacement) {
if (source == null || regex == null || replacement == null) {
return source;
}
RegExp compile = RegExp.compile(regex, "gm");
String resultString = source.replace('\n', (ch... | [
"public",
"static",
"String",
"replacePattern",
"(",
"final",
"String",
"source",
",",
"final",
"String",
"regex",
",",
"final",
"String",
"replacement",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"regex",
"==",
"null",
"||",
"replacement",
"==",
"... | <p>Replaces each substring of the source String that matches the given regular expression with the given
replacement using the {@link Pattern#DOTALL} option. DOTALL is also known as single-line mode in Perl.</p>
This call is a {@code null} safe equivalent to:
<ul>
<li>{@code source.replaceAll("(?s)" + regex,... | [
"<p",
">",
"Replaces",
"each",
"substring",
"of",
"the",
"source",
"String",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"with",
"the",
"given",
"replacement",
"using",
"the",
"{",
"@link",
"Pattern#DOTALL",
"}",
"option",
".",
"DOTALL",
"is",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L5238-L5246 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/bucket/ReplicaReader.java | ReplicaReader.assembleRequests | private static Observable<BinaryRequest> assembleRequests(final ClusterFacade core, final String id,
final ReplicaMode type, final String bucket) {
"""
Helper method to assemble all possible/needed replica get requests.
The number of configured replicas is also loaded on demand for each request. In the ... | java | private static Observable<BinaryRequest> assembleRequests(final ClusterFacade core, final String id,
final ReplicaMode type, final String bucket) {
if (type != ReplicaMode.ALL) {
return Observable.just((BinaryRequest) new ReplicaGetRequest(id, bucket, (short) type.ordinal()));
}
... | [
"private",
"static",
"Observable",
"<",
"BinaryRequest",
">",
"assembleRequests",
"(",
"final",
"ClusterFacade",
"core",
",",
"final",
"String",
"id",
",",
"final",
"ReplicaMode",
"type",
",",
"final",
"String",
"bucket",
")",
"{",
"if",
"(",
"type",
"!=",
"... | Helper method to assemble all possible/needed replica get requests.
The number of configured replicas is also loaded on demand for each request. In the future, this can be
maybe optimized.
@param core the core reference.
@param id the id of the document to load from the replicas.
@param type the replica mode type.
@p... | [
"Helper",
"method",
"to",
"assemble",
"all",
"possible",
"/",
"needed",
"replica",
"get",
"requests",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/bucket/ReplicaReader.java#L159-L189 |
jenkinsci/github-plugin | src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java | GitHubRepositoryNameContributor.parseAssociatedNames | @Deprecated
public void parseAssociatedNames(AbstractProject<?, ?> job, Collection<GitHubRepositoryName> result) {
"""
Looks at the definition of {@link AbstractProject} and list up the related github repositories,
then puts them into the collection.
@deprecated Use {@link #parseAssociatedNames(Item, Colle... | java | @Deprecated
public void parseAssociatedNames(AbstractProject<?, ?> job, Collection<GitHubRepositoryName> result) {
parseAssociatedNames((Item) job, result);
} | [
"@",
"Deprecated",
"public",
"void",
"parseAssociatedNames",
"(",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"job",
",",
"Collection",
"<",
"GitHubRepositoryName",
">",
"result",
")",
"{",
"parseAssociatedNames",
"(",
"(",
"Item",
")",
"job",
",",
"result",
... | Looks at the definition of {@link AbstractProject} and list up the related github repositories,
then puts them into the collection.
@deprecated Use {@link #parseAssociatedNames(Item, Collection)} | [
"Looks",
"at",
"the",
"definition",
"of",
"{",
"@link",
"AbstractProject",
"}",
"and",
"list",
"up",
"the",
"related",
"github",
"repositories",
"then",
"puts",
"them",
"into",
"the",
"collection",
"."
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java#L42-L45 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler2.java | BreakpointMessageHandler2.handleMessageReceivedFromServer | public boolean handleMessageReceivedFromServer(Message aMessage, boolean onlyIfInScope) {
"""
Do not call if in {@link Mode#safe}.
@param aMessage
@param onlyIfInScope
@return False if message should be dropped.
"""
if (! isBreakpoint(aMessage, false, onlyIfInScope)) {
return true;
... | java | public boolean handleMessageReceivedFromServer(Message aMessage, boolean onlyIfInScope) {
if (! isBreakpoint(aMessage, false, onlyIfInScope)) {
return true;
}
// Do this outside of the semaphore loop so that the 'continue' button can apply to all queued break points
... | [
"public",
"boolean",
"handleMessageReceivedFromServer",
"(",
"Message",
"aMessage",
",",
"boolean",
"onlyIfInScope",
")",
"{",
"if",
"(",
"!",
"isBreakpoint",
"(",
"aMessage",
",",
"false",
",",
"onlyIfInScope",
")",
")",
"{",
"return",
"true",
";",
"}",
"// D... | Do not call if in {@link Mode#safe}.
@param aMessage
@param onlyIfInScope
@return False if message should be dropped. | [
"Do",
"not",
"call",
"if",
"in",
"{",
"@link",
"Mode#safe",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler2.java#L94-L114 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.listForResourceWithServiceResponseAsync | public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
"""
Gets role assignments for a... | java | public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
return listForResourceSingle... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"RoleAssignmentInner",
">",
">",
">",
"listForResourceWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"resourceProviderNamespace",
",",
"final",
"String",
"... | Gets role assignments for a resource.
@param resourceGroupName The name of the resource group.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath The parent resource identity.
@param resourceType The resource type of the resource.
@param resourceName The name of the reso... | [
"Gets",
"role",
"assignments",
"for",
"a",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L350-L362 |
JodaOrg/joda-time | src/main/java/org/joda/time/Seconds.java | Seconds.secondsBetween | public static Seconds secondsBetween(ReadablePartial start, ReadablePartial end) {
"""
Creates a <code>Seconds</code> representing the number of whole seconds
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalTime</code> o... | java | public static Seconds secondsBetween(ReadablePartial start, ReadablePartial end) {
if (start instanceof LocalTime && end instanceof LocalTime) {
Chronology chrono = DateTimeUtils.getChronology(start.getChronology());
int seconds = chrono.seconds().getDifference(
((L... | [
"public",
"static",
"Seconds",
"secondsBetween",
"(",
"ReadablePartial",
"start",
",",
"ReadablePartial",
"end",
")",
"{",
"if",
"(",
"start",
"instanceof",
"LocalTime",
"&&",
"end",
"instanceof",
"LocalTime",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils"... | Creates a <code>Seconds</code> representing the number of whole seconds
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalTime</code> objects.
@param start the start partial date, must not be null
@param end the end partial date... | [
"Creates",
"a",
"<code",
">",
"Seconds<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"seconds",
"between",
"the",
"two",
"specified",
"partial",
"datetimes",
".",
"<p",
">",
"The",
"two",
"partials",
"must",
"contain",
"the",
"same",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Seconds.java#L117-L126 |
lucee/Lucee | core/src/main/java/lucee/runtime/gateway/GatewayEngineImpl.java | GatewayEngineImpl.sendMessage | public String sendMessage(String gatewayId, Struct data) throws PageException, IOException {
"""
send the message to the gateway
@param gatewayId
@param data
@return
@throws PageException
"""
Gateway g = getGateway(gatewayId);
if (g.getState() != Gateway.RUNNING) throw new GatewayException("Gateway [" ... | java | public String sendMessage(String gatewayId, Struct data) throws PageException, IOException {
Gateway g = getGateway(gatewayId);
if (g.getState() != Gateway.RUNNING) throw new GatewayException("Gateway [" + gatewayId + "] is not running");
return g.sendMessage(data);
} | [
"public",
"String",
"sendMessage",
"(",
"String",
"gatewayId",
",",
"Struct",
"data",
")",
"throws",
"PageException",
",",
"IOException",
"{",
"Gateway",
"g",
"=",
"getGateway",
"(",
"gatewayId",
")",
";",
"if",
"(",
"g",
".",
"getState",
"(",
")",
"!=",
... | send the message to the gateway
@param gatewayId
@param data
@return
@throws PageException | [
"send",
"the",
"message",
"to",
"the",
"gateway"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/gateway/GatewayEngineImpl.java#L162-L166 |
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java | ApplicationWsDelegate.undeployAll | public void undeployAll( String applicationName, String instancePath )
throws ApplicationWsException {
"""
Undeploys several instances at once.
@param applicationName the application name
@param instancePath the path of the instance to undeploy (null for all the application instances)
@throws ApplicationWsExce... | java | public void undeployAll( String applicationName, String instancePath )
throws ApplicationWsException {
this.logger.finer( "Undeploying instances in " + applicationName + " from instance = " + instancePath );
WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "undeploy-all" )... | [
"public",
"void",
"undeployAll",
"(",
"String",
"applicationName",
",",
"String",
"instancePath",
")",
"throws",
"ApplicationWsException",
"{",
"this",
".",
"logger",
".",
"finer",
"(",
"\"Undeploying instances in \"",
"+",
"applicationName",
"+",
"\" from instance = \"... | Undeploys several instances at once.
@param applicationName the application name
@param instancePath the path of the instance to undeploy (null for all the application instances)
@throws ApplicationWsException if something went wrong | [
"Undeploys",
"several",
"instances",
"at",
"once",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java#L177-L192 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java | ByteBuffer.indexOf | public int indexOf(byte[] bytes, int offset) {
"""
Returns the index within this buffer of the first occurrence of the
specified bytes after the offset. The bytes to search for must have a
size lower than or equal to the current buffer size. This method will
return -1 if the bytes are not contained within this ... | java | public int indexOf(byte[] bytes, int offset) {
// make sure we're not checking against any byte arrays of length 0
if (bytes.length == 0 || size() == 0) {
// a match is not possible
return -1;
}
// make sure the offset won't cause us to read past the end ... | [
"public",
"int",
"indexOf",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"// make sure we're not checking against any byte arrays of length 0",
"if",
"(",
"bytes",
".",
"length",
"==",
"0",
"||",
"size",
"(",
")",
"==",
"0",
")",
"{",
"// ... | Returns the index within this buffer of the first occurrence of the
specified bytes after the offset. The bytes to search for must have a
size lower than or equal to the current buffer size. This method will
return -1 if the bytes are not contained within this byte buffer.
@param bytes The byte array to search for
@par... | [
"Returns",
"the",
"index",
"within",
"this",
"buffer",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"bytes",
"after",
"the",
"offset",
".",
"The",
"bytes",
"to",
"search",
"for",
"must",
"have",
"a",
"size",
"lower",
"than",
"or",
"equal",... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java#L921-L948 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_pci_GET | public ArrayList<OvhRtmPci> serviceName_statistics_pci_GET(String serviceName) throws IOException {
"""
Get server PCI devices informations
REST: GET /dedicated/server/{serviceName}/statistics/pci
@param serviceName [required] The internal name of your dedicated server
"""
String qPath = "/dedicated/serv... | java | public ArrayList<OvhRtmPci> serviceName_statistics_pci_GET(String serviceName) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/pci";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t8);
} | [
"public",
"ArrayList",
"<",
"OvhRtmPci",
">",
"serviceName_statistics_pci_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/statistics/pci\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"... | Get server PCI devices informations
REST: GET /dedicated/server/{serviceName}/statistics/pci
@param serviceName [required] The internal name of your dedicated server | [
"Get",
"server",
"PCI",
"devices",
"informations"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1277-L1282 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java | MessageBundleScriptCreator.updateProperties | public void updateProperties(ResourceBundle bundle, Properties props, Charset charset) {
"""
Loads the message resource bundles specified and uses a
BundleStringJasonifier to generate the properties.
@param bundle
the bundle
@param props
the properties
@param charset
the charset
"""
Enumeration<Str... | java | public void updateProperties(ResourceBundle bundle, Properties props, Charset charset) {
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
if (matchesFilter(key)) {
String value = bundle.getString(key);
props.put(key, value);
}
}
} | [
"public",
"void",
"updateProperties",
"(",
"ResourceBundle",
"bundle",
",",
"Properties",
"props",
",",
"Charset",
"charset",
")",
"{",
"Enumeration",
"<",
"String",
">",
"keys",
"=",
"bundle",
".",
"getKeys",
"(",
")",
";",
"while",
"(",
"keys",
".",
"has... | Loads the message resource bundles specified and uses a
BundleStringJasonifier to generate the properties.
@param bundle
the bundle
@param props
the properties
@param charset
the charset | [
"Loads",
"the",
"message",
"resource",
"bundles",
"specified",
"and",
"uses",
"a",
"BundleStringJasonifier",
"to",
"generate",
"the",
"properties",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java#L234-L246 |
RestComm/sip-servlets | sip-servlets-application-router/src/main/java/org/mobicents/servlet/sip/router/DefaultApplicationRouterParser.java | DefaultApplicationRouterParser.parseSipApplicationRouterInfos | private List<? extends SipApplicationRouterInfo> parseSipApplicationRouterInfos(String sipApplicationRouterInfosStringified)
throws ParseException {
"""
Parse a string corresponding to one or more definition of SipApplicationRouterInfo ex : ("SimpleSipServlet", "DAR:From",
"ORIGINATING", "", "NO_ROUT... | java | private List<? extends SipApplicationRouterInfo> parseSipApplicationRouterInfos(String sipApplicationRouterInfosStringified)
throws ParseException {
List<DefaultSipApplicationRouterInfo> sipApplicationRouterInfos = new ArrayList<DefaultSipApplicationRouterInfo>();
while (sipApplicationRou... | [
"private",
"List",
"<",
"?",
"extends",
"SipApplicationRouterInfo",
">",
"parseSipApplicationRouterInfos",
"(",
"String",
"sipApplicationRouterInfosStringified",
")",
"throws",
"ParseException",
"{",
"List",
"<",
"DefaultSipApplicationRouterInfo",
">",
"sipApplicationRouterInfo... | Parse a string corresponding to one or more definition of SipApplicationRouterInfo ex : ("SimpleSipServlet", "DAR:From",
"ORIGINATING", "", "NO_ROUTE", "0"), ("SimpleSipServlet", "DAR:To", "TERMINATING", "", "NO_ROUTE", "1") and return the
corresponding object list
@param sipApplicationRouterInfosStringified the strin... | [
"Parse",
"a",
"string",
"corresponding",
"to",
"one",
"or",
"more",
"definition",
"of",
"SipApplicationRouterInfo",
"ex",
":",
"(",
"SimpleSipServlet",
"DAR",
":",
"From",
"ORIGINATING",
"NO_ROUTE",
"0",
")",
"(",
"SimpleSipServlet",
"DAR",
":",
"To",
"TERMINATI... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-application-router/src/main/java/org/mobicents/servlet/sip/router/DefaultApplicationRouterParser.java#L186-L219 |
dadoonet/fscrawler | framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/MetaFileHandler.java | MetaFileHandler.removeFile | protected void removeFile(String subdir, String filename) throws IOException {
"""
Remove a file from ~/.fscrawler/{subdir} dir
@param subdir subdir where we can read the file (null if we read in the root dir)
@param filename filename
@throws IOException in case of error while reading
"""
Path dir =... | java | protected void removeFile(String subdir, String filename) throws IOException {
Path dir = root;
if (subdir != null) {
dir = dir.resolve(subdir);
}
Files.deleteIfExists(dir.resolve(filename));
} | [
"protected",
"void",
"removeFile",
"(",
"String",
"subdir",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"Path",
"dir",
"=",
"root",
";",
"if",
"(",
"subdir",
"!=",
"null",
")",
"{",
"dir",
"=",
"dir",
".",
"resolve",
"(",
"subdir",
")... | Remove a file from ~/.fscrawler/{subdir} dir
@param subdir subdir where we can read the file (null if we read in the root dir)
@param filename filename
@throws IOException in case of error while reading | [
"Remove",
"a",
"file",
"from",
"~",
"/",
".",
"fscrawler",
"/",
"{",
"subdir",
"}",
"dir"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/MetaFileHandler.java#L83-L89 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.setFieldValue | public static void setFieldValue(final Object object, final String fieldName, final Object value) {
"""
Changing the value of a given field.
@param object
-- target object of injection
@param fieldName
-- name of field whose value is to be set
@param value
-- object that is injected
"""
final ... | java | public static void setFieldValue(final Object object, final String fieldName, final Object value) {
final boolean success = new DerivedClassIterator(object.getClass()) {
@Override
protected boolean handleClass(final Class<?> clazz) {
try {
setFieldVa... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"value",
")",
"{",
"final",
"boolean",
"success",
"=",
"new",
"DerivedClassIterator",
"(",
"object",
".",
"getClass",
"(... | Changing the value of a given field.
@param object
-- target object of injection
@param fieldName
-- name of field whose value is to be set
@param value
-- object that is injected | [
"Changing",
"the",
"value",
"of",
"a",
"given",
"field",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L201-L221 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java | PatchOperationTarget.createStandalone | public static final PatchOperationTarget createStandalone(final ModelControllerClient controllerClient) {
"""
Create a standalone target.
@param controllerClient the connected controller client to a standalone instance.
@return the remote target
"""
final PathAddress address = PathAddress.EMPTY_ADD... | java | public static final PatchOperationTarget createStandalone(final ModelControllerClient controllerClient) {
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(CORE_SERVICES);
return new RemotePatchOperationTarget(address, controllerClient);
} | [
"public",
"static",
"final",
"PatchOperationTarget",
"createStandalone",
"(",
"final",
"ModelControllerClient",
"controllerClient",
")",
"{",
"final",
"PathAddress",
"address",
"=",
"PathAddress",
".",
"EMPTY_ADDRESS",
".",
"append",
"(",
"CORE_SERVICES",
")",
";",
"r... | Create a standalone target.
@param controllerClient the connected controller client to a standalone instance.
@return the remote target | [
"Create",
"a",
"standalone",
"target",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L87-L90 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newPushButton | public static PushButton newPushButton (Image defaultImage, Image overImage,
Image downImage, ClickHandler onClick) {
"""
Creates a PushButton with default(up), mouseover and mousedown states.
"""
PushButton button = new PushButton(defaultImage, downImage);
... | java | public static PushButton newPushButton (Image defaultImage, Image overImage,
Image downImage, ClickHandler onClick)
{
PushButton button = new PushButton(defaultImage, downImage);
maybeAddClickHandler(button, onClick);
button.getUpHoveringFace().set... | [
"public",
"static",
"PushButton",
"newPushButton",
"(",
"Image",
"defaultImage",
",",
"Image",
"overImage",
",",
"Image",
"downImage",
",",
"ClickHandler",
"onClick",
")",
"{",
"PushButton",
"button",
"=",
"new",
"PushButton",
"(",
"defaultImage",
",",
"downImage"... | Creates a PushButton with default(up), mouseover and mousedown states. | [
"Creates",
"a",
"PushButton",
"with",
"default",
"(",
"up",
")",
"mouseover",
"and",
"mousedown",
"states",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L405-L412 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java | AdvancedRecyclerArrayAdapter.replaceItem | public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
"""
replaces the old with the new item. The new item will not be added when the old one is not
found.
@param oldObject will be removed
@param newObject is added only when hte old item is removed
"""
synchronized (mLo... | java | public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
synchronized (mLock) {
final int position = getPosition(oldObject);
if (position == -1) {
// not found, don't replace
return;
}
mObjects.remove(posit... | [
"public",
"void",
"replaceItem",
"(",
"@",
"NonNull",
"final",
"T",
"oldObject",
",",
"@",
"NonNull",
"final",
"T",
"newObject",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"final",
"int",
"position",
"=",
"getPosition",
"(",
"oldObject",
")",
";",
... | replaces the old with the new item. The new item will not be added when the old one is not
found.
@param oldObject will be removed
@param newObject is added only when hte old item is removed | [
"replaces",
"the",
"old",
"with",
"the",
"new",
"item",
".",
"The",
"new",
"item",
"will",
"not",
"be",
"added",
"when",
"the",
"old",
"one",
"is",
"not",
"found",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java#L283-L308 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java | XMLSerializer.startDocument | public void startDocument(String encoding, Boolean standalone) throws IOException {
"""
Start document.
@param encoding the encoding
@param standalone the standalone
@throws IOException Signals that an I/O exception has occurred.
"""
@SuppressWarnings("unused")
char apos = attributeUseApostrophe ? '\'... | java | public void startDocument(String encoding, Boolean standalone) throws IOException {
@SuppressWarnings("unused")
char apos = attributeUseApostrophe ? '\'' : '"';
if (attributeUseApostrophe) {
out.write("<?xml version='1.0'");
} else {
out.write("<?xml version=\"1.0\"");
}
if (encoding != null) {
out... | [
"public",
"void",
"startDocument",
"(",
"String",
"encoding",
",",
"Boolean",
"standalone",
")",
"throws",
"IOException",
"{",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"char",
"apos",
"=",
"attributeUseApostrophe",
"?",
"'",
"'",
":",
"'",
"'",
";",
... | Start document.
@param encoding the encoding
@param standalone the standalone
@throws IOException Signals that an I/O exception has occurred. | [
"Start",
"document",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L539-L570 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.multTransAB | public static void multTransAB(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. ... | java | public static void multTransAB(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c )
{
if( a.numCols >= EjmlParameters.CMULT_TRANAB_COLUMN_SWITCH ) {
MatrixMatrixMult_ZDRM.multTransAB_aux(a, b, c, null);
} else {
MatrixMatrixMult_ZDRM.multTransAB(a, b, c);
}
} | [
"public",
"static",
"void",
"multTransAB",
"(",
"ZMatrixRMaj",
"a",
",",
"ZMatrixRMaj",
"b",
",",
"ZMatrixRMaj",
"c",
")",
"{",
"if",
"(",
"a",
".",
"numCols",
">=",
"EjmlParameters",
".",
"CMULT_TRANAB_COLUMN_SWITCH",
")",
"{",
"MatrixMatrixMult_ZDRM",
".",
"... | <p>
Performs the following operation:<br>
<br>
c = a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c W... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"&sum",
";",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L538-L545 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/KernelPoints.java | KernelPoints.setErrorTolerance | public void setErrorTolerance(double errorTolerance) {
"""
Sets the error tolerance used for projection maintenance strategies such
as {@link KernelPoint.BudgetStrategy#PROJECTION}
@param errorTolerance the error tolerance in [0, 1]
"""
if(Double.isNaN(errorTolerance) || errorTolerance < 0 || errorTo... | java | public void setErrorTolerance(double errorTolerance)
{
if(Double.isNaN(errorTolerance) || errorTolerance < 0 || errorTolerance > 1)
throw new IllegalArgumentException("Error tolerance must be in [0, 1], not " + errorTolerance);
this.errorTolerance = errorTolerance;
for(KernelPoin... | [
"public",
"void",
"setErrorTolerance",
"(",
"double",
"errorTolerance",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"errorTolerance",
")",
"||",
"errorTolerance",
"<",
"0",
"||",
"errorTolerance",
">",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
... | Sets the error tolerance used for projection maintenance strategies such
as {@link KernelPoint.BudgetStrategy#PROJECTION}
@param errorTolerance the error tolerance in [0, 1] | [
"Sets",
"the",
"error",
"tolerance",
"used",
"for",
"projection",
"maintenance",
"strategies",
"such",
"as",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/KernelPoints.java#L128-L135 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java | GerritHandler.notifyListener | private void notifyListener(GerritEventListener listener, GerritEvent event) {
"""
Sub method of {@link #notifyListeners(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent) }.
This is where most of the reflection magic in the event notification is done.
@param listener the listener to notify
@param even... | java | private void notifyListener(GerritEventListener listener, GerritEvent event) {
logger.trace("Notifying listener {} of event {}", listener, event);
try {
logger.trace("Reflecting closest method");
Method method = listener.getClass().getMethod("gerritEvent", event.getClass());
... | [
"private",
"void",
"notifyListener",
"(",
"GerritEventListener",
"listener",
",",
"GerritEvent",
"event",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Notifying listener {} of event {}\"",
",",
"listener",
",",
"event",
")",
";",
"try",
"{",
"logger",
".",
"trace",
... | Sub method of {@link #notifyListeners(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent) }.
This is where most of the reflection magic in the event notification is done.
@param listener the listener to notify
@param event the event. | [
"Sub",
"method",
"of",
"{",
"@link",
"#notifyListeners",
"(",
"com",
".",
"sonymobile",
".",
"tools",
".",
"gerrit",
".",
"gerritevents",
".",
"dto",
".",
"GerritEvent",
")",
"}",
".",
"This",
"is",
"where",
"most",
"of",
"the",
"reflection",
"magic",
"i... | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java#L491-L514 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorCircleHexagonalGrid.java | CalibrationDetectorCircleHexagonalGrid.createLayout | public static List<Point2D_F64> createLayout( int numRows , int numCols , double centerDistance ) {
"""
Specifies the physical location of each point on the 2D calibration plane. The fiducial is centered on the
coordinate system
@param numRows Number of rows
@param numCols Number of columns
@param centerDista... | java | public static List<Point2D_F64> createLayout( int numRows , int numCols , double centerDistance ) {
List<Point2D_F64> ret = new ArrayList<>();
double spaceX = centerDistance/2.0;
double spaceY = centerDistance*Math.sin(UtilAngle.radian(60));
double width = (numCols-1)*spaceX;
double height = (numRows-1)*sp... | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"createLayout",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"double",
"centerDistance",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"double",
... | Specifies the physical location of each point on the 2D calibration plane. The fiducial is centered on the
coordinate system
@param numRows Number of rows
@param numCols Number of columns
@param centerDistance Space between each circle's center along x and y axis
@return 2D locations | [
"Specifies",
"the",
"physical",
"location",
"of",
"each",
"point",
"on",
"the",
"2D",
"calibration",
"plane",
".",
"The",
"fiducial",
"is",
"centered",
"on",
"the",
"coordinate",
"system"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorCircleHexagonalGrid.java#L146-L165 |
google/closure-templates | java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java | TranslateToPyExprVisitor.genCodeForFieldAccess | private String genCodeForFieldAccess(
ExprNode node, SoyType baseType, String containerExpr, String fieldName) {
"""
Generates the code for a field name access, e.g. ".foo" or "['bar']".
@param node the field access source node
@param baseType the type of the object that contains the field
@param contai... | java | private String genCodeForFieldAccess(
ExprNode node, SoyType baseType, String containerExpr, String fieldName) {
if (baseType != null && baseType.getKind() == SoyType.Kind.PROTO) {
errorReporter.report(node.getSourceLocation(), PROTO_ACCESS_NOT_SUPPORTED);
return ".ERROR";
}
return genCode... | [
"private",
"String",
"genCodeForFieldAccess",
"(",
"ExprNode",
"node",
",",
"SoyType",
"baseType",
",",
"String",
"containerExpr",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"baseType",
"!=",
"null",
"&&",
"baseType",
".",
"getKind",
"(",
")",
"==",
"S... | Generates the code for a field name access, e.g. ".foo" or "['bar']".
@param node the field access source node
@param baseType the type of the object that contains the field
@param containerExpr an expression that evaluates to the container of the named field. This
expression may have any operator precedence that bind... | [
"Generates",
"the",
"code",
"for",
"a",
"field",
"name",
"access",
"e",
".",
"g",
".",
".",
"foo",
"or",
"[",
"bar",
"]",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L625-L632 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java | AbstractSession.ensureTransmittable | protected void ensureTransmittable(String activityName, boolean only) throws IOException {
"""
Ensure the session is transmittable. If the session not transmittable
then an exception thrown.
@param activityName is the activity name.
@param only set to <tt>true</tt> if you want to ensure transmittable only
(t... | java | protected void ensureTransmittable(String activityName, boolean only) throws IOException {
// TODO uudashr: do we have to use another exception for this checking?
SessionState currentState = getSessionState();
if (!currentState.isTransmittable() || (only && currentState.isReceivable())) {
... | [
"protected",
"void",
"ensureTransmittable",
"(",
"String",
"activityName",
",",
"boolean",
"only",
")",
"throws",
"IOException",
"{",
"// TODO uudashr: do we have to use another exception for this checking?",
"SessionState",
"currentState",
"=",
"getSessionState",
"(",
")",
"... | Ensure the session is transmittable. If the session not transmittable
then an exception thrown.
@param activityName is the activity name.
@param only set to <tt>true</tt> if you want to ensure transmittable only
(transceive will not pass), otherwise set to <tt>false</tt>.
@throws IOException if the session not transmi... | [
"Ensure",
"the",
"session",
"is",
"transmittable",
".",
"If",
"the",
"session",
"not",
"transmittable",
"then",
"an",
"exception",
"thrown",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java#L439-L445 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java | HttpTools.getRequest | public String getRequest(final URL url) throws MovieDbException {
"""
GET data from the URL
@param url URL to use in the request
@return String content
@throws MovieDbException exception
"""
try {
HttpGet httpGet = new HttpGet(url.toURI());
httpGet.addHeader(HttpHeaders.ACC... | java | public String getRequest(final URL url) throws MovieDbException {
try {
HttpGet httpGet = new HttpGet(url.toURI());
httpGet.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON);
DigestedResponse response = DigestedResponseReader.requestContent(httpClient, httpGet, CHARSET);
... | [
"public",
"String",
"getRequest",
"(",
"final",
"URL",
"url",
")",
"throws",
"MovieDbException",
"{",
"try",
"{",
"HttpGet",
"httpGet",
"=",
"new",
"HttpGet",
"(",
"url",
".",
"toURI",
"(",
")",
")",
";",
"httpGet",
".",
"addHeader",
"(",
"HttpHeaders",
... | GET data from the URL
@param url URL to use in the request
@return String content
@throws MovieDbException exception | [
"GET",
"data",
"from",
"the",
"URL"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L66-L87 |
arnaudroger/SimpleFlatMapper | sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java | DiscriminatorJdbcBuilder.when | public DiscriminatorJdbcSubBuilder when(String value, Type type) {
"""
Add a discriminator value with its associated type.
@param value the value
@param type the type
@return the current builder
"""
return when(new DiscriminatorPredicate(value), type);
} | java | public DiscriminatorJdbcSubBuilder when(String value, Type type) {
return when(new DiscriminatorPredicate(value), type);
} | [
"public",
"DiscriminatorJdbcSubBuilder",
"when",
"(",
"String",
"value",
",",
"Type",
"type",
")",
"{",
"return",
"when",
"(",
"new",
"DiscriminatorPredicate",
"(",
"value",
")",
",",
"type",
")",
";",
"}"
] | Add a discriminator value with its associated type.
@param value the value
@param type the type
@return the current builder | [
"Add",
"a",
"discriminator",
"value",
"with",
"its",
"associated",
"type",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/DiscriminatorJdbcBuilder.java#L45-L47 |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java | AbstractTTTLearner.finalizeDiscriminator | private void finalizeDiscriminator(AbstractBaseDTNode<I, D> blockRoot, Splitter<I, D> splitter) {
"""
Finalize a discriminator. Given a block root and a {@link Splitter}, replace the discriminator at the block root
by the one derived from the splitter, and update the discrimination tree accordingly.
@param blo... | java | private void finalizeDiscriminator(AbstractBaseDTNode<I, D> blockRoot, Splitter<I, D> splitter) {
assert blockRoot.isBlockRoot();
notifyPreFinalizeDiscriminator(blockRoot, splitter);
Word<I> succDiscr = splitter.getDiscriminator().prepend(alphabet.getSymbol(splitter.symbolIdx));
if (!... | [
"private",
"void",
"finalizeDiscriminator",
"(",
"AbstractBaseDTNode",
"<",
"I",
",",
"D",
">",
"blockRoot",
",",
"Splitter",
"<",
"I",
",",
"D",
">",
"splitter",
")",
"{",
"assert",
"blockRoot",
".",
"isBlockRoot",
"(",
")",
";",
"notifyPreFinalizeDiscriminat... | Finalize a discriminator. Given a block root and a {@link Splitter}, replace the discriminator at the block root
by the one derived from the splitter, and update the discrimination tree accordingly.
@param blockRoot
the block root whose discriminator to finalize
@param splitter
the splitter to use for finalization | [
"Finalize",
"a",
"discriminator",
".",
"Given",
"a",
"block",
"root",
"and",
"a",
"{",
"@link",
"Splitter",
"}",
"replace",
"the",
"discriminator",
"at",
"the",
"block",
"root",
"by",
"the",
"one",
"derived",
"from",
"the",
"splitter",
"and",
"update",
"th... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/AbstractTTTLearner.java#L555-L576 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java | DatabaseEventManager.fireResultRemoved | public void fireResultRemoved(Result r, Result parent) {
"""
Informs all registered <code>ResultListener</code> that a new result has
been removed.
@param r result that has been removed
@param parent Parent result that has been removed
"""
for(int i = resultListenerList.size(); --i >= 0;) {
resu... | java | public void fireResultRemoved(Result r, Result parent) {
for(int i = resultListenerList.size(); --i >= 0;) {
resultListenerList.get(i).resultRemoved(r, parent);
}
} | [
"public",
"void",
"fireResultRemoved",
"(",
"Result",
"r",
",",
"Result",
"parent",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"resultListenerList",
".",
"size",
"(",
")",
";",
"--",
"i",
">=",
"0",
";",
")",
"{",
"resultListenerList",
".",
"get",
"(",
"... | Informs all registered <code>ResultListener</code> that a new result has
been removed.
@param r result that has been removed
@param parent Parent result that has been removed | [
"Informs",
"all",
"registered",
"<code",
">",
"ResultListener<",
"/",
"code",
">",
"that",
"a",
"new",
"result",
"has",
"been",
"removed",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java#L325-L329 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.setPassword | public void setPassword(String username, String oldPassword, String newPassword) throws CmsException {
"""
Sets the password for a specified user.<p>
@param username the name of the user
@param oldPassword the old password
@param newPassword the new password
@throws CmsException if the user data could not ... | java | public void setPassword(String username, String oldPassword, String newPassword) throws CmsException {
m_securityManager.resetPassword(m_context, username, oldPassword, newPassword);
} | [
"public",
"void",
"setPassword",
"(",
"String",
"username",
",",
"String",
"oldPassword",
",",
"String",
"newPassword",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"resetPassword",
"(",
"m_context",
",",
"username",
",",
"oldPassword",
",",
"newP... | Sets the password for a specified user.<p>
@param username the name of the user
@param oldPassword the old password
@param newPassword the new password
@throws CmsException if the user data could not be read from the database | [
"Sets",
"the",
"password",
"for",
"a",
"specified",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3854-L3857 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/platform/GingerbreadPurgeableDecoder.java | GingerbreadPurgeableDecoder.decodeByteArrayAsPurgeable | @Override
protected Bitmap decodeByteArrayAsPurgeable(
CloseableReference<PooledByteBuffer> bytesRef, BitmapFactory.Options options) {
"""
Decodes a byteArray into a purgeable bitmap
@param bytesRef the byte buffer that contains the encoded bytes
@param options the options passed to the BitmapFactory
... | java | @Override
protected Bitmap decodeByteArrayAsPurgeable(
CloseableReference<PooledByteBuffer> bytesRef, BitmapFactory.Options options) {
return decodeFileDescriptorAsPurgeable(bytesRef, bytesRef.get().size(), null, options);
} | [
"@",
"Override",
"protected",
"Bitmap",
"decodeByteArrayAsPurgeable",
"(",
"CloseableReference",
"<",
"PooledByteBuffer",
">",
"bytesRef",
",",
"BitmapFactory",
".",
"Options",
"options",
")",
"{",
"return",
"decodeFileDescriptorAsPurgeable",
"(",
"bytesRef",
",",
"byte... | Decodes a byteArray into a purgeable bitmap
@param bytesRef the byte buffer that contains the encoded bytes
@param options the options passed to the BitmapFactory
@return the decoded bitmap | [
"Decodes",
"a",
"byteArray",
"into",
"a",
"purgeable",
"bitmap"
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/platform/GingerbreadPurgeableDecoder.java#L55-L59 |
Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/util/ScanExceptionHandler.java | ScanExceptionHandler.handleException | public static void handleException(final Activity context, final BleScanException exception) {
"""
Show toast with error message appropriate to exception reason.
@param context current Activity context
@param exception BleScanException to show error message for
"""
final String text;
fina... | java | public static void handleException(final Activity context, final BleScanException exception) {
final String text;
final int reason = exception.getReason();
// Special case, as there might or might not be a retry date suggestion
if (reason == BleScanException.UNDOCUMENTED_SCAN_THROTTLE) ... | [
"public",
"static",
"void",
"handleException",
"(",
"final",
"Activity",
"context",
",",
"final",
"BleScanException",
"exception",
")",
"{",
"final",
"String",
"text",
";",
"final",
"int",
"reason",
"=",
"exception",
".",
"getReason",
"(",
")",
";",
"// Specia... | Show toast with error message appropriate to exception reason.
@param context current Activity context
@param exception BleScanException to show error message for | [
"Show",
"toast",
"with",
"error",
"message",
"appropriate",
"to",
"exception",
"reason",
"."
] | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/util/ScanExceptionHandler.java#L63-L84 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/builder/AbstractActivityContextBuilder.java | AbstractActivityContextBuilder.createActivityContext | protected ActivityContext createActivityContext(ContextRuleAssistant assistant)
throws BeanReferenceException, IllegalRuleException {
"""
Returns a new instance of ActivityContext.
@param assistant the context rule assistant
@return the activity context
@throws BeanReferenceException will be throw... | java | protected ActivityContext createActivityContext(ContextRuleAssistant assistant)
throws BeanReferenceException, IllegalRuleException {
initContextEnvironment(assistant);
AspectranActivityContext activityContext = new AspectranActivityContext(assistant.getContextEnvironment());
Aspec... | [
"protected",
"ActivityContext",
"createActivityContext",
"(",
"ContextRuleAssistant",
"assistant",
")",
"throws",
"BeanReferenceException",
",",
"IllegalRuleException",
"{",
"initContextEnvironment",
"(",
"assistant",
")",
";",
"AspectranActivityContext",
"activityContext",
"="... | Returns a new instance of ActivityContext.
@param assistant the context rule assistant
@return the activity context
@throws BeanReferenceException will be thrown when cannot resolve reference to bean
@throws IllegalRuleException if an illegal rule is found | [
"Returns",
"a",
"new",
"instance",
"of",
"ActivityContext",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/builder/AbstractActivityContextBuilder.java#L340-L373 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.getMediaSourceDownload | public GetMediaSourceDownloadResponse getMediaSourceDownload(GetMediaSourceDownloadRequest request) {
"""
Transcode the media again. Only status is FAILED or PUBLISHED media can use.
@param request The request object containing mediaid
@return
"""
checkStringNotEmpty(request.getMediaId(), "Media I... | java | public GetMediaSourceDownloadResponse getMediaSourceDownload(GetMediaSourceDownloadRequest request) {
checkStringNotEmpty(request.getMediaId(), "Media ID should not be null or empty!");
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, PATH_MEDIA, request.get... | [
"public",
"GetMediaSourceDownloadResponse",
"getMediaSourceDownload",
"(",
"GetMediaSourceDownloadRequest",
"request",
")",
"{",
"checkStringNotEmpty",
"(",
"request",
".",
"getMediaId",
"(",
")",
",",
"\"Media ID should not be null or empty!\"",
")",
";",
"InternalRequest",
... | Transcode the media again. Only status is FAILED or PUBLISHED media can use.
@param request The request object containing mediaid
@return | [
"Transcode",
"the",
"media",
"again",
".",
"Only",
"status",
"is",
"FAILED",
"or",
"PUBLISHED",
"media",
"can",
"use",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L918-L928 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java | PathUtils.getPathWithoutSchemeAndAuthority | public static Path getPathWithoutSchemeAndAuthority(Path path) {
"""
Removes the Scheme and Authority from a Path.
@see Path
@see URI
"""
return new Path(null, null, path.toUri().getPath());
} | java | public static Path getPathWithoutSchemeAndAuthority(Path path) {
return new Path(null, null, path.toUri().getPath());
} | [
"public",
"static",
"Path",
"getPathWithoutSchemeAndAuthority",
"(",
"Path",
"path",
")",
"{",
"return",
"new",
"Path",
"(",
"null",
",",
"null",
",",
"path",
".",
"toUri",
"(",
")",
".",
"getPath",
"(",
")",
")",
";",
"}"
] | Removes the Scheme and Authority from a Path.
@see Path
@see URI | [
"Removes",
"the",
"Scheme",
"and",
"Authority",
"from",
"a",
"Path",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PathUtils.java#L67-L69 |
alkacon/opencms-core | src/org/opencms/ui/apps/dbmanager/CmsResourceTypeStatResultList.java | CmsResourceTypeStatResultList.removeRow | private void removeRow(VerticalLayout layout, CmsResourceTypeStatResult result) {
"""
Removes result row representing given results.<p>
@param layout with results
@param result to be removed
"""
Component componentToRemove = null;
Iterator<Component> iterator = layout.iterator();
w... | java | private void removeRow(VerticalLayout layout, CmsResourceTypeStatResult result) {
Component componentToRemove = null;
Iterator<Component> iterator = layout.iterator();
while (iterator.hasNext()) {
Component component = iterator.next();
if (component instanceof Horizontal... | [
"private",
"void",
"removeRow",
"(",
"VerticalLayout",
"layout",
",",
"CmsResourceTypeStatResult",
"result",
")",
"{",
"Component",
"componentToRemove",
"=",
"null",
";",
"Iterator",
"<",
"Component",
">",
"iterator",
"=",
"layout",
".",
"iterator",
"(",
")",
";... | Removes result row representing given results.<p>
@param layout with results
@param result to be removed | [
"Removes",
"result",
"row",
"representing",
"given",
"results",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/dbmanager/CmsResourceTypeStatResultList.java#L240-L255 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.beginScanForUpdates | public void beginScanForUpdates(String deviceName, String resourceGroupName) {
"""
Scans for updates on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudE... | java | public void beginScanForUpdates(String deviceName, String resourceGroupName) {
beginScanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body();
} | [
"public",
"void",
"beginScanForUpdates",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
")",
"{",
"beginScanForUpdatesWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
... | Scans for updates on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapp... | [
"Scans",
"for",
"updates",
"on",
"a",
"data",
"box",
"edge",
"/",
"gateway",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1750-L1752 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java | AbstractHibernateDao.getAllByHql | public List< T> getAllByHql(String secondHalfOfHql, Object paramValue1, Type paramType1, Object paramValue2, Type paramType2) {
"""
Get all by HQL with two pairs of parameterType-value
@param secondHalfOfHql
@param paramValue1
@param paramType1
@param paramValue2
@param paramType2
@return the query result
... | java | public List< T> getAllByHql(String secondHalfOfHql, Object paramValue1, Type paramType1, Object paramValue2, Type paramType2) {
return getAllByHql(secondHalfOfHql, new Object[] {paramValue1, paramValue2}, new Type[]{paramType2, paramType2}, null, null);
} | [
"public",
"List",
"<",
"T",
">",
"getAllByHql",
"(",
"String",
"secondHalfOfHql",
",",
"Object",
"paramValue1",
",",
"Type",
"paramType1",
",",
"Object",
"paramValue2",
",",
"Type",
"paramType2",
")",
"{",
"return",
"getAllByHql",
"(",
"secondHalfOfHql",
",",
... | Get all by HQL with two pairs of parameterType-value
@param secondHalfOfHql
@param paramValue1
@param paramType1
@param paramValue2
@param paramType2
@return the query result | [
"Get",
"all",
"by",
"HQL",
"with",
"two",
"pairs",
"of",
"parameterType",
"-",
"value"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java#L168-L170 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.createDummyPolygon | public static Polygon createDummyPolygon() {
"""
Creates a polygon that may help out as placeholder.
@return a dummy {@link Polygon}.
"""
Coordinate[] c = new Coordinate[]{new Coordinate(0.0, 0.0), new Coordinate(1.0, 1.0), new Coordinate(1.0, 0.0),
new Coordinate(0.0, 0.0)};
... | java | public static Polygon createDummyPolygon() {
Coordinate[] c = new Coordinate[]{new Coordinate(0.0, 0.0), new Coordinate(1.0, 1.0), new Coordinate(1.0, 0.0),
new Coordinate(0.0, 0.0)};
LinearRing linearRing = gf().createLinearRing(c);
return gf().createPolygon(linearRing, null);
... | [
"public",
"static",
"Polygon",
"createDummyPolygon",
"(",
")",
"{",
"Coordinate",
"[",
"]",
"c",
"=",
"new",
"Coordinate",
"[",
"]",
"{",
"new",
"Coordinate",
"(",
"0.0",
",",
"0.0",
")",
",",
"new",
"Coordinate",
"(",
"1.0",
",",
"1.0",
")",
",",
"n... | Creates a polygon that may help out as placeholder.
@return a dummy {@link Polygon}. | [
"Creates",
"a",
"polygon",
"that",
"may",
"help",
"out",
"as",
"placeholder",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L124-L129 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducialCalibration.java | FactoryFiducialCalibration.circleHexagonalGrid | public static CalibrationDetectorCircleHexagonalGrid circleHexagonalGrid( @Nullable ConfigCircleHexagonalGrid config ,
ConfigGridDimen configGrid ) {
"""
Detector for hexagonal grid of circles. All circles must be entirely inside of the image.
@param config Configuration for target
@return... | java | public static CalibrationDetectorCircleHexagonalGrid circleHexagonalGrid( @Nullable ConfigCircleHexagonalGrid config ,
ConfigGridDimen configGrid ) {
if( config == null )
config = new ConfigCircleHexagonalGrid();
config.checkValidity();
return new CalibrationDetectorCircleHexagonalGrid(con... | [
"public",
"static",
"CalibrationDetectorCircleHexagonalGrid",
"circleHexagonalGrid",
"(",
"@",
"Nullable",
"ConfigCircleHexagonalGrid",
"config",
",",
"ConfigGridDimen",
"configGrid",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
"ConfigCircleH... | Detector for hexagonal grid of circles. All circles must be entirely inside of the image.
@param config Configuration for target
@return The detector | [
"Detector",
"for",
"hexagonal",
"grid",
"of",
"circles",
".",
"All",
"circles",
"must",
"be",
"entirely",
"inside",
"of",
"the",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/factory/fiducial/FactoryFiducialCalibration.java#L107-L114 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newEntity | public Entity newEntity(String id, List<Span<Term>> references) {
"""
Creates an Entity object to load an existing entity. It receives the ID as an argument. The entity is added to the document object.
@param id the ID of the named entity.
@param type entity type. 8 values are posible: Person, Organization, Loca... | java | public Entity newEntity(String id, List<Span<Term>> references) {
idManager.updateCounter(AnnotationType.ENTITY, id);
Entity newEntity = new Entity(id, references);
annotationContainer.add(newEntity, Layer.ENTITIES, AnnotationType.ENTITY);
return newEntity;
} | [
"public",
"Entity",
"newEntity",
"(",
"String",
"id",
",",
"List",
"<",
"Span",
"<",
"Term",
">",
">",
"references",
")",
"{",
"idManager",
".",
"updateCounter",
"(",
"AnnotationType",
".",
"ENTITY",
",",
"id",
")",
";",
"Entity",
"newEntity",
"=",
"new"... | Creates an Entity object to load an existing entity. It receives the ID as an argument. The entity is added to the document object.
@param id the ID of the named entity.
@param type entity type. 8 values are posible: Person, Organization, Location, Date, Time, Money, Percent, Misc.
@param references it contains one or ... | [
"Creates",
"an",
"Entity",
"object",
"to",
"load",
"an",
"existing",
"entity",
".",
"It",
"receives",
"the",
"ID",
"as",
"an",
"argument",
".",
"The",
"entity",
"is",
"added",
"to",
"the",
"document",
"object",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L732-L737 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.xpathQuery | public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
throws XPathExpressionException {
"""
Return the result of evaluating an XPath query on the builder's DOM
using the given namespace. Returns null if the query finds nothing,
or finds a node that does not match the type specifi... | java | public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
throws XPathExpressionException {
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xPath = xpathFactory.newXPath();
if (nsContext != null) {
xPath.setNamespaceContext(n... | [
"public",
"Object",
"xpathQuery",
"(",
"String",
"xpath",
",",
"QName",
"type",
",",
"NamespaceContext",
"nsContext",
")",
"throws",
"XPathExpressionException",
"{",
"XPathFactory",
"xpathFactory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"XPath",
"... | Return the result of evaluating an XPath query on the builder's DOM
using the given namespace. Returns null if the query finds nothing,
or finds a node that does not match the type specified by returnType.
@param xpath
an XPath expression
@param type
the type the XPath is expected to resolve to, e.g:
{@link XPathConst... | [
"Return",
"the",
"result",
"of",
"evaluating",
"an",
"XPath",
"query",
"on",
"the",
"builder",
"s",
"DOM",
"using",
"the",
"given",
"namespace",
".",
"Returns",
"null",
"if",
"the",
"query",
"finds",
"nothing",
"or",
"finds",
"a",
"node",
"that",
"does",
... | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L398-L412 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/cli/BaseTool.java | BaseTool.optionDisplayString | protected String optionDisplayString(final String opt, boolean extended) {
"""
Return a string to display the specified option in help text
@param extended if true, include full argument descriptor
@param opt opt name
@return display string
"""
StringBuffer stringBuffer = new StringBuffer();
... | java | protected String optionDisplayString(final String opt, boolean extended) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("-").append(opt);
Option option = getOption(opt);
if(null!=option) {
if (option.getLongOpt() != null) {
stringBuffer.... | [
"protected",
"String",
"optionDisplayString",
"(",
"final",
"String",
"opt",
",",
"boolean",
"extended",
")",
"{",
"StringBuffer",
"stringBuffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"stringBuffer",
".",
"append",
"(",
"\"-\"",
")",
".",
"append",
"(",
... | Return a string to display the specified option in help text
@param extended if true, include full argument descriptor
@param opt opt name
@return display string | [
"Return",
"a",
"string",
"to",
"display",
"the",
"specified",
"option",
"in",
"help",
"text"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/cli/BaseTool.java#L111-L127 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkStaticVariableDeclaration | public void checkStaticVariableDeclaration(Decl.StaticVariable decl) {
"""
check and check types for a given constant declaration.
@param cd
Constant declaration to check.
@throws IOException
"""
Environment environment = new Environment();
// Check type not void
checkVariableDeclaration(decl, envir... | java | public void checkStaticVariableDeclaration(Decl.StaticVariable decl) {
Environment environment = new Environment();
// Check type not void
checkVariableDeclaration(decl, environment);
} | [
"public",
"void",
"checkStaticVariableDeclaration",
"(",
"Decl",
".",
"StaticVariable",
"decl",
")",
"{",
"Environment",
"environment",
"=",
"new",
"Environment",
"(",
")",
";",
"// Check type not void",
"checkVariableDeclaration",
"(",
"decl",
",",
"environment",
")"... | check and check types for a given constant declaration.
@param cd
Constant declaration to check.
@throws IOException | [
"check",
"and",
"check",
"types",
"for",
"a",
"given",
"constant",
"declaration",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L181-L185 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/StringUtils.java | StringUtils.containsWordIgnoreCase | public static boolean containsWordIgnoreCase(final String text, final String word) {
"""
Returns true if given text contains given word ignore case; false
otherwise.
@param text string text to be tested.
@param word string word to be tested.
@return true if given text contains given word ignore case; false
... | java | public static boolean containsWordIgnoreCase(final String text, final String word) {
if (text == null || word == null) {
return false;
}
return containsWord(text.toLowerCase(), word.toLowerCase());
} | [
"public",
"static",
"boolean",
"containsWordIgnoreCase",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"word",
")",
"{",
"if",
"(",
"text",
"==",
"null",
"||",
"word",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"containsWord",... | Returns true if given text contains given word ignore case; false
otherwise.
@param text string text to be tested.
@param word string word to be tested.
@return true if given text contains given word ignore case; false
otherwise. | [
"Returns",
"true",
"if",
"given",
"text",
"contains",
"given",
"word",
"ignore",
"case",
";",
"false",
"otherwise",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/StringUtils.java#L280-L286 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.setBusHaltBinding | public void setBusHaltBinding(Map<BusItineraryHalt, Pair<Integer, Float>> binding) {
"""
Set the binding informations for all the bus halts of this itinerary.
@param binding are the pairs containing the index of the road segment and the
curviline position of each bus itinerary halt.
"""
if (binding != nu... | java | public void setBusHaltBinding(Map<BusItineraryHalt, Pair<Integer, Float>> binding) {
if (binding != null) {
BusItineraryHalt halt;
boolean shapeChanged = false;
for (final Entry<BusItineraryHalt, Pair<Integer, Float>> entry : binding.entrySet()) {
halt = entry.getKey();
halt.setRoadSegmentIndex(entry... | [
"public",
"void",
"setBusHaltBinding",
"(",
"Map",
"<",
"BusItineraryHalt",
",",
"Pair",
"<",
"Integer",
",",
"Float",
">",
">",
"binding",
")",
"{",
"if",
"(",
"binding",
"!=",
"null",
")",
"{",
"BusItineraryHalt",
"halt",
";",
"boolean",
"shapeChanged",
... | Set the binding informations for all the bus halts of this itinerary.
@param binding are the pairs containing the index of the road segment and the
curviline position of each bus itinerary halt. | [
"Set",
"the",
"binding",
"informations",
"for",
"all",
"the",
"bus",
"halts",
"of",
"this",
"itinerary",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L858-L880 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterList.java | FilterList.buildData | protected void buildData(String[] data, boolean validateOnly) {
"""
Build the address tree from a string of data which contains valid
IPv4 and/or IPv6 addresses. The string array should contain all the
addresses.
@param data
list of IPv4 and/or IPv6 address which are
to be used to create a new address tree.... | java | protected void buildData(String[] data, boolean validateOnly) {
if (data == null) {
return;
}
int length = data.length;
for (int i = 0; i < length; i++) {
addAddressToList(data[i], validateOnly);
}
} | [
"protected",
"void",
"buildData",
"(",
"String",
"[",
"]",
"data",
",",
"boolean",
"validateOnly",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
";",
"}",
"int",
"length",
"=",
"data",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=... | Build the address tree from a string of data which contains valid
IPv4 and/or IPv6 addresses. The string array should contain all the
addresses.
@param data
list of IPv4 and/or IPv6 address which are
to be used to create a new address tree. | [
"Build",
"the",
"address",
"tree",
"from",
"a",
"string",
"of",
"data",
"which",
"contains",
"valid",
"IPv4",
"and",
"/",
"or",
"IPv6",
"addresses",
".",
"The",
"string",
"array",
"should",
"contain",
"all",
"the",
"addresses",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterList.java#L57-L69 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.findOne | public static <T> T findOne(Iterable<T> collection, Filter<T> filter) {
"""
查找第一个匹配元素对象
@param <T> 集合元素类型
@param collection 集合
@param filter 过滤器,满足过滤条件的第一个元素将被返回
@return 满足过滤条件的第一个元素
@since 3.1.0
"""
if (null != collection) {
for (T t : collection) {
if (filter.accept(t)) {
return t;
... | java | public static <T> T findOne(Iterable<T> collection, Filter<T> filter) {
if (null != collection) {
for (T t : collection) {
if (filter.accept(t)) {
return t;
}
}
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findOne",
"(",
"Iterable",
"<",
"T",
">",
"collection",
",",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"if",
"(",
"null",
"!=",
"collection",
")",
"{",
"for",
"(",
"T",
"t",
":",
"collection",
")",
"{",... | 查找第一个匹配元素对象
@param <T> 集合元素类型
@param collection 集合
@param filter 过滤器,满足过滤条件的第一个元素将被返回
@return 满足过滤条件的第一个元素
@since 3.1.0 | [
"查找第一个匹配元素对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1211-L1220 |
paypal/SeLion | server/src/main/java/com/paypal/selion/node/servlets/LogServlet.java | LogServlet.process | protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
"""
This method display the log file content
@param request
HttpServletRequest
@param response
HttpServletResponse
@param fileName
To display the log file content in the web pa... | java | protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
// TODO put this html code in a template
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(200);
FileB... | [
"protected",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"// TODO put this html code in a template",
"response",
".",
"setContentType",
"(",
"\"text/html\"",
... | This method display the log file content
@param request
HttpServletRequest
@param response
HttpServletResponse
@param fileName
To display the log file content in the web page.
@throws IOException | [
"This",
"method",
"display",
"the",
"log",
"file",
"content"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/node/servlets/LogServlet.java#L149-L173 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java | CapacityFactory.loadExtension | private static Object loadExtension(Extension extension, ClassLoaderPlugin classLoaderPlugin) {
"""
Load the class
@param extension The extension metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The object
"""
try
{
Class<?> c ... | java | private static Object loadExtension(Extension extension, ClassLoaderPlugin classLoaderPlugin)
{
try
{
Class<?> c = classLoaderPlugin.loadClass(extension.getClassName(),
extension.getModuleName(), extension.getModuleSlot());
return c.newInstance();
}
catch (Thr... | [
"private",
"static",
"Object",
"loadExtension",
"(",
"Extension",
"extension",
",",
"ClassLoaderPlugin",
"classLoaderPlugin",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"c",
"=",
"classLoaderPlugin",
".",
"loadClass",
"(",
"extension",
".",
"getClassName",
"(... | Load the class
@param extension The extension metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The object | [
"Load",
"the",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java#L189-L203 |
podio/podio-java | src/main/java/com/podio/task/TaskAPI.java | TaskAPI.updateDueDate | public void updateDueDate(int taskId, LocalDate dueDate) {
"""
Updates the due date of the task to the given value
@param taskId
The id of the task
@param dueDate
The new due date of the task
"""
getResourceFactory()
.getApiResource("/task/" + taskId + "/due_date")
.entity(new TaskDueDate(dueDa... | java | public void updateDueDate(int taskId, LocalDate dueDate) {
getResourceFactory()
.getApiResource("/task/" + taskId + "/due_date")
.entity(new TaskDueDate(dueDate),
MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateDueDate",
"(",
"int",
"taskId",
",",
"LocalDate",
"dueDate",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/task/\"",
"+",
"taskId",
"+",
"\"/due_date\"",
")",
".",
"entity",
"(",
"new",
"TaskDueDate",
"(",
... | Updates the due date of the task to the given value
@param taskId
The id of the task
@param dueDate
The new due date of the task | [
"Updates",
"the",
"due",
"date",
"of",
"the",
"task",
"to",
"the",
"given",
"value"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/task/TaskAPI.java#L114-L119 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java | ElemLiteralResult.excludeResultNSDecl | private boolean excludeResultNSDecl(String prefix, String uri)
throws TransformerException {
"""
Tell if the result namespace decl should be excluded. Should be called before
namespace aliasing (I think).
@param prefix Prefix of namespace to check
@param uri URI of namespace to check
@return Tru... | java | private boolean excludeResultNSDecl(String prefix, String uri)
throws TransformerException
{
if (null != m_excludeResultPrefixes)
{
return containsExcludeResultPrefix(prefix, uri);
}
return false;
} | [
"private",
"boolean",
"excludeResultNSDecl",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"null",
"!=",
"m_excludeResultPrefixes",
")",
"{",
"return",
"containsExcludeResultPrefix",
"(",
"prefix",
",",
"uri",
... | Tell if the result namespace decl should be excluded. Should be called before
namespace aliasing (I think).
@param prefix Prefix of namespace to check
@param uri URI of namespace to check
@return True if the given namespace should be excluded
@throws TransformerException | [
"Tell",
"if",
"the",
"result",
"namespace",
"decl",
"should",
"be",
"excluded",
".",
"Should",
"be",
"called",
"before",
"namespace",
"aliasing",
"(",
"I",
"think",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java#L1278-L1288 |
EdwardRaff/JSAT | JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java | OnlineLDAsvi.expandPsiMinusPsiSum | private void expandPsiMinusPsiSum(Vec input, double sum, Vec output) {
"""
From the 2013 paper, see expectations in figure 5 on page 1323, and
equation (27) on page 1325
See also equation 6 in the 2010 paper. 2013 paper figure 5 seems to be a
typo
@param input the vector to take the input values from
@param s... | java | private void expandPsiMinusPsiSum(Vec input, double sum, Vec output)
{
double psiSum = FastMath.digamma(sum);
for(int i = 0; i < input.length(); i++)
output.set(i, FastMath.digamma(input.get(i))-psiSum);
} | [
"private",
"void",
"expandPsiMinusPsiSum",
"(",
"Vec",
"input",
",",
"double",
"sum",
",",
"Vec",
"output",
")",
"{",
"double",
"psiSum",
"=",
"FastMath",
".",
"digamma",
"(",
"sum",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"input",... | From the 2013 paper, see expectations in figure 5 on page 1323, and
equation (27) on page 1325
See also equation 6 in the 2010 paper. 2013 paper figure 5 seems to be a
typo
@param input the vector to take the input values from
@param sum the sum of the {@code input} vector
@param output the vector to store the transfor... | [
"From",
"the",
"2013",
"paper",
"see",
"expectations",
"in",
"figure",
"5",
"on",
"page",
"1323",
"and",
"equation",
"(",
"27",
")",
"on",
"page",
"1325",
"See",
"also",
"equation",
"6",
"in",
"the",
"2010",
"paper",
".",
"2013",
"paper",
"figure",
"5"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java#L379-L384 |
tvesalainen/util | util/src/main/java/d3/env/TSAGeoMag.java | TSAGeoMag.getDeclination | public double getDeclination( double dlat, double dlong, double year, double altitude ) {
"""
Returns the declination from the Department of
Defense geomagnetic model and data, in degrees. The
magnetic heading + declination = true heading.
(True heading + variation = magnetic heading.)
@param dlat Latitude... | java | public double getDeclination( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return dec;
} | [
"public",
"double",
"getDeclination",
"(",
"double",
"dlat",
",",
"double",
"dlong",
",",
"double",
"year",
",",
"double",
"altitude",
")",
"{",
"calcGeoMag",
"(",
"dlat",
",",
"dlong",
",",
"year",
",",
"altitude",
")",
";",
"return",
"dec",
";",
"}"
] | Returns the declination from the Department of
Defense geomagnetic model and data, in degrees. The
magnetic heading + declination = true heading.
(True heading + variation = magnetic heading.)
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year The date as a decimial ye... | [
"Returns",
"the",
"declination",
"from",
"the",
"Department",
"of",
"Defense",
"geomagnetic",
"model",
"and",
"data",
"in",
"degrees",
".",
"The",
"magnetic",
"heading",
"+",
"declination",
"=",
"true",
"heading",
".",
"(",
"True",
"heading",
"+",
"variation",... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/d3/env/TSAGeoMag.java#L933-L937 |
craftercms/core | src/main/java/org/craftercms/core/util/XmlUtils.java | XmlUtils.selectSingleNode | public static Node selectSingleNode(Node node, String xpathQuery, Map<String, String> namespaceUris) {
"""
Executes the specified namespace aware XPath query as a single node query, returning the resulting single node.
"""
XPath xpath = DocumentHelper.createXPath(xpathQuery);
xpath.setNamespace... | java | public static Node selectSingleNode(Node node, String xpathQuery, Map<String, String> namespaceUris) {
XPath xpath = DocumentHelper.createXPath(xpathQuery);
xpath.setNamespaceURIs(namespaceUris);
return xpath.selectSingleNode(node);
} | [
"public",
"static",
"Node",
"selectSingleNode",
"(",
"Node",
"node",
",",
"String",
"xpathQuery",
",",
"Map",
"<",
"String",
",",
"String",
">",
"namespaceUris",
")",
"{",
"XPath",
"xpath",
"=",
"DocumentHelper",
".",
"createXPath",
"(",
"xpathQuery",
")",
"... | Executes the specified namespace aware XPath query as a single node query, returning the resulting single node. | [
"Executes",
"the",
"specified",
"namespace",
"aware",
"XPath",
"query",
"as",
"a",
"single",
"node",
"query",
"returning",
"the",
"resulting",
"single",
"node",
"."
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/util/XmlUtils.java#L105-L110 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/selectiveaccess/SelectiveAccessHandler.java | SelectiveAccessHandler.setDefaultSectionHandling | public void setDefaultSectionHandling( EnumMap<SIT, EnumMap<CIT, Boolean>> sh ) {
"""
sets the section handling for all sections which are not set by level or name...
"""
sectionHandling.put( SectionType.DEFAULT_SECTION.toString(), sh );
} | java | public void setDefaultSectionHandling( EnumMap<SIT, EnumMap<CIT, Boolean>> sh ){
sectionHandling.put( SectionType.DEFAULT_SECTION.toString(), sh );
} | [
"public",
"void",
"setDefaultSectionHandling",
"(",
"EnumMap",
"<",
"SIT",
",",
"EnumMap",
"<",
"CIT",
",",
"Boolean",
">",
">",
"sh",
")",
"{",
"sectionHandling",
".",
"put",
"(",
"SectionType",
".",
"DEFAULT_SECTION",
".",
"toString",
"(",
")",
",",
"sh"... | sets the section handling for all sections which are not set by level or name... | [
"sets",
"the",
"section",
"handling",
"for",
"all",
"sections",
"which",
"are",
"not",
"set",
"by",
"level",
"or",
"name",
"..."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/selectiveaccess/SelectiveAccessHandler.java#L141-L143 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/DoublesAuxiliary.java | DoublesAuxiliary.populateFromDoublesSketch | private final static void populateFromDoublesSketch(
final int k, final long n, final long bitPattern,
final DoublesSketchAccessor sketchAccessor,
final double[] itemsArr, final long[] cumWtsArr) {
"""
Populate the arrays and registers from a DoublesSketch
@param k K value of sketch
... | java | private final static void populateFromDoublesSketch(
final int k, final long n, final long bitPattern,
final DoublesSketchAccessor sketchAccessor,
final double[] itemsArr, final long[] cumWtsArr) {
long weight = 1;
int nxt = 0;
long bits = bitPattern;
assert bits == (n / (2... | [
"private",
"final",
"static",
"void",
"populateFromDoublesSketch",
"(",
"final",
"int",
"k",
",",
"final",
"long",
"n",
",",
"final",
"long",
"bitPattern",
",",
"final",
"DoublesSketchAccessor",
"sketchAccessor",
",",
"final",
"double",
"[",
"]",
"itemsArr",
","... | Populate the arrays and registers from a DoublesSketch
@param k K value of sketch
@param n The current size of the stream
@param bitPattern the bit pattern for valid log levels
@param sketchAccessor A DoublesSketchAccessor around the sketch
@param itemsArr the consolidated array of all items from the sketch populated h... | [
"Populate",
"the",
"arrays",
"and",
"registers",
"from",
"a",
"DoublesSketch"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesAuxiliary.java#L96-L133 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnStats | public Statistics columnStats(String columnName, ColumnStats columnStats) {
"""
Sets statistics for a column. Overwrites all existing statistics for this column.
@param columnName the column name
@param columnStats expected statistics for the column
"""
Map<String, String> map = normalizeColumnStats(col... | java | public Statistics columnStats(String columnName, ColumnStats columnStats) {
Map<String, String> map = normalizeColumnStats(columnStats);
this.columnStats.put(columnName, map);
return this;
} | [
"public",
"Statistics",
"columnStats",
"(",
"String",
"columnName",
",",
"ColumnStats",
"columnStats",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"normalizeColumnStats",
"(",
"columnStats",
")",
";",
"this",
".",
"columnStats",
".",
"put",... | Sets statistics for a column. Overwrites all existing statistics for this column.
@param columnName the column name
@param columnStats expected statistics for the column | [
"Sets",
"statistics",
"for",
"a",
"column",
".",
"Overwrites",
"all",
"existing",
"statistics",
"for",
"this",
"column",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L82-L86 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/App.java | App.withTags | public App withTags(java.util.Map<String, String> tags) {
"""
<p>
Tag for Amplify App.
</p>
@param tags
Tag for Amplify App.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public App withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"App",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Tag for Amplify App.
</p>
@param tags
Tag for Amplify App.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Tag",
"for",
"Amplify",
"App",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/App.java#L294-L297 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.createOrUpdateAsync | public Observable<VirtualMachineInner> createOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
"""
The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param paramete... | java | public Observable<VirtualMachineInner> createOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineInner>, VirtualMachineInner>() {
@Ove... | [
"public",
"Observable",
"<",
"VirtualMachineInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Create Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return t... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L577-L584 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/RuntimeUtil.java | RuntimeUtil.runCommand | public static String runCommand(String command, String[] envp, File workingDir) throws IOException {
"""
Runs the specified <code>command</code> in terminal (sh in *nix/cmd in windows) and
returns the command output.
@param command complete command to be executed
@param envp array of strings, each ... | java | public static String runCommand(String command, String[] envp, File workingDir) throws IOException{
String cmd[];
if(OS.get().isUnix())
cmd = new String[]{ "sh", "-c", command };
else
cmd = new String[]{ "cmd", "/C", command };
Process p = Runtime.getRuntime().ex... | [
"public",
"static",
"String",
"runCommand",
"(",
"String",
"command",
",",
"String",
"[",
"]",
"envp",
",",
"File",
"workingDir",
")",
"throws",
"IOException",
"{",
"String",
"cmd",
"[",
"]",
";",
"if",
"(",
"OS",
".",
"get",
"(",
")",
".",
"isUnix",
... | Runs the specified <code>command</code> in terminal (sh in *nix/cmd in windows) and
returns the command output.
@param command complete command to be executed
@param envp array of strings, each element of which
has environment variable settings in the format
<i>name</i>=<i>value</i>, or
<tt>null</tt> if the... | [
"Runs",
"the",
"specified",
"<code",
">",
"command<",
"/",
"code",
">",
"in",
"terminal",
"(",
"sh",
"in",
"*",
"nix",
"/",
"cmd",
"in",
"windows",
")",
"and",
"returns",
"the",
"command",
"output",
"."
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/RuntimeUtil.java#L73-L92 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.xdsl_installation_offer_GET | public OvhPrice xdsl_installation_offer_GET(net.minidev.ovh.api.price.xdsl.OvhInstallationEnum offer) throws IOException {
"""
Get the price of options installation fee
REST: GET /price/xdsl/installation/{offer}
@param offer [required] The offer
"""
String qPath = "/price/xdsl/installation/{offer}";
St... | java | public OvhPrice xdsl_installation_offer_GET(net.minidev.ovh.api.price.xdsl.OvhInstallationEnum offer) throws IOException {
String qPath = "/price/xdsl/installation/{offer}";
StringBuilder sb = path(qPath, offer);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice.class);
} | [
"public",
"OvhPrice",
"xdsl_installation_offer_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"xdsl",
".",
"OvhInstallationEnum",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/xdsl/installation/{offer}\""... | Get the price of options installation fee
REST: GET /price/xdsl/installation/{offer}
@param offer [required] The offer | [
"Get",
"the",
"price",
"of",
"options",
"installation",
"fee"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L89-L94 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.cut | public static void cut(File srcImgFile, File destImgFile, Rectangle rectangle) {
"""
图像切割(按指定起点坐标和宽高切割)
@param srcImgFile 源图像文件
@param destImgFile 切片后的图像文件
@param rectangle 矩形对象,表示矩形区域的x,y,width,height
@since 3.1.0
"""
cut(read(srcImgFile), destImgFile, rectangle);
} | java | public static void cut(File srcImgFile, File destImgFile, Rectangle rectangle) {
cut(read(srcImgFile), destImgFile, rectangle);
} | [
"public",
"static",
"void",
"cut",
"(",
"File",
"srcImgFile",
",",
"File",
"destImgFile",
",",
"Rectangle",
"rectangle",
")",
"{",
"cut",
"(",
"read",
"(",
"srcImgFile",
")",
",",
"destImgFile",
",",
"rectangle",
")",
";",
"}"
] | 图像切割(按指定起点坐标和宽高切割)
@param srcImgFile 源图像文件
@param destImgFile 切片后的图像文件
@param rectangle 矩形对象,表示矩形区域的x,y,width,height
@since 3.1.0 | [
"图像切割",
"(",
"按指定起点坐标和宽高切割",
")"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L256-L258 |
CloudSlang/cs-actions | cs-commons/src/main/java/io/cloudslang/content/utils/StringEscapeUtilities.java | StringEscapeUtilities.removeEscapedChars | @NotNull
public static String removeEscapedChars(@NotNull final String string, final char[] toRemove) {
"""
Removes all the occurrences of the \<toRemove> characters from the <string>
@param string the string from which to remove the characters
@param toRemove the \character to remove from the <string>
... | java | @NotNull
public static String removeEscapedChars(@NotNull final String string, final char[] toRemove) {
String toReturn = string;
for (char character : toRemove) {
toReturn = removeEscapedChar(toReturn, character);
}
return toReturn;
} | [
"@",
"NotNull",
"public",
"static",
"String",
"removeEscapedChars",
"(",
"@",
"NotNull",
"final",
"String",
"string",
",",
"final",
"char",
"[",
"]",
"toRemove",
")",
"{",
"String",
"toReturn",
"=",
"string",
";",
"for",
"(",
"char",
"character",
":",
"toR... | Removes all the occurrences of the \<toRemove> characters from the <string>
@param string the string from which to remove the characters
@param toRemove the \character to remove from the <string>
@return a new string with the removed \<toRemove> characters | [
"Removes",
"all",
"the",
"occurrences",
"of",
"the",
"\\",
"<toRemove",
">",
"characters",
"from",
"the",
"<string",
">"
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-commons/src/main/java/io/cloudslang/content/utils/StringEscapeUtilities.java#L109-L116 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadStagingResourceWithImageRequest | public static Request newUploadStagingResourceWithImageRequest(Session session,
Bitmap image, Callback callback) {
"""
Creates a new Request configured to upload an image to create a staging resource. Staging resources
allow you to post binary data such as images, in preparation for a post of an Open ... | java | public static Request newUploadStagingResourceWithImageRequest(Session session,
Bitmap image, Callback callback) {
Bundle parameters = new Bundle(1);
parameters.putParcelable(STAGING_PARAM, image);
return new Request(session, MY_STAGING_RESOURCES, parameters, HttpMethod.POST, callba... | [
"public",
"static",
"Request",
"newUploadStagingResourceWithImageRequest",
"(",
"Session",
"session",
",",
"Bitmap",
"image",
",",
"Callback",
"callback",
")",
"{",
"Bundle",
"parameters",
"=",
"new",
"Bundle",
"(",
"1",
")",
";",
"parameters",
".",
"putParcelable... | Creates a new Request configured to upload an image to create a staging resource. Staging resources
allow you to post binary data such as images, in preparation for a post of an Open Graph object or action
which references the image. The URI returned when uploading a staging resource may be passed as the image
property... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"an",
"image",
"to",
"create",
"a",
"staging",
"resource",
".",
"Staging",
"resources",
"allow",
"you",
"to",
"post",
"binary",
"data",
"such",
"as",
"images",
"in",
"preparation",
"for",
"a",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L637-L643 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java | FeatureValidationCheck.reportWarning | protected ValidationMessage<Origin> reportWarning(Origin origin, String messageKey,
Object... params) {
"""
Creates a warning validation message for the feature and adds it to
the validation result.
@param origin the origin
@param messageKey a message key
@param params message parameters
"""
return ... | java | protected ValidationMessage<Origin> reportWarning(Origin origin, String messageKey,
Object... params) {
return reportMessage(Severity.WARNING, origin, messageKey, params);
} | [
"protected",
"ValidationMessage",
"<",
"Origin",
">",
"reportWarning",
"(",
"Origin",
"origin",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"reportMessage",
"(",
"Severity",
".",
"WARNING",
",",
"origin",
",",
"messageKey",
... | Creates a warning validation message for the feature and adds it to
the validation result.
@param origin the origin
@param messageKey a message key
@param params message parameters | [
"Creates",
"a",
"warning",
"validation",
"message",
"for",
"the",
"feature",
"and",
"adds",
"it",
"to",
"the",
"validation",
"result",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/check/feature/FeatureValidationCheck.java#L121-L124 |
duracloud/duracloud | common-xml/src/main/java/org/duracloud/common/xml/SchemaGenerator.java | SchemaGenerator.createOutput | @Override
public Result createOutput(String namespaceUri, String defaultFileName)
throws IOException {
"""
Called by the schema generation process. There is no need to call
this method directly.
"""
if (null == fileName) {
fileName = defaultFileName;
}
ret... | java | @Override
public Result createOutput(String namespaceUri, String defaultFileName)
throws IOException {
if (null == fileName) {
fileName = defaultFileName;
}
return new StreamResult(new File(baseDir, fileName));
} | [
"@",
"Override",
"public",
"Result",
"createOutput",
"(",
"String",
"namespaceUri",
",",
"String",
"defaultFileName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"==",
"fileName",
")",
"{",
"fileName",
"=",
"defaultFileName",
";",
"}",
"return",
"new... | Called by the schema generation process. There is no need to call
this method directly. | [
"Called",
"by",
"the",
"schema",
"generation",
"process",
".",
"There",
"is",
"no",
"need",
"to",
"call",
"this",
"method",
"directly",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-xml/src/main/java/org/duracloud/common/xml/SchemaGenerator.java#L75-L82 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/zinternaltools/DateVetoPolicyMinimumMaximumDate.java | DateVetoPolicyMinimumMaximumDate.setDateRangeLimits | public void setDateRangeLimits(LocalDate firstAllowedDate, LocalDate lastAllowedDate) {
"""
setDateRangeLimits, This sets the currently used date limits.
"""
if (firstAllowedDate == null && lastAllowedDate == null) {
throw new RuntimeException("DateVetoPolicyMinimumMaximumDate.setDateRangeL... | java | public void setDateRangeLimits(LocalDate firstAllowedDate, LocalDate lastAllowedDate) {
if (firstAllowedDate == null && lastAllowedDate == null) {
throw new RuntimeException("DateVetoPolicyMinimumMaximumDate.setDateRangeLimits(),"
+ "The variable firstAllowedDate can be null, or ... | [
"public",
"void",
"setDateRangeLimits",
"(",
"LocalDate",
"firstAllowedDate",
",",
"LocalDate",
"lastAllowedDate",
")",
"{",
"if",
"(",
"firstAllowedDate",
"==",
"null",
"&&",
"lastAllowedDate",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"D... | setDateRangeLimits, This sets the currently used date limits. | [
"setDateRangeLimits",
"This",
"sets",
"the",
"currently",
"used",
"date",
"limits",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/DateVetoPolicyMinimumMaximumDate.java#L67-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.