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 |
|---|---|---|---|---|---|---|---|---|---|---|
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java | ServerHandshaker.clientKeyExchange | private SecretKey clientKeyExchange(KerberosClientKeyExchange mesg)
throws IOException {
"""
/*
For Kerberos ciphers, the premaster secret is encrypted using
the session key. See RFC 2712.
"""
if (debug != null && Debug.isOn("handshake")) {
mesg.print(System.out);
}
... | java | private SecretKey clientKeyExchange(KerberosClientKeyExchange mesg)
throws IOException {
if (debug != null && Debug.isOn("handshake")) {
mesg.print(System.out);
}
// Record the principals involved in exchange
session.setPeerPrincipal(mesg.getPeerPrincipal());
... | [
"private",
"SecretKey",
"clientKeyExchange",
"(",
"KerberosClientKeyExchange",
"mesg",
")",
"throws",
"IOException",
"{",
"if",
"(",
"debug",
"!=",
"null",
"&&",
"Debug",
".",
"isOn",
"(",
"\"handshake\"",
")",
")",
"{",
"mesg",
".",
"print",
"(",
"System",
... | /*
For Kerberos ciphers, the premaster secret is encrypted using
the session key. See RFC 2712. | [
"/",
"*",
"For",
"Kerberos",
"ciphers",
"the",
"premaster",
"secret",
"is",
"encrypted",
"using",
"the",
"session",
"key",
".",
"See",
"RFC",
"2712",
"."
] | train | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java#L1394-L1407 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.addAll | @Inline(value="$3.$4addAll($1, $2)", imported=Iterables.class)
public static <T> boolean addAll(Collection<T> collection, Iterable<? extends T> elements) {
"""
Adds all of the specified elements to the specified collection.
@param collection
the collection into which the {@code elements} are to be inserted. M... | java | @Inline(value="$3.$4addAll($1, $2)", imported=Iterables.class)
public static <T> boolean addAll(Collection<T> collection, Iterable<? extends T> elements) {
return Iterables.addAll(collection, elements);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$3.$4addAll($1, $2)\"",
",",
"imported",
"=",
"Iterables",
".",
"class",
")",
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Iterable",
"<",
"?",
"extends",... | Adds all of the specified elements to the specified collection.
@param collection
the collection into which the {@code elements} are to be inserted. May not be <code>null</code>.
@param elements
the elements to insert into the {@code collection}. May not be <code>null</code> but may contain
<code>null</code> entries i... | [
"Adds",
"all",
"of",
"the",
"specified",
"elements",
"to",
"the",
"specified",
"collection",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L268-L271 |
siom79/japicmp | japicmp/src/main/java/japicmp/model/JApiSuperclass.java | JApiSuperclass.getJApiClass | public Optional<JApiClass> getJApiClass() {
"""
Returns the {@link japicmp.model.JApiClass} representation of this superclass.
The return value is Optional.absent() in case the superclass for the old and new version is absent.
@return the {@link japicmp.model.JApiClass} representation of this superclass as {@l... | java | public Optional<JApiClass> getJApiClass() {
if (oldSuperclassOptional.isPresent() && newSuperclassOptional.isPresent()) {
CtClass oldSuperclass = oldSuperclassOptional.get();
CtClass newSuperclass = newSuperclassOptional.get();
String oldSuperclassName = oldSuperclass.getName();
String newSuperclassName =... | [
"public",
"Optional",
"<",
"JApiClass",
">",
"getJApiClass",
"(",
")",
"{",
"if",
"(",
"oldSuperclassOptional",
".",
"isPresent",
"(",
")",
"&&",
"newSuperclassOptional",
".",
"isPresent",
"(",
")",
")",
"{",
"CtClass",
"oldSuperclass",
"=",
"oldSuperclassOption... | Returns the {@link japicmp.model.JApiClass} representation of this superclass.
The return value is Optional.absent() in case the superclass for the old and new version is absent.
@return the {@link japicmp.model.JApiClass} representation of this superclass as {@link com.google.common.base.Optional} | [
"Returns",
"the",
"{",
"@link",
"japicmp",
".",
"model",
".",
"JApiClass",
"}",
"representation",
"of",
"this",
"superclass",
".",
"The",
"return",
"value",
"is",
"Optional",
".",
"absent",
"()",
"in",
"case",
"the",
"superclass",
"for",
"the",
"old",
"and... | train | https://github.com/siom79/japicmp/blob/f008ea588eec721c45f568bf1db5074fbcbcfced/japicmp/src/main/java/japicmp/model/JApiSuperclass.java#L39-L66 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunkcollision/ChunkCollision.java | ChunkCollision.getRayTraceResult | public RayTraceResult getRayTraceResult(World world, Pair<Point, Point> infos, RayTraceResult result, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) {
"""
Gets the ray trace result.<br>
Called via ASM from {@link World#rayTraceBlocks(Vec3d, Vec3d, boolean, boolea... | java | public RayTraceResult getRayTraceResult(World world, Pair<Point, Point> infos, RayTraceResult result, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)
{
if (infos == null)
return result;
RayTraceResult tmp = new RaytraceChunk(world, infos.getLeft(), infos.getRig... | [
"public",
"RayTraceResult",
"getRayTraceResult",
"(",
"World",
"world",
",",
"Pair",
"<",
"Point",
",",
"Point",
">",
"infos",
",",
"RayTraceResult",
"result",
",",
"boolean",
"stopOnLiquid",
",",
"boolean",
"ignoreBlockWithoutBoundingBox",
",",
"boolean",
"returnLa... | Gets the ray trace result.<br>
Called via ASM from {@link World#rayTraceBlocks(Vec3d, Vec3d, boolean, boolean, boolean)} before each return.
@param world the world
@param result the mop
@return the ray trace result | [
"Gets",
"the",
"ray",
"trace",
"result",
".",
"<br",
">",
"Called",
"via",
"ASM",
"from",
"{",
"@link",
"World#rayTraceBlocks",
"(",
"Vec3d",
"Vec3d",
"boolean",
"boolean",
"boolean",
")",
"}",
"before",
"each",
"return",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunkcollision/ChunkCollision.java#L165-L173 |
bekkopen/NoCommons | src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java | NorwegianDateUtil.checkDate | private static boolean checkDate(Calendar cal, Calendar other) {
"""
Check if the given dates match on day and month.
@param cal
The Calendar representing the first date.
@param other
The Calendar representing the second date.
@return true if they match, false otherwise.
"""
return checkDate(cal, othe... | java | private static boolean checkDate(Calendar cal, Calendar other) {
return checkDate(cal, other.get(Calendar.DATE), other.get(Calendar.MONTH));
} | [
"private",
"static",
"boolean",
"checkDate",
"(",
"Calendar",
"cal",
",",
"Calendar",
"other",
")",
"{",
"return",
"checkDate",
"(",
"cal",
",",
"other",
".",
"get",
"(",
"Calendar",
".",
"DATE",
")",
",",
"other",
".",
"get",
"(",
"Calendar",
".",
"MO... | Check if the given dates match on day and month.
@param cal
The Calendar representing the first date.
@param other
The Calendar representing the second date.
@return true if they match, false otherwise. | [
"Check",
"if",
"the",
"given",
"dates",
"match",
"on",
"day",
"and",
"month",
"."
] | train | https://github.com/bekkopen/NoCommons/blob/5a576696390cecaac111fa97fde581e0c1afb9b8/src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java#L216-L218 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/ResultSetUtility.java | ResultSetUtility.columnToPropertyName | protected String columnToPropertyName(ResultSetMetaData rsmd, int col) throws SQLException {
"""
Convert column name to property name for a column, for example, THIS_IS_1ST_COLUMN_$$ will become thisIs1stColumn
@param rsmd the metadata
@param col the column number
@return for example, THIS_IS_1ST_COLUMN_$$ wil... | java | protected String columnToPropertyName(ResultSetMetaData rsmd, int col) throws SQLException{
String columnName = rsmd.getColumnLabel(col);
if (null == columnName || 0 == columnName.length()) {
columnName = rsmd.getColumnName(col);
}
return columnNameToPropertyName(columnName);
} | [
"protected",
"String",
"columnToPropertyName",
"(",
"ResultSetMetaData",
"rsmd",
",",
"int",
"col",
")",
"throws",
"SQLException",
"{",
"String",
"columnName",
"=",
"rsmd",
".",
"getColumnLabel",
"(",
"col",
")",
";",
"if",
"(",
"null",
"==",
"columnName",
"||... | Convert column name to property name for a column, for example, THIS_IS_1ST_COLUMN_$$ will become thisIs1stColumn
@param rsmd the metadata
@param col the column number
@return for example, THIS_IS_1ST_COLUMN_$$ will become thisIs1stColumn
@throws SQLException | [
"Convert",
"column",
"name",
"to",
"property",
"name",
"for",
"a",
"column",
"for",
"example",
"THIS_IS_1ST_COLUMN_$$",
"will",
"become",
"thisIs1stColumn"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/ResultSetUtility.java#L294-L300 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java | VisualizerParameterizer.shortenClassname | protected static String shortenClassname(String nam, char c) {
"""
Shorten the class name.
@param nam Class name
@param c Splitting character
@return Shortened name
"""
final int lastdot = nam.lastIndexOf(c);
if(lastdot >= 0) {
nam = nam.substring(lastdot + 1);
}
return nam;
} | java | protected static String shortenClassname(String nam, char c) {
final int lastdot = nam.lastIndexOf(c);
if(lastdot >= 0) {
nam = nam.substring(lastdot + 1);
}
return nam;
} | [
"protected",
"static",
"String",
"shortenClassname",
"(",
"String",
"nam",
",",
"char",
"c",
")",
"{",
"final",
"int",
"lastdot",
"=",
"nam",
".",
"lastIndexOf",
"(",
"c",
")",
";",
"if",
"(",
"lastdot",
">=",
"0",
")",
"{",
"nam",
"=",
"nam",
".",
... | Shorten the class name.
@param nam Class name
@param c Splitting character
@return Shortened name | [
"Shorten",
"the",
"class",
"name",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L205-L211 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSType.java | JSType.getLeastSupertype | @SuppressWarnings("AmbiguousMethodReference")
public JSType getLeastSupertype(JSType that) {
"""
Gets the least supertype of {@code this} and {@code that}. The least supertype is the join
(∨) or supremum of both types in the type lattice.
<p>Examples:
<ul>
<li><code>number ∨ *</code> = {@code... | java | @SuppressWarnings("AmbiguousMethodReference")
public JSType getLeastSupertype(JSType that) {
if (areIdentical(this, that)) {
return this;
}
that = filterNoResolvedType(that);
if (that.isUnionType()) {
// Union types have their own implementation of getLeastSupertype.
return that.toM... | [
"@",
"SuppressWarnings",
"(",
"\"AmbiguousMethodReference\"",
")",
"public",
"JSType",
"getLeastSupertype",
"(",
"JSType",
"that",
")",
"{",
"if",
"(",
"areIdentical",
"(",
"this",
",",
"that",
")",
")",
"{",
"return",
"this",
";",
"}",
"that",
"=",
"filterN... | Gets the least supertype of {@code this} and {@code that}. The least supertype is the join
(∨) or supremum of both types in the type lattice.
<p>Examples:
<ul>
<li><code>number ∨ *</code> = {@code *}
<li><code>number ∨ Object</code> = {@code (number, Object)}
<li><code>Number ∨ Object</code> =... | [
"Gets",
"the",
"least",
"supertype",
"of",
"{",
"@code",
"this",
"}",
"and",
"{",
"@code",
"that",
"}",
".",
"The",
"least",
"supertype",
"is",
"the",
"join",
"(",
"∨",
";",
")",
"or",
"supremum",
"of",
"both",
"types",
"in",
"the",
"type",
"lat... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSType.java#L1150-L1162 |
code4everything/util | src/main/java/com/zhazhapan/util/dialog/Alerts.java | Alerts.showConfirmation | public static Optional<ButtonType> showConfirmation(String title, String header, String content) {
"""
弹出确认框
@param title 标题
@param header 信息头
@param content 内容
@return {@link ButtonType}
"""
return alert(title, header, content, AlertType.CONFIRMATION);
} | java | public static Optional<ButtonType> showConfirmation(String title, String header, String content) {
return alert(title, header, content, AlertType.CONFIRMATION);
} | [
"public",
"static",
"Optional",
"<",
"ButtonType",
">",
"showConfirmation",
"(",
"String",
"title",
",",
"String",
"header",
",",
"String",
"content",
")",
"{",
"return",
"alert",
"(",
"title",
",",
"header",
",",
"content",
",",
"AlertType",
".",
"CONFIRMAT... | 弹出确认框
@param title 标题
@param header 信息头
@param content 内容
@return {@link ButtonType} | [
"弹出确认框"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/dialog/Alerts.java#L120-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java | EJBJavaColonNamingHelper.hasObjectWithPrefix | @Override
public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
"""
can suppress warning - if cmd is null NamingException will be thrown by getComponentMetaData
"""
JavaColonNamespaceBindings<EJBBinding> bindings;
boolean result = false;
... | java | @Override
public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
JavaColonNamespaceBindings<EJBBinding> bindings;
boolean result = false;
Lock readLock = null;
ComponentMetaData cmd = null;
try {
// This helper on... | [
"@",
"Override",
"public",
"boolean",
"hasObjectWithPrefix",
"(",
"JavaColonNamespace",
"namespace",
",",
"String",
"name",
")",
"throws",
"NamingException",
"{",
"JavaColonNamespaceBindings",
"<",
"EJBBinding",
">",
"bindings",
";",
"boolean",
"result",
"=",
"false",... | can suppress warning - if cmd is null NamingException will be thrown by getComponentMetaData | [
"can",
"suppress",
"warning",
"-",
"if",
"cmd",
"is",
"null",
"NamingException",
"will",
"be",
"thrown",
"by",
"getComponentMetaData"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java#L295-L338 |
voldemort/voldemort | src/java/voldemort/utils/RebalanceUtils.java | RebalanceUtils.vacateZone | public static Cluster vacateZone(Cluster currentCluster, int dropZoneId) {
"""
Given the current cluster and a zone id that needs to be dropped, this
method will remove all partitions from the zone that is being dropped and
move it to the existing zones. The partitions are moved intelligently so
as not to avoid... | java | public static Cluster vacateZone(Cluster currentCluster, int dropZoneId) {
Cluster returnCluster = Cluster.cloneCluster(currentCluster);
// Go over each node in the zone being dropped
for(Integer nodeId: currentCluster.getNodeIdsInZone(dropZoneId)) {
// For each node grab all the par... | [
"public",
"static",
"Cluster",
"vacateZone",
"(",
"Cluster",
"currentCluster",
",",
"int",
"dropZoneId",
")",
"{",
"Cluster",
"returnCluster",
"=",
"Cluster",
".",
"cloneCluster",
"(",
"currentCluster",
")",
";",
"// Go over each node in the zone being dropped",
"for",
... | Given the current cluster and a zone id that needs to be dropped, this
method will remove all partitions from the zone that is being dropped and
move it to the existing zones. The partitions are moved intelligently so
as not to avoid any data movement in the existing zones.
This is achieved by moving the partitions to... | [
"Given",
"the",
"current",
"cluster",
"and",
"a",
"zone",
"id",
"that",
"needs",
"to",
"be",
"dropped",
"this",
"method",
"will",
"remove",
"all",
"partitions",
"from",
"the",
"zone",
"that",
"is",
"being",
"dropped",
"and",
"move",
"it",
"to",
"the",
"e... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/RebalanceUtils.java#L295-L325 |
jayantk/jklol | src/com/jayantkrish/jklol/tensor/SparseTensor.java | SparseTensor.fromUnorderedKeyValuesNoCopy | public static SparseTensor fromUnorderedKeyValuesNoCopy(int[] dimensionNumbers,
int[] dimensionSizes, long[] keyNums, double[] values) {
"""
Same as {@link #fromUnorderedKeyValues}, except that neither
input array is copied. These arrays must not be modified by the
caller after invoking this method.
@pa... | java | public static SparseTensor fromUnorderedKeyValuesNoCopy(int[] dimensionNumbers,
int[] dimensionSizes, long[] keyNums, double[] values) {
ArrayUtils.sortKeyValuePairs(keyNums, values, 0, keyNums.length);
return new SparseTensor(dimensionNumbers, dimensionSizes, keyNums, values);
} | [
"public",
"static",
"SparseTensor",
"fromUnorderedKeyValuesNoCopy",
"(",
"int",
"[",
"]",
"dimensionNumbers",
",",
"int",
"[",
"]",
"dimensionSizes",
",",
"long",
"[",
"]",
"keyNums",
",",
"double",
"[",
"]",
"values",
")",
"{",
"ArrayUtils",
".",
"sortKeyValu... | Same as {@link #fromUnorderedKeyValues}, except that neither
input array is copied. These arrays must not be modified by the
caller after invoking this method.
@param dimensionNumbers
@param dimensionSizes
@param keyNums
@param values | [
"Same",
"as",
"{",
"@link",
"#fromUnorderedKeyValues",
"}",
"except",
"that",
"neither",
"input",
"array",
"is",
"copied",
".",
"These",
"arrays",
"must",
"not",
"be",
"modified",
"by",
"the",
"caller",
"after",
"invoking",
"this",
"method",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/tensor/SparseTensor.java#L1286-L1290 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java | MPD9AbstractReader.getDefaultOnNull | public Double getDefaultOnNull(Double value, Double defaultValue) {
"""
Returns a default value if a null value is found.
@param value value under test
@param defaultValue default if value is null
@return value
"""
return (value == null ? defaultValue : value);
} | java | public Double getDefaultOnNull(Double value, Double defaultValue)
{
return (value == null ? defaultValue : value);
} | [
"public",
"Double",
"getDefaultOnNull",
"(",
"Double",
"value",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"(",
"value",
"==",
"null",
"?",
"defaultValue",
":",
"value",
")",
";",
"}"
] | Returns a default value if a null value is found.
@param value value under test
@param defaultValue default if value is null
@return value | [
"Returns",
"a",
"default",
"value",
"if",
"a",
"null",
"value",
"is",
"found",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1295-L1298 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/image/ImageUtil.java | ImageUtil.createScaledDownImageCacheFile | public static boolean createScaledDownImageCacheFile(String sourcePath, String cachedFileName) {
"""
This method creates a cached version of the original image, and compresses it in the process so it doesn't fill up the disk. Therefore, do not use
it to store an exact copy of the file in question.
@param sourc... | java | public static boolean createScaledDownImageCacheFile(String sourcePath, String cachedFileName) {
File localFile = new File(cachedFileName);
// Retrieve image orientation
int imageOrientation = 0;
try {
ExifInterface exif = new ExifInterface(sourcePath);
imageOrientation = exif.getAttributeInt(ExifInterfa... | [
"public",
"static",
"boolean",
"createScaledDownImageCacheFile",
"(",
"String",
"sourcePath",
",",
"String",
"cachedFileName",
")",
"{",
"File",
"localFile",
"=",
"new",
"File",
"(",
"cachedFileName",
")",
";",
"// Retrieve image orientation",
"int",
"imageOrientation",... | This method creates a cached version of the original image, and compresses it in the process so it doesn't fill up the disk. Therefore, do not use
it to store an exact copy of the file in question.
@param sourcePath can be full file path or content uri string
@param cachedFileName file name of the cache to be crea... | [
"This",
"method",
"creates",
"a",
"cached",
"version",
"of",
"the",
"original",
"image",
"and",
"compresses",
"it",
"in",
"the",
"process",
"so",
"it",
"doesn",
"t",
"fill",
"up",
"the",
"disk",
".",
"Therefore",
"do",
"not",
"use",
"it",
"to",
"store",
... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/image/ImageUtil.java#L270-L307 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/dictionary/CommonSuffixExtractor.java | CommonSuffixExtractor.extractSuffix | public List<String> extractSuffix(int length, int size, boolean extend) {
"""
提取公共后缀
@param length 公共后缀长度
@param size 频率最高的前多少个公共后缀
@param extend 长度是否拓展为从1到length为止的后缀
@return 公共后缀列表
"""
TFDictionary suffixTreeSet = new TFDictionary();
for (String key : tfDictionary.keySet())
{
... | java | public List<String> extractSuffix(int length, int size, boolean extend)
{
TFDictionary suffixTreeSet = new TFDictionary();
for (String key : tfDictionary.keySet())
{
if (key.length() > length)
{
suffixTreeSet.add(key.substring(key.length() - length, ke... | [
"public",
"List",
"<",
"String",
">",
"extractSuffix",
"(",
"int",
"length",
",",
"int",
"size",
",",
"boolean",
"extend",
")",
"{",
"TFDictionary",
"suffixTreeSet",
"=",
"new",
"TFDictionary",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"tfDictionary... | 提取公共后缀
@param length 公共后缀长度
@param size 频率最高的前多少个公共后缀
@param extend 长度是否拓展为从1到length为止的后缀
@return 公共后缀列表 | [
"提取公共后缀"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/CommonSuffixExtractor.java#L54-L78 |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java | CmsEditSiteForm.getParameterString | private String getParameterString(Entry<String, String> parameter) {
"""
Map entry of parameter to String representation.<p>
@param parameter Entry holding parameter info.
@return the parameter formatted as string
"""
return parameter.getKey() + "=" + parameter.getValue();
} | java | private String getParameterString(Entry<String, String> parameter) {
return parameter.getKey() + "=" + parameter.getValue();
} | [
"private",
"String",
"getParameterString",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"parameter",
")",
"{",
"return",
"parameter",
".",
"getKey",
"(",
")",
"+",
"\"=\"",
"+",
"parameter",
".",
"getValue",
"(",
")",
";",
"}"
] | Map entry of parameter to String representation.<p>
@param parameter Entry holding parameter info.
@return the parameter formatted as string | [
"Map",
"entry",
"of",
"parameter",
"to",
"String",
"representation",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java#L1784-L1787 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/view/facelets/MetaTagHandler.java | MetaTagHandler.setAttributes | protected void setAttributes(FaceletContext ctx, Object instance) {
"""
Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to
the passed instance.
@param ctx
@param instance
"""
if (instance != null)
{
Class<?> type = instance.ge... | java | protected void setAttributes(FaceletContext ctx, Object instance)
{
if (instance != null)
{
Class<?> type = instance.getClass();
if (_mapper == null || !_lastType.equals(type))
{
_lastType = type;
_mapper = createMetaRuleset(type).f... | [
"protected",
"void",
"setAttributes",
"(",
"FaceletContext",
"ctx",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"_mapper... | Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to
the passed instance.
@param ctx
@param instance | [
"Invoking",
"/",
"extending",
"this",
"method",
"will",
"cause",
"the",
"results",
"of",
"the",
"created",
"MetaRuleset",
"to",
"auto",
"-",
"wire",
"state",
"to",
"the",
"passed",
"instance",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/view/facelets/MetaTagHandler.java#L52-L65 |
ACRA/acra | acra-core/src/main/java/org/acra/collector/MediaCodecListCollector.java | MediaCodecListCollector.collectCapabilitiesForType | @NonNull
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private JSONObject collectCapabilitiesForType(@NonNull final MediaCodecInfo codecInfo, @NonNull String type) throws JSONException {
"""
Retrieve capabilities (ColorFormats and CodecProfileLevels) for a specific codec type.
@param codecInfo the currentl... | java | @NonNull
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private JSONObject collectCapabilitiesForType(@NonNull final MediaCodecInfo codecInfo, @NonNull String type) throws JSONException {
final JSONObject result = new JSONObject();
final MediaCodecInfo.CodecCapabilities codecCapabilities = codecInfo... | [
"@",
"NonNull",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN",
")",
"private",
"JSONObject",
"collectCapabilitiesForType",
"(",
"@",
"NonNull",
"final",
"MediaCodecInfo",
"codecInfo",
",",
"@",
"NonNull",
"String",
"type",
")",
"throws",
... | Retrieve capabilities (ColorFormats and CodecProfileLevels) for a specific codec type.
@param codecInfo the currently inspected codec
@param type supported type to collect
@return the color formats and codec profile levels available for a specific codec type. | [
"Retrieve",
"capabilities",
"(",
"ColorFormats",
"and",
"CodecProfileLevels",
")",
"for",
"a",
"specific",
"codec",
"type",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/collector/MediaCodecListCollector.java#L183-L238 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/AbstractClusterNodeConnectionFactory.java | AbstractClusterNodeConnectionFactory.getSocketAddress | private SocketAddress getSocketAddress(String nodeId) {
"""
Get the {@link SocketAddress} for a {@code nodeId} from {@link Partitions}.
@param nodeId
@return the {@link SocketAddress}.
@throws IllegalArgumentException if {@code nodeId} cannot be looked up.
"""
for (RedisClusterNode partition : pa... | java | private SocketAddress getSocketAddress(String nodeId) {
for (RedisClusterNode partition : partitions) {
if (partition.getNodeId().equals(nodeId)) {
return resolve(partition.getUri());
}
}
throw new IllegalArgumentException(String.format("Cannot resolve a... | [
"private",
"SocketAddress",
"getSocketAddress",
"(",
"String",
"nodeId",
")",
"{",
"for",
"(",
"RedisClusterNode",
"partition",
":",
"partitions",
")",
"{",
"if",
"(",
"partition",
".",
"getNodeId",
"(",
")",
".",
"equals",
"(",
"nodeId",
")",
")",
"{",
"r... | Get the {@link SocketAddress} for a {@code nodeId} from {@link Partitions}.
@param nodeId
@return the {@link SocketAddress}.
@throws IllegalArgumentException if {@code nodeId} cannot be looked up. | [
"Get",
"the",
"{",
"@link",
"SocketAddress",
"}",
"for",
"a",
"{",
"@code",
"nodeId",
"}",
"from",
"{",
"@link",
"Partitions",
"}",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/AbstractClusterNodeConnectionFactory.java#L97-L106 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readNotationDeclaration | private void readNotationDeclaration() throws IOException, KriptonRuntimeException {
"""
Read notation declaration.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception
"""
read(START_NOTATION);
skip();
readName();
if (!readEx... | java | private void readNotationDeclaration() throws IOException, KriptonRuntimeException {
read(START_NOTATION);
skip();
readName();
if (!readExternalId(false, false)) {
throw new KriptonRuntimeException("Expected external ID or public ID for notation", true, this.getLineNumber(), this.getColumnNumber(), getPositi... | [
"private",
"void",
"readNotationDeclaration",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"START_NOTATION",
")",
";",
"skip",
"(",
")",
";",
"readName",
"(",
")",
";",
"if",
"(",
"!",
"readExternalId",
"(",
"false",
"... | Read notation declaration.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"notation",
"declaration",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L1138-L1147 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java | GuestWindowsRegistryManager.deleteRegistryKeyInGuest | public void deleteRegistryKeyInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, boolean recursive) throws GuestComponentsOutOfDate, GuestOperationsFault,
GuestOperationsUnavailable, GuestPermissionDenied, GuestRegistryKeyHasSubkeys, GuestRegistryKeyInvalid, InvalidGuestLogin, Inva... | java | public void deleteRegistryKeyInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, boolean recursive) throws GuestComponentsOutOfDate, GuestOperationsFault,
GuestOperationsUnavailable, GuestPermissionDenied, GuestRegistryKeyHasSubkeys, GuestRegistryKeyInvalid, InvalidGuestLogin, Inva... | [
"public",
"void",
"deleteRegistryKeyInGuest",
"(",
"VirtualMachine",
"vm",
",",
"GuestAuthentication",
"auth",
",",
"GuestRegKeyNameSpec",
"keyName",
",",
"boolean",
"recursive",
")",
"throws",
"GuestComponentsOutOfDate",
",",
"GuestOperationsFault",
",",
"GuestOperationsUn... | Delete a registry key.
@param vm Virtual machine to perform the operation on.
@param auth The guest authentication data.
@param keyName The path to the registry key to be deleted.
@param recursive If true, the key is deleted along with any subkeys (if present). Otherwise, it shall only delete the key if ... | [
"Delete",
"a",
"registry",
"key",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java#L92-L96 |
protostuff/protostuff | protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java | JsonIOUtil.newJsonGenerator | public static UTF8JsonGenerator newJsonGenerator(OutputStream out, byte[] buf) {
"""
Creates a {@link UTF8JsonGenerator} for the outputstream with the supplied buf {@code outBuffer} to use.
"""
return newJsonGenerator(out, buf, 0, false, new IOContext(
DEFAULT_JSON_FACTORY._getBufferR... | java | public static UTF8JsonGenerator newJsonGenerator(OutputStream out, byte[] buf)
{
return newJsonGenerator(out, buf, 0, false, new IOContext(
DEFAULT_JSON_FACTORY._getBufferRecycler(), out, false));
} | [
"public",
"static",
"UTF8JsonGenerator",
"newJsonGenerator",
"(",
"OutputStream",
"out",
",",
"byte",
"[",
"]",
"buf",
")",
"{",
"return",
"newJsonGenerator",
"(",
"out",
",",
"buf",
",",
"0",
",",
"false",
",",
"new",
"IOContext",
"(",
"DEFAULT_JSON_FACTORY",... | Creates a {@link UTF8JsonGenerator} for the outputstream with the supplied buf {@code outBuffer} to use. | [
"Creates",
"a",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java#L210-L214 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java | NetworkServiceRecordAgent.deleteVNFCInstance | @Help(help = "remove VNFCInstance. Aka SCALE IN")
public void deleteVNFCInstance(final String idNsr, final String idVnfr) throws SDKException {
"""
Delete a VNFCInstance from a VirtualNetworkFunctionRecord. This operation is also called
scaling in. This method does not require you to specify the VirtualDeployme... | java | @Help(help = "remove VNFCInstance. Aka SCALE IN")
public void deleteVNFCInstance(final String idNsr, final String idVnfr) throws SDKException {
String url = idNsr + "/vnfrecords/" + idVnfr + "/vdunits/vnfcinstances";
requestDelete(url);
} | [
"@",
"Help",
"(",
"help",
"=",
"\"remove VNFCInstance. Aka SCALE IN\"",
")",
"public",
"void",
"deleteVNFCInstance",
"(",
"final",
"String",
"idNsr",
",",
"final",
"String",
"idVnfr",
")",
"throws",
"SDKException",
"{",
"String",
"url",
"=",
"idNsr",
"+",
"\"/vn... | Delete a VNFCInstance from a VirtualNetworkFunctionRecord. This operation is also called
scaling in. This method does not require you to specify the VirtualDeploymentUnit from which a
VNFCInstance shall be deleted.
@param idNsr the ID of the NetworkServiceRecord from which a VNFCInstance shall be deleted
@param idVnfr... | [
"Delete",
"a",
"VNFCInstance",
"from",
"a",
"VirtualNetworkFunctionRecord",
".",
"This",
"operation",
"is",
"also",
"called",
"scaling",
"in",
".",
"This",
"method",
"does",
"not",
"require",
"you",
"to",
"specify",
"the",
"VirtualDeploymentUnit",
"from",
"which",... | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java#L343-L347 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/session/SessionDatasource.java | SessionDatasource.getInstance | public static Session getInstance(String datasourceName, PageContext pc, Log log) throws PageException {
"""
load an new instance of the client datasource scope
@param datasourceName
@param appName
@param pc
@param checkExpires
@return client datasource scope
@throws PageException
"""
Struct _sct = _... | java | public static Session getInstance(String datasourceName, PageContext pc, Log log) throws PageException {
Struct _sct = _loadData(pc, datasourceName, "session", SCOPE_SESSION, log, false);
if (_sct == null) _sct = new StructImpl();
return new SessionDatasource(pc, datasourceName, _sct);
} | [
"public",
"static",
"Session",
"getInstance",
"(",
"String",
"datasourceName",
",",
"PageContext",
"pc",
",",
"Log",
"log",
")",
"throws",
"PageException",
"{",
"Struct",
"_sct",
"=",
"_loadData",
"(",
"pc",
",",
"datasourceName",
",",
"\"session\"",
",",
"SCO... | load an new instance of the client datasource scope
@param datasourceName
@param appName
@param pc
@param checkExpires
@return client datasource scope
@throws PageException | [
"load",
"an",
"new",
"instance",
"of",
"the",
"client",
"datasource",
"scope"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/session/SessionDatasource.java#L55-L61 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/util/GraphicUtils.java | GraphicUtils.fillCircle | public static void fillCircle(Graphics g, Point center, int diameter) {
"""
Draws a circle with the specified diameter using the given point as center
and fills it with the current color of the graphics context.
@param g Graphics context
@param center Circle center
@param diameter Circle diameter
"""
fil... | java | public static void fillCircle(Graphics g, Point center, int diameter){
fillCircle(g, (int) center.getX(), (int) center.getY(), diameter);
} | [
"public",
"static",
"void",
"fillCircle",
"(",
"Graphics",
"g",
",",
"Point",
"center",
",",
"int",
"diameter",
")",
"{",
"fillCircle",
"(",
"g",
",",
"(",
"int",
")",
"center",
".",
"getX",
"(",
")",
",",
"(",
"int",
")",
"center",
".",
"getY",
"(... | Draws a circle with the specified diameter using the given point as center
and fills it with the current color of the graphics context.
@param g Graphics context
@param center Circle center
@param diameter Circle diameter | [
"Draws",
"a",
"circle",
"with",
"the",
"specified",
"diameter",
"using",
"the",
"given",
"point",
"as",
"center",
"and",
"fills",
"it",
"with",
"the",
"current",
"color",
"of",
"the",
"graphics",
"context",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/util/GraphicUtils.java#L41-L43 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/common/SystemConfiguration.java | SystemConfiguration.getObjectAttributeValueAsProperties | public Properties getObjectAttributeValueAsProperties(final String _key)
throws EFapsException {
"""
Returns for given <code>OID</code> the related value as Properties. If no
attribute is found an empty Properties is returned.
@param _key key of searched attribute
@return Properties
@throws EFapsExce... | java | public Properties getObjectAttributeValueAsProperties(final String _key)
throws EFapsException
{
final Properties ret = new Properties();
final String value = getValue(_key, ConfType.OBJATTR);
if (value != null) {
try {
ret.load(new StringReader(value));
... | [
"public",
"Properties",
"getObjectAttributeValueAsProperties",
"(",
"final",
"String",
"_key",
")",
"throws",
"EFapsException",
"{",
"final",
"Properties",
"ret",
"=",
"new",
"Properties",
"(",
")",
";",
"final",
"String",
"value",
"=",
"getValue",
"(",
"_key",
... | Returns for given <code>OID</code> the related value as Properties. If no
attribute is found an empty Properties is returned.
@param _key key of searched attribute
@return Properties
@throws EFapsException on error
@see #objectAttributes | [
"Returns",
"for",
"given",
"<code",
">",
"OID<",
"/",
"code",
">",
"the",
"related",
"value",
"as",
"Properties",
".",
"If",
"no",
"attribute",
"is",
"found",
"an",
"empty",
"Properties",
"is",
"returned",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/common/SystemConfiguration.java#L350-L363 |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.updateDataPayload | private void updateDataPayload(DigitalObject object, String input)
throws StorageException {
"""
Update the data payload (ending in '.tfpackage') in the provided object.
@param object
The digital object holding our payload
@param input
The String to store
@throws StorageException
if an errors occurs or ... | java | private void updateDataPayload(DigitalObject object, String input)
throws StorageException {
try {
for (String pid : object.getPayloadIdList()) {
if (pid.endsWith(DATA_PAYLOAD_SUFFIX)) {
InputStream inStream = new ByteArrayInputStream(
input.getBytes("UTF-8"));
object.updatePayload(pid, inS... | [
"private",
"void",
"updateDataPayload",
"(",
"DigitalObject",
"object",
",",
"String",
"input",
")",
"throws",
"StorageException",
"{",
"try",
"{",
"for",
"(",
"String",
"pid",
":",
"object",
".",
"getPayloadIdList",
"(",
")",
")",
"{",
"if",
"(",
"pid",
"... | Update the data payload (ending in '.tfpackage') in the provided object.
@param object
The digital object holding our payload
@param input
The String to store
@throws StorageException
if an errors occurs or the payload is not found | [
"Update",
"the",
"data",
"payload",
"(",
"ending",
"in",
".",
"tfpackage",
")",
"in",
"the",
"provided",
"object",
"."
] | train | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L2009-L2024 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java | MetricContext.contextAwareHistogram | public ContextAwareHistogram contextAwareHistogram(String name, long windowSize, TimeUnit unit) {
"""
Get a {@link ContextAwareHistogram} with a given name and a customized {@link com.codahale.metrics.SlidingTimeWindowReservoir}
@param name name of the {@link ContextAwareHistogram}
@param windowSize normally t... | java | public ContextAwareHistogram contextAwareHistogram(String name, long windowSize, TimeUnit unit) {
ContextAwareMetricFactoryArgs.SlidingTimeWindowArgs args = new ContextAwareMetricFactoryArgs.SlidingTimeWindowArgs(
this.innerMetricContext.getMetricContext().get(), name, windowSize, unit);
return this.inn... | [
"public",
"ContextAwareHistogram",
"contextAwareHistogram",
"(",
"String",
"name",
",",
"long",
"windowSize",
",",
"TimeUnit",
"unit",
")",
"{",
"ContextAwareMetricFactoryArgs",
".",
"SlidingTimeWindowArgs",
"args",
"=",
"new",
"ContextAwareMetricFactoryArgs",
".",
"Slidi... | Get a {@link ContextAwareHistogram} with a given name and a customized {@link com.codahale.metrics.SlidingTimeWindowReservoir}
@param name name of the {@link ContextAwareHistogram}
@param windowSize normally the duration of the time window
@param unit the unit of time
@return the {@link ContextAwareHistogram} with the... | [
"Get",
"a",
"{",
"@link",
"ContextAwareHistogram",
"}",
"with",
"a",
"given",
"name",
"and",
"a",
"customized",
"{",
"@link",
"com",
".",
"codahale",
".",
"metrics",
".",
"SlidingTimeWindowReservoir",
"}"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java#L479-L483 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.notEmpty | public static <T extends CharSequence> T notEmpty(final T chars, final String message, final Object... values) {
"""
<p>Validate that the specified argument character sequence is neither {@code null} nor a length of zero (no characters); otherwise throwing an exception with the specified message.
<pre>Validate.no... | java | public static <T extends CharSequence> T notEmpty(final T chars, final String message, final Object... values) {
return INSTANCE.notEmpty(chars, message, values);
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"notEmpty",
"(",
"final",
"T",
"chars",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"return",
"INSTANCE",
".",
"notEmpty",
"(",
"chars",
",",
"me... | <p>Validate that the specified argument character sequence is neither {@code null} nor a length of zero (no characters); otherwise throwing an exception with the specified message.
<pre>Validate.notEmpty(myString, "The string must not be empty");</pre>
@param <T>
the character sequence type
@param chars
the character ... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"character",
"sequence",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"a",
"length",
"of",
"zero",
"(",
"no",
"characters",
")",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L966-L968 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterators.java | CloseableIterators.transform | public static <F, T> CloseableIterator<T> transform(CloseableIterator<F> iterator, Function<F, T> function) {
"""
Returns a closeable iterator that applies {@code function} to each element of {@code
fromIterator}.
"""
return wrap(Iterators.transform(iterator, function::apply), iterator);
} | java | public static <F, T> CloseableIterator<T> transform(CloseableIterator<F> iterator, Function<F, T> function) {
return wrap(Iterators.transform(iterator, function::apply), iterator);
} | [
"public",
"static",
"<",
"F",
",",
"T",
">",
"CloseableIterator",
"<",
"T",
">",
"transform",
"(",
"CloseableIterator",
"<",
"F",
">",
"iterator",
",",
"Function",
"<",
"F",
",",
"T",
">",
"function",
")",
"{",
"return",
"wrap",
"(",
"Iterators",
".",
... | Returns a closeable iterator that applies {@code function} to each element of {@code
fromIterator}. | [
"Returns",
"a",
"closeable",
"iterator",
"that",
"applies",
"{"
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterators.java#L232-L234 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java | UsersInner.updateAsync | public Observable<UserInner> updateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user) {
"""
Modify properties of users.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of... | java | public Observable<UserInner> updateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).map(new Func1<ServiceResponse<UserInner>, UserInner>() {
@... | [
"public",
"Observable",
"<",
"UserInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"userName",
",",
"UserFragment",
"user",
")",
"{",
"return",
"updateWithServiceResponseAsync",
... | Modify properties of users.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param userName The name of the user.
@param user The User registered to a lab
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Modify",
"properties",
"of",
"users",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java#L908-L915 |
apruve/apruve-java | src/main/java/com/apruve/models/Payment.java | Payment.getAll | public static ApruveResponse<List<Payment>> getAll(String paymentRequestId) {
"""
Fetches all Payments belonging to the PaymentRequest with the specified
ID.
@see <a
href="https://www.apruve.com/doc/developers/rest-api/">https://www.apruve.com/doc/developers/rest-api/</a>
@param paymentRequestId
The ID of t... | java | public static ApruveResponse<List<Payment>> getAll(String paymentRequestId) {
return ApruveClient.getInstance().index(
getPaymentsPath(paymentRequestId),
new GenericType<List<Payment>>() {
});
} | [
"public",
"static",
"ApruveResponse",
"<",
"List",
"<",
"Payment",
">",
">",
"getAll",
"(",
"String",
"paymentRequestId",
")",
"{",
"return",
"ApruveClient",
".",
"getInstance",
"(",
")",
".",
"index",
"(",
"getPaymentsPath",
"(",
"paymentRequestId",
")",
",",... | Fetches all Payments belonging to the PaymentRequest with the specified
ID.
@see <a
href="https://www.apruve.com/doc/developers/rest-api/">https://www.apruve.com/doc/developers/rest-api/</a>
@param paymentRequestId
The ID of the PaymentRequest that owns the Payment
@return List of Payments, or null if the PaymentReque... | [
"Fetches",
"all",
"Payments",
"belonging",
"to",
"the",
"PaymentRequest",
"with",
"the",
"specified",
"ID",
"."
] | train | https://github.com/apruve/apruve-java/blob/b188d6b17f777823c2e46427847318849978685e/src/main/java/com/apruve/models/Payment.java#L117-L122 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getSAMLAssertionVerifying | public SAMLEndpointResponse getSAMLAssertionVerifying(String appId, String devideId, String stateToken, String otpToken, String urlEndpoint, Boolean doNotNotify) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Verifies a one-time password (OTP) value provided for a second factor when m... | java | public SAMLEndpointResponse getSAMLAssertionVerifying(String appId, String devideId, String stateToken, String otpToken, String urlEndpoint, Boolean doNotNotify) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
String target;
if (urlEndpoint != null && !url... | [
"public",
"SAMLEndpointResponse",
"getSAMLAssertionVerifying",
"(",
"String",
"appId",
",",
"String",
"devideId",
",",
"String",
"stateToken",
",",
"String",
"otpToken",
",",
"String",
"urlEndpoint",
",",
"Boolean",
"doNotNotify",
")",
"throws",
"OAuthSystemException",
... | Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
@param appId
App ID of the app for which you want to generate a SAML token
@param devideId
Provide the MFA device_id you are submitting for verification.
@param stateToken
P... | [
"Verifies",
"a",
"one",
"-",
"time",
"password",
"(",
"OTP",
")",
"value",
"provided",
"for",
"a",
"second",
"factor",
"when",
"multi",
"-",
"factor",
"authentication",
"(",
"MFA",
")",
"is",
"required",
"for",
"SAML",
"authentication",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2482-L2528 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/StringUtils.java | StringUtils.checkNonEmpty | public static String checkNonEmpty(String s, String msg) {
"""
Checks that the supplied string is non-empty. If it is empty, an {@link
java.lang.IllegalArgumentException} is thrown with the supplied message.
"""
checkArgument(!s.isEmpty(), msg);
return s;
} | java | public static String checkNonEmpty(String s, String msg) {
checkArgument(!s.isEmpty(), msg);
return s;
} | [
"public",
"static",
"String",
"checkNonEmpty",
"(",
"String",
"s",
",",
"String",
"msg",
")",
"{",
"checkArgument",
"(",
"!",
"s",
".",
"isEmpty",
"(",
")",
",",
"msg",
")",
";",
"return",
"s",
";",
"}"
] | Checks that the supplied string is non-empty. If it is empty, an {@link
java.lang.IllegalArgumentException} is thrown with the supplied message. | [
"Checks",
"that",
"the",
"supplied",
"string",
"is",
"non",
"-",
"empty",
".",
"If",
"it",
"is",
"empty",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/StringUtils.java#L574-L577 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.addImage | @SneakyThrows
public static void addImage(Sheet sheet, String cpImageName, String anchorCellReference) {
"""
增加一张图片。
@param sheet 表单
@param cpImageName 类路径中的图片文件名称
@param anchorCellReference 图片锚定单元格索引
"""
// add a picture shape
val anchor = sheet.getWorkbook().get... | java | @SneakyThrows
public static void addImage(Sheet sheet, String cpImageName, String anchorCellReference) {
// add a picture shape
val anchor = sheet.getWorkbook().getCreationHelper().createClientAnchor();
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
// subsequent... | [
"@",
"SneakyThrows",
"public",
"static",
"void",
"addImage",
"(",
"Sheet",
"sheet",
",",
"String",
"cpImageName",
",",
"String",
"anchorCellReference",
")",
"{",
"// add a picture shape",
"val",
"anchor",
"=",
"sheet",
".",
"getWorkbook",
"(",
")",
".",
"getCrea... | 增加一张图片。
@param sheet 表单
@param cpImageName 类路径中的图片文件名称
@param anchorCellReference 图片锚定单元格索引 | [
"增加一张图片。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L427-L444 |
gallandarakhneorg/afc | advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPolylineDrawer.java | AbstractMapPolylineDrawer.definePath | protected void definePath(ZoomableGraphicsContext gc, T element) {
"""
Draw the polyline path.
@param gc the graphics context that must be used for drawing.
@param element the map element.
"""
gc.beginPath();
final PathIterator2afp<PathElement2d> pathIterator = element.toPath2D().getPathIterator();
s... | java | protected void definePath(ZoomableGraphicsContext gc, T element) {
gc.beginPath();
final PathIterator2afp<PathElement2d> pathIterator = element.toPath2D().getPathIterator();
switch (pathIterator.getWindingRule()) {
case EVEN_ODD:
gc.setFillRule(FillRule.EVEN_ODD);
break;
case NON_ZERO:
gc.setFillRule... | [
"protected",
"void",
"definePath",
"(",
"ZoomableGraphicsContext",
"gc",
",",
"T",
"element",
")",
"{",
"gc",
".",
"beginPath",
"(",
")",
";",
"final",
"PathIterator2afp",
"<",
"PathElement2d",
">",
"pathIterator",
"=",
"element",
".",
"toPath2D",
"(",
")",
... | Draw the polyline path.
@param gc the graphics context that must be used for drawing.
@param element the map element. | [
"Draw",
"the",
"polyline",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPolylineDrawer.java#L46-L90 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholder_ZDRM.java | QRDecompositionHouseholder_ZDRM.getQ | @Override
public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) {
"""
Computes the Q matrix from the information stored in the QR matrix. This
operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
@param Q The orthogonal Q matrix.
"""
if( compact )
Q ... | java | @Override
public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) {
if( compact )
Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,minLength);
else
Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,numRows);
for( int j = minLength-1; j >= 0; j-- ) {
... | [
"@",
"Override",
"public",
"ZMatrixRMaj",
"getQ",
"(",
"ZMatrixRMaj",
"Q",
",",
"boolean",
"compact",
")",
"{",
"if",
"(",
"compact",
")",
"Q",
"=",
"UtilDecompositons_ZDRM",
".",
"checkIdentity",
"(",
"Q",
",",
"numRows",
",",
"minLength",
")",
";",
"else... | Computes the Q matrix from the information stored in the QR matrix. This
operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
@param Q The orthogonal Q matrix. | [
"Computes",
"the",
"Q",
"matrix",
"from",
"the",
"information",
"stored",
"in",
"the",
"QR",
"matrix",
".",
"This",
"operation",
"requires",
"about",
"4",
"(",
"m<sup",
">",
"2<",
"/",
"sup",
">",
"n",
"-",
"mn<sup",
">",
"2<",
"/",
"sup",
">",
"+",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholder_ZDRM.java#L125-L138 |
Waikato/moa | moa/src/main/java/moa/clusterers/kmeanspm/CuckooHashing.java | CuckooHashing.put | public void put(long key, T element) {
"""
Adds an element to the hash table.
@param key
key value of the element
@param element
value of the element
"""
Entry<T> entry = new Entry<T>(key, element);
elements.add(entry);
this.numElements++;
fileElement(entry, true);
} | java | public void put(long key, T element) {
Entry<T> entry = new Entry<T>(key, element);
elements.add(entry);
this.numElements++;
fileElement(entry, true);
} | [
"public",
"void",
"put",
"(",
"long",
"key",
",",
"T",
"element",
")",
"{",
"Entry",
"<",
"T",
">",
"entry",
"=",
"new",
"Entry",
"<",
"T",
">",
"(",
"key",
",",
"element",
")",
";",
"elements",
".",
"add",
"(",
"entry",
")",
";",
"this",
".",
... | Adds an element to the hash table.
@param key
key value of the element
@param element
value of the element | [
"Adds",
"an",
"element",
"to",
"the",
"hash",
"table",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/kmeanspm/CuckooHashing.java#L116-L121 |
RKumsher/utils | src/main/java/com/github/rkumsher/number/RandomNumberUtils.java | RandomNumberUtils.randomDoubleLessThan | public static double randomDoubleLessThan(double maxExclusive) {
"""
Returns a random double that is less than the given double.
@param maxExclusive the value that returned double must be less than
@return the random double
@throws IllegalArgumentException if maxExclusive is less than or equal to negative {@l... | java | public static double randomDoubleLessThan(double maxExclusive) {
checkArgument(
maxExclusive > -Double.MAX_VALUE, "Cannot produce double less than %s", -Double.MAX_VALUE);
return randomDouble(-Double.MAX_VALUE, maxExclusive);
} | [
"public",
"static",
"double",
"randomDoubleLessThan",
"(",
"double",
"maxExclusive",
")",
"{",
"checkArgument",
"(",
"maxExclusive",
">",
"-",
"Double",
".",
"MAX_VALUE",
",",
"\"Cannot produce double less than %s\"",
",",
"-",
"Double",
".",
"MAX_VALUE",
")",
";",
... | Returns a random double that is less than the given double.
@param maxExclusive the value that returned double must be less than
@return the random double
@throws IllegalArgumentException if maxExclusive is less than or equal to negative {@link
Double#MAX_VALUE} | [
"Returns",
"a",
"random",
"double",
"that",
"is",
"less",
"than",
"the",
"given",
"double",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/number/RandomNumberUtils.java#L224-L228 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/SqlAgentImpl.java | SqlAgentImpl.setEntityIdValue | private void setEntityIdValue(final Object entity, final BigDecimal id, final MappingColumn column) {
"""
entityにID値を設定する
@param entity Entity
@param id ID値
@param column 設定する対象のカラム
"""
Class<?> rawType = column.getJavaType().getRawType();
if (int.class.equals(rawType) || Integer.class.equals(rawType)) ... | java | private void setEntityIdValue(final Object entity, final BigDecimal id, final MappingColumn column) {
Class<?> rawType = column.getJavaType().getRawType();
if (int.class.equals(rawType) || Integer.class.equals(rawType)) {
column.setValue(entity, id.intValue());
} else if (long.class.equals(rawType) || Long.cla... | [
"private",
"void",
"setEntityIdValue",
"(",
"final",
"Object",
"entity",
",",
"final",
"BigDecimal",
"id",
",",
"final",
"MappingColumn",
"column",
")",
"{",
"Class",
"<",
"?",
">",
"rawType",
"=",
"column",
".",
"getJavaType",
"(",
")",
".",
"getRawType",
... | entityにID値を設定する
@param entity Entity
@param id ID値
@param column 設定する対象のカラム | [
"entityにID値を設定する"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/SqlAgentImpl.java#L759-L775 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java | WebConfigParamUtils.getIntegerInitParameter | public static int getIntegerInitParameter(ExternalContext context, String name, int defaultValue) {
"""
Gets the int init parameter value from the specified context. If the parameter was not specified,
the default value is used instead.
@param context
the application's external context
@param name
the init ... | java | public static int getIntegerInitParameter(ExternalContext context, String name, int defaultValue)
{
if (name == null)
{
throw new NullPointerException();
}
String param = getStringInitParameter(context, name);
if (param == null)
{
return defau... | [
"public",
"static",
"int",
"getIntegerInitParameter",
"(",
"ExternalContext",
"context",
",",
"String",
"name",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"Stri... | Gets the int init parameter value from the specified context. If the parameter was not specified,
the default value is used instead.
@param context
the application's external context
@param name
the init parameter's name
@param deprecatedName
the init parameter's deprecated name.
@param defaultValue
the default value ... | [
"Gets",
"the",
"int",
"init",
"parameter",
"value",
"from",
"the",
"specified",
"context",
".",
"If",
"the",
"parameter",
"was",
"not",
"specified",
"the",
"default",
"value",
"is",
"used",
"instead",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java#L457-L473 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.findLast | @NotNull
public OptionalDouble findLast() {
"""
Returns the last element wrapped by {@code OptionalDouble} class.
If stream is empty, returns {@code OptionalDouble.empty()}.
<p>This is a short-circuiting terminal operation.
@return an {@code OptionalDouble} with the last element
or {@code OptionalDoubl... | java | @NotNull
public OptionalDouble findLast() {
return reduce(new DoubleBinaryOperator() {
@Override
public double applyAsDouble(double left, double right) {
return right;
}
});
} | [
"@",
"NotNull",
"public",
"OptionalDouble",
"findLast",
"(",
")",
"{",
"return",
"reduce",
"(",
"new",
"DoubleBinaryOperator",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"applyAsDouble",
"(",
"double",
"left",
",",
"double",
"right",
")",
"{",
"retu... | Returns the last element wrapped by {@code OptionalDouble} class.
If stream is empty, returns {@code OptionalDouble.empty()}.
<p>This is a short-circuiting terminal operation.
@return an {@code OptionalDouble} with the last element
or {@code OptionalDouble.empty()} if the stream is empty
@since 1.1.8 | [
"Returns",
"the",
"last",
"element",
"wrapped",
"by",
"{",
"@code",
"OptionalDouble",
"}",
"class",
".",
"If",
"stream",
"is",
"empty",
"returns",
"{",
"@code",
"OptionalDouble",
".",
"empty",
"()",
"}",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L1148-L1156 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java | AjaxAddableTabbedPanel.newCloseTitle | protected Component newCloseTitle(final String titleId, final IModel<?> titleModel,
final int index) {
"""
Factory method for tab titles. Returned component can be anything that can attach to span
tags such as a fragment, panel, or a label
@param titleId
id of title component
@param titleModel
model conta... | java | protected Component newCloseTitle(final String titleId, final IModel<?> titleModel,
final int index)
{
return new Label(titleId, titleModel);
} | [
"protected",
"Component",
"newCloseTitle",
"(",
"final",
"String",
"titleId",
",",
"final",
"IModel",
"<",
"?",
">",
"titleModel",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"Label",
"(",
"titleId",
",",
"titleModel",
")",
";",
"}"
] | Factory method for tab titles. Returned component can be anything that can attach to span
tags such as a fragment, panel, or a label
@param titleId
id of title component
@param titleModel
model containing tab title
@param index
index of tab
@return title component | [
"Factory",
"method",
"for",
"tab",
"titles",
".",
"Returned",
"component",
"can",
"be",
"anything",
"that",
"can",
"attach",
"to",
"span",
"tags",
"such",
"as",
"a",
"fragment",
"panel",
"or",
"a",
"label"
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java#L423-L427 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/img/ImageExtensions.java | ImageExtensions.createPdf | public static void createPdf(final OutputStream result, final List<BufferedImage> images)
throws DocumentException, IOException {
"""
Creates from the given Collection of images an pdf file.
@param result
the output stream from the pdf file where the images shell be written.
@param images
the BufferedImage... | java | public static void createPdf(final OutputStream result, final List<BufferedImage> images)
throws DocumentException, IOException
{
final Document document = new Document();
PdfWriter.getInstance(document, result);
for (final BufferedImage image : images)
{
final ByteArrayOutputStream baos = new ByteArrayOu... | [
"public",
"static",
"void",
"createPdf",
"(",
"final",
"OutputStream",
"result",
",",
"final",
"List",
"<",
"BufferedImage",
">",
"images",
")",
"throws",
"DocumentException",
",",
"IOException",
"{",
"final",
"Document",
"document",
"=",
"new",
"Document",
"(",... | Creates from the given Collection of images an pdf file.
@param result
the output stream from the pdf file where the images shell be written.
@param images
the BufferedImage collection to be written in the pdf file.
@throws DocumentException
is thrown if an error occurs when trying to get an instance of {@link PdfWrit... | [
"Creates",
"from",
"the",
"given",
"Collection",
"of",
"images",
"an",
"pdf",
"file",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/img/ImageExtensions.java#L128-L144 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java | SARLProjectConfigurator.configureSARLSourceFolders | public static void configureSARLSourceFolders(IProject project, boolean createFolders, IProgressMonitor monitor) {
"""
Configure the source folders for a SARL project.
@param project the project.
@param createFolders indicates if the folders must be created or not.
@param monitor the monitor.
@since 0.8
@... | java | public static void configureSARLSourceFolders(IProject project, boolean createFolders, IProgressMonitor monitor) {
try {
final SubMonitor subMonitor = SubMonitor.convert(monitor, 8);
final OutParameter<IFolder[]> sourceFolders = new OutParameter<>();
final OutParameter<IFolder[]> testSourceFolders = new Out... | [
"public",
"static",
"void",
"configureSARLSourceFolders",
"(",
"IProject",
"project",
",",
"boolean",
"createFolders",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"try",
"{",
"final",
"SubMonitor",
"subMonitor",
"=",
"SubMonitor",
".",
"convert",
"(",
"monitor",
... | Configure the source folders for a SARL project.
@param project the project.
@param createFolders indicates if the folders must be created or not.
@param monitor the monitor.
@since 0.8
@see #addSarlNatures(IProject, IProgressMonitor)
@see #configureSARLProject(IProject, boolean, boolean, boolean, IProgressMonitor) | [
"Configure",
"the",
"source",
"folders",
"for",
"a",
"SARL",
"project",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/natures/SARLProjectConfigurator.java#L369-L403 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java | LoadBalancersInner.createOrUpdate | public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) {
"""
Creates or updates a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param parameters Parameters suppli... | java | public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().body();
} | [
"public",
"LoadBalancerInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"LoadBalancerInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBalancerName",
","... | Creates or updates a load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param parameters Parameters supplied to the create or update load balancer operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cl... | [
"Creates",
"or",
"updates",
"a",
"load",
"balancer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java#L444-L446 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.stripPrefixIfPresent | public static String stripPrefixIfPresent(final String key, final String prefix) {
"""
Strips the prefix from the key if it is present. For example, for input key
ufs://my-bucket-name/my-key/file and prefix ufs://my-bucket-name/, the output would be
my-key/file. This method will leave keys without a prefix unalt... | java | public static String stripPrefixIfPresent(final String key, final String prefix) {
if (key.startsWith(prefix)) {
return key.substring(prefix.length());
}
return key;
} | [
"public",
"static",
"String",
"stripPrefixIfPresent",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"prefix",
")",
"{",
"if",
"(",
"key",
".",
"startsWith",
"(",
"prefix",
")",
")",
"{",
"return",
"key",
".",
"substring",
"(",
"prefix",
".",
"le... | Strips the prefix from the key if it is present. For example, for input key
ufs://my-bucket-name/my-key/file and prefix ufs://my-bucket-name/, the output would be
my-key/file. This method will leave keys without a prefix unaltered, ie. my-key/file
returns my-key/file.
@param key the key to strip
@param prefix prefix t... | [
"Strips",
"the",
"prefix",
"from",
"the",
"key",
"if",
"it",
"is",
"present",
".",
"For",
"example",
"for",
"input",
"key",
"ufs",
":",
"//",
"my",
"-",
"bucket",
"-",
"name",
"/",
"my",
"-",
"key",
"/",
"file",
"and",
"prefix",
"ufs",
":",
"//",
... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L364-L369 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/PipelineApi.java | PipelineApi.retryPipelineJob | public Pipeline retryPipelineJob(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
"""
Retry a job in specified pipelines in a project.
<pre><code>GitLab Endpoint: POST /projects/:id/pipelines/:pipeline_id/retry</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), ... | java | public Pipeline retryPipelineJob(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
GitLabApiForm formData = null;
Response response = post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "retry");
return (response.readEnti... | [
"public",
"Pipeline",
"retryPipelineJob",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"pipelineId",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"null",
";",
"Response",
"response",
"=",
"post",
"(",
"Response",
".",
"Status",
".",... | Retry a job in specified pipelines in a project.
<pre><code>GitLab Endpoint: POST /projects/:id/pipelines/:pipeline_id/retry</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param pipelineId the pipeline ID to retry a job from
@return pipeline instance ... | [
"Retry",
"a",
"job",
"in",
"specified",
"pipelines",
"in",
"a",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/PipelineApi.java#L275-L279 |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/appender/FileAppender.java | FileAppender.getLogFile | public synchronized File getLogFile() {
"""
if the file hasn't been settled, will auto set to external storage.
@return the log file used to log to external storage
"""
File dir = getStorageDir();
if (dir == null) {
Log.e(TAG, "Unable to open log file from external storage");
... | java | public synchronized File getLogFile() {
File dir = getStorageDir();
if (dir == null) {
Log.e(TAG, "Unable to open log file from external storage");
return null;
}
switch (wraper.nameFormat) {
case WrapFormatter.NAME_FORMAT_DATE: {
Str... | [
"public",
"synchronized",
"File",
"getLogFile",
"(",
")",
"{",
"File",
"dir",
"=",
"getStorageDir",
"(",
")",
";",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"Log",
".",
"e",
"(",
"TAG",
",",
"\"Unable to open log file from external storage\"",
")",
";",
"r... | if the file hasn't been settled, will auto set to external storage.
@return the log file used to log to external storage | [
"if",
"the",
"file",
"hasn",
"t",
"been",
"settled",
"will",
"auto",
"set",
"to",
"external",
"storage",
"."
] | train | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/appender/FileAppender.java#L403-L440 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/ShareableResource.java | ShareableResource.sumConsumptions | public int sumConsumptions(Collection<VM> ids, boolean undef) {
"""
Get the cumulative VMs consumption.
@param ids the VMs.
@param undef {@code true} to include the undefined elements using the default value
@return the value
"""
int s = 0;
for (VM u: ids) {
if (consumptionDefined(u) || un... | java | public int sumConsumptions(Collection<VM> ids, boolean undef) {
int s = 0;
for (VM u: ids) {
if (consumptionDefined(u) || undef) {
s += vmsConsumption.get(u);
}
}
return s;
} | [
"public",
"int",
"sumConsumptions",
"(",
"Collection",
"<",
"VM",
">",
"ids",
",",
"boolean",
"undef",
")",
"{",
"int",
"s",
"=",
"0",
";",
"for",
"(",
"VM",
"u",
":",
"ids",
")",
"{",
"if",
"(",
"consumptionDefined",
"(",
"u",
")",
"||",
"undef",
... | Get the cumulative VMs consumption.
@param ids the VMs.
@param undef {@code true} to include the undefined elements using the default value
@return the value | [
"Get",
"the",
"cumulative",
"VMs",
"consumption",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L367-L375 |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java | AbstractCSSParser.doubleValue | protected double doubleValue(final char op, final String s) {
"""
Parses the sting into an double.
@param op the sign char
@param s the string to parse
@return the double value
"""
final double result = Double.parseDouble(s);
if (op == '-') {
return -1 * result;
}
... | java | protected double doubleValue(final char op, final String s) {
final double result = Double.parseDouble(s);
if (op == '-') {
return -1 * result;
}
return result;
} | [
"protected",
"double",
"doubleValue",
"(",
"final",
"char",
"op",
",",
"final",
"String",
"s",
")",
"{",
"final",
"double",
"result",
"=",
"Double",
".",
"parseDouble",
"(",
"s",
")",
";",
"if",
"(",
"op",
"==",
"'",
"'",
")",
"{",
"return",
"-",
"... | Parses the sting into an double.
@param op the sign char
@param s the string to parse
@return the double value | [
"Parses",
"the",
"sting",
"into",
"an",
"double",
"."
] | train | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java#L767-L773 |
opentracing-contrib/java-kafka-client | opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java | TracingKafkaUtils.injectSecond | static void injectSecond(SpanContext spanContext, Headers headers,
Tracer tracer) {
"""
Inject second Span Context to record headers
@param spanContext Span Context
@param headers record headers
"""
tracer.inject(spanContext, Format.Builtin.TEXT_MAP,
new HeadersMapInjectAdapter(headers, t... | java | static void injectSecond(SpanContext spanContext, Headers headers,
Tracer tracer) {
tracer.inject(spanContext, Format.Builtin.TEXT_MAP,
new HeadersMapInjectAdapter(headers, true));
} | [
"static",
"void",
"injectSecond",
"(",
"SpanContext",
"spanContext",
",",
"Headers",
"headers",
",",
"Tracer",
"tracer",
")",
"{",
"tracer",
".",
"inject",
"(",
"spanContext",
",",
"Format",
".",
"Builtin",
".",
"TEXT_MAP",
",",
"new",
"HeadersMapInjectAdapter",... | Inject second Span Context to record headers
@param spanContext Span Context
@param headers record headers | [
"Inject",
"second",
"Span",
"Context",
"to",
"record",
"headers"
] | train | https://github.com/opentracing-contrib/java-kafka-client/blob/e3aeec8d68d3a2dead89b9dbdfea3791817e1a26/opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java#L75-L79 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java | LocaleHelper.getLocaleDisplayName | @Nonnull
public static String getLocaleDisplayName (@Nullable final Locale aLocale, @Nonnull final Locale aContentLocale) {
"""
Get the display name of the passed language in the currently selected UI
language.
@param aLocale
The locale from which the display name is required. May be
<code>null</code>.
@p... | java | @Nonnull
public static String getLocaleDisplayName (@Nullable final Locale aLocale, @Nonnull final Locale aContentLocale)
{
ValueEnforcer.notNull (aContentLocale, "ContentLocale");
if (aLocale == null || aLocale.equals (LOCALE_INDEPENDENT))
return ELocaleName.ID_LANGUAGE_INDEPENDENT.getDisplayText (a... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getLocaleDisplayName",
"(",
"@",
"Nullable",
"final",
"Locale",
"aLocale",
",",
"@",
"Nonnull",
"final",
"Locale",
"aContentLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aContentLocale",
",",
"\"ContentLoc... | Get the display name of the passed language in the currently selected UI
language.
@param aLocale
The locale from which the display name is required. May be
<code>null</code>.
@param aContentLocale
The locale in which the name of the locale is required. If aLocale
is "de" and display locale is "de" the result would be... | [
"Get",
"the",
"display",
"name",
"of",
"the",
"passed",
"language",
"in",
"the",
"currently",
"selected",
"UI",
"language",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java#L146-L156 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/js/JSMarshaller.java | JSMarshaller.javaScriptEscape | @Nullable
public static String javaScriptEscape (@Nullable final String sInput) {
"""
Turn special characters into escaped characters conforming to JavaScript.
Handles complete character set defined in HTML 4.01 recommendation.<br>
Reference: <a href=
"http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_... | java | @Nullable
public static String javaScriptEscape (@Nullable final String sInput)
{
if (StringHelper.hasNoText (sInput))
return sInput;
final char [] aInput = sInput.toCharArray ();
if (!StringHelper.containsAny (aInput, CHARS_TO_MASK))
return sInput;
final char [] ret = new char [aInput... | [
"@",
"Nullable",
"public",
"static",
"String",
"javaScriptEscape",
"(",
"@",
"Nullable",
"final",
"String",
"sInput",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sInput",
")",
")",
"return",
"sInput",
";",
"final",
"char",
"[",
"]",
"aInpu... | Turn special characters into escaped characters conforming to JavaScript.
Handles complete character set defined in HTML 4.01 recommendation.<br>
Reference: <a href=
"http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals#String_Literals"
> Core JavaScript 1.5 Guide </a>
@param sInput
the input string... | [
"Turn",
"special",
"characters",
"into",
"escaped",
"characters",
"conforming",
"to",
"JavaScript",
".",
"Handles",
"complete",
"character",
"set",
"defined",
"in",
"HTML",
"4",
".",
"01",
"recommendation",
".",
"<br",
">",
"Reference",
":",
"<a",
"href",
"=",... | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/js/JSMarshaller.java#L114-L165 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.chunkedUploadAppend | public long chunkedUploadAppend(String uploadId, long uploadOffset, byte[] data)
throws DbxException {
"""
Equivalent to {@link #chunkedUploadAppend(String, long, byte[], int, int)
chunkedUploadAppend(uploadId, uploadOffset, data, 0, data.length)}.
"""
return chunkedUploadAppend(uploadId, uplo... | java | public long chunkedUploadAppend(String uploadId, long uploadOffset, byte[] data)
throws DbxException
{
return chunkedUploadAppend(uploadId, uploadOffset, data, 0, data.length);
} | [
"public",
"long",
"chunkedUploadAppend",
"(",
"String",
"uploadId",
",",
"long",
"uploadOffset",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"DbxException",
"{",
"return",
"chunkedUploadAppend",
"(",
"uploadId",
",",
"uploadOffset",
",",
"data",
",",
"0",
",... | Equivalent to {@link #chunkedUploadAppend(String, long, byte[], int, int)
chunkedUploadAppend(uploadId, uploadOffset, data, 0, data.length)}. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1071-L1075 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.writeLines | public <T> File writeLines(Collection<T> list, boolean isAppend) throws IORuntimeException {
"""
将列表写入文件
@param <T> 集合元素类型
@param list 列表
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeException IO异常
"""
return writeLines(list, null, isAppend);
} | java | public <T> File writeLines(Collection<T> list, boolean isAppend) throws IORuntimeException {
return writeLines(list, null, isAppend);
} | [
"public",
"<",
"T",
">",
"File",
"writeLines",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeLines",
"(",
"list",
",",
"null",
",",
"isAppend",
")",
";",
"}"
] | 将列表写入文件
@param <T> 集合元素类型
@param list 列表
@param isAppend 是否追加
@return 目标文件
@throws IORuntimeException IO异常 | [
"将列表写入文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L182-L184 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java | LabelProcessor.getLabelByLanguage | public static String getLabelByLanguage(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
"""
Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale... | java | public static String getLabelByLanguage(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
return getLabelByLanguage(locale.getLanguage(), label);
} | [
"public",
"static",
"String",
"getLabelByLanguage",
"(",
"final",
"Locale",
"locale",
",",
"final",
"LabelOrBuilder",
"label",
")",
"throws",
"NotAvailableException",
"{",
"return",
"getLabelByLanguage",
"(",
"locale",
".",
"getLanguage",
"(",
")",
",",
"label",
"... | Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale by calling
{@link Locale#getLanguage()}.
@param locale the locale from which a language code is extracted
@param label the labe... | [
"Get",
"the",
"first",
"label",
"for",
"a",
"languageCode",
"from",
"a",
"label",
"type",
".",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#getLabelByLanguage",
"(",
"String",
"LabelOrBuilder",
")",
"}",
"but",
"the",
"language",
"code",
"is"... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java#L275-L277 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/trees/ExtraTree.java | ExtraTree.fillList | static private <T> void fillList(final int listsToAdd, Stack<List<T>> reusableLists, List<List<T>> aSplit) {
"""
Add lists to a list of lists
@param <T> the content type of the list
@param listsToAdd the number of lists to add
@param reusableLists available pre allocated lists for reuse
@param aSplit the list... | java | static private <T> void fillList(final int listsToAdd, Stack<List<T>> reusableLists, List<List<T>> aSplit)
{
for(int j = 0; j < listsToAdd; j++)
if(reusableLists.isEmpty())
aSplit.add(new ArrayList<>());
else
aSplit.add(reusableLists.pop());
} | [
"static",
"private",
"<",
"T",
">",
"void",
"fillList",
"(",
"final",
"int",
"listsToAdd",
",",
"Stack",
"<",
"List",
"<",
"T",
">",
">",
"reusableLists",
",",
"List",
"<",
"List",
"<",
"T",
">",
">",
"aSplit",
")",
"{",
"for",
"(",
"int",
"j",
"... | Add lists to a list of lists
@param <T> the content type of the list
@param listsToAdd the number of lists to add
@param reusableLists available pre allocated lists for reuse
@param aSplit the list of lists to add to | [
"Add",
"lists",
"to",
"a",
"list",
"of",
"lists"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/ExtraTree.java#L554-L561 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/JulianDate.java | JulianDate.ofEpochDay | static JulianDate ofEpochDay(final long epochDay) {
"""
Obtains a {@code JulianDate} representing a date in the Julian calendar
system from the epoch-day.
@param epochDay the epoch day to convert based on 1970-01-01 (ISO)
@return the date in Julian calendar system, not null
@throws DateTimeException if the ... | java | static JulianDate ofEpochDay(final long epochDay) {
EPOCH_DAY.range().checkValidValue(epochDay, EPOCH_DAY); // validate outer bounds
// use of Julian 0001 makes leap year at end of cycle
long julianEpochDay = epochDay + JULIAN_0001_TO_ISO_1970;
long cycle = Math.floorDiv(julianEpochDay,... | [
"static",
"JulianDate",
"ofEpochDay",
"(",
"final",
"long",
"epochDay",
")",
"{",
"EPOCH_DAY",
".",
"range",
"(",
")",
".",
"checkValidValue",
"(",
"epochDay",
",",
"EPOCH_DAY",
")",
";",
"// validate outer bounds",
"// use of Julian 0001 makes leap year at end of cycle... | Obtains a {@code JulianDate} representing a date in the Julian calendar
system from the epoch-day.
@param epochDay the epoch day to convert based on 1970-01-01 (ISO)
@return the date in Julian calendar system, not null
@throws DateTimeException if the epoch-day is out of range | [
"Obtains",
"a",
"{",
"@code",
"JulianDate",
"}",
"representing",
"a",
"date",
"in",
"the",
"Julian",
"calendar",
"system",
"from",
"the",
"epoch",
"-",
"day",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/JulianDate.java#L232-L245 |
joestelmach/natty | src/main/java/com/joestelmach/natty/WalkerState.java | WalkerState.seekToMonth | public void seekToMonth(String direction, String seekAmount, String month) {
"""
seeks to a particular month
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekAmount the amount to seek. Must be guaranteed to parse as an integer
@param month the month to... | java | public void seekToMonth(String direction, String seekAmount, String month) {
int seekAmountInt = Integer.parseInt(seekAmount);
int monthInt = Integer.parseInt(month);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(monthInt >= 1 && monthInt <= 12);
markDateInvocation()... | [
"public",
"void",
"seekToMonth",
"(",
"String",
"direction",
",",
"String",
"seekAmount",
",",
"String",
"month",
")",
"{",
"int",
"seekAmountInt",
"=",
"Integer",
".",
"parseInt",
"(",
"seekAmount",
")",
";",
"int",
"monthInt",
"=",
"Integer",
".",
"parseIn... | seeks to a particular month
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekAmount the amount to seek. Must be guaranteed to parse as an integer
@param month the month to seek to. Must be guaranteed to parse as an integer
between 1 and 12 | [
"seeks",
"to",
"a",
"particular",
"month"
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/WalkerState.java#L169-L194 |
bit3/jsass | example/webapp/src/main/java/io/bit3/jsass/example/webapp/JsassServlet.java | JsassServlet.resolveImport | private Collection<Import> resolveImport(Path path) throws IOException, URISyntaxException {
"""
Try to determine the import object for a given path.
@param path The path to resolve.
@return The import object or {@code null} if the file was not found.
"""
URL resource = resolveResource(path);
if (null... | java | private Collection<Import> resolveImport(Path path) throws IOException, URISyntaxException {
URL resource = resolveResource(path);
if (null == resource) {
return null;
}
// calculate a webapp absolute URI
final URI uri = new URI(
Paths.get("/").resolve(
Paths.get(getServletContext().getResource("/... | [
"private",
"Collection",
"<",
"Import",
">",
"resolveImport",
"(",
"Path",
"path",
")",
"throws",
"IOException",
",",
"URISyntaxException",
"{",
"URL",
"resource",
"=",
"resolveResource",
"(",
"path",
")",
";",
"if",
"(",
"null",
"==",
"resource",
")",
"{",
... | Try to determine the import object for a given path.
@param path The path to resolve.
@return The import object or {@code null} if the file was not found. | [
"Try",
"to",
"determine",
"the",
"import",
"object",
"for",
"a",
"given",
"path",
"."
] | train | https://github.com/bit3/jsass/blob/fba91d5cb1eb507c7cfde5a261e04b1d328cb1ef/example/webapp/src/main/java/io/bit3/jsass/example/webapp/JsassServlet.java#L139-L156 |
pedrovgs/Renderers | renderers/src/main/java/com/pedrogomez/renderers/RVRendererAdapter.java | RVRendererAdapter.onBindViewHolder | @Override public void onBindViewHolder(RendererViewHolder viewHolder, int position) {
"""
Given a RendererViewHolder passed as argument and a position renders the view using the
Renderer previously stored into the RendererViewHolder.
@param viewHolder with a Renderer class inside.
@param position to render.
... | java | @Override public void onBindViewHolder(RendererViewHolder viewHolder, int position) {
T content = getItem(position);
Renderer<T> renderer = viewHolder.getRenderer();
if (renderer == null) {
throw new NullRendererBuiltException("RendererBuilder have to return a not null renderer");
}
renderer.s... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"RendererViewHolder",
"viewHolder",
",",
"int",
"position",
")",
"{",
"T",
"content",
"=",
"getItem",
"(",
"position",
")",
";",
"Renderer",
"<",
"T",
">",
"renderer",
"=",
"viewHolder",
".",
"getRe... | Given a RendererViewHolder passed as argument and a position renders the view using the
Renderer previously stored into the RendererViewHolder.
@param viewHolder with a Renderer class inside.
@param position to render. | [
"Given",
"a",
"RendererViewHolder",
"passed",
"as",
"argument",
"and",
"a",
"position",
"renders",
"the",
"view",
"using",
"the",
"Renderer",
"previously",
"stored",
"into",
"the",
"RendererViewHolder",
"."
] | train | https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/RVRendererAdapter.java#L113-L122 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java | DSSPParser.parseFile | public static List<SecStrucState> parseFile(String dsspPath,
Structure structure, boolean assign)
throws IOException, StructureException {
"""
Parse a DSSP output file and return the secondary structure
annotation as a List of {@link SecStrucState} objects.
@param dsspPath path to the DSSP file to pars... | java | public static List<SecStrucState> parseFile(String dsspPath,
Structure structure, boolean assign)
throws IOException, StructureException {
File file = new File(dsspPath);
Reader read = new FileReader(file);
BufferedReader reader = new BufferedReader(read);
return generalParse(reader, structure, assign)... | [
"public",
"static",
"List",
"<",
"SecStrucState",
">",
"parseFile",
"(",
"String",
"dsspPath",
",",
"Structure",
"structure",
",",
"boolean",
"assign",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"dssp... | Parse a DSSP output file and return the secondary structure
annotation as a List of {@link SecStrucState} objects.
@param dsspPath path to the DSSP file to parse
@param structure Structure object associated to the dssp
@param assign assigns the SS to the structure if true
@return a List of SS annotation objects
@throw... | [
"Parse",
"a",
"DSSP",
"output",
"file",
"and",
"return",
"the",
"secondary",
"structure",
"annotation",
"as",
"a",
"List",
"of",
"{",
"@link",
"SecStrucState",
"}",
"objects",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java#L92-L100 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/NetworkElement.java | NetworkElement.changeProperty | public void changeProperty(String propertyName, Object propertyValue)
throws ShanksException {
"""
If the property exists, this method changes it. If not, this method
creates it.
@param propertyName
@param propertyValue
@throws UnsupportedNetworkElementFieldException
"""
this.properti... | java | public void changeProperty(String propertyName, Object propertyValue)
throws ShanksException {
this.properties.put(propertyName, propertyValue);
this.checkStatus();
} | [
"public",
"void",
"changeProperty",
"(",
"String",
"propertyName",
",",
"Object",
"propertyValue",
")",
"throws",
"ShanksException",
"{",
"this",
".",
"properties",
".",
"put",
"(",
"propertyName",
",",
"propertyValue",
")",
";",
"this",
".",
"checkStatus",
"(",... | If the property exists, this method changes it. If not, this method
creates it.
@param propertyName
@param propertyValue
@throws UnsupportedNetworkElementFieldException | [
"If",
"the",
"property",
"exists",
"this",
"method",
"changes",
"it",
".",
"If",
"not",
"this",
"method",
"creates",
"it",
"."
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/NetworkElement.java#L253-L257 |
yshrsmz/KeyboardVisibilityEvent | keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java | UIUtil.showKeyboardInDialog | public static void showKeyboardInDialog(Dialog dialog, EditText target) {
"""
Show keyboard and focus to given EditText.
Use this method if target EditText is in Dialog.
@param dialog Dialog
@param target EditText to focus
"""
if (dialog == null || target == null) {
return;
}
... | java | public static void showKeyboardInDialog(Dialog dialog, EditText target) {
if (dialog == null || target == null) {
return;
}
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
target.requestFocus();
} | [
"public",
"static",
"void",
"showKeyboardInDialog",
"(",
"Dialog",
"dialog",
",",
"EditText",
"target",
")",
"{",
"if",
"(",
"dialog",
"==",
"null",
"||",
"target",
"==",
"null",
")",
"{",
"return",
";",
"}",
"dialog",
".",
"getWindow",
"(",
")",
".",
... | Show keyboard and focus to given EditText.
Use this method if target EditText is in Dialog.
@param dialog Dialog
@param target EditText to focus | [
"Show",
"keyboard",
"and",
"focus",
"to",
"given",
"EditText",
".",
"Use",
"this",
"method",
"if",
"target",
"EditText",
"is",
"in",
"Dialog",
"."
] | train | https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java#L47-L54 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRDirectLight.java | GVRDirectLight.setShadowRange | public void setShadowRange(float near, float far) {
"""
Sets the near and far range of the shadow map camera.
<p>
This function enables shadow mapping and sets the shadow map
camera near and far range, controlling which objects affect
the shadow map. To modify other properties of the shadow map
camera's proje... | java | public void setShadowRange(float near, float far)
{
GVRSceneObject owner = getOwnerObject();
GVROrthogonalCamera shadowCam = null;
if (owner == null)
{
throw new UnsupportedOperationException("Light must have an owner to set the shadow range");
}
GVRShado... | [
"public",
"void",
"setShadowRange",
"(",
"float",
"near",
",",
"float",
"far",
")",
"{",
"GVRSceneObject",
"owner",
"=",
"getOwnerObject",
"(",
")",
";",
"GVROrthogonalCamera",
"shadowCam",
"=",
"null",
";",
"if",
"(",
"owner",
"==",
"null",
")",
"{",
"thr... | Sets the near and far range of the shadow map camera.
<p>
This function enables shadow mapping and sets the shadow map
camera near and far range, controlling which objects affect
the shadow map. To modify other properties of the shadow map
camera's projection, you can call {@link GVRShadowMap#getCamera}
and update them... | [
"Sets",
"the",
"near",
"and",
"far",
"range",
"of",
"the",
"shadow",
"map",
"camera",
".",
"<p",
">",
"This",
"function",
"enables",
"shadow",
"mapping",
"and",
"sets",
"the",
"shadow",
"map",
"camera",
"near",
"and",
"far",
"range",
"controlling",
"which"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRDirectLight.java#L242-L269 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/CmsUpdateDBManager.java | CmsUpdateDBManager.getMySqlEngine | protected void getMySqlEngine(Map<String, String> dbPoolData) {
"""
Retrieves the mysql engine name.<p>
@param dbPoolData the database pool data
"""
String engine = "MYISAM";
CmsSetupDb setupDb = new CmsSetupDb(null);
CmsSetupDBWrapper db = null;
try {
setupDb.se... | java | protected void getMySqlEngine(Map<String, String> dbPoolData) {
String engine = "MYISAM";
CmsSetupDb setupDb = new CmsSetupDb(null);
CmsSetupDBWrapper db = null;
try {
setupDb.setConnection(
dbPoolData.get("driver"),
dbPoolData.get("url"),
... | [
"protected",
"void",
"getMySqlEngine",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"dbPoolData",
")",
"{",
"String",
"engine",
"=",
"\"MYISAM\"",
";",
"CmsSetupDb",
"setupDb",
"=",
"new",
"CmsSetupDb",
"(",
"null",
")",
";",
"CmsSetupDBWrapper",
"db",
"="... | Retrieves the mysql engine name.<p>
@param dbPoolData the database pool data | [
"Retrieves",
"the",
"mysql",
"engine",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/CmsUpdateDBManager.java#L389-L417 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChildren | public List<VirtualFile> getChildren() {
"""
Get the children. This is the combined list of real children within this directory, as well as virtual children
created by submounts.
@return the children
"""
// isDirectory does the read security check
if (!isDirectory()) { return Collections.e... | java | public List<VirtualFile> getChildren() {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
final VFS.Mount mount = VFS.getMount(this);
final Set<String> submounts = VFS.getSubmounts(this);
final List<String> names = mount.getFileS... | [
"public",
"List",
"<",
"VirtualFile",
">",
"getChildren",
"(",
")",
"{",
"// isDirectory does the read security check",
"if",
"(",
"!",
"isDirectory",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"final",
"VFS",
".",
"Mo... | Get the children. This is the combined list of real children within this directory, as well as virtual children
created by submounts.
@return the children | [
"Get",
"the",
"children",
".",
"This",
"is",
"the",
"combined",
"list",
"of",
"real",
"children",
"within",
"this",
"directory",
"as",
"well",
"as",
"virtual",
"children",
"created",
"by",
"submounts",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L395-L412 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.drawEmbedded | public void drawEmbedded(float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2) {
"""
Draw a section of this image at a particular location and scale on the screen, while this
is image is "in use", i.e. between calls to startUse and endUse.
@param x The x position to draw the i... | java | public void drawEmbedded(float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2) {
drawEmbedded(x,y,x2,y2,srcx,srcy,srcx2,srcy2,null);
} | [
"public",
"void",
"drawEmbedded",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"x2",
",",
"float",
"y2",
",",
"float",
"srcx",
",",
"float",
"srcy",
",",
"float",
"srcx2",
",",
"float",
"srcy2",
")",
"{",
"drawEmbedded",
"(",
"x",
",",
"y",
... | Draw a section of this image at a particular location and scale on the screen, while this
is image is "in use", i.e. between calls to startUse and endUse.
@param x The x position to draw the image
@param y The y position to draw the image
@param x2 The x position of the bottom right corner of the drawn image
@param y2... | [
"Draw",
"a",
"section",
"of",
"this",
"image",
"at",
"a",
"particular",
"location",
"and",
"scale",
"on",
"the",
"screen",
"while",
"this",
"is",
"image",
"is",
"in",
"use",
"i",
".",
"e",
".",
"between",
"calls",
"to",
"startUse",
"and",
"endUse",
"."... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L1076-L1078 |
kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioSelector.java | AbstractNioSelector.openSelector | private void openSelector(ThreadNameDeterminer determiner) {
"""
Start the {@link AbstractNioWorker} and return the {@link Selector} that will be used for
the {@link AbstractNioChannel}'s when they get registered
"""
try {
selector = SelectorUtil.open();
} catch (Throwable t) {
... | java | private void openSelector(ThreadNameDeterminer determiner) {
try {
selector = SelectorUtil.open();
} catch (Throwable t) {
throw new ChannelException("Failed to create a selector.", t);
}
// Start the worker thread with the new Selector.
boolean success =... | [
"private",
"void",
"openSelector",
"(",
"ThreadNameDeterminer",
"determiner",
")",
"{",
"try",
"{",
"selector",
"=",
"SelectorUtil",
".",
"open",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"throw",
"new",
"ChannelException",
"(",
"\"Failed... | Start the {@link AbstractNioWorker} and return the {@link Selector} that will be used for
the {@link AbstractNioChannel}'s when they get registered | [
"Start",
"the",
"{"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioSelector.java#L408-L433 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.catalog_formatted_privateCloudReseller_GET | public net.minidev.ovh.api.order.catalog.pcc.OvhCatalog catalog_formatted_privateCloudReseller_GET(OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
"""
Retrieve information of Private Cloud Reseller catalog
REST: GET /order/catalog/formatted/privateCloudReseller
@param ovhSubsidiary [required] Subsidia... | java | public net.minidev.ovh.api.order.catalog.pcc.OvhCatalog catalog_formatted_privateCloudReseller_GET(OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
String qPath = "/order/catalog/formatted/privateCloudReseller";
StringBuilder sb = path(qPath);
query(sb, "ovhSubsidiary", ovhSubsidiary);
String resp = exe... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"order",
".",
"catalog",
".",
"pcc",
".",
"OvhCatalog",
"catalog_formatted_privateCloudReseller_GET",
"(",
"OvhOvhSubsidiaryEnum",
"ovhSubsidiary",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Retrieve information of Private Cloud Reseller catalog
REST: GET /order/catalog/formatted/privateCloudReseller
@param ovhSubsidiary [required] Subsidiary of the country you want to consult catalog | [
"Retrieve",
"information",
"of",
"Private",
"Cloud",
"Reseller",
"catalog"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L7205-L7211 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/BaseDateTimeField.java | BaseDateTimeField.getAsText | public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
"""
Get the human-readable, text value of this field from a partial instant.
If the specified locale is null, the default locale is used.
<p>
The default implementation returns getAsText(fieldValue, locale).
@param partial the... | java | public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
return getAsText(fieldValue, locale);
} | [
"public",
"String",
"getAsText",
"(",
"ReadablePartial",
"partial",
",",
"int",
"fieldValue",
",",
"Locale",
"locale",
")",
"{",
"return",
"getAsText",
"(",
"fieldValue",
",",
"locale",
")",
";",
"}"
] | Get the human-readable, text value of this field from a partial instant.
If the specified locale is null, the default locale is used.
<p>
The default implementation returns getAsText(fieldValue, locale).
@param partial the partial instant to query
@param fieldValue the field value of this field, provided for perform... | [
"Get",
"the",
"human",
"-",
"readable",
"text",
"value",
"of",
"this",
"field",
"from",
"a",
"partial",
"instant",
".",
"If",
"the",
"specified",
"locale",
"is",
"null",
"the",
"default",
"locale",
"is",
"used",
".",
"<p",
">",
"The",
"default",
"impleme... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/BaseDateTimeField.java#L120-L122 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T1, T2, T3> TriConsumer<T1, T2, T3> spy1st(TriConsumer<T1, T2, T3> consumer, Box<T1> param1) {
"""
Proxies a ternary consumer spying for first parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param <T3> the consumer third parameter type
@... | java | public static <T1, T2, T3> TriConsumer<T1, T2, T3> spy1st(TriConsumer<T1, T2, T3> consumer, Box<T1> param1) {
return spy(consumer, param1, Box.<T2>empty(), Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"TriConsumer",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"spy1st",
"(",
"TriConsumer",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"consumer",
",",
"Box",
"<",
"T1",
">",
"param1",
")",
"{",
"retu... | Proxies a ternary consumer spying for first parameter.
@param <T1> the consumer first parameter type
@param <T2> the consumer second parameter type
@param <T3> the consumer third parameter type
@param consumer the consumer that will be spied
@param param1 a box that will be containing the first spied parameter
@return... | [
"Proxies",
"a",
"ternary",
"consumer",
"spying",
"for",
"first",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L321-L323 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfUtils.java | MmtfUtils.insertSeqResGroup | public static void insertSeqResGroup(Chain chain, Group group, int sequenceIndexId) {
"""
Insert the group in the given position in the sequence.
@param chain the chain to add the seq res group to
@param group the group to add
@param sequenceIndexId the index to add it in
"""
List<Group> seqResGroups = ch... | java | public static void insertSeqResGroup(Chain chain, Group group, int sequenceIndexId) {
List<Group> seqResGroups = chain.getSeqResGroups();
addGroupAtId(seqResGroups, group, sequenceIndexId);
} | [
"public",
"static",
"void",
"insertSeqResGroup",
"(",
"Chain",
"chain",
",",
"Group",
"group",
",",
"int",
"sequenceIndexId",
")",
"{",
"List",
"<",
"Group",
">",
"seqResGroups",
"=",
"chain",
".",
"getSeqResGroups",
"(",
")",
";",
"addGroupAtId",
"(",
"seqR... | Insert the group in the given position in the sequence.
@param chain the chain to add the seq res group to
@param group the group to add
@param sequenceIndexId the index to add it in | [
"Insert",
"the",
"group",
"in",
"the",
"given",
"position",
"in",
"the",
"sequence",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfUtils.java#L492-L495 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.defaultIfBlank | public static <T extends CharSequence> T defaultIfBlank(T str, T defaultStr) {
"""
<p>
Returns either the passed in CharSequence, or if the CharSequence is whitespace, empty ("") or
{@code null}, the value of {@code defaultStr}.
</p>
@param str
@param defaultStr
"""
return isBlank(str) ? defaultStr ... | java | public static <T extends CharSequence> T defaultIfBlank(T str, T defaultStr) {
return isBlank(str) ? defaultStr : str;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"defaultIfBlank",
"(",
"T",
"str",
",",
"T",
"defaultStr",
")",
"{",
"return",
"isBlank",
"(",
"str",
")",
"?",
"defaultStr",
":",
"str",
";",
"}"
] | <p>
Returns either the passed in CharSequence, or if the CharSequence is whitespace, empty ("") or
{@code null}, the value of {@code defaultStr}.
</p>
@param str
@param defaultStr | [
"<p",
">",
"Returns",
"either",
"the",
"passed",
"in",
"CharSequence",
"or",
"if",
"the",
"CharSequence",
"is",
"whitespace",
"empty",
"(",
")",
"or",
"{",
"@code",
"null",
"}",
"the",
"value",
"of",
"{",
"@code",
"defaultStr",
"}",
".",
"<",
"/",
"p",... | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L1428-L1430 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/util/BuildDataHelper.java | BuildDataHelper.getCommitSHA1 | @Nonnull
public static ObjectId getCommitSHA1(@Nonnull Run<?, ?> build) throws IOException {
"""
Gets SHA1 from the build.
@param build
@return SHA1 of the las
@throws IOException Cannot get the info about commit ID
"""
List<BuildData> buildDataList = build.getActions(BuildData.class);
... | java | @Nonnull
public static ObjectId getCommitSHA1(@Nonnull Run<?, ?> build) throws IOException {
List<BuildData> buildDataList = build.getActions(BuildData.class);
Job<?, ?> parent = build.getParent();
BuildData buildData = calculateBuildData(
parent.getName(), parent.getFullName()... | [
"@",
"Nonnull",
"public",
"static",
"ObjectId",
"getCommitSHA1",
"(",
"@",
"Nonnull",
"Run",
"<",
"?",
",",
"?",
">",
"build",
")",
"throws",
"IOException",
"{",
"List",
"<",
"BuildData",
">",
"buildDataList",
"=",
"build",
".",
"getActions",
"(",
"BuildDa... | Gets SHA1 from the build.
@param build
@return SHA1 of the las
@throws IOException Cannot get the info about commit ID | [
"Gets",
"SHA1",
"from",
"the",
"build",
"."
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/util/BuildDataHelper.java#L76-L104 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateExplicitListItemAsync | public Observable<OperationStatus> updateExplicitListItemAsync(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) {
"""
Updates an explicit list item for a Pattern.Any entity.
@param appId The application ID.
@param version... | java | public Observable<OperationStatus> updateExplicitListItemAsync(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) {
return updateExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId, updateExplicitList... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"updateExplicitListItemAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"long",
"itemId",
",",
"UpdateExplicitListItemOptionalParameter",
"updateExplicitListItemOptionalParameter",
"... | Updates an explicit list item for a Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param itemId The explicit list item ID.
@param updateExplicitListItemOptionalParameter the object representing the optional parameters to be se... | [
"Updates",
"an",
"explicit",
"list",
"item",
"for",
"a",
"Pattern",
".",
"Any",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L14094-L14101 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.unZlib | public static String unZlib(byte[] buf, String charset) {
"""
Zlib解压缩处理
@param buf 压缩过的字节流
@param charset 编码
@return 解压后的字符串
@since 4.1.4
"""
return StrUtil.str(unZlib(buf), charset);
} | java | public static String unZlib(byte[] buf, String charset) {
return StrUtil.str(unZlib(buf), charset);
} | [
"public",
"static",
"String",
"unZlib",
"(",
"byte",
"[",
"]",
"buf",
",",
"String",
"charset",
")",
"{",
"return",
"StrUtil",
".",
"str",
"(",
"unZlib",
"(",
"buf",
")",
",",
"charset",
")",
";",
"}"
] | Zlib解压缩处理
@param buf 压缩过的字节流
@param charset 编码
@return 解压后的字符串
@since 4.1.4 | [
"Zlib解压缩处理"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L698-L700 |
epam/parso | src/main/java/com/epam/parso/DataWriterUtil.java | DataWriterUtil.getDateFormatProcessor | private static Format getDateFormatProcessor(ColumnFormat columnFormat, Locale locale) {
"""
The function to get a formatter to convert date elements into a string.
@param columnFormat the (@link ColumnFormat) class variable that stores the format name that must belong to
the set of {@link DataWriterUtil#DATE_... | java | private static Format getDateFormatProcessor(ColumnFormat columnFormat, Locale locale) {
if (!DATE_OUTPUT_FORMAT_STRINGS.containsKey(columnFormat.getName())) {
throw new NoSuchElementException(UNKNOWN_DATE_FORMAT_EXCEPTION);
}
SimpleDateFormat dateFormat =
new SimpleD... | [
"private",
"static",
"Format",
"getDateFormatProcessor",
"(",
"ColumnFormat",
"columnFormat",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"!",
"DATE_OUTPUT_FORMAT_STRINGS",
".",
"containsKey",
"(",
"columnFormat",
".",
"getName",
"(",
")",
")",
")",
"{",
"thro... | The function to get a formatter to convert date elements into a string.
@param columnFormat the (@link ColumnFormat) class variable that stores the format name that must belong to
the set of {@link DataWriterUtil#DATE_OUTPUT_FORMAT_STRINGS} mapping keys.
@param locale locale for parsing date elements.
@return a ... | [
"The",
"function",
"to",
"get",
"a",
"formatter",
"to",
"convert",
"date",
"elements",
"into",
"a",
"string",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/DataWriterUtil.java#L410-L418 |
spring-projects/spring-mobile | spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java | StandardSiteSwitcherHandlerFactory.mDot | public static SiteSwitcherHandler mDot(String serverName, Boolean tabletIsMobile) {
"""
Creates a site switcher that redirects to a <code>m.</code> domain for normal site requests that either
originate from a mobile device or indicate a mobile site preference.
Uses a {@link CookieSitePreferenceRepository} that s... | java | public static SiteSwitcherHandler mDot(String serverName, Boolean tabletIsMobile) {
return standard(serverName, "m." + serverName, "." + serverName, tabletIsMobile);
} | [
"public",
"static",
"SiteSwitcherHandler",
"mDot",
"(",
"String",
"serverName",
",",
"Boolean",
"tabletIsMobile",
")",
"{",
"return",
"standard",
"(",
"serverName",
",",
"\"m.\"",
"+",
"serverName",
",",
"\".\"",
"+",
"serverName",
",",
"tabletIsMobile",
")",
";... | Creates a site switcher that redirects to a <code>m.</code> domain for normal site requests that either
originate from a mobile device or indicate a mobile site preference.
Uses a {@link CookieSitePreferenceRepository} that saves a cookie that is shared between the two domains. | [
"Creates",
"a",
"site",
"switcher",
"that",
"redirects",
"to",
"a",
"<code",
">",
"m",
".",
"<",
"/",
"code",
">",
"domain",
"for",
"normal",
"site",
"requests",
"that",
"either",
"originate",
"from",
"a",
"mobile",
"device",
"or",
"indicate",
"a",
"mobi... | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java#L42-L44 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java | BlobStore.createBlob | public void createBlob(String key, byte [] data, SettableBlobMeta meta) throws KeyAlreadyExistsException, IOException {
"""
Wrapper called to create the blob which contains
the byte data
@param key Key for the blob.
@param data Byte data that needs to be uploaded.
@param meta Metadata which contains the acls i... | java | public void createBlob(String key, byte [] data, SettableBlobMeta meta) throws KeyAlreadyExistsException, IOException {
AtomicOutputStream out = null;
try {
out = createBlob(key, meta);
out.write(data);
out.close();
out = null;
} finally {
... | [
"public",
"void",
"createBlob",
"(",
"String",
"key",
",",
"byte",
"[",
"]",
"data",
",",
"SettableBlobMeta",
"meta",
")",
"throws",
"KeyAlreadyExistsException",
",",
"IOException",
"{",
"AtomicOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"out",
"=",
... | Wrapper called to create the blob which contains
the byte data
@param key Key for the blob.
@param data Byte data that needs to be uploaded.
@param meta Metadata which contains the acls information
@throws KeyAlreadyExistsException
@throws IOException | [
"Wrapper",
"called",
"to",
"create",
"the",
"blob",
"which",
"contains",
"the",
"byte",
"data"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java#L165-L177 |
eyp/serfj | src/main/java/net/sf/serfj/ResponseHelper.java | ResponseHelper.setFile | public void setFile(File file, String attachmentFilename, String contentType) {
"""
Sets the file to send to the client. If a file is set then the framework will try to read it
and write it into the response using a FileSerializer.
@param file The file.
@param attachmentFilename Name for the file that will be... | java | public void setFile(File file, String attachmentFilename, String contentType) {
this.file = file;
this.attachmentFilename = attachmentFilename;
this.contentType = contentType;
} | [
"public",
"void",
"setFile",
"(",
"File",
"file",
",",
"String",
"attachmentFilename",
",",
"String",
"contentType",
")",
"{",
"this",
".",
"file",
"=",
"file",
";",
"this",
".",
"attachmentFilename",
"=",
"attachmentFilename",
";",
"this",
".",
"contentType",... | Sets the file to send to the client. If a file is set then the framework will try to read it
and write it into the response using a FileSerializer.
@param file The file.
@param attachmentFilename Name for the file that will be sent.
@param contentType Content type for the response header. | [
"Sets",
"the",
"file",
"to",
"send",
"to",
"the",
"client",
".",
"If",
"a",
"file",
"is",
"set",
"then",
"the",
"framework",
"will",
"try",
"to",
"read",
"it",
"and",
"write",
"it",
"into",
"the",
"response",
"using",
"a",
"FileSerializer",
"."
] | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/ResponseHelper.java#L214-L218 |
js-lib-com/dom | src/main/java/js/dom/w3c/ElementImpl.java | ElementImpl.getRichText | private static void getRichText(Node node, StringBuilder builder) {
"""
Extract rich text content from given node. It is not expected that rich text HTML formatting tags to have attributes and
this builder just ignore them. Also ignores all other node types beside text and elements.
@param node source node,
@... | java | private static void getRichText(Node node, StringBuilder builder) {
Node n = node.getFirstChild();
while (n != null) {
if (n.getNodeType() == Node.TEXT_NODE) {
builder.append(n.getNodeValue());
} else if (n.getNodeType() == Node.ELEMENT_NODE) {
builder.append('<');
builder.append(n.getNodeN... | [
"private",
"static",
"void",
"getRichText",
"(",
"Node",
"node",
",",
"StringBuilder",
"builder",
")",
"{",
"Node",
"n",
"=",
"node",
".",
"getFirstChild",
"(",
")",
";",
"while",
"(",
"n",
"!=",
"null",
")",
"{",
"if",
"(",
"n",
".",
"getNodeType",
... | Extract rich text content from given node. It is not expected that rich text HTML formatting tags to have attributes and
this builder just ignore them. Also ignores all other node types beside text and elements.
@param node source node,
@param builder rich text target builder. | [
"Extract",
"rich",
"text",
"content",
"from",
"given",
"node",
".",
"It",
"is",
"not",
"expected",
"that",
"rich",
"text",
"HTML",
"formatting",
"tags",
"to",
"have",
"attributes",
"and",
"this",
"builder",
"just",
"ignore",
"them",
".",
"Also",
"ignores",
... | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/ElementImpl.java#L613-L630 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/metadata/TechnologyReference.java | TechnologyReference.parseFromIDAndVersion | public static TechnologyReference parseFromIDAndVersion(String idAndVersion) {
"""
Parses a {@link TechnologyReference} from a string that is formatted as either
"id" or "id:versionRange".
"""
if (idAndVersion.contains(":"))
{
String tech = StringUtils.substringBefore(idAndVersion,... | java | public static TechnologyReference parseFromIDAndVersion(String idAndVersion)
{
if (idAndVersion.contains(":"))
{
String tech = StringUtils.substringBefore(idAndVersion, ":");
String versionRangeString = StringUtils.substringAfter(idAndVersion, ":");
if (!versionRa... | [
"public",
"static",
"TechnologyReference",
"parseFromIDAndVersion",
"(",
"String",
"idAndVersion",
")",
"{",
"if",
"(",
"idAndVersion",
".",
"contains",
"(",
"\":\"",
")",
")",
"{",
"String",
"tech",
"=",
"StringUtils",
".",
"substringBefore",
"(",
"idAndVersion",... | Parses a {@link TechnologyReference} from a string that is formatted as either
"id" or "id:versionRange". | [
"Parses",
"a",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/metadata/TechnologyReference.java#L62-L75 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.setValueForOtherLocales | private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) {
"""
Sets the value in all other locales.<p>
@param cms the cms context
@param value the value
@param requiredParent the path to the required parent value
"""
if (!value.isSimpleType()) {
... | java | private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) {
if (!value.isSimpleType()) {
throw new IllegalArgumentException();
}
for (Locale locale : getLocales()) {
if (locale.equals(value.getLocale())) {
cont... | [
"private",
"void",
"setValueForOtherLocales",
"(",
"CmsObject",
"cms",
",",
"I_CmsXmlContentValue",
"value",
",",
"String",
"requiredParent",
")",
"{",
"if",
"(",
"!",
"value",
".",
"isSimpleType",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Sets the value in all other locales.<p>
@param cms the cms context
@param value the value
@param requiredParent the path to the required parent value | [
"Sets",
"the",
"value",
"in",
"all",
"other",
"locales",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L1131-L1153 |
Sproutigy/Java-Commons-Binary | src/main/java/com/sproutigy/commons/binary/Binary.java | Binary.toByteArray | public int toByteArray(byte[] target, int targetOffset) throws IOException {
"""
Writes data to some existing byte array starting from specific offset
@param target byte array destination
@param targetOffset destination offset to start
@return length of source (written) data
@throws IOException
"""
... | java | public int toByteArray(byte[] target, int targetOffset) throws IOException {
long length = length();
if ((long)targetOffset + length > Integer.MAX_VALUE) {
throw new IOException("Unable to write - too big data");
}
if (target.length < targetOffset + length) {
thro... | [
"public",
"int",
"toByteArray",
"(",
"byte",
"[",
"]",
"target",
",",
"int",
"targetOffset",
")",
"throws",
"IOException",
"{",
"long",
"length",
"=",
"length",
"(",
")",
";",
"if",
"(",
"(",
"long",
")",
"targetOffset",
"+",
"length",
">",
"Integer",
... | Writes data to some existing byte array starting from specific offset
@param target byte array destination
@param targetOffset destination offset to start
@return length of source (written) data
@throws IOException | [
"Writes",
"data",
"to",
"some",
"existing",
"byte",
"array",
"starting",
"from",
"specific",
"offset"
] | train | https://github.com/Sproutigy/Java-Commons-Binary/blob/547ab53d16e454d53ed5cef1d1ee514ec2d7c726/src/main/java/com/sproutigy/commons/binary/Binary.java#L264-L293 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.searchRecipes | public List<Integer> searchRecipes(boolean isInput, int id) throws GuildWars2Exception {
"""
For more info on Recipes search API go <a href="https://wiki.guildwars2.com/wiki/API:2/recipes/search">here</a><br/>
@param isInput is given id an ingredient
@param id recipe id
@return list of recipe id
@throws... | java | public List<Integer> searchRecipes(boolean isInput, int id) throws GuildWars2Exception {
try {
Response<List<Integer>> response = (isInput) ?
gw2API.searchInputRecipes(Integer.toString(id)).execute() :
gw2API.searchOutputRecipes(Integer.toString(id)).execute();
if (!response.isSuccessful()) throwError... | [
"public",
"List",
"<",
"Integer",
">",
"searchRecipes",
"(",
"boolean",
"isInput",
",",
"int",
"id",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"List",
"<",
"Integer",
">>",
"response",
"=",
"(",
"isInput",
")",
"?",
"gw2API",
... | For more info on Recipes search API go <a href="https://wiki.guildwars2.com/wiki/API:2/recipes/search">here</a><br/>
@param isInput is given id an ingredient
@param id recipe id
@return list of recipe id
@throws GuildWars2Exception see {@link ErrorCode} for detail | [
"For",
"more",
"info",
"on",
"Recipes",
"search",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"recipes",
"/",
"search",
">",
"here<",
"/",
"a",
">",
"<br",
"/"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L3134-L3144 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.prepareAttachment | public PreparedAttachment prepareAttachment(Attachment att, long length, long encodedLength)
throws AttachmentException {
"""
<p>
Read attachment stream to a temporary location and calculate sha1,
prior to being added to the DocumentStore.
</p>
<p>
Used by replicator when receiving new/updated att... | java | public PreparedAttachment prepareAttachment(Attachment att, long length, long encodedLength)
throws AttachmentException {
PreparedAttachment pa = AttachmentManager.prepareAttachment(attachmentsDir,
attachmentStreamFactory, att, length, encodedLength);
return pa;
} | [
"public",
"PreparedAttachment",
"prepareAttachment",
"(",
"Attachment",
"att",
",",
"long",
"length",
",",
"long",
"encodedLength",
")",
"throws",
"AttachmentException",
"{",
"PreparedAttachment",
"pa",
"=",
"AttachmentManager",
".",
"prepareAttachment",
"(",
"attachmen... | <p>
Read attachment stream to a temporary location and calculate sha1,
prior to being added to the DocumentStore.
</p>
<p>
Used by replicator when receiving new/updated attachments
</p>
@param att Attachment to be prepared, providing data either from a file or a stream
@param length Size in bytes of a... | [
"<p",
">",
"Read",
"attachment",
"stream",
"to",
"a",
"temporary",
"location",
"and",
"calculate",
"sha1",
"prior",
"to",
"being",
"added",
"to",
"the",
"DocumentStore",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Used",
"by",
"replicator",
"when",
"receiving",
... | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L810-L815 |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java | ConditionMessage.of | public static ConditionMessage of(String message, Object... args) {
"""
Factory method to create a new {@link ConditionMessage} with a specific message.
@param message the source message (may be a format string if {@code args} are
specified)
@param args format arguments for the message
@return a new {@link Con... | java | public static ConditionMessage of(String message, Object... args) {
if (ObjectUtils.isEmpty(args)) {
return new ConditionMessage(message);
}
return new ConditionMessage(String.format(message, args));
} | [
"public",
"static",
"ConditionMessage",
"of",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"ObjectUtils",
".",
"isEmpty",
"(",
"args",
")",
")",
"{",
"return",
"new",
"ConditionMessage",
"(",
"message",
")",
";",
"}",
"ret... | Factory method to create a new {@link ConditionMessage} with a specific message.
@param message the source message (may be a format string if {@code args} are
specified)
@param args format arguments for the message
@return a new {@link ConditionMessage} instance | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java#L148-L153 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/data/AnyValueMap.java | AnyValueMap.getAsType | public <T> T getAsType(Class<T> type, String key) {
"""
Converts map element into a value defined by specied typecode. If conversion
is not possible it returns default value for the specified type.
@param type the Class type that defined the type of the result
@param key a key of element to get.
@return ele... | java | public <T> T getAsType(Class<T> type, String key) {
return getAsTypeWithDefault(type, key, null);
} | [
"public",
"<",
"T",
">",
"T",
"getAsType",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"key",
")",
"{",
"return",
"getAsTypeWithDefault",
"(",
"type",
",",
"key",
",",
"null",
")",
";",
"}"
] | Converts map element into a value defined by specied typecode. If conversion
is not possible it returns default value for the specified type.
@param type the Class type that defined the type of the result
@param key a key of element to get.
@return element value defined by the typecode or default if conversion is not... | [
"Converts",
"map",
"element",
"into",
"a",
"value",
"defined",
"by",
"specied",
"typecode",
".",
"If",
"conversion",
"is",
"not",
"possible",
"it",
"returns",
"default",
"value",
"for",
"the",
"specified",
"type",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/data/AnyValueMap.java#L479-L481 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.removeEdges | int removeEdges(final PrepEdgeFilter bothFilter, List<IntArrayList> components, int min) {
"""
This method removes the access to edges available from the nodes contained in the components.
But only if a components' size is smaller then the specified min value.
@return number of removed edges
"""
//... | java | int removeEdges(final PrepEdgeFilter bothFilter, List<IntArrayList> components, int min) {
// remove edges determined from nodes but only if less than minimum size
EdgeExplorer explorer = ghStorage.createEdgeExplorer(bothFilter);
int removedEdges = 0;
for (IntArrayList component : compon... | [
"int",
"removeEdges",
"(",
"final",
"PrepEdgeFilter",
"bothFilter",
",",
"List",
"<",
"IntArrayList",
">",
"components",
",",
"int",
"min",
")",
"{",
"// remove edges determined from nodes but only if less than minimum size",
"EdgeExplorer",
"explorer",
"=",
"ghStorage",
... | This method removes the access to edges available from the nodes contained in the components.
But only if a components' size is smaller then the specified min value.
@return number of removed edges | [
"This",
"method",
"removes",
"the",
"access",
"to",
"edges",
"available",
"from",
"the",
"nodes",
"contained",
"in",
"the",
"components",
".",
"But",
"only",
"if",
"a",
"components",
"size",
"is",
"smaller",
"then",
"the",
"specified",
"min",
"value",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L216-L224 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java | SubWriterHolderWriter.addSummaryLinkComment | public void addSummaryLinkComment(AbstractMemberWriter mw, Element member, Content contentTree) {
"""
Add the summary link for the member.
@param mw the writer for the member being documented
@param member the member to be documented
@param contentTree the content tree to which the link will be added
"""
... | java | public void addSummaryLinkComment(AbstractMemberWriter mw, Element member, Content contentTree) {
List<? extends DocTree> tags = utils.getFirstSentenceTrees(member);
addSummaryLinkComment(mw, member, tags, contentTree);
} | [
"public",
"void",
"addSummaryLinkComment",
"(",
"AbstractMemberWriter",
"mw",
",",
"Element",
"member",
",",
"Content",
"contentTree",
")",
"{",
"List",
"<",
"?",
"extends",
"DocTree",
">",
"tags",
"=",
"utils",
".",
"getFirstSentenceTrees",
"(",
"member",
")",
... | Add the summary link for the member.
@param mw the writer for the member being documented
@param member the member to be documented
@param contentTree the content tree to which the link will be added | [
"Add",
"the",
"summary",
"link",
"for",
"the",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java#L228-L231 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.bindSerializer | public CRestBuilder bindSerializer(Class<? extends Serializer> serializer, Class<?>... classes) {
"""
<p>Binds a serializer to a list of interface method's parameter types</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>java.util.Date</li>
<li>java.lang.Boolean</li>
<li>java.io.File</... | java | public CRestBuilder bindSerializer(Class<? extends Serializer> serializer, Class<?>... classes){
return bindSerializer(serializer, classes, Collections.<String, Object>emptyMap());
} | [
"public",
"CRestBuilder",
"bindSerializer",
"(",
"Class",
"<",
"?",
"extends",
"Serializer",
">",
"serializer",
",",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"return",
"bindSerializer",
"(",
"serializer",
",",
"classes",
",",
"Collections",
".",
"... | <p>Binds a serializer to a list of interface method's parameter types</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>java.util.Date</li>
<li>java.lang.Boolean</li>
<li>java.io.File</li>
<li>java.io.InputStream</li>
<li>java.io.Reader</li>
</ul>
<p>Meaning any interface method parameter type ca... | [
"<p",
">",
"Binds",
"a",
"serializer",
"to",
"a",
"list",
"of",
"interface",
"method",
"s",
"parameter",
"types<",
"/",
"p",
">",
"<p",
">",
"By",
"default",
"<b",
">",
"CRest<",
"/",
"b",
">",
"handle",
"the",
"following",
"types",
":",
"<",
"/",
... | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L588-L590 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/MoveOnSelectHandler.java | MoveOnSelectHandler.init | public void init(Record record, BaseField fldDest, BaseField fldSource, Converter convCheckMark, boolean bMoveOnNew, boolean bMoveOnValid, boolean bMoveOnSelect, boolean bMoveOnAdd, boolean bMoveOnUpdate, String strSource, boolean bDontMoveNullSource) {
"""
Constructor.
@param pfldDest tour.field.BaseField The de... | java | public void init(Record record, BaseField fldDest, BaseField fldSource, Converter convCheckMark, boolean bMoveOnNew, boolean bMoveOnValid, boolean bMoveOnSelect, boolean bMoveOnAdd, boolean bMoveOnUpdate, String strSource, boolean bDontMoveNullSource)
{
super.init(record, fldDest, fldSource, convCheckMark, ... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"BaseField",
"fldDest",
",",
"BaseField",
"fldSource",
",",
"Converter",
"convCheckMark",
",",
"boolean",
"bMoveOnNew",
",",
"boolean",
"bMoveOnValid",
",",
"boolean",
"bMoveOnSelect",
",",
"boolean",
"bMoveO... | Constructor.
@param pfldDest tour.field.BaseField The destination field.
@param fldSource The source field.
@param pCheckMark If is field if false, don't move the data.
@param bMoveOnNew If true, move on new also.
@param bMoveOnValid If true, move on valid also. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/MoveOnSelectHandler.java#L52-L55 |
jhy/jsoup | src/main/java/org/jsoup/internal/StringUtil.java | StringUtil.appendNormalisedWhitespace | public static void appendNormalisedWhitespace(StringBuilder accum, String string, boolean stripLeading) {
"""
After normalizing the whitespace within a string, appends it to a string builder.
@param accum builder to append to
@param string string to normalize whitespace within
@param stripLeading set to true if... | java | public static void appendNormalisedWhitespace(StringBuilder accum, String string, boolean stripLeading) {
boolean lastWasWhite = false;
boolean reachedNonWhite = false;
int len = string.length();
int c;
for (int i = 0; i < len; i+= Character.charCount(c)) {
c = strin... | [
"public",
"static",
"void",
"appendNormalisedWhitespace",
"(",
"StringBuilder",
"accum",
",",
"String",
"string",
",",
"boolean",
"stripLeading",
")",
"{",
"boolean",
"lastWasWhite",
"=",
"false",
";",
"boolean",
"reachedNonWhite",
"=",
"false",
";",
"int",
"len",... | After normalizing the whitespace within a string, appends it to a string builder.
@param accum builder to append to
@param string string to normalize whitespace within
@param stripLeading set to true if you wish to remove any leading whitespace | [
"After",
"normalizing",
"the",
"whitespace",
"within",
"a",
"string",
"appends",
"it",
"to",
"a",
"string",
"builder",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/internal/StringUtil.java#L157-L177 |
rzwitserloot/lombok | src/core/lombok/javac/HandlerLibrary.java | HandlerLibrary.loadAnnotationHandlers | @SuppressWarnings( {
"""
Uses SPI Discovery to find implementations of {@link JavacAnnotationHandler}.
""""rawtypes", "unchecked"})
private static void loadAnnotationHandlers(HandlerLibrary lib, Trees trees) throws IOException {
//No, that seemingly superfluous reference to JavacAnnotationHandler's classloa... | java | @SuppressWarnings({"rawtypes", "unchecked"})
private static void loadAnnotationHandlers(HandlerLibrary lib, Trees trees) throws IOException {
//No, that seemingly superfluous reference to JavacAnnotationHandler's classloader is not in fact superfluous!
for (JavacAnnotationHandler handler : SpiLoadUtil.findServices... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"static",
"void",
"loadAnnotationHandlers",
"(",
"HandlerLibrary",
"lib",
",",
"Trees",
"trees",
")",
"throws",
"IOException",
"{",
"//No, that seemingly superfluous reference ... | Uses SPI Discovery to find implementations of {@link JavacAnnotationHandler}. | [
"Uses",
"SPI",
"Discovery",
"to",
"find",
"implementations",
"of",
"{"
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/HandlerLibrary.java#L178-L191 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/utils/Utils.java | Utils.copyProperty | public static void copyProperty(Object bean, String name, Object value)
throws Excel4JException {
"""
根据属性名与属性类型获取字段内容
@param bean 对象
@param name 字段名
@param value 字段类型
"""
if (null == name || null == value)
return;
Field field = matchClassField(bean.getClass(), n... | java | public static void copyProperty(Object bean, String name, Object value)
throws Excel4JException {
if (null == name || null == value)
return;
Field field = matchClassField(bean.getClass(), name);
if (null == field)
return;
Method method;
try {
... | [
"public",
"static",
"void",
"copyProperty",
"(",
"Object",
"bean",
",",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"Excel4JException",
"{",
"if",
"(",
"null",
"==",
"name",
"||",
"null",
"==",
"value",
")",
"return",
";",
"Field",
"field",
... | 根据属性名与属性类型获取字段内容
@param bean 对象
@param name 字段名
@param value 字段类型 | [
"根据属性名与属性类型获取字段内容"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/utils/Utils.java#L309-L330 |
hector-client/hector | core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java | HFactory.createKeyspace | public static Keyspace createKeyspace(String keyspace, Cluster cluster,
ConsistencyLevelPolicy consistencyLevelPolicy,
FailoverPolicy failoverPolicy, Map<String, String> credentials) {
"""
Creates a Keyspace with the given consistency level, fail over policy
and user credentials. For a reference to th... | java | public static Keyspace createKeyspace(String keyspace, Cluster cluster,
ConsistencyLevelPolicy consistencyLevelPolicy,
FailoverPolicy failoverPolicy, Map<String, String> credentials) {
return new ExecutingKeyspace(keyspace, cluster.getConnectionManager(),
consistencyLevelPolicy, failoverPolicy, ... | [
"public",
"static",
"Keyspace",
"createKeyspace",
"(",
"String",
"keyspace",
",",
"Cluster",
"cluster",
",",
"ConsistencyLevelPolicy",
"consistencyLevelPolicy",
",",
"FailoverPolicy",
"failoverPolicy",
",",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
")",... | Creates a Keyspace with the given consistency level, fail over policy
and user credentials. For a reference to the consistency level, please
refer to http://wiki.apache.org/cassandra/API.
@param keyspace
@param cluster
@param consistencyLevelPolicy
@param credentials
@return | [
"Creates",
"a",
"Keyspace",
"with",
"the",
"given",
"consistency",
"level",
"fail",
"over",
"policy",
"and",
"user",
"credentials",
".",
"For",
"a",
"reference",
"to",
"the",
"consistency",
"level",
"please",
"refer",
"to",
"http",
":",
"//",
"wiki",
".",
... | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L289-L294 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java | IntuitResponseDeserializer.getBatchItemResponse | private BatchItemResponse getBatchItemResponse(JsonNode jsonNode) throws IOException {
"""
Method to deserialize the BatchItemResponse object
@param jsonNode the json node
@return BatchItemResponse the batch item response
"""
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new Si... | java | private BatchItemResponse getBatchItemResponse(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("BatchItemResponseDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(BatchItemResponse.class, new BatchItemResponseDe... | [
"private",
"BatchItemResponse",
"getBatchItemResponse",
"(",
"JsonNode",
"jsonNode",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"BatchItemRe... | Method to deserialize the BatchItemResponse object
@param jsonNode the json node
@return BatchItemResponse the batch item response | [
"Method",
"to",
"deserialize",
"the",
"BatchItemResponse",
"object"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java#L354-L364 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentDataPropertiesAxiomImpl_CustomFieldSerializer.java | OWLEquivalentDataPropertiesAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentDataPropertiesAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link c... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentDataPropertiesAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLEquivalentDataPropertiesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentDataPropertiesAxiomImpl_CustomFieldSerializer.java#L74-L77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.