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 |
|---|---|---|---|---|---|---|---|---|---|---|
schallee/alib4j | core/src/main/java/net/darkmist/alib/str/CharSequenceUtil.java | CharSequenceUtil.indexOf | public static int indexOf(CharSequence str, char ch) {
"""
Find index of first occurance of a character. This is different
from {@link String#indexOf(String)} in that it works on
{@link CharSequence}s and looks for a single character
instead of a string.
@param str haystack
@param ch needle
@return position ... | java | public static int indexOf(CharSequence str, char ch)
{
for(int i=0; i<str.length(); i++)
if(str.charAt(i) == ch)
return i;
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"CharSequence",
"str",
",",
"char",
"ch",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"if",
"(",
"str",
".",
"charAt",
"(",
"i",
")... | Find index of first occurance of a character. This is different
from {@link String#indexOf(String)} in that it works on
{@link CharSequence}s and looks for a single character
instead of a string.
@param str haystack
@param ch needle
@return position of needle in haystack or -1 if not found. | [
"Find",
"index",
"of",
"first",
"occurance",
"of",
"a",
"character",
".",
"This",
"is",
"different",
"from",
"{"
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/str/CharSequenceUtil.java#L82-L88 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileSet.java | TileSet.getTile | public Tile getTile (int tileIndex, Colorization[] zations) {
"""
Creates a {@link Tile} object from this tileset corresponding to the specified tile id and
returns that tile. A null tile will never be returned, but one with an error image may be
returned if a problem occurs loading the underlying tileset image.... | java | public Tile getTile (int tileIndex, Colorization[] zations)
{
Tile tile = null;
// first look in the active set; if it's in use by anyone or in the cache, it will be in
// the active set
synchronized (_atiles) {
_key.tileSet = this;
_key.tileIndex = tileIndex... | [
"public",
"Tile",
"getTile",
"(",
"int",
"tileIndex",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"Tile",
"tile",
"=",
"null",
";",
"// first look in the active set; if it's in use by anyone or in the cache, it will be in",
"// the active set",
"synchronized",
"(",
... | Creates a {@link Tile} object from this tileset corresponding to the specified tile id and
returns that tile. A null tile will never be returned, but one with an error image may be
returned if a problem occurs loading the underlying tileset image.
@param tileIndex the index of the tile in the tileset. Tile indexes sta... | [
"Creates",
"a",
"{",
"@link",
"Tile",
"}",
"object",
"from",
"this",
"tileset",
"corresponding",
"to",
"the",
"specified",
"tile",
"id",
"and",
"returns",
"that",
"tile",
".",
"A",
"null",
"tile",
"will",
"never",
"be",
"returned",
"but",
"one",
"with",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L202-L232 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiForm.java | GitLabApiForm.withParam | public <T> GitLabApiForm withParam(String name, List<T> values, boolean required) throws IllegalArgumentException {
"""
Fluent method for adding a List type query and form parameters to a get() or post() call.
@param <T> the type contained by the List
@param name the name of the field/attribute to add
@param ... | java | public <T> GitLabApiForm withParam(String name, List<T> values, boolean required) throws IllegalArgumentException {
if (values == null || values.isEmpty()) {
if (required) {
throw new IllegalArgumentException(name + " cannot be empty or null");
}
retu... | [
"public",
"<",
"T",
">",
"GitLabApiForm",
"withParam",
"(",
"String",
"name",
",",
"List",
"<",
"T",
">",
"values",
",",
"boolean",
"required",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"isEmpty... | Fluent method for adding a List type query and form parameters to a get() or post() call.
@param <T> the type contained by the List
@param name the name of the field/attribute to add
@param values a List containing the values of the field/attribute to add
@param required the field is required flag
@return this GitLabA... | [
"Fluent",
"method",
"for",
"adding",
"a",
"List",
"type",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L120-L137 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.getTabs | private List<UIComponent> getTabs(TabView tabView) {
"""
Essentially, getTabs() does the same as getChildren(), but it filters
everything that's not a tab. In particular, comments are ignored. See issue
77 (https://github.com/TheCoder4eu/BootsFaces-OSP/issues/77).
@return
"""
List<UIComponent> children ... | java | private List<UIComponent> getTabs(TabView tabView) {
List<UIComponent> children = tabView.getChildren();
List<UIComponent> filtered = new ArrayList<UIComponent>(children.size());
for (UIComponent c : children) {
if (c instanceof Tab)
filtered.add(c);
}
return filtered;
} | [
"private",
"List",
"<",
"UIComponent",
">",
"getTabs",
"(",
"TabView",
"tabView",
")",
"{",
"List",
"<",
"UIComponent",
">",
"children",
"=",
"tabView",
".",
"getChildren",
"(",
")",
";",
"List",
"<",
"UIComponent",
">",
"filtered",
"=",
"new",
"ArrayList"... | Essentially, getTabs() does the same as getChildren(), but it filters
everything that's not a tab. In particular, comments are ignored. See issue
77 (https://github.com/TheCoder4eu/BootsFaces-OSP/issues/77).
@return | [
"Essentially",
"getTabs",
"()",
"does",
"the",
"same",
"as",
"getChildren",
"()",
"but",
"it",
"filters",
"everything",
"that",
"s",
"not",
"a",
"tab",
".",
"In",
"particular",
"comments",
"are",
"ignored",
".",
"See",
"issue",
"77",
"(",
"https",
":",
"... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L334-L342 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPaymentPersistenceImpl.java | CommerceOrderPaymentPersistenceImpl.findByCommerceOrderId | @Override
public List<CommerceOrderPayment> findByCommerceOrderId(
long commerceOrderId, int start, int end) {
"""
Returns a range of all the commerce order payments where commerceOrderId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code>... | java | @Override
public List<CommerceOrderPayment> findByCommerceOrderId(
long commerceOrderId, int start, int end) {
return findByCommerceOrderId(commerceOrderId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrderPayment",
">",
"findByCommerceOrderId",
"(",
"long",
"commerceOrderId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommerceOrderId",
"(",
"commerceOrderId",
",",
"start",
",",
"end",
"... | Returns a range of all the commerce order payments where commerceOrderId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first resul... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"order",
"payments",
"where",
"commerceOrderId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPaymentPersistenceImpl.java#L142-L146 |
redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitExport | public void visitExport(String packaze, int access, String... modules) {
"""
Visit an exported package of the current module.
@param packaze the qualified name of the exported package.
@param access the access flag of the exported package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}... | java | public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitExport(packaze, access, modules);
}
} | [
"public",
"void",
"visitExport",
"(",
"String",
"packaze",
",",
"int",
"access",
",",
"String",
"...",
"modules",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitExport",
"(",
"packaze",
",",
"access",
",",
"modules",
")",
";",
"}... | Visit an exported package of the current module.
@param packaze the qualified name of the exported package.
@param access the access flag of the exported package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}.
@param modules the qualified names of the modules that can access to
the public class... | [
"Visit",
"an",
"exported",
"package",
"of",
"the",
"current",
"module",
"."
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L162-L166 |
iron-io/iron_mq_java | src/main/java/io/iron/ironmq/Queue.java | Queue.deleteMessage | public void deleteMessage(String id, String reservationId, String subscriberName) throws IOException {
"""
Deletes a Message from the queue.
@param id The ID of the message to delete.
@param reservationId Reservation Id of the message. Reserved message could not be deleted without reservation Id.
@throws io... | java | public void deleteMessage(String id, String reservationId, String subscriberName) throws IOException {
String payload = gson.toJson(new SubscribedMessageOptions(reservationId, subscriberName));
IronReader reader = client.delete("queues/" + name + "/messages/" + id, payload);
reader.close();
... | [
"public",
"void",
"deleteMessage",
"(",
"String",
"id",
",",
"String",
"reservationId",
",",
"String",
"subscriberName",
")",
"throws",
"IOException",
"{",
"String",
"payload",
"=",
"gson",
".",
"toJson",
"(",
"new",
"SubscribedMessageOptions",
"(",
"reservationId... | Deletes a Message from the queue.
@param id The ID of the message to delete.
@param reservationId Reservation Id of the message. Reserved message could not be deleted without reservation Id.
@throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK.
@throws java.io.IOException If t... | [
"Deletes",
"a",
"Message",
"from",
"the",
"queue",
"."
] | train | https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L294-L298 |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/EntryValueIntFactory.java | EntryValueIntFactory.reinitValue | @Override
public void reinitValue(DataReader in, EntryValueInt value) throws IOException {
"""
Read data from stream to populate an EntryValueInt.
@param in
data reader for EntryValueInt.
@param value
an EntryValueInt to populate.
@throws IOException
"""
value.reinit(in.readInt(), /* array p... | java | @Override
public void reinitValue(DataReader in, EntryValueInt value) throws IOException {
value.reinit(in.readInt(), /* array position */
in.readInt(), /* data value */
in.readLong() /* SCN value */);
} | [
"@",
"Override",
"public",
"void",
"reinitValue",
"(",
"DataReader",
"in",
",",
"EntryValueInt",
"value",
")",
"throws",
"IOException",
"{",
"value",
".",
"reinit",
"(",
"in",
".",
"readInt",
"(",
")",
",",
"/* array position */",
"in",
".",
"readInt",
"(",
... | Read data from stream to populate an EntryValueInt.
@param in
data reader for EntryValueInt.
@param value
an EntryValueInt to populate.
@throws IOException | [
"Read",
"data",
"from",
"stream",
"to",
"populate",
"an",
"EntryValueInt",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/EntryValueIntFactory.java#L68-L73 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java | WorkbookUtil.createBook | public static Workbook createBook(InputStream in, String password, boolean closeAfterRead) {
"""
创建或加载工作簿
@param in Excel输入流
@param password 密码
@param closeAfterRead 读取结束是否关闭流
@return {@link Workbook}
@since 4.0.3
"""
try {
return WorkbookFactory.create(IoUtil.toMarkSupportStream(in), password);
... | java | public static Workbook createBook(InputStream in, String password, boolean closeAfterRead) {
try {
return WorkbookFactory.create(IoUtil.toMarkSupportStream(in), password);
} catch (Exception e) {
throw new POIException(e);
} finally {
if (closeAfterRead) {
IoUtil.close(in);
}
}
} | [
"public",
"static",
"Workbook",
"createBook",
"(",
"InputStream",
"in",
",",
"String",
"password",
",",
"boolean",
"closeAfterRead",
")",
"{",
"try",
"{",
"return",
"WorkbookFactory",
".",
"create",
"(",
"IoUtil",
".",
"toMarkSupportStream",
"(",
"in",
")",
",... | 创建或加载工作簿
@param in Excel输入流
@param password 密码
@param closeAfterRead 读取结束是否关闭流
@return {@link Workbook}
@since 4.0.3 | [
"创建或加载工作簿"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L86-L96 |
modelmapper/modelmapper | core/src/main/java/org/modelmapper/internal/util/Iterables.java | Iterables.getElementFromCollection | public static Object getElementFromCollection(Collection<Object> collection, int index) {
"""
Gets the element from a collection with given index.
@param collection the collection
@param index the index
@return null if the collection doesn't have the element at index, otherwise, return the element
"""
... | java | public static Object getElementFromCollection(Collection<Object> collection, int index) {
if (collection.size() < index + 1)
return null;
if (collection instanceof List)
return ((List<Object>) collection).get(index);
Iterator<Object> iterator = collection.iterator();
for (int i = 0... | [
"public",
"static",
"Object",
"getElementFromCollection",
"(",
"Collection",
"<",
"Object",
">",
"collection",
",",
"int",
"index",
")",
"{",
"if",
"(",
"collection",
".",
"size",
"(",
")",
"<",
"index",
"+",
"1",
")",
"return",
"null",
";",
"if",
"(",
... | Gets the element from a collection with given index.
@param collection the collection
@param index the index
@return null if the collection doesn't have the element at index, otherwise, return the element | [
"Gets",
"the",
"element",
"from",
"a",
"collection",
"with",
"given",
"index",
"."
] | train | https://github.com/modelmapper/modelmapper/blob/491d165ded9dc9aba7ce8b56984249e1a1363204/core/src/main/java/org/modelmapper/internal/util/Iterables.java#L105-L117 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.startsWith | public static boolean startsWith(String str, char prefix) {
"""
Test if the given {@code String} starts with the specified prefix character.
@param str the {@code String} to check
@param prefix the prefix character to look for
@return true if the string starts with the specified prefix; otherwise false
@see ... | java | public static boolean startsWith(String str, char prefix) {
return (str != null && !str.isEmpty() && (str.charAt(0) == prefix));
} | [
"public",
"static",
"boolean",
"startsWith",
"(",
"String",
"str",
",",
"char",
"prefix",
")",
"{",
"return",
"(",
"str",
"!=",
"null",
"&&",
"!",
"str",
".",
"isEmpty",
"(",
")",
"&&",
"(",
"str",
".",
"charAt",
"(",
"0",
")",
"==",
"prefix",
")",... | Test if the given {@code String} starts with the specified prefix character.
@param str the {@code String} to check
@param prefix the prefix character to look for
@return true if the string starts with the specified prefix; otherwise false
@see java.lang.String#startsWith | [
"Test",
"if",
"the",
"given",
"{",
"@code",
"String",
"}",
"starts",
"with",
"the",
"specified",
"prefix",
"character",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L329-L331 |
craterdog/java-security-framework | java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java | CertificateManager.decodeKeyStore | public final KeyStore decodeKeyStore(String base64String, char[] password) {
"""
This method decodes a PKCS12 format key store from its encrypted byte stream.
@param base64String The base 64 encoded, password encrypted PKCS12 byte stream.
@param password The password that was used to encrypt the byte stream.
... | java | public final KeyStore decodeKeyStore(String base64String, char[] password) {
logger.entry();
byte[] bytes = Base64Utils.decode(base64String);
try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
KeyStore keyStore = KeyStore.getInstance(KEY_STORE_FORMAT);
... | [
"public",
"final",
"KeyStore",
"decodeKeyStore",
"(",
"String",
"base64String",
",",
"char",
"[",
"]",
"password",
")",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"Base64Utils",
".",
"decode",
"(",
"base64String",
")",
";... | This method decodes a PKCS12 format key store from its encrypted byte stream.
@param base64String The base 64 encoded, password encrypted PKCS12 byte stream.
@param password The password that was used to encrypt the byte stream.
@return The PKCS12 format key store. | [
"This",
"method",
"decodes",
"a",
"PKCS12",
"format",
"key",
"store",
"from",
"its",
"encrypted",
"byte",
"stream",
"."
] | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java#L247-L260 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getNavigationForFolder | public List<CmsJspNavElement> getNavigationForFolder(
String folder,
Visibility visibility,
CmsResourceFilter resourceFilter) {
"""
Collect all navigation elements from the files in the given folder.<p>
@param folder the selected folder
@param visibility the visibility mode
@param reso... | java | public List<CmsJspNavElement> getNavigationForFolder(
String folder,
Visibility visibility,
CmsResourceFilter resourceFilter) {
folder = CmsFileUtil.removeTrailingSeparator(folder);
List<CmsJspNavElement> result = new ArrayList<CmsJspNavElement>();
List<CmsResource> res... | [
"public",
"List",
"<",
"CmsJspNavElement",
">",
"getNavigationForFolder",
"(",
"String",
"folder",
",",
"Visibility",
"visibility",
",",
"CmsResourceFilter",
"resourceFilter",
")",
"{",
"folder",
"=",
"CmsFileUtil",
".",
"removeTrailingSeparator",
"(",
"folder",
")",
... | Collect all navigation elements from the files in the given folder.<p>
@param folder the selected folder
@param visibility the visibility mode
@param resourceFilter the filter to use reading the resources
@return A sorted (ascending to navigation position) list of navigation elements | [
"Collect",
"all",
"navigation",
"elements",
"from",
"the",
"files",
"in",
"the",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L537-L569 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/util/JSONUtil.java | JSONUtil.getStringFromJSONObject | public static Object getStringFromJSONObject(final String json, final String key) {
"""
从json获取指定key的字符串
@param json json字符串
@param key 字符串的key
@return 指定key的值
"""
requireNonNull(json, "json is null");
return JSON.parseObject(json).getString(key);
} | java | public static Object getStringFromJSONObject(final String json, final String key) {
requireNonNull(json, "json is null");
return JSON.parseObject(json).getString(key);
} | [
"public",
"static",
"Object",
"getStringFromJSONObject",
"(",
"final",
"String",
"json",
",",
"final",
"String",
"key",
")",
"{",
"requireNonNull",
"(",
"json",
",",
"\"json is null\"",
")",
";",
"return",
"JSON",
".",
"parseObject",
"(",
"json",
")",
".",
"... | 从json获取指定key的字符串
@param json json字符串
@param key 字符串的key
@return 指定key的值 | [
"从json获取指定key的字符串"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/util/JSONUtil.java#L36-L39 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.orthoSymmetricLH | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(flo... | java | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar) {
return orthoSymmetricLH(width, height, zNear, zFar, false, thisOrNew());
} | [
"public",
"Matrix4f",
"orthoSymmetricLH",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
",",
"false",
",",
"thisOr... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float) orthoLH()} with
<code>left=-width/2</code>, <code>right=+wid... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7638-L7640 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/internal/Util.java | Util.validateVoid | @SuppressWarnings( {
"""
Validate that a method returns no value.
@param method the method to be tested
@param errors a list to place the errors
""""ThrowableInstanceNeverThrown"})
public static void validateVoid(Method method, List<Throwable> errors)
{
if (method.getReturnType() != Void.TY... | java | @SuppressWarnings({"ThrowableInstanceNeverThrown"})
public static void validateVoid(Method method, List<Throwable> errors)
{
if (method.getReturnType() != Void.TYPE)
{
errors.add(new Exception("Method " + method.getName() + "() should be void"));
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"ThrowableInstanceNeverThrown\"",
"}",
")",
"public",
"static",
"void",
"validateVoid",
"(",
"Method",
"method",
",",
"List",
"<",
"Throwable",
">",
"errors",
")",
"{",
"if",
"(",
"method",
".",
"getReturnType",
"(",
")",
... | Validate that a method returns no value.
@param method the method to be tested
@param errors a list to place the errors | [
"Validate",
"that",
"a",
"method",
"returns",
"no",
"value",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/internal/Util.java#L54-L61 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.listByResourceGroupAsync | public Observable<Page<RoleAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter) {
"""
Gets role assignments for a resource group.
@param resourceGroupName The name of the resource group.
@param filter The filter to apply on the operation. Use $filter=atScope() to retu... | java | public Observable<Page<RoleAssignmentInner>> listByResourceGroupAsync(final String resourceGroupName, final String filter) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter)
.map(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Page<RoleAssignmentInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"RoleAssignmentInner",
">",
">",
"listByResourceGroupAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"filter",
")",
"{",
"return",
"listByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName... | Gets role assignments for a resource group.
@param resourceGroupName The name of the resource group.
@param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scop... | [
"Gets",
"role",
"assignments",
"for",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L577-L585 |
hawkular/hawkular-commons | hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java | CorsFilters.filterRequest | public static void filterRequest(ContainerRequestContext requestContext, Predicate<String> predicate) {
"""
Apply CORS filter on request
@param requestContext request context
@param predicate must return {@code true} if the input origin is allowed, else {@code false}.
"""
//NOT a CORS request
... | java | public static void filterRequest(ContainerRequestContext requestContext, Predicate<String> predicate) {
//NOT a CORS request
String requestOrigin = requestContext.getHeaderString(Headers.ORIGIN);
if (requestOrigin == null) {
return;
}
if (!predicate.test(requestOrigi... | [
"public",
"static",
"void",
"filterRequest",
"(",
"ContainerRequestContext",
"requestContext",
",",
"Predicate",
"<",
"String",
">",
"predicate",
")",
"{",
"//NOT a CORS request",
"String",
"requestOrigin",
"=",
"requestContext",
".",
"getHeaderString",
"(",
"Headers",
... | Apply CORS filter on request
@param requestContext request context
@param predicate must return {@code true} if the input origin is allowed, else {@code false}. | [
"Apply",
"CORS",
"filter",
"on",
"request"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java#L41-L57 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.constrainedBy | public Query constrainedBy( Constraint constraint ) {
"""
Create a copy of this query, but one that uses the supplied constraint.
@param constraint the constraint that should be used; never null
@return the copy of the query that uses the supplied constraint; never null
"""
return new Query(source,... | java | public Query constrainedBy( Constraint constraint ) {
return new Query(source, constraint, orderings(), columns, getLimits(), distinct);
} | [
"public",
"Query",
"constrainedBy",
"(",
"Constraint",
"constraint",
")",
"{",
"return",
"new",
"Query",
"(",
"source",
",",
"constraint",
",",
"orderings",
"(",
")",
",",
"columns",
",",
"getLimits",
"(",
")",
",",
"distinct",
")",
";",
"}"
] | Create a copy of this query, but one that uses the supplied constraint.
@param constraint the constraint that should be used; never null
@return the copy of the query that uses the supplied constraint; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"one",
"that",
"uses",
"the",
"supplied",
"constraint",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L177-L179 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/HostActiveDirectoryAuthentication.java | HostActiveDirectoryAuthentication.removeSmartCardTrustAnchorByFingerprint | public void removeSmartCardTrustAnchorByFingerprint(String fingerprint, String digest) throws HostConfigFault, RuntimeFault, RemoteException {
"""
Remove a smart card trust anchor certificate from the system by fingerprint.
@param fingerprint Certificate fingerprint
@param digest Digest function used to c... | java | public void removeSmartCardTrustAnchorByFingerprint(String fingerprint, String digest) throws HostConfigFault, RuntimeFault, RemoteException {
getVimService().removeSmartCardTrustAnchorByFingerprint(getMOR(), fingerprint, digest);
} | [
"public",
"void",
"removeSmartCardTrustAnchorByFingerprint",
"(",
"String",
"fingerprint",
",",
"String",
"digest",
")",
"throws",
"HostConfigFault",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"getVimService",
"(",
")",
".",
"removeSmartCardTrustAnchorByFingerprint",... | Remove a smart card trust anchor certificate from the system by fingerprint.
@param fingerprint Certificate fingerprint
@param digest Digest function used to compute fingerprint. One of {@link com.vmware.vim25.HostActiveDirectoryAuthenticationCertificateDigest}.
@throws HostConfigFault
@throws RuntimeFault
@throw... | [
"Remove",
"a",
"smart",
"card",
"trust",
"anchor",
"certificate",
"from",
"the",
"system",
"by",
"fingerprint",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/HostActiveDirectoryAuthentication.java#L118-L120 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/util/URIUtils.java | URIUtils.isAllowed | private static boolean isAllowed(char c, String allow) {
"""
Returns true if the given character is allowed.
@param c character to check
@param allow characters to allow
@return true if the character is allowed or false if it should be
encoded
"""
return (c >= 'A' && c <= 'Z')
... | java | private static boolean isAllowed(char c, String allow) {
return (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
|| (c >= '0' && c <= '9')
|| "_-!.~'()*".indexOf(c) != NOT_FOUND
|| (allow != null && allow.indexOf(c) != NOT_FOUND);
} | [
"private",
"static",
"boolean",
"isAllowed",
"(",
"char",
"c",
",",
"String",
"allow",
")",
"{",
"return",
"(",
"c",
">=",
"'",
"'",
"&&",
"c",
"<=",
"'",
"'",
")",
"||",
"(",
"c",
">=",
"'",
"'",
"&&",
"c",
"<=",
"'",
"'",
")",
"||",
"(",
... | Returns true if the given character is allowed.
@param c character to check
@param allow characters to allow
@return true if the character is allowed or false if it should be
encoded | [
"Returns",
"true",
"if",
"the",
"given",
"character",
"is",
"allowed",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/util/URIUtils.java#L170-L176 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java | UserDataManager.getURL | @Nonnull
@Nonempty
public static SimpleURL getURL (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
@Nonnull final IUserDataObject aUDO) {
"""
Get the URL to the passed UDO object.
@param aRequestScope
The request web scope to be used. Required for cookie-less... | java | @Nonnull
@Nonempty
public static SimpleURL getURL (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
@Nonnull final IUserDataObject aUDO)
{
return new SimpleURL (getURLPath (aRequestScope, aUDO));
} | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"SimpleURL",
"getURL",
"(",
"@",
"Nonnull",
"final",
"IRequestWebScopeWithoutResponse",
"aRequestScope",
",",
"@",
"Nonnull",
"final",
"IUserDataObject",
"aUDO",
")",
"{",
"return",
"new",
"SimpleURL",
"(",
"get... | Get the URL to the passed UDO object.
@param aRequestScope
The request web scope to be used. Required for cookie-less handling.
May not be <code>null</code>.
@param aUDO
The UDO object to get the URL from.
@return The URL to the user data object, including the context path. Always
starting with a "/". E.g. <code>/cont... | [
"Get",
"the",
"URL",
"to",
"the",
"passed",
"UDO",
"object",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java#L135-L141 |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Joiner4All.java | Joiner4All.mapPkToRow | private static Tuple2<Object, List<Object>> mapPkToRow(String timestamp, JSONObject jsonRow, List<String> joinFields) {
"""
Extract fields(k,v) from json
k = primary field(s) could be a composite key.
v = all fields . The first field is always timestamp.
Presumption is jsonRow object passed to this method shoul... | java | private static Tuple2<Object, List<Object>> mapPkToRow(String timestamp, JSONObject jsonRow, List<String> joinFields) {
Object joinValue = null;
List<Object> rowValues = new ArrayList<>();
rowValues.add(timestamp);
for (Object key : jsonRow.keySet()) {
String colName = key.to... | [
"private",
"static",
"Tuple2",
"<",
"Object",
",",
"List",
"<",
"Object",
">",
">",
"mapPkToRow",
"(",
"String",
"timestamp",
",",
"JSONObject",
"jsonRow",
",",
"List",
"<",
"String",
">",
"joinFields",
")",
"{",
"Object",
"joinValue",
"=",
"null",
";",
... | Extract fields(k,v) from json
k = primary field(s) could be a composite key.
v = all fields . The first field is always timestamp.
Presumption is jsonRow object passed to this method should not have timestamp field.
@param timestamp
@param jsonRow (This is a jsonObject without timestamp(even for select query response t... | [
"Extract",
"fields",
"(",
"k",
"v",
")",
"from",
"json",
"k",
"=",
"primary",
"field",
"(",
"s",
")",
"could",
"be",
"a",
"composite",
"key",
".",
"v",
"=",
"all",
"fields",
".",
"The",
"first",
"field",
"is",
"always",
"timestamp",
".",
"Presumption... | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Joiner4All.java#L111-L129 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java | ImagePipeline.isInDiskCacheSync | public boolean isInDiskCacheSync(final Uri uri) {
"""
Returns whether the image is stored in the disk cache.
Performs disk cache check synchronously. It is not recommended to use this
unless you know what exactly you are doing. Disk cache check is a costly operation,
the call will block the caller thread until ... | java | public boolean isInDiskCacheSync(final Uri uri) {
return isInDiskCacheSync(uri, ImageRequest.CacheChoice.SMALL) ||
isInDiskCacheSync(uri, ImageRequest.CacheChoice.DEFAULT);
} | [
"public",
"boolean",
"isInDiskCacheSync",
"(",
"final",
"Uri",
"uri",
")",
"{",
"return",
"isInDiskCacheSync",
"(",
"uri",
",",
"ImageRequest",
".",
"CacheChoice",
".",
"SMALL",
")",
"||",
"isInDiskCacheSync",
"(",
"uri",
",",
"ImageRequest",
".",
"CacheChoice",... | Returns whether the image is stored in the disk cache.
Performs disk cache check synchronously. It is not recommended to use this
unless you know what exactly you are doing. Disk cache check is a costly operation,
the call will block the caller thread until the cache check is completed.
@param uri the uri for the imag... | [
"Returns",
"whether",
"the",
"image",
"is",
"stored",
"in",
"the",
"disk",
"cache",
".",
"Performs",
"disk",
"cache",
"check",
"synchronously",
".",
"It",
"is",
"not",
"recommended",
"to",
"use",
"this",
"unless",
"you",
"know",
"what",
"exactly",
"you",
"... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ImagePipeline.java#L559-L562 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java | QuickValidator.doAndGetComplexResult | public static ComplexResult doAndGetComplexResult(Decorator decorator, ValidatorContext context) {
"""
Execute validation by using a new FluentValidator instance with a shared context.
The result type is {@link ComplexResult}
@param decorator Same as decorator design pattern, provided to add more functions to ... | java | public static ComplexResult doAndGetComplexResult(Decorator decorator, ValidatorContext context) {
return validate(decorator, FluentValidator.checkAll(), context, ResultCollectors.toComplex());
} | [
"public",
"static",
"ComplexResult",
"doAndGetComplexResult",
"(",
"Decorator",
"decorator",
",",
"ValidatorContext",
"context",
")",
"{",
"return",
"validate",
"(",
"decorator",
",",
"FluentValidator",
".",
"checkAll",
"(",
")",
",",
"context",
",",
"ResultCollecto... | Execute validation by using a new FluentValidator instance with a shared context.
The result type is {@link ComplexResult}
@param decorator Same as decorator design pattern, provided to add more functions to the fluentValidator
@param context Validation context which can be shared
@return ComplexResult | [
"Execute",
"validation",
"by",
"using",
"a",
"new",
"FluentValidator",
"instance",
"with",
"a",
"shared",
"context",
".",
"The",
"result",
"type",
"is",
"{",
"@link",
"ComplexResult",
"}"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java#L27-L29 |
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/DebugWsDelegate.java | DebugWsDelegate.diagnoseInstance | public Diagnostic diagnoseInstance( String applicationName, String instancePath )
throws DebugWsException {
"""
Runs a diagnostic for a given instance.
@return the instance
@throws DebugWsException
"""
this.logger.finer( "Diagnosing instance " + instancePath + " in application " + applicationName );
W... | java | public Diagnostic diagnoseInstance( String applicationName, String instancePath )
throws DebugWsException {
this.logger.finer( "Diagnosing instance " + instancePath + " in application " + applicationName );
WebResource path = this.resource.path( UrlConstants.DEBUG ).path( "diagnose-instance" );
path = path.que... | [
"public",
"Diagnostic",
"diagnoseInstance",
"(",
"String",
"applicationName",
",",
"String",
"instancePath",
")",
"throws",
"DebugWsException",
"{",
"this",
".",
"logger",
".",
"finer",
"(",
"\"Diagnosing instance \"",
"+",
"instancePath",
"+",
"\" in application \"",
... | Runs a diagnostic for a given instance.
@return the instance
@throws DebugWsException | [
"Runs",
"a",
"diagnostic",
"for",
"a",
"given",
"instance",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/DebugWsDelegate.java#L128-L149 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/UIContextImpl.java | UIContextImpl.setFwkAttribute | @Override
public void setFwkAttribute(final String name, final Object value) {
"""
Reserved for internal framework use. Sets a framework attribute.
@param name the attribute name.
@param value the attribute value.
"""
if (attribMap == null) {
attribMap = new HashMap<>();
}
attribMap.put(name, va... | java | @Override
public void setFwkAttribute(final String name, final Object value) {
if (attribMap == null) {
attribMap = new HashMap<>();
}
attribMap.put(name, value);
} | [
"@",
"Override",
"public",
"void",
"setFwkAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"attribMap",
"==",
"null",
")",
"{",
"attribMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"attribMap",
... | Reserved for internal framework use. Sets a framework attribute.
@param name the attribute name.
@param value the attribute value. | [
"Reserved",
"for",
"internal",
"framework",
"use",
".",
"Sets",
"a",
"framework",
"attribute",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/UIContextImpl.java#L360-L367 |
rundeck/rundeck | core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java | ResourceXMLGenerator.joinStrings | private static String joinStrings(final Set tags, final String delim) {
"""
utility to join tags into string
@param tags tags set
@param delim delimiter string
@return joined string
"""
ArrayList<String> strings = new ArrayList<String>(tags);
String[] objects = strings.toArray(new String... | java | private static String joinStrings(final Set tags, final String delim) {
ArrayList<String> strings = new ArrayList<String>(tags);
String[] objects = strings.toArray(new String[strings.size()]);
Arrays.sort(objects);
final StringBuffer sb = new StringBuffer();
for (final String tag... | [
"private",
"static",
"String",
"joinStrings",
"(",
"final",
"Set",
"tags",
",",
"final",
"String",
"delim",
")",
"{",
"ArrayList",
"<",
"String",
">",
"strings",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"tags",
")",
";",
"String",
"[",
"]",
"o... | utility to join tags into string
@param tags tags set
@param delim delimiter string
@return joined string | [
"utility",
"to",
"join",
"tags",
"into",
"string"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java#L151-L164 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.findPrototypeSingleton | private static double findPrototypeSingleton(DistanceQuery<?> dq, DBIDs cx, DBIDRef cy, DBIDVar prototype) {
"""
Find the prototypes.
@param dq Distance query
@param cx First set
@param cy Singleton object
@param prototype Prototype output variable
@return New best distance
"""
double maxDisty = 0.,... | java | private static double findPrototypeSingleton(DistanceQuery<?> dq, DBIDs cx, DBIDRef cy, DBIDVar prototype) {
double maxDisty = 0., minMaxDist = Double.POSITIVE_INFINITY;
for(DBIDIter i = cx.iter(); i.valid(); i.advance()) {
// Maximum distance of i to the element in cy
double maxDist = dq.distance(i... | [
"private",
"static",
"double",
"findPrototypeSingleton",
"(",
"DistanceQuery",
"<",
"?",
">",
"dq",
",",
"DBIDs",
"cx",
",",
"DBIDRef",
"cy",
",",
"DBIDVar",
"prototype",
")",
"{",
"double",
"maxDisty",
"=",
"0.",
",",
"minMaxDist",
"=",
"Double",
".",
"PO... | Find the prototypes.
@param dq Distance query
@param cx First set
@param cy Singleton object
@param prototype Prototype output variable
@return New best distance | [
"Find",
"the",
"prototypes",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L343-L368 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/support/ConnectionWrapping.java | ConnectionWrapping.wrapConnection | @SuppressWarnings( {
"""
Wrap a connection along its {@link Origin} reference.
@param connection
@param pool
@param <T>
@return
""" "unchecked", "rawtypes" })
static <T> T wrapConnection(T connection, Origin<T> pool) {
ReturnObjectOnCloseInvocationHandler<T> handler = new ReturnObjectOnClose... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
static <T> T wrapConnection(T connection, Origin<T> pool) {
ReturnObjectOnCloseInvocationHandler<T> handler = new ReturnObjectOnCloseInvocationHandler<T>(connection, pool);
Class<?>[] implementedInterfaces = connection.getClass().getInterfaces();
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"static",
"<",
"T",
">",
"T",
"wrapConnection",
"(",
"T",
"connection",
",",
"Origin",
"<",
"T",
">",
"pool",
")",
"{",
"ReturnObjectOnCloseInvocationHandler",
"<",
"T",
">",
... | Wrap a connection along its {@link Origin} reference.
@param connection
@param pool
@param <T>
@return | [
"Wrap",
"a",
"connection",
"along",
"its",
"{",
"@link",
"Origin",
"}",
"reference",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/support/ConnectionWrapping.java#L46-L60 |
landawn/AbacusUtil | src/com/landawn/abacus/hash/HashCode.java | HashCode.writeBytesTo | public int writeBytesTo(byte[] dest, int offset, int maxLength) {
"""
Copies bytes from this hash code into {@code dest}.
@param dest the byte array into which the hash code will be written
@param offset the start offset in the data
@param maxLength the maximum number of bytes to write
@return the number of ... | java | public int writeBytesTo(byte[] dest, int offset, int maxLength) {
maxLength = N.min(maxLength, bits() / 8);
Util.checkPositionIndexes(offset, offset + maxLength, dest.length);
writeBytesToImpl(dest, offset, maxLength);
return maxLength;
} | [
"public",
"int",
"writeBytesTo",
"(",
"byte",
"[",
"]",
"dest",
",",
"int",
"offset",
",",
"int",
"maxLength",
")",
"{",
"maxLength",
"=",
"N",
".",
"min",
"(",
"maxLength",
",",
"bits",
"(",
")",
"/",
"8",
")",
";",
"Util",
".",
"checkPositionIndexe... | Copies bytes from this hash code into {@code dest}.
@param dest the byte array into which the hash code will be written
@param offset the start offset in the data
@param maxLength the maximum number of bytes to write
@return the number of bytes written to {@code dest}
@throws IndexOutOfBoundsException if there is not ... | [
"Copies",
"bytes",
"from",
"this",
"hash",
"code",
"into",
"{",
"@code",
"dest",
"}",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/HashCode.java#L83-L88 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java | DelegatedClientNavigationController.redirectToProvider | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
"""
Redirect to provider. Receive the client name from the request and then try to determine and build the endpoint url
for the redirection. The redirection data/url must conta... | java | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
var clientName = request.getParameter(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER);
if (StringUtils.isBlank(clientName)) {
clientName = (String) request.... | [
"@",
"GetMapping",
"(",
"ENDPOINT_REDIRECT",
")",
"public",
"View",
"redirectToProvider",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"var",
"clientName",
"=",
"request",
".",
"getParameter",
"(",
"Pac4jC... | Redirect to provider. Receive the client name from the request and then try to determine and build the endpoint url
for the redirection. The redirection data/url must contain a delegated client ticket id so that the request be can
restored on the trip back. SAML clients use the relay-state session attribute while other... | [
"Redirect",
"to",
"provider",
".",
"Receive",
"the",
"client",
"name",
"from",
"the",
"request",
"and",
"then",
"try",
"to",
"determine",
"and",
"build",
"the",
"endpoint",
"url",
"for",
"the",
"redirection",
".",
"The",
"redirection",
"data",
"/",
"url",
... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java#L70-L95 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java | EscapedFunctions.sqlmonthname | public static String sqlmonthname(List<?> parsedArgs) throws SQLException {
"""
monthname translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens
"""
if (parsedArgs.size() != 1) {
throw new PSQLException(GT.tr("{0} function takes one and only one... | java | public static String sqlmonthname(List<?> parsedArgs) throws SQLException {
if (parsedArgs.size() != 1) {
throw new PSQLException(GT.tr("{0} function takes one and only one argument.", "monthname"),
PSQLState.SYNTAX_ERROR);
}
return "to_char(" + parsedArgs.get(0) + ",'Month')";
} | [
"public",
"static",
"String",
"sqlmonthname",
"(",
"List",
"<",
"?",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"parsedArgs",
".",
"size",
"(",
")",
"!=",
"1",
")",
"{",
"throw",
"new",
"PSQLException",
"(",
"GT",
".",
"tr",
"(",... | monthname translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens | [
"monthname",
"translation",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L522-L528 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java | SubscribeBeanPostProcessor.postProcessBeforeInitialization | @Override
public Object postProcessBeforeInitialization(final Object bean, final String beanName) throws BeansException {
"""
Creates a map of subscriber bean names with the corresponding
{@link Subscribe} annotations which is retrived from the <b>unproxied</b>
bean.
"""
if (bean instanceof EventSubscri... | java | @Override
public Object postProcessBeforeInitialization(final Object bean, final String beanName) throws BeansException {
if (bean instanceof EventSubscriber) {
Subscribe annotation = getAnnotation(bean.getClass(), beanName);
if (annotation != null) {
subscribers.put(beanName, annotation);
}
}
... | [
"@",
"Override",
"public",
"Object",
"postProcessBeforeInitialization",
"(",
"final",
"Object",
"bean",
",",
"final",
"String",
"beanName",
")",
"throws",
"BeansException",
"{",
"if",
"(",
"bean",
"instanceof",
"EventSubscriber",
")",
"{",
"Subscribe",
"annotation",... | Creates a map of subscriber bean names with the corresponding
{@link Subscribe} annotations which is retrived from the <b>unproxied</b>
bean. | [
"Creates",
"a",
"map",
"of",
"subscriber",
"bean",
"names",
"with",
"the",
"corresponding",
"{"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/SubscribeBeanPostProcessor.java#L55-L64 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/LittleEndianDataInputStream.java | LittleEndianDataInputStream.readFully | public final void readFully(byte pBytes[], int pOffset, int pLength) throws IOException {
"""
See the general contract of the {@code readFully}
method of {@code DataInput}.
<p/>
Bytes
for this operation are read from the contained
input stream.
@param pBytes the buffer into which the data is read.
@para... | java | public final void readFully(byte pBytes[], int pOffset, int pLength) throws IOException {
if (pLength < 0) {
throw new IndexOutOfBoundsException();
}
int count = 0;
while (count < pLength) {
int read = in.read(pBytes, pOffset + count, pLength - count);
... | [
"public",
"final",
"void",
"readFully",
"(",
"byte",
"pBytes",
"[",
"]",
",",
"int",
"pOffset",
",",
"int",
"pLength",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";"... | See the general contract of the {@code readFully}
method of {@code DataInput}.
<p/>
Bytes
for this operation are read from the contained
input stream.
@param pBytes the buffer into which the data is read.
@param pOffset the start offset of the data.
@param pLength the number of bytes to read.
@throws EOFException if... | [
"See",
"the",
"general",
"contract",
"of",
"the",
"{",
"@code",
"readFully",
"}",
"method",
"of",
"{",
"@code",
"DataInput",
"}",
".",
"<p",
"/",
">",
"Bytes",
"for",
"this",
"operation",
"are",
"read",
"from",
"the",
"contained",
"input",
"stream",
"."
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/LittleEndianDataInputStream.java#L416-L432 |
HeidelTime/heideltime | src/jvntextpro/util/StringUtils.java | StringUtils.findLastOf | public static int findLastOf (String container, String charSeq, int begin) {
"""
Find the last occurrence.
@param container the string on which we search
@param charSeq the string which we search for the occurrence
@param begin the start position in container to search from
@return the position where charSeq... | java | public static int findLastOf (String container, String charSeq, int begin){
//find the last occurrence of one of characters in charSeq from begin backward
for (int i = begin; i < container.length() && i >= 0; --i){
if (charSeq.contains("" + container.charAt(i)))
return ... | [
"public",
"static",
"int",
"findLastOf",
"(",
"String",
"container",
",",
"String",
"charSeq",
",",
"int",
"begin",
")",
"{",
"//find the last occurrence of one of characters in charSeq from begin backward\r",
"for",
"(",
"int",
"i",
"=",
"begin",
";",
"i",
"<",
"co... | Find the last occurrence.
@param container the string on which we search
@param charSeq the string which we search for the occurrence
@param begin the start position in container to search from
@return the position where charSeq occurs for the last time in container (from right to left). | [
"Find",
"the",
"last",
"occurrence",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L69-L76 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java | ClassificationService.attachLink | public ClassificationModel attachLink(ClassificationModel classificationModel, LinkModel linkModel) {
"""
Attach the given link to the classification, while checking for duplicates.
"""
for (LinkModel existing : classificationModel.getLinks())
{
if (StringUtils.equals(existing.getLi... | java | public ClassificationModel attachLink(ClassificationModel classificationModel, LinkModel linkModel)
{
for (LinkModel existing : classificationModel.getLinks())
{
if (StringUtils.equals(existing.getLink(), linkModel.getLink()))
{
return classificationModel;
... | [
"public",
"ClassificationModel",
"attachLink",
"(",
"ClassificationModel",
"classificationModel",
",",
"LinkModel",
"linkModel",
")",
"{",
"for",
"(",
"LinkModel",
"existing",
":",
"classificationModel",
".",
"getLinks",
"(",
")",
")",
"{",
"if",
"(",
"StringUtils",... | Attach the given link to the classification, while checking for duplicates. | [
"Attach",
"the",
"given",
"link",
"to",
"the",
"classification",
"while",
"checking",
"for",
"duplicates",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationService.java#L317-L328 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java | BitmapUtils.getSize | public static Point getSize(String path) {
"""
Get width and height of the bitmap specified with the file path.
@param path the bitmap file path.
@return the size.
"""
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeF... | java | public static Point getSize(String path) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, options);
int width = options.outWidth;
int height = options.outHeight;
return new Point(width, height... | [
"public",
"static",
"Point",
"getSize",
"(",
"String",
"path",
")",
"{",
"BitmapFactory",
".",
"Options",
"options",
"=",
"new",
"BitmapFactory",
".",
"Options",
"(",
")",
";",
"options",
".",
"inJustDecodeBounds",
"=",
"true",
";",
"BitmapFactory",
".",
"de... | Get width and height of the bitmap specified with the file path.
@param path the bitmap file path.
@return the size. | [
"Get",
"width",
"and",
"height",
"of",
"the",
"bitmap",
"specified",
"with",
"the",
"file",
"path",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java#L103-L110 |
ops4j/org.ops4j.pax.web | pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebAppParser.java | WebAppParser.parseMimeMappings | private static void parseMimeMappings(final MimeMappingType mimeMappingType, final WebApp webApp) {
"""
Parses mime mappings out of web.xml.
@param mimeMappingType mimeMappingType element from web.xml
@param webApp model for web.xml
"""
final WebAppMimeMapping mimeMapping = new WebAppMimeMapping(... | java | private static void parseMimeMappings(final MimeMappingType mimeMappingType, final WebApp webApp) {
final WebAppMimeMapping mimeMapping = new WebAppMimeMapping();
mimeMapping.setExtension(mimeMappingType.getExtension().getValue());
mimeMapping.setMimeType(mimeMappingType.getMimeType().getValue());
webApp.ad... | [
"private",
"static",
"void",
"parseMimeMappings",
"(",
"final",
"MimeMappingType",
"mimeMappingType",
",",
"final",
"WebApp",
"webApp",
")",
"{",
"final",
"WebAppMimeMapping",
"mimeMapping",
"=",
"new",
"WebAppMimeMapping",
"(",
")",
";",
"mimeMapping",
".",
"setExt... | Parses mime mappings out of web.xml.
@param mimeMappingType mimeMappingType element from web.xml
@param webApp model for web.xml | [
"Parses",
"mime",
"mappings",
"out",
"of",
"web",
".",
"xml",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebAppParser.java#L791-L796 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/websphere/exception/DistributedExceptionInfo.java | DistributedExceptionInfo.getErrorMsg | private String getErrorMsg(String resourceBundle, String resourceKey, String defaultEnglishMessage) {
"""
This is called by getMessage() when the resource bundle or the
resource key for the message for this exception is not found.
This method will try to retrieve a localized message for this situation.
However,... | java | private String getErrorMsg(String resourceBundle, String resourceKey, String defaultEnglishMessage) {
ResourceBundle bundle = null;
String errorMsg = null;
try {
bundle = ResourceBundle.getBundle(resourceBundle);
} catch (MissingResourceException e) {
errorMsg = ... | [
"private",
"String",
"getErrorMsg",
"(",
"String",
"resourceBundle",
",",
"String",
"resourceKey",
",",
"String",
"defaultEnglishMessage",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"null",
";",
"String",
"errorMsg",
"=",
"null",
";",
"try",
"{",
"bundle",
"=",
... | This is called by getMessage() when the resource bundle or the
resource key for the message for this exception is not found.
This method will try to retrieve a localized message for this situation.
However, if there is a problem retrieving that message, at least
provide some information in English (instead of nothing a... | [
"This",
"is",
"called",
"by",
"getMessage",
"()",
"when",
"the",
"resource",
"bundle",
"or",
"the",
"resource",
"key",
"for",
"the",
"message",
"for",
"this",
"exception",
"is",
"not",
"found",
".",
"This",
"method",
"will",
"try",
"to",
"retrieve",
"a",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/websphere/exception/DistributedExceptionInfo.java#L244-L263 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addConstraintsMinMessage | public FessMessages addConstraintsMinMessage(String property, String value) {
"""
Add the created action message for the key 'constraints.Min.message' with parameters.
<pre>
message: {item} must be greater than or equal to {value}.
</pre>
@param property The property name for the message. (NotNull)
@param val... | java | public FessMessages addConstraintsMinMessage(String property, String value) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Min_MESSAGE, value));
return this;
} | [
"public",
"FessMessages",
"addConstraintsMinMessage",
"(",
"String",
"property",
",",
"String",
"value",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"CONSTRAINTS_Min_MESSAGE",
",",
"value",
... | Add the created action message for the key 'constraints.Min.message' with parameters.
<pre>
message: {item} must be greater than or equal to {value}.
</pre>
@param property The property name for the message. (NotNull)
@param value The parameter value for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"constraints",
".",
"Min",
".",
"message",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"item",
"}",
"must",
"be",
"greater",
"than",
"or",
"equal",
"to",
"{",
"value",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L711-L715 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java | HttpClientRestEndpoint.executeRequest | @Override
public final <RQ, RS> Maybe<Response<RS>> executeRequest(RestCommand<RQ, RS> command)
throws RestEndpointIOException {
"""
Executes request command
@param command REST request representation
@return Future wrapper of REST response
@throws RestEndpointIOException In case of error
@se... | java | @Override
public final <RQ, RS> Maybe<Response<RS>> executeRequest(RestCommand<RQ, RS> command)
throws RestEndpointIOException {
URI uri = spliceUrl(command.getUri());
HttpUriRequest rq;
Serializer serializer;
switch (command.getHttpMethod()) {
case GET:
... | [
"@",
"Override",
"public",
"final",
"<",
"RQ",
",",
"RS",
">",
"Maybe",
"<",
"Response",
"<",
"RS",
">",
">",
"executeRequest",
"(",
"RestCommand",
"<",
"RQ",
",",
"RS",
">",
"command",
")",
"throws",
"RestEndpointIOException",
"{",
"URI",
"uri",
"=",
... | Executes request command
@param command REST request representation
@return Future wrapper of REST response
@throws RestEndpointIOException In case of error
@see Maybe | [
"Executes",
"request",
"command"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java#L399-L442 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.gammaCdf | protected static double gammaCdf(double x, double a) {
"""
Internal function used by gammaCdf
@param x
@param a
@return
"""
if(x<0) {
throw new IllegalArgumentException("The x parameter must be positive.");
}
double GI;
if (a>200) {
double z... | java | protected static double gammaCdf(double x, double a) {
if(x<0) {
throw new IllegalArgumentException("The x parameter must be positive.");
}
double GI;
if (a>200) {
double z=(x-a)/Math.sqrt(a);
double y=gaussCdf(z);
double b1=2/Math... | [
"protected",
"static",
"double",
"gammaCdf",
"(",
"double",
"x",
",",
"double",
"a",
")",
"{",
"if",
"(",
"x",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The x parameter must be positive.\"",
")",
";",
"}",
"double",
"GI",
";",
... | Internal function used by gammaCdf
@param x
@param a
@return | [
"Internal",
"function",
"used",
"by",
"gammaCdf"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L321-L346 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedHashMap.java | BackedHashMap.isValidCopy | boolean isValidCopy(BackedSession sess, long nowTime, int versionId) {
"""
/*
isValidCopy - determines if the cached session is still valid
"""
synchronized (sess) {
if (!sess.isValid())
return false;
int maxTime = sess.getMaxInactiveInterval();
boo... | java | boolean isValidCopy(BackedSession sess, long nowTime, int versionId) {
synchronized (sess) {
if (!sess.isValid())
return false;
int maxTime = sess.getMaxInactiveInterval();
boolean accBeforeTO = (sess.getCurrentAccessTime() >= nowTime - (1000 * (long) maxTime... | [
"boolean",
"isValidCopy",
"(",
"BackedSession",
"sess",
",",
"long",
"nowTime",
",",
"int",
"versionId",
")",
"{",
"synchronized",
"(",
"sess",
")",
"{",
"if",
"(",
"!",
"sess",
".",
"isValid",
"(",
")",
")",
"return",
"false",
";",
"int",
"maxTime",
"... | /*
isValidCopy - determines if the cached session is still valid | [
"/",
"*",
"isValidCopy",
"-",
"determines",
"if",
"the",
"cached",
"session",
"is",
"still",
"valid"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedHashMap.java#L236-L247 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/rule/LogicTransformer.java | LogicTransformer.fixClonedDeclarations | protected void fixClonedDeclarations( GroupElement and, Map<String, Class<?>> globals ) {
"""
During the logic transformation, we eventually clone CEs,
specially patterns and corresponding declarations. So now
we need to fix any references to cloned declarations.
"""
Stack<RuleConditionElement> conte... | java | protected void fixClonedDeclarations( GroupElement and, Map<String, Class<?>> globals ) {
Stack<RuleConditionElement> contextStack = new Stack<RuleConditionElement>();
DeclarationScopeResolver resolver = new DeclarationScopeResolver( globals,
... | [
"protected",
"void",
"fixClonedDeclarations",
"(",
"GroupElement",
"and",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"globals",
")",
"{",
"Stack",
"<",
"RuleConditionElement",
">",
"contextStack",
"=",
"new",
"Stack",
"<",
"RuleConditionEleme... | During the logic transformation, we eventually clone CEs,
specially patterns and corresponding declarations. So now
we need to fix any references to cloned declarations. | [
"During",
"the",
"logic",
"transformation",
"we",
"eventually",
"clone",
"CEs",
"specially",
"patterns",
"and",
"corresponding",
"declarations",
".",
"So",
"now",
"we",
"need",
"to",
"fix",
"any",
"references",
"to",
"cloned",
"declarations",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/rule/LogicTransformer.java#L147-L157 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/RubyObject.java | RubyObject.send | public static <E> E send(Object o, String methodName, Byte arg) {
"""
Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Byte
@return the result of the method called
"""
return send(o, methodName, (Object) arg);
} | java | public static <E> E send(Object o, String methodName, Byte arg) {
return send(o, methodName, (Object) arg);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"send",
"(",
"Object",
"o",
",",
"String",
"methodName",
",",
"Byte",
"arg",
")",
"{",
"return",
"send",
"(",
"o",
",",
"methodName",
",",
"(",
"Object",
")",
"arg",
")",
";",
"}"
] | Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Byte
@return the result of the method called | [
"Executes",
"a",
"method",
"of",
"any",
"Object",
"by",
"Java",
"reflection",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L111-L113 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java | MachineTypeId.of | public static MachineTypeId of(String project, String zone, String type) {
"""
Returns a machine type identity given project, zone and type names.
"""
return new MachineTypeId(project, zone, type);
} | java | public static MachineTypeId of(String project, String zone, String type) {
return new MachineTypeId(project, zone, type);
} | [
"public",
"static",
"MachineTypeId",
"of",
"(",
"String",
"project",
",",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"new",
"MachineTypeId",
"(",
"project",
",",
"zone",
",",
"type",
")",
";",
"}"
] | Returns a machine type identity given project, zone and type names. | [
"Returns",
"a",
"machine",
"type",
"identity",
"given",
"project",
"zone",
"and",
"type",
"names",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java#L116-L118 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateExpressionWithChecks | public Pair<Expr, Context> translateExpressionWithChecks(WyilFile.Expr expr, Integer selector, Context context) {
"""
Translate a given expression into its equivalent WyAL expression. At the same
time, emit verification conditions to check that the expression's
preconditions. For example, in the expression <code... | java | public Pair<Expr, Context> translateExpressionWithChecks(WyilFile.Expr expr, Integer selector, Context context) {
// Generate expression preconditions as verification conditions
checkExpressionPreconditions(expr, context);
// Gather up any postconditions from function invocations.
context = assumeExpressionPost... | [
"public",
"Pair",
"<",
"Expr",
",",
"Context",
">",
"translateExpressionWithChecks",
"(",
"WyilFile",
".",
"Expr",
"expr",
",",
"Integer",
"selector",
",",
"Context",
"context",
")",
"{",
"// Generate expression preconditions as verification conditions",
"checkExpressionP... | Translate a given expression into its equivalent WyAL expression. At the same
time, emit verification conditions to check that the expression's
preconditions. For example, in the expression <code>x[i] + 1</code> we need
to check that <code>i</code> is within bounds.
@param expr
--- Expression to be translated
@param c... | [
"Translate",
"a",
"given",
"expression",
"into",
"its",
"equivalent",
"WyAL",
"expression",
".",
"At",
"the",
"same",
"time",
"emit",
"verification",
"conditions",
"to",
"check",
"that",
"the",
"expression",
"s",
"preconditions",
".",
"For",
"example",
"in",
"... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L1222-L1229 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeNamedBlock | private Status executeNamedBlock(Stmt.NamedBlock stmt, CallStack frame, EnclosingScope scope) {
"""
Execute a named block which is simply a block of statements.
@param stmt
--- Block statement to executed
@param frame
--- The current stack frame
@return
"""
return executeBlock(stmt.getBlock(),frame,sc... | java | private Status executeNamedBlock(Stmt.NamedBlock stmt, CallStack frame, EnclosingScope scope) {
return executeBlock(stmt.getBlock(),frame,scope);
} | [
"private",
"Status",
"executeNamedBlock",
"(",
"Stmt",
".",
"NamedBlock",
"stmt",
",",
"CallStack",
"frame",
",",
"EnclosingScope",
"scope",
")",
"{",
"return",
"executeBlock",
"(",
"stmt",
".",
"getBlock",
"(",
")",
",",
"frame",
",",
"scope",
")",
";",
"... | Execute a named block which is simply a block of statements.
@param stmt
--- Block statement to executed
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"named",
"block",
"which",
"is",
"simply",
"a",
"block",
"of",
"statements",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L402-L404 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.typeofName | public static String typeofName(Scriptable scope, String id) {
"""
The typeof operator that correctly handles the undefined case
"""
Context cx = Context.getContext();
Scriptable val = bind(cx, scope, id);
if (val == null)
return "undefined";
return typeof(getObjectP... | java | public static String typeofName(Scriptable scope, String id)
{
Context cx = Context.getContext();
Scriptable val = bind(cx, scope, id);
if (val == null)
return "undefined";
return typeof(getObjectProp(val, id, cx));
} | [
"public",
"static",
"String",
"typeofName",
"(",
"Scriptable",
"scope",
",",
"String",
"id",
")",
"{",
"Context",
"cx",
"=",
"Context",
".",
"getContext",
"(",
")",
";",
"Scriptable",
"val",
"=",
"bind",
"(",
"cx",
",",
"scope",
",",
"id",
")",
";",
... | The typeof operator that correctly handles the undefined case | [
"The",
"typeof",
"operator",
"that",
"correctly",
"handles",
"the",
"undefined",
"case"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2877-L2884 |
Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java | GrpcServerBuilder.keepAliveTime | public GrpcServerBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit) {
"""
Sets the keep alive time.
@param keepAliveTime the time to wait after idle before pinging client
@param timeUnit unit of the time
@return an updated instance of this {@link GrpcServerBuilder}
"""
mNettyServerBuilder = ... | java | public GrpcServerBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit) {
mNettyServerBuilder = mNettyServerBuilder.keepAliveTime(keepAliveTime, timeUnit);
return this;
} | [
"public",
"GrpcServerBuilder",
"keepAliveTime",
"(",
"long",
"keepAliveTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"mNettyServerBuilder",
"=",
"mNettyServerBuilder",
".",
"keepAliveTime",
"(",
"keepAliveTime",
",",
"timeUnit",
")",
";",
"return",
"this",
";",
"}"
... | Sets the keep alive time.
@param keepAliveTime the time to wait after idle before pinging client
@param timeUnit unit of the time
@return an updated instance of this {@link GrpcServerBuilder} | [
"Sets",
"the",
"keep",
"alive",
"time",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L122-L125 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.createFutureRead | private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) {
"""
Creates a ReadResultEntry that is a placeholder for data that is not in memory, or in storage, which has
a starting offset beyond the length of the StreamSegment.
@param streamSegmentOffset The Offset in the StreamSegme... | java | private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) {
FutureReadResultEntry entry = new FutureReadResultEntry(streamSegmentOffset, maxLength);
this.futureReads.add(entry);
return entry;
} | [
"private",
"ReadResultEntryBase",
"createFutureRead",
"(",
"long",
"streamSegmentOffset",
",",
"int",
"maxLength",
")",
"{",
"FutureReadResultEntry",
"entry",
"=",
"new",
"FutureReadResultEntry",
"(",
"streamSegmentOffset",
",",
"maxLength",
")",
";",
"this",
".",
"fu... | Creates a ReadResultEntry that is a placeholder for data that is not in memory, or in storage, which has
a starting offset beyond the length of the StreamSegment.
@param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at.
@param maxLength The maximum length of the Read... | [
"Creates",
"a",
"ReadResultEntry",
"that",
"is",
"a",
"placeholder",
"for",
"data",
"that",
"is",
"not",
"in",
"memory",
"or",
"in",
"storage",
"which",
"has",
"a",
"starting",
"offset",
"beyond",
"the",
"length",
"of",
"the",
"StreamSegment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1043-L1047 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java | PackageUrl.updatePackageUrl | public static MozuUrl updatePackageUrl(String packageId, String responseFields, String returnId) {
"""
Get Resource Url for UpdatePackage
@param packageId Unique identifier of the package for which to retrieve the label.
@param responseFields Filtering syntax appended to an API call to increase or decrease the a... | java | public static MozuUrl updatePackageUrl(String packageId, String responseFields, String returnId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/packages/{packageId}?responseFields={responseFields}");
formatter.formatUrl("packageId", packageId);
formatter.formatUrl("responseFiel... | [
"public",
"static",
"MozuUrl",
"updatePackageUrl",
"(",
"String",
"packageId",
",",
"String",
"responseFields",
",",
"String",
"returnId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/returns/{returnId}/packages/{packageId}?respon... | Get Resource Url for UpdatePackage
@param packageId Unique identifier of the package for which to retrieve the label.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting t... | [
"Get",
"Resource",
"Url",
"for",
"UpdatePackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/returns/PackageUrl.java#L69-L76 |
alibaba/ARouter | arouter-annotation/src/main/java/com/alibaba/android/arouter/facade/model/RouteMeta.java | RouteMeta.build | public static RouteMeta build(RouteType type, Class<?> destination, String path, String group, int priority, int extra) {
"""
For versions of 'compiler' less than 1.0.7, contain 1.0.7
@param type type
@param destination destination
@param path path
@param group group
@param priority p... | java | public static RouteMeta build(RouteType type, Class<?> destination, String path, String group, int priority, int extra) {
return new RouteMeta(type, null, destination, null, path, group, null, priority, extra);
} | [
"public",
"static",
"RouteMeta",
"build",
"(",
"RouteType",
"type",
",",
"Class",
"<",
"?",
">",
"destination",
",",
"String",
"path",
",",
"String",
"group",
",",
"int",
"priority",
",",
"int",
"extra",
")",
"{",
"return",
"new",
"RouteMeta",
"(",
"type... | For versions of 'compiler' less than 1.0.7, contain 1.0.7
@param type type
@param destination destination
@param path path
@param group group
@param priority priority
@param extra extra
@return this | [
"For",
"versions",
"of",
"compiler",
"less",
"than",
"1",
".",
"0",
".",
"7",
"contain",
"1",
".",
"0",
".",
"7"
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-annotation/src/main/java/com/alibaba/android/arouter/facade/model/RouteMeta.java#L45-L47 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DeviceTypesApi.java | DeviceTypesApi.getDeviceTypesByApplication | public DeviceTypesEnvelope getDeviceTypesByApplication(String appId, Boolean productInfo, Integer count, Integer offset) throws ApiException {
"""
Get Device Types by Application
Get Device Types by Application
@param appId Application ID. (required)
@param productInfo Flag to include the associated ProductInfo... | java | public DeviceTypesEnvelope getDeviceTypesByApplication(String appId, Boolean productInfo, Integer count, Integer offset) throws ApiException {
ApiResponse<DeviceTypesEnvelope> resp = getDeviceTypesByApplicationWithHttpInfo(appId, productInfo, count, offset);
return resp.getData();
} | [
"public",
"DeviceTypesEnvelope",
"getDeviceTypesByApplication",
"(",
"String",
"appId",
",",
"Boolean",
"productInfo",
",",
"Integer",
"count",
",",
"Integer",
"offset",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"DeviceTypesEnvelope",
">",
"resp",
"=",
... | Get Device Types by Application
Get Device Types by Application
@param appId Application ID. (required)
@param productInfo Flag to include the associated ProductInfo if present (optional)
@param count Desired count of items in the result set. (optional)
@param offset Offset for pagination. (optional)
@return DeviceType... | [
"Get",
"Device",
"Types",
"by",
"Application",
"Get",
"Device",
"Types",
"by",
"Application"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DeviceTypesApi.java#L509-L512 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java | DnsLookupDataAdapter.assignMinimumTTL | private void assignMinimumTTL(List<? extends DnsAnswer> dnsAnswers, LookupResult.Builder builder) {
"""
Assigns the minimum TTL found in the supplied DnsAnswers. The minimum makes sense, because this is the least
amount of time that at least one of the records is valid for.
"""
if (config.hasOverride... | java | private void assignMinimumTTL(List<? extends DnsAnswer> dnsAnswers, LookupResult.Builder builder) {
if (config.hasOverrideTTL()) {
builder.cacheTTL(config.getCacheTTLOverrideMillis());
} else {
// Deduce minimum TTL on all TXT records. A TTL will always be returned by DNS server... | [
"private",
"void",
"assignMinimumTTL",
"(",
"List",
"<",
"?",
"extends",
"DnsAnswer",
">",
"dnsAnswers",
",",
"LookupResult",
".",
"Builder",
"builder",
")",
"{",
"if",
"(",
"config",
".",
"hasOverrideTTL",
"(",
")",
")",
"{",
"builder",
".",
"cacheTTL",
"... | Assigns the minimum TTL found in the supplied DnsAnswers. The minimum makes sense, because this is the least
amount of time that at least one of the records is valid for. | [
"Assigns",
"the",
"minimum",
"TTL",
"found",
"in",
"the",
"supplied",
"DnsAnswers",
".",
"The",
"minimum",
"makes",
"sense",
"because",
"this",
"is",
"the",
"least",
"amount",
"of",
"time",
"that",
"at",
"least",
"one",
"of",
"the",
"records",
"is",
"valid... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java#L373-L383 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationldappolicy_binding.java | authenticationldappolicy_binding.get | public static authenticationldappolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authenticationldappolicy_binding resource of given name .
"""
authenticationldappolicy_binding obj = new authenticationldappolicy_binding();
obj.set_name(name);
authenticati... | java | public static authenticationldappolicy_binding get(nitro_service service, String name) throws Exception{
authenticationldappolicy_binding obj = new authenticationldappolicy_binding();
obj.set_name(name);
authenticationldappolicy_binding response = (authenticationldappolicy_binding) obj.get_resource(service);
re... | [
"public",
"static",
"authenticationldappolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationldappolicy_binding",
"obj",
"=",
"new",
"authenticationldappolicy_binding",
"(",
")",
";",
"obj",
".",
... | Use this API to fetch authenticationldappolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationldappolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationldappolicy_binding.java#L136-L141 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.getSend | public JsonResponse getSend(String sendId) throws IOException {
"""
Get the status of a transational send
@param sendId Unique send id
@throws IOException
"""
Map<String, Object> data = new HashMap<String, Object>();
data.put(Send.PARAM_SEND_ID, sendId);
return apiGet(ApiAction.send, ... | java | public JsonResponse getSend(String sendId) throws IOException {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Send.PARAM_SEND_ID, sendId);
return apiGet(ApiAction.send, data);
} | [
"public",
"JsonResponse",
"getSend",
"(",
"String",
"sendId",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"Send",... | Get the status of a transational send
@param sendId Unique send id
@throws IOException | [
"Get",
"the",
"status",
"of",
"a",
"transational",
"send"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L103-L107 |
grails/grails-core | grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java | DataBindingUtils.bindObjectToInstance | public static BindingResult bindObjectToInstance(Object object, Object source) {
"""
Binds the given source object to the given target object performing type conversion if necessary
@param object The object to bind to
@param source The source object
@return A BindingResult if there were errors or null if it w... | java | public static BindingResult bindObjectToInstance(Object object, Object source) {
return bindObjectToInstance(object, source, getBindingIncludeList(object), Collections.emptyList(), null);
} | [
"public",
"static",
"BindingResult",
"bindObjectToInstance",
"(",
"Object",
"object",
",",
"Object",
"source",
")",
"{",
"return",
"bindObjectToInstance",
"(",
"object",
",",
"source",
",",
"getBindingIncludeList",
"(",
"object",
")",
",",
"Collections",
".",
"emp... | Binds the given source object to the given target object performing type conversion if necessary
@param object The object to bind to
@param source The source object
@return A BindingResult if there were errors or null if it was successful | [
"Binds",
"the",
"given",
"source",
"object",
"to",
"the",
"given",
"target",
"object",
"performing",
"type",
"conversion",
"if",
"necessary"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java#L110-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java | FaceletViewDeclarationLanguage.createFaceletFactory | protected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler) {
"""
Creates a FaceletFactory instance using the specified compiler.
@param context
the current FacesContext
@param compiler
the compiler to be used by the factory
@return the factory used by this VDL to load pages
... | java | protected FaceletFactory createFaceletFactory(FacesContext context, Compiler compiler)
{
ExternalContext eContext = context.getExternalContext();
// refresh period
long refreshPeriod;
if (context.isProjectStage(ProjectStage.Production))
{
refreshPeriod = WebConfi... | [
"protected",
"FaceletFactory",
"createFaceletFactory",
"(",
"FacesContext",
"context",
",",
"Compiler",
"compiler",
")",
"{",
"ExternalContext",
"eContext",
"=",
"context",
".",
"getExternalContext",
"(",
")",
";",
"// refresh period",
"long",
"refreshPeriod",
";",
"i... | Creates a FaceletFactory instance using the specified compiler.
@param context
the current FacesContext
@param compiler
the compiler to be used by the factory
@return the factory used by this VDL to load pages | [
"Creates",
"a",
"FaceletFactory",
"instance",
"using",
"the",
"specified",
"compiler",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java#L2196-L2236 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/Instant.java | Instant.plus | private Instant plus(long secondsToAdd, long nanosToAdd) {
"""
Returns a copy of this instant with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or ne... | java | private Instant plus(long secondsToAdd, long nanosToAdd) {
if ((secondsToAdd | nanosToAdd) == 0) {
return this;
}
long epochSec = Jdk8Methods.safeAdd(seconds, secondsToAdd);
epochSec = Jdk8Methods.safeAdd(epochSec, nanosToAdd / NANOS_PER_SECOND);
nanosToAdd = nanosToA... | [
"private",
"Instant",
"plus",
"(",
"long",
"secondsToAdd",
",",
"long",
"nanosToAdd",
")",
"{",
"if",
"(",
"(",
"secondsToAdd",
"|",
"nanosToAdd",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"epochSec",
"=",
"Jdk8Methods",
".",
"safeAdd... | Returns a copy of this instant with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or negative
@return an {@code Instant} based on this instant with the specifie... | [
"Returns",
"a",
"copy",
"of",
"this",
"instant",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/Instant.java#L781-L790 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.beginCreateOrUpdate | public ManagedClusterInner beginCreateOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
"""
Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of... | java | public ManagedClusterInner beginCreateOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body();
} | [
"public",
"ManagedClusterInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",... | Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Create or Up... | [
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"Kubernetes",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L715-L717 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/ReOpenableHashPartition.java | ReOpenableHashPartition.restorePartitionBuffers | void restorePartitionBuffers(IOManager ioManager, List<MemorySegment> availableMemory) throws IOException {
"""
This method is called every time a multi-match hash map is opened again for a new probe input.
@param ioManager
@param availableMemory
@throws IOException
"""
final BulkBlockChannelReader reader... | java | void restorePartitionBuffers(IOManager ioManager, List<MemorySegment> availableMemory) throws IOException {
final BulkBlockChannelReader reader = ioManager.createBulkBlockChannelReader(this.initialBuildSideChannel,
availableMemory, this.initialPartitionBuffersCount);
reader.close();
final List<MemorySegment> ... | [
"void",
"restorePartitionBuffers",
"(",
"IOManager",
"ioManager",
",",
"List",
"<",
"MemorySegment",
">",
"availableMemory",
")",
"throws",
"IOException",
"{",
"final",
"BulkBlockChannelReader",
"reader",
"=",
"ioManager",
".",
"createBulkBlockChannelReader",
"(",
"this... | This method is called every time a multi-match hash map is opened again for a new probe input.
@param ioManager
@param availableMemory
@throws IOException | [
"This",
"method",
"is",
"called",
"every",
"time",
"a",
"multi",
"-",
"match",
"hash",
"map",
"is",
"opened",
"again",
"for",
"a",
"new",
"probe",
"input",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/ReOpenableHashPartition.java#L124-L135 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.insertBusHaltBefore | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, String name, BusItineraryHaltType type) {
"""
Insert newHalt before beforeHalt in the ordered list of {@link BusItineraryHalt}.
@param beforeHalt the halt where insert the new halt
@param name name of the new halt
@param type the type of b... | java | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, String name, BusItineraryHaltType type) {
return this.insertBusHaltBefore(beforeHalt, null, name, type);
} | [
"public",
"BusItineraryHalt",
"insertBusHaltBefore",
"(",
"BusItineraryHalt",
"beforeHalt",
",",
"String",
"name",
",",
"BusItineraryHaltType",
"type",
")",
"{",
"return",
"this",
".",
"insertBusHaltBefore",
"(",
"beforeHalt",
",",
"null",
",",
"name",
",",
"type",
... | Insert newHalt before beforeHalt in the ordered list of {@link BusItineraryHalt}.
@param beforeHalt the halt where insert the new halt
@param name name of the new halt
@param type the type of bus halt
@return the added bus halt, otherwise <code>null</code> | [
"Insert",
"newHalt",
"before",
"beforeHalt",
"in",
"the",
"ordered",
"list",
"of",
"{",
"@link",
"BusItineraryHalt",
"}",
".",
"@param",
"beforeHalt",
"the",
"halt",
"where",
"insert",
"the",
"new",
"halt",
"@param",
"name",
"name",
"of",
"the",
"new",
"halt... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1236-L1238 |
xwiki/xwiki-rendering | xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java | XMLWikiPrinter.printXMLStartElement | public void printXMLStartElement(String name, Attributes attributes) {
"""
Print the start tag of xml element. In the form {@code <name att1="value1" att2="value2">}.
@param name the xml element to print
@param attributes the xml attributes of the element to print
"""
try {
this.xmlWrit... | java | public void printXMLStartElement(String name, Attributes attributes)
{
try {
this.xmlWriter.startElement("", name, name, attributes);
} catch (SAXException e) {
// TODO: add error log here
}
} | [
"public",
"void",
"printXMLStartElement",
"(",
"String",
"name",
",",
"Attributes",
"attributes",
")",
"{",
"try",
"{",
"this",
".",
"xmlWriter",
".",
"startElement",
"(",
"\"\"",
",",
"name",
",",
"name",
",",
"attributes",
")",
";",
"}",
"catch",
"(",
... | Print the start tag of xml element. In the form {@code <name att1="value1" att2="value2">}.
@param name the xml element to print
@param attributes the xml attributes of the element to print | [
"Print",
"the",
"start",
"tag",
"of",
"xml",
"element",
".",
"In",
"the",
"form",
"{",
"@code",
"<name",
"att1",
"=",
"value1",
"att2",
"=",
"value2",
">",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java#L177-L184 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java | JsiiObject.jsiiAsyncCall | @Nullable
protected final <T> T jsiiAsyncCall(final String method, final Class<T> returnType, @Nullable final Object... args) {
"""
Calls an async method on the object.
@param method The name of the method.
@param returnType The return type.
@param args Method arguments.
@param <T> Java type for the return... | java | @Nullable
protected final <T> T jsiiAsyncCall(final String method, final Class<T> returnType, @Nullable final Object... args) {
JsiiClient client = engine.getClient();
JsiiPromise promise = client.beginAsyncMethod(this.objRef, method, JsiiObjectMapper.valueToTree(args));
engine.processAllPe... | [
"@",
"Nullable",
"protected",
"final",
"<",
"T",
">",
"T",
"jsiiAsyncCall",
"(",
"final",
"String",
"method",
",",
"final",
"Class",
"<",
"T",
">",
"returnType",
",",
"@",
"Nullable",
"final",
"Object",
"...",
"args",
")",
"{",
"JsiiClient",
"client",
"=... | Calls an async method on the object.
@param method The name of the method.
@param returnType The return type.
@param args Method arguments.
@param <T> Java type for the return value.
@return A ereturn value. | [
"Calls",
"an",
"async",
"method",
"on",
"the",
"object",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java#L88-L96 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java | TempUtils.createTempDir | public static File createTempDir(String prefix) {
"""
Creates a temporary directory prefixed with <code>prefix</code>.
@param prefix folder prefix
@return temporary folder
"""
File baseDir = new File(System.getProperty("java.io.tmpdir"));
String baseName = prefix + System.currentTimeMillis() + "-";... | java | public static File createTempDir(String prefix) {
File baseDir = new File(System.getProperty("java.io.tmpdir"));
String baseName = prefix + System.currentTimeMillis() + "-";
for (int counter = 0; counter < 10000; counter++) {
File tempDir = new File(baseDir, baseName + counter);
if (tempDir.mkd... | [
"public",
"static",
"File",
"createTempDir",
"(",
"String",
"prefix",
")",
"{",
"File",
"baseDir",
"=",
"new",
"File",
"(",
"System",
".",
"getProperty",
"(",
"\"java.io.tmpdir\"",
")",
")",
";",
"String",
"baseName",
"=",
"prefix",
"+",
"System",
".",
"cu... | Creates a temporary directory prefixed with <code>prefix</code>.
@param prefix folder prefix
@return temporary folder | [
"Creates",
"a",
"temporary",
"directory",
"prefixed",
"with",
"<code",
">",
"prefix<",
"/",
"code",
">",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java#L41-L54 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImplR.java | IntersectionImplR.wrapInstance | static IntersectionImplR wrapInstance(final Memory srcMem, final long seed) {
"""
Wrap an Intersection target around the given source Memory containing intersection data.
@param srcMem The source Memory image.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/reso... | java | static IntersectionImplR wrapInstance(final Memory srcMem, final long seed) {
final IntersectionImplR impl = new IntersectionImplR((WritableMemory) srcMem, seed, false);
return internalWrapInstance(srcMem, impl);
} | [
"static",
"IntersectionImplR",
"wrapInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"IntersectionImplR",
"impl",
"=",
"new",
"IntersectionImplR",
"(",
"(",
"WritableMemory",
")",
"srcMem",
",",
"seed",
",",
"false",
... | Wrap an Intersection target around the given source Memory containing intersection data.
@param srcMem The source Memory image.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return an IntersectionImplR that wraps a read-on... | [
"Wrap",
"an",
"Intersection",
"target",
"around",
"the",
"given",
"source",
"Memory",
"containing",
"intersection",
"data",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImplR.java#L88-L91 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java | Normalizer.quickCheck | @Deprecated
public static QuickCheckResult quickCheck(String source, Mode mode, int options) {
"""
Performing quick check on a string, to quickly determine if the string is
in a particular normalization format.
Three types of result can be returned Normalizer.YES, Normalizer.NO or
Normalizer.MAYBE. Result N... | java | @Deprecated
public static QuickCheckResult quickCheck(String source, Mode mode, int options) {
return mode.getNormalizer2(options).quickCheck(source);
} | [
"@",
"Deprecated",
"public",
"static",
"QuickCheckResult",
"quickCheck",
"(",
"String",
"source",
",",
"Mode",
"mode",
",",
"int",
"options",
")",
"{",
"return",
"mode",
".",
"getNormalizer2",
"(",
"options",
")",
".",
"quickCheck",
"(",
"source",
")",
";",
... | Performing quick check on a string, to quickly determine if the string is
in a particular normalization format.
Three types of result can be returned Normalizer.YES, Normalizer.NO or
Normalizer.MAYBE. Result Normalizer.YES indicates that the argument
string is in the desired normalized format, Normalizer.NO determines ... | [
"Performing",
"quick",
"check",
"on",
"a",
"string",
"to",
"quickly",
"determine",
"if",
"the",
"string",
"is",
"in",
"a",
"particular",
"normalization",
"format",
".",
"Three",
"types",
"of",
"result",
"can",
"be",
"returned",
"Normalizer",
".",
"YES",
"Nor... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Normalizer.java#L1008-L1011 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/IsIncludedIn.java | IsIncludedIn.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null
@throws SuperCsvConstraintViolationException
if value isn't one of the possible values
"""
validateInputNotNull(value, context);
if( !possibleValues.conta... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if( !possibleValues.contains(value) ) {
throw new SuperCsvConstraintViolationException(String.format(
"'%s' is not included in the allowed set of values", value), context, this);
}
return nex... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"possibleValues",
".",
"contains",
"(",
"value",
")",
")",
"{",... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null
@throws SuperCsvConstraintViolationException
if value isn't one of the possible values | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/IsIncludedIn.java#L162-L171 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageUtils.java | ImageUtils.composeThroughMask | public static void composeThroughMask(Raster src, WritableRaster dst, Raster sel) {
"""
Compose src onto dst using the alpha of sel to interpolate between the two.
I can't think of a way to do this using AlphaComposite.
@param src the source raster
@param dst the destination raster
@param sel the mask raster
... | java | public static void composeThroughMask(Raster src, WritableRaster dst, Raster sel) {
int x = src.getMinX();
int y = src.getMinY();
int w = src.getWidth();
int h = src.getHeight();
int srcRGB[] = null;
int selRGB[] = null;
int dstRGB[] = null;
for ( int i = 0; i < h; i++ ) {
srcRGB = src.getPixels(x,... | [
"public",
"static",
"void",
"composeThroughMask",
"(",
"Raster",
"src",
",",
"WritableRaster",
"dst",
",",
"Raster",
"sel",
")",
"{",
"int",
"x",
"=",
"src",
".",
"getMinX",
"(",
")",
";",
"int",
"y",
"=",
"src",
".",
"getMinY",
"(",
")",
";",
"int",... | Compose src onto dst using the alpha of sel to interpolate between the two.
I can't think of a way to do this using AlphaComposite.
@param src the source raster
@param dst the destination raster
@param sel the mask raster | [
"Compose",
"src",
"onto",
"dst",
"using",
"the",
"alpha",
"of",
"sel",
"to",
"interpolate",
"between",
"the",
"two",
".",
"I",
"can",
"t",
"think",
"of",
"a",
"way",
"to",
"do",
"this",
"using",
"AlphaComposite",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageUtils.java#L208-L247 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.modifyAckDeadline | public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName, final int ackDeadlineSeconds,
final List<String> ackIds) {
"""
Modify the ack deadline for a list of received messages.
@param canonicalSubscriptionName The canonical (including proj... | java | public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName, final int ackDeadlineSeconds,
final List<String> ackIds) {
final String path = canonicalSubscriptionName + ":modifyAckDeadline";
final ModifyAckDeadlineRequest req = ModifyAckDeadlin... | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"modifyAckDeadline",
"(",
"final",
"String",
"canonicalSubscriptionName",
",",
"final",
"int",
"ackDeadlineSeconds",
",",
"final",
"List",
"<",
"String",
">",
"ackIds",
")",
"{",
"final",
"String",
"path",
"=",
"canoni... | Modify the ack deadline for a list of received messages.
@param canonicalSubscriptionName The canonical (including project name) subscription of the received message to
modify the ack deadline on.
@param ackDeadlineSeconds The new ack deadline.
@param ackIds List of message ID's to modify the... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"a",
"list",
"of",
"received",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L701-L709 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.predicateTemplate | @Deprecated
public static PredicateTemplate predicateTemplate(Template template, ImmutableList<?> args) {
"""
Create a new Template expression
@deprecated Use {@link #predicateTemplate(Template, List)} instead.
@param template template
@param args template parameters
@return template expression
"""... | java | @Deprecated
public static PredicateTemplate predicateTemplate(Template template, ImmutableList<?> args) {
return new PredicateTemplate(template, args);
} | [
"@",
"Deprecated",
"public",
"static",
"PredicateTemplate",
"predicateTemplate",
"(",
"Template",
"template",
",",
"ImmutableList",
"<",
"?",
">",
"args",
")",
"{",
"return",
"new",
"PredicateTemplate",
"(",
"template",
",",
"args",
")",
";",
"}"
] | Create a new Template expression
@deprecated Use {@link #predicateTemplate(Template, List)} instead.
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L189-L192 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllIndexDescriptorColumns | public void forAllIndexDescriptorColumns(String template, Properties attributes) throws XDocletException {
"""
Processes the template for all index columns for the current index descriptor.
@param template The template
@param attributes The attributes of the tag
@exception XDocletExcep... | java | public void forAllIndexDescriptorColumns(String template, Properties attributes) throws XDocletException
{
String fields = _curIndexDescriptorDef.getProperty(PropertyHelper.OJB_PROPERTY_FIELDS);
FieldDescriptorDef fieldDef;
String name;
for (CommaListIt... | [
"public",
"void",
"forAllIndexDescriptorColumns",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"fields",
"=",
"_curIndexDescriptorDef",
".",
"getProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_FIELDS",
... | Processes the template for all index columns for the current index descriptor.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"index",
"columns",
"for",
"the",
"current",
"index",
"descriptor",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L437-L457 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/PhotoUtils.java | PhotoUtils.getImageForSize | public static BufferedImage getImageForSize(JinxConstants.PhotoSize size, Photo photo) throws JinxException {
"""
Get an image for a photo at a specific size.
@param size Required. The the desired size.
@param photo Required. The photo to get the image for.
@return buffered image data from Flickr.
@throws J... | java | public static BufferedImage getImageForSize(JinxConstants.PhotoSize size, Photo photo) throws JinxException {
if (photo == null || size == null) {
throw new JinxException("Cannot look up null photo or size.");
}
BufferedImage image;
try {
image = ImageIO.read(getUrlForSize(size, photo));
} catch (JinxEx... | [
"public",
"static",
"BufferedImage",
"getImageForSize",
"(",
"JinxConstants",
".",
"PhotoSize",
"size",
",",
"Photo",
"photo",
")",
"throws",
"JinxException",
"{",
"if",
"(",
"photo",
"==",
"null",
"||",
"size",
"==",
"null",
")",
"{",
"throw",
"new",
"JinxE... | Get an image for a photo at a specific size.
@param size Required. The the desired size.
@param photo Required. The photo to get the image for.
@return buffered image data from Flickr.
@throws JinxException if any parameter is null, or if there are any errors. | [
"Get",
"an",
"image",
"for",
"a",
"photo",
"at",
"a",
"specific",
"size",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/PhotoUtils.java#L54-L67 |
samskivert/samskivert | src/main/java/com/samskivert/util/MethodFinder.java | MethodFinder.findMethod | public Method findMethod (String methodName, Class<?>[] parameterTypes)
throws NoSuchMethodException {
"""
Returns the most specific public method in my target class that has the given name and
accepts the number and type of parameters in the given Class array in a reflective
invocation.
<p> A null va... | java | public Method findMethod (String methodName, Class<?>[] parameterTypes)
throws NoSuchMethodException
{
// make sure the constructor list is loaded
maybeLoadMethods();
List<Member> methodList = _methodMap.get(methodName);
if (methodList == null) {
throw new NoSuch... | [
"public",
"Method",
"findMethod",
"(",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"throws",
"NoSuchMethodException",
"{",
"// make sure the constructor list is loaded",
"maybeLoadMethods",
"(",
")",
";",
"List",
"<",
"Membe... | Returns the most specific public method in my target class that has the given name and
accepts the number and type of parameters in the given Class array in a reflective
invocation.
<p> A null value or Void.TYPE in parameterTypes will match a corresponding Object or array
reference in a method's formal parameter list,... | [
"Returns",
"the",
"most",
"specific",
"public",
"method",
"in",
"my",
"target",
"class",
"that",
"has",
"the",
"given",
"name",
"and",
"accepts",
"the",
"number",
"and",
"type",
"of",
"parameters",
"in",
"the",
"given",
"Class",
"array",
"in",
"a",
"reflec... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L110-L127 |
roboconf/roboconf-platform | core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java | InstanceTemplateHelper.injectInstanceImports | public static void injectInstanceImports(Instance instance, String templateFilePath, Writer writer)
throws IOException {
"""
Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instance... | java | public static void injectInstanceImports(Instance instance, String templateFilePath, Writer writer)
throws IOException {
injectInstanceImports(instance, new File( templateFilePath ), writer);
} | [
"public",
"static",
"void",
"injectInstanceImports",
"(",
"Instance",
"instance",
",",
"String",
"templateFilePath",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"injectInstanceImports",
"(",
"instance",
",",
"new",
"File",
"(",
"templateFilePath",
")... | Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instance whose imports must be injected
@param templateFilePath the path of the template file
@param writer a writer
@throws IOException if some... | [
"Reads",
"the",
"import",
"values",
"of",
"the",
"instances",
"and",
"injects",
"them",
"into",
"the",
"template",
"file",
".",
"<p",
">",
"See",
"test",
"resources",
"to",
"see",
"the",
"associated",
"way",
"to",
"write",
"templates",
"<",
"/",
"p",
">"... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java#L88-L91 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.getTopic | public PubsubFuture<Topic> getTopic(final String canonicalTopic) {
"""
Get a Pub/Sub topic.
@param canonicalTopic The canonical (including project) name of the topic to get.
@return A future that is completed when this request is completed. The future will be completed with {@code null}
if the response is 404... | java | public PubsubFuture<Topic> getTopic(final String canonicalTopic) {
validateCanonicalTopic(canonicalTopic);
return get("get topic", canonicalTopic, readJson(Topic.class));
} | [
"public",
"PubsubFuture",
"<",
"Topic",
">",
"getTopic",
"(",
"final",
"String",
"canonicalTopic",
")",
"{",
"validateCanonicalTopic",
"(",
"canonicalTopic",
")",
";",
"return",
"get",
"(",
"\"get topic\"",
",",
"canonicalTopic",
",",
"readJson",
"(",
"Topic",
"... | Get a Pub/Sub topic.
@param canonicalTopic The canonical (including project) name of the topic to get.
@return A future that is completed when this request is completed. The future will be completed with {@code null}
if the response is 404. | [
"Get",
"a",
"Pub",
"/",
"Sub",
"topic",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L317-L320 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.notIn | public Where<T, ID> notIn(String columnName, QueryBuilder<?, ?> subQueryBuilder) throws SQLException {
"""
Same as {@link #in(String, QueryBuilder)} except with a NOT IN clause.
"""
return in(false, columnName, subQueryBuilder);
} | java | public Where<T, ID> notIn(String columnName, QueryBuilder<?, ?> subQueryBuilder) throws SQLException {
return in(false, columnName, subQueryBuilder);
} | [
"public",
"Where",
"<",
"T",
",",
"ID",
">",
"notIn",
"(",
"String",
"columnName",
",",
"QueryBuilder",
"<",
"?",
",",
"?",
">",
"subQueryBuilder",
")",
"throws",
"SQLException",
"{",
"return",
"in",
"(",
"false",
",",
"columnName",
",",
"subQueryBuilder",... | Same as {@link #in(String, QueryBuilder)} except with a NOT IN clause. | [
"Same",
"as",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L262-L264 |
apache/incubator-heron | heron/schedulers/src/java/org/apache/heron/scheduler/mesos/MesosScheduler.java | MesosScheduler.joinSchedulerDriver | protected void joinSchedulerDriver(long timeout, TimeUnit unit) {
"""
Waits for the driver to be stopped or aborted
@param timeout maximum time waiting
@param unit time unit to wait
"""
// ExecutorService used to monitor whether close() completes in time
ExecutorService service = Executors.newFixed... | java | protected void joinSchedulerDriver(long timeout, TimeUnit unit) {
// ExecutorService used to monitor whether close() completes in time
ExecutorService service = Executors.newFixedThreadPool(1);
final CountDownLatch closeLatch = new CountDownLatch(1);
Runnable driverJoin = new Runnable() {
@Overrid... | [
"protected",
"void",
"joinSchedulerDriver",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"// ExecutorService used to monitor whether close() completes in time",
"ExecutorService",
"service",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"1",
")",
";",
"f... | Waits for the driver to be stopped or aborted
@param timeout maximum time waiting
@param unit time unit to wait | [
"Waits",
"for",
"the",
"driver",
"to",
"be",
"stopped",
"or",
"aborted"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/schedulers/src/java/org/apache/heron/scheduler/mesos/MesosScheduler.java#L98-L124 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/CmsListCollectorEditor.java | CmsListCollectorEditor.openEditDialog | protected void openEditDialog(boolean isNew, String mode, CmsEditHandlerData handlerDataForNew) {
"""
Opens the content editor.<p>
@param isNew <code>true</code> to create and edit a new resource
@param mode the content creation mode
@param handlerDataForNew the data for the edit handler if it is used for the... | java | protected void openEditDialog(boolean isNew, String mode, CmsEditHandlerData handlerDataForNew) {
CmsContainerpageController.get().getContentEditorHandler().openDialog(
m_editableData,
isNew,
m_parentResourceId,
mode,
handlerDataForNew);
} | [
"protected",
"void",
"openEditDialog",
"(",
"boolean",
"isNew",
",",
"String",
"mode",
",",
"CmsEditHandlerData",
"handlerDataForNew",
")",
"{",
"CmsContainerpageController",
".",
"get",
"(",
")",
".",
"getContentEditorHandler",
"(",
")",
".",
"openDialog",
"(",
"... | Opens the content editor.<p>
@param isNew <code>true</code> to create and edit a new resource
@param mode the content creation mode
@param handlerDataForNew the data for the edit handler if it is used for the 'new' function | [
"Opens",
"the",
"content",
"editor",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/CmsListCollectorEditor.java#L371-L379 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java | CoreLabelTokenFactory.makeToken | public CoreLabel makeToken(String tokenText, int begin, int length) {
"""
Constructs a CoreLabel as a String with a corresponding BEGIN and END position.
(Does not take substring).
"""
return makeToken(tokenText, tokenText, begin, length);
} | java | public CoreLabel makeToken(String tokenText, int begin, int length) {
return makeToken(tokenText, tokenText, begin, length);
} | [
"public",
"CoreLabel",
"makeToken",
"(",
"String",
"tokenText",
",",
"int",
"begin",
",",
"int",
"length",
")",
"{",
"return",
"makeToken",
"(",
"tokenText",
",",
"tokenText",
",",
"begin",
",",
"length",
")",
";",
"}"
] | Constructs a CoreLabel as a String with a corresponding BEGIN and END position.
(Does not take substring). | [
"Constructs",
"a",
"CoreLabel",
"as",
"a",
"String",
"with",
"a",
"corresponding",
"BEGIN",
"and",
"END",
"position",
".",
"(",
"Does",
"not",
"take",
"substring",
")",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java#L50-L52 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/GeometryEngine.java | GeometryEngine.geometryToWkt | public static String geometryToWkt(Geometry geometry, int exportFlags) {
"""
Exports a geometry to a string in WKT format.
See OperatorExportToWkt.
@param geometry The geometry to export. (null value is not allowed)
@param exportFlags Use the {@link WktExportFlags} interface.
@return A String containing th... | java | public static String geometryToWkt(Geometry geometry, int exportFlags) {
OperatorExportToWkt op = (OperatorExportToWkt) factory
.getOperator(Operator.Type.ExportToWkt);
return op.execute(exportFlags, geometry, null);
} | [
"public",
"static",
"String",
"geometryToWkt",
"(",
"Geometry",
"geometry",
",",
"int",
"exportFlags",
")",
"{",
"OperatorExportToWkt",
"op",
"=",
"(",
"OperatorExportToWkt",
")",
"factory",
".",
"getOperator",
"(",
"Operator",
".",
"Type",
".",
"ExportToWkt",
"... | Exports a geometry to a string in WKT format.
See OperatorExportToWkt.
@param geometry The geometry to export. (null value is not allowed)
@param exportFlags Use the {@link WktExportFlags} interface.
@return A String containing the exported geometry in WKT format. | [
"Exports",
"a",
"geometry",
"to",
"a",
"string",
"in",
"WKT",
"format",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/GeometryEngine.java#L271-L275 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/store/mongo/MongoTemplate.java | MongoTemplate.ensureIndex | public void ensureIndex(String collName, String name, String fields, boolean unique, boolean dropDupsOnCreate) {
"""
Ensures (creating if necessary) the index including the field(s) + directions; eg fields = "field1, -field2" ({field1:1, field2:-1})
"""
BasicDBObject dbFields = parseFieldsString(field... | java | public void ensureIndex(String collName, String name, String fields, boolean unique, boolean dropDupsOnCreate) {
BasicDBObject dbFields = parseFieldsString(fields);
final BasicDBObjectBuilder keyOpts = new BasicDBObjectBuilder();
if (name != null && name.length() != 0) {
keyOpts.ad... | [
"public",
"void",
"ensureIndex",
"(",
"String",
"collName",
",",
"String",
"name",
",",
"String",
"fields",
",",
"boolean",
"unique",
",",
"boolean",
"dropDupsOnCreate",
")",
"{",
"BasicDBObject",
"dbFields",
"=",
"parseFieldsString",
"(",
"fields",
")",
";",
... | Ensures (creating if necessary) the index including the field(s) + directions; eg fields = "field1, -field2" ({field1:1, field2:-1}) | [
"Ensures",
"(",
"creating",
"if",
"necessary",
")",
"the",
"index",
"including",
"the",
"field",
"(",
"s",
")",
"+",
"directions",
";",
"eg",
"fields",
"=",
"field1",
"-",
"field2",
"(",
"{",
"field1",
":",
"1",
"field2",
":",
"-",
"1",
"}",
")"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/store/mongo/MongoTemplate.java#L84-L109 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteLabel | public void deleteLabel(Serializable projectId, GitlabLabel label)
throws IOException {
"""
Deletes an existing label.
@param projectId The ID of the project containing the label.
@param label The label to delete.
@throws IOException on gitlab api call error
"""
deleteLabel(project... | java | public void deleteLabel(Serializable projectId, GitlabLabel label)
throws IOException {
deleteLabel(projectId, label.getName());
} | [
"public",
"void",
"deleteLabel",
"(",
"Serializable",
"projectId",
",",
"GitlabLabel",
"label",
")",
"throws",
"IOException",
"{",
"deleteLabel",
"(",
"projectId",
",",
"label",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Deletes an existing label.
@param projectId The ID of the project containing the label.
@param label The label to delete.
@throws IOException on gitlab api call error | [
"Deletes",
"an",
"existing",
"label",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2835-L2838 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getOUComboBox | public static ComboBox getOUComboBox(CmsObject cms, String baseOu, Log log, boolean includeWebOU) {
"""
Creates the ComboBox for OU selection.<p>
@param cms CmsObject
@param baseOu OU
@param log Logger object
@param includeWebOU include webou?
@return ComboBox
"""
ComboBox combo = null;
... | java | public static ComboBox getOUComboBox(CmsObject cms, String baseOu, Log log, boolean includeWebOU) {
ComboBox combo = null;
try {
IndexedContainer container = new IndexedContainer();
container.addContainerProperty("desc", String.class, "");
for (String ou : CmsOUHandl... | [
"public",
"static",
"ComboBox",
"getOUComboBox",
"(",
"CmsObject",
"cms",
",",
"String",
"baseOu",
",",
"Log",
"log",
",",
"boolean",
"includeWebOU",
")",
"{",
"ComboBox",
"combo",
"=",
"null",
";",
"try",
"{",
"IndexedContainer",
"container",
"=",
"new",
"I... | Creates the ComboBox for OU selection.<p>
@param cms CmsObject
@param baseOu OU
@param log Logger object
@param includeWebOU include webou?
@return ComboBox | [
"Creates",
"the",
"ComboBox",
"for",
"OU",
"selection",
".",
"<p",
">",
"@param",
"cms",
"CmsObject",
"@param",
"baseOu",
"OU",
"@param",
"log",
"Logger",
"object",
"@param",
"includeWebOU",
"include",
"webou?"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L671-L708 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.createAsync | public Observable<RedisResourceInner> createAsync(String resourceGroupName, String name, RedisCreateParameters parameters) {
"""
Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis ca... | java | public Observable<RedisResourceInner> createAsync(String resourceGroupName, String name, RedisCreateParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<RedisResourceInner>, RedisResourceInner>() {
@Override
pub... | [
"public",
"Observable",
"<",
"RedisResourceInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"RedisCreateParameters",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
","... | Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters supplied to the Create Redis operation.
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Create",
"or",
"replace",
"(",
"overwrite",
"/",
"recreate",
"with",
"potential",
"downtime",
")",
"an",
"existing",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L362-L369 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java | MenuLoader.requestMoreSearchResultsFrom | public List<Message> requestMoreSearchResultsFrom(final int player, final CdjStatus.TrackSourceSlot slot,
final int sortOrder, final String text,
final int offset, final int count)
throws Exception {
... | java | public List<Message> requestMoreSearchResultsFrom(final int player, final CdjStatus.TrackSourceSlot slot,
final int sortOrder, final String text,
final int offset, final int count)
throws Exception {
... | [
"public",
"List",
"<",
"Message",
">",
"requestMoreSearchResultsFrom",
"(",
"final",
"int",
"player",
",",
"final",
"CdjStatus",
".",
"TrackSourceSlot",
"slot",
",",
"final",
"int",
"sortOrder",
",",
"final",
"String",
"text",
",",
"final",
"int",
"offset",
",... | Ask the specified player for more database records whose names contain {@code text}. This can be used after
calling {@link #requestSearchResultsFrom(int, CdjStatus.TrackSourceSlot, int, String, AtomicInteger)} to obtain
a partial result and the total count available, to gradually expand the search under direction from ... | [
"Ask",
"the",
"specified",
"player",
"for",
"more",
"database",
"records",
"whose",
"names",
"contain",
"{",
"@code",
"text",
"}",
".",
"This",
"can",
"be",
"used",
"after",
"calling",
"{",
"@link",
"#requestSearchResultsFrom",
"(",
"int",
"CdjStatus",
".",
... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java#L1748-L1760 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java | MolecularFormulaManipulator.getString | public static String getString(IMolecularFormula formula, String[] orderElements,
boolean setOne) {
"""
Returns the string representation of the molecular formula.
@param formula The IMolecularFormula Object
@param orderElements The order of Elements
@param setOne ... | java | public static String getString(IMolecularFormula formula, String[] orderElements,
boolean setOne) {
return getString(formula, orderElements, setOne, true);
} | [
"public",
"static",
"String",
"getString",
"(",
"IMolecularFormula",
"formula",
",",
"String",
"[",
"]",
"orderElements",
",",
"boolean",
"setOne",
")",
"{",
"return",
"getString",
"(",
"formula",
",",
"orderElements",
",",
"setOne",
",",
"true",
")",
";",
"... | Returns the string representation of the molecular formula.
@param formula The IMolecularFormula Object
@param orderElements The order of Elements
@param setOne True, when must be set the value 1 for elements with
one atom
@return A String containing the molecular formula
@see #getHTML(IMolecularFormula)
... | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"molecular",
"formula",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L242-L245 |
alipay/sofa-rpc | extension-impl/codec-sofa-hessian/src/main/java/com/alipay/sofa/rpc/codec/sofahessian/SofaHessianSerializer.java | SofaHessianSerializer.getSerializerFactory | protected SerializerFactory getSerializerFactory(boolean multipleClassLoader, boolean generic) {
"""
Gets serializer factory.
@param multipleClassLoader the multiple class loader
@param generic the generic
@return the serializer factory
"""
if (generic) {
return multipleCla... | java | protected SerializerFactory getSerializerFactory(boolean multipleClassLoader, boolean generic) {
if (generic) {
return multipleClassLoader ? new GenericMultipleClassLoaderSofaSerializerFactory() :
new GenericSingleClassLoaderSofaSerializerFactory();
} else {
retur... | [
"protected",
"SerializerFactory",
"getSerializerFactory",
"(",
"boolean",
"multipleClassLoader",
",",
"boolean",
"generic",
")",
"{",
"if",
"(",
"generic",
")",
"{",
"return",
"multipleClassLoader",
"?",
"new",
"GenericMultipleClassLoaderSofaSerializerFactory",
"(",
")",
... | Gets serializer factory.
@param multipleClassLoader the multiple class loader
@param generic the generic
@return the serializer factory | [
"Gets",
"serializer",
"factory",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/codec-sofa-hessian/src/main/java/com/alipay/sofa/rpc/codec/sofahessian/SofaHessianSerializer.java#L118-L126 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/spi/MediaHandlerConfig.java | MediaHandlerConfig.getDefaultImageQuality | public double getDefaultImageQuality(String mimeType) {
"""
Get the default quality for images in this app generated with the Layer API.
The meaning of the quality parameter for the different image formats is described in
{@link com.day.image.Layer#write(String, double, java.io.OutputStream)}.
@param mimeType M... | java | public double getDefaultImageQuality(String mimeType) {
if (StringUtils.isNotEmpty(mimeType)) {
String format = StringUtils.substringAfter(mimeType.toLowerCase(), "image/");
if (StringUtils.equals(format, "jpg") || StringUtils.equals(format, "jpeg")) {
return DEFAULT_JPEG_QUALITY;
}
... | [
"public",
"double",
"getDefaultImageQuality",
"(",
"String",
"mimeType",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"mimeType",
")",
")",
"{",
"String",
"format",
"=",
"StringUtils",
".",
"substringAfter",
"(",
"mimeType",
".",
"toLowerCase",
... | Get the default quality for images in this app generated with the Layer API.
The meaning of the quality parameter for the different image formats is described in
{@link com.day.image.Layer#write(String, double, java.io.OutputStream)}.
@param mimeType MIME-type of the output format
@return Quality factor | [
"Get",
"the",
"default",
"quality",
"for",
"images",
"in",
"this",
"app",
"generated",
"with",
"the",
"Layer",
"API",
".",
"The",
"meaning",
"of",
"the",
"quality",
"parameter",
"for",
"the",
"different",
"image",
"formats",
"is",
"described",
"in",
"{"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/spi/MediaHandlerConfig.java#L93-L105 |
alkacon/opencms-core | src/org/opencms/file/types/A_CmsResourceType.java | A_CmsResourceType.addCopyResource | public void addCopyResource(String source, String target, String type) throws CmsConfigurationException {
"""
Adds a new "copy resource" to this resource type,
allowed only during the configuration phase.<p>
The "copy resources" are copied to the specified location after
a new resource of this type is created... | java | public void addCopyResource(String source, String target, String type) throws CmsConfigurationException {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_ADD_COPY_RESOURCE_4,
new Object[] {this, source, targ... | [
"public",
"void",
"addCopyResource",
"(",
"String",
"source",
",",
"String",
"target",
",",
"String",
"type",
")",
"throws",
"CmsConfigurationException",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Messages",
... | Adds a new "copy resource" to this resource type,
allowed only during the configuration phase.<p>
The "copy resources" are copied to the specified location after
a new resource of this type is created. Usually this feature is used to
populate a newly created folder with some default resources.<p>
If target is <code>n... | [
"Adds",
"a",
"new",
"copy",
"resource",
"to",
"this",
"resource",
"type",
"allowed",
"only",
"during",
"the",
"configuration",
"phase",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/types/A_CmsResourceType.java#L202-L224 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/AbstractBuilder.java | AbstractBuilder.isSubTypeOf | @Pure
protected boolean isSubTypeOf(EObject context, JvmTypeReference subType, JvmTypeReference superType) {
"""
Replies if the first parameter is a subtype of the second parameter.
@param context the context.
@param subType the subtype to test.
@param superType the expected super type.
@return the type ref... | java | @Pure
protected boolean isSubTypeOf(EObject context, JvmTypeReference subType, JvmTypeReference superType) {
if (isTypeReference(superType) && isTypeReference(subType)) {
StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, context);
LightweightTypeReferenceFactory factory = new Lightwei... | [
"@",
"Pure",
"protected",
"boolean",
"isSubTypeOf",
"(",
"EObject",
"context",
",",
"JvmTypeReference",
"subType",
",",
"JvmTypeReference",
"superType",
")",
"{",
"if",
"(",
"isTypeReference",
"(",
"superType",
")",
"&&",
"isTypeReference",
"(",
"subType",
")",
... | Replies if the first parameter is a subtype of the second parameter.
@param context the context.
@param subType the subtype to test.
@param superType the expected super type.
@return the type reference. | [
"Replies",
"if",
"the",
"first",
"parameter",
"is",
"a",
"subtype",
"of",
"the",
"second",
"parameter",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/AbstractBuilder.java#L226-L235 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseDuration.java | BaseDuration.toPeriod | public Period toPeriod(PeriodType type, Chronology chrono) {
"""
Converts this duration to a Period instance using the specified period type
and chronology.
<p>
Only precise fields in the period type will be used.
Exactly which fields are precise depends on the chronology.
Only the time fields are precise for... | java | public Period toPeriod(PeriodType type, Chronology chrono) {
return new Period(getMillis(), type, chrono);
} | [
"public",
"Period",
"toPeriod",
"(",
"PeriodType",
"type",
",",
"Chronology",
"chrono",
")",
"{",
"return",
"new",
"Period",
"(",
"getMillis",
"(",
")",
",",
"type",
",",
"chrono",
")",
";",
"}"
] | Converts this duration to a Period instance using the specified period type
and chronology.
<p>
Only precise fields in the period type will be used.
Exactly which fields are precise depends on the chronology.
Only the time fields are precise for ISO chronology with a time zone.
However, ISO UTC also has precise days an... | [
"Converts",
"this",
"duration",
"to",
"a",
"Period",
"instance",
"using",
"the",
"specified",
"period",
"type",
"and",
"chronology",
".",
"<p",
">",
"Only",
"precise",
"fields",
"in",
"the",
"period",
"type",
"will",
"be",
"used",
".",
"Exactly",
"which",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseDuration.java#L184-L186 |
neilboyd/SendLog | sendlog-library/src/main/java/org/l6n/sendlog/library/SendLogActivityBase.java | SendLogActivityBase.getMessageText | protected String getMessageText(final File pZipFile, final PackageManager pPackageManager) {
"""
The text of the email. Override to use different text.
@param pZipFile the file containing the zipped log
@param pPackageManager the package manager
@return the message text
"""
String version = "";
... | java | protected String getMessageText(final File pZipFile, final PackageManager pPackageManager) {
String version = "";
try {
final PackageInfo pi = pPackageManager.getPackageInfo(getPackageName(), 0);
version = " " + pi.versionName;
} catch (final PackageManager.NameNotFoundEx... | [
"protected",
"String",
"getMessageText",
"(",
"final",
"File",
"pZipFile",
",",
"final",
"PackageManager",
"pPackageManager",
")",
"{",
"String",
"version",
"=",
"\"\"",
";",
"try",
"{",
"final",
"PackageInfo",
"pi",
"=",
"pPackageManager",
".",
"getPackageInfo",
... | The text of the email. Override to use different text.
@param pZipFile the file containing the zipped log
@param pPackageManager the package manager
@return the message text | [
"The",
"text",
"of",
"the",
"email",
".",
"Override",
"to",
"use",
"different",
"text",
"."
] | train | https://github.com/neilboyd/SendLog/blob/5be734165e48047c53c40149554e52eb88b9598c/sendlog-library/src/main/java/org/l6n/sendlog/library/SendLogActivityBase.java#L89-L100 |
VoltDB/voltdb | src/frontend/org/voltdb/StatsProcInputTable.java | StatsProcInputTable.calculateAverage | static long calculateAverage(long currAvg, long currInvoc, long rowAvg, long rowInvoc) {
"""
Given a running average and the running invocation total as well as a new
row's average and invocation total, return a new running average
"""
long currTtl = currAvg * currInvoc;
long rowTtl = rowAvg *... | java | static long calculateAverage(long currAvg, long currInvoc, long rowAvg, long rowInvoc)
{
long currTtl = currAvg * currInvoc;
long rowTtl = rowAvg * rowInvoc;
// If both are 0, then currTtl, rowTtl are also 0.
if ((currInvoc + rowInvoc) == 0L) {
return 0L;
} else ... | [
"static",
"long",
"calculateAverage",
"(",
"long",
"currAvg",
",",
"long",
"currInvoc",
",",
"long",
"rowAvg",
",",
"long",
"rowInvoc",
")",
"{",
"long",
"currTtl",
"=",
"currAvg",
"*",
"currInvoc",
";",
"long",
"rowTtl",
"=",
"rowAvg",
"*",
"rowInvoc",
";... | Given a running average and the running invocation total as well as a new
row's average and invocation total, return a new running average | [
"Given",
"a",
"running",
"average",
"and",
"the",
"running",
"invocation",
"total",
"as",
"well",
"as",
"a",
"new",
"row",
"s",
"average",
"and",
"invocation",
"total",
"return",
"a",
"new",
"running",
"average"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsProcInputTable.java#L97-L108 |
alkacon/opencms-core | src/org/opencms/search/documents/CmsDocumentXmlContent.java | CmsDocumentXmlContent.extractContent | public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
"""
Returns the raw text content of a given VFS resource of type <code>CmsResourceTypeXmlContent</code>.<p>
All XML nodes from the content for all locales will be stored separately ... | java | public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsException {
logContentExtraction(resource, index);
try {
CmsFile file = readFile(cms, resource);
A_CmsXmlDocument xmlContent = CmsXmlContentFactory.unmarshal(cm... | [
"public",
"I_CmsExtractionResult",
"extractContent",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"throws",
"CmsException",
"{",
"logContentExtraction",
"(",
"resource",
",",
"index",
")",
";",
"try",
"{",
"CmsFile"... | Returns the raw text content of a given VFS resource of type <code>CmsResourceTypeXmlContent</code>.<p>
All XML nodes from the content for all locales will be stored separately in the item map
which you can access using {@link CmsExtractionResult#getContentItems()}. The XML elements will be
accessible using their xpat... | [
"Returns",
"the",
"raw",
"text",
"content",
"of",
"a",
"given",
"VFS",
"resource",
"of",
"type",
"<code",
">",
"CmsResourceTypeXmlContent<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentXmlContent.java#L103-L135 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/JChord.java | JChord.createAnchorNote | protected JNote createAnchorNote(Note note, Point2D base, ScoreMetrics metrics) {
"""
The anchor of the chord is the one that present the rhytm (the highest one
in case of stem up, the lowest one in case of stem down)
"""
// JNote jNote = new JNote(note, base, metrics);
JNote jNote = new JChordNote(note,... | java | protected JNote createAnchorNote(Note note, Point2D base, ScoreMetrics metrics) {
// JNote jNote = new JNote(note, base, metrics);
JNote jNote = new JChordNote(note, getClef(), base, metrics);
//note.set
return jNote;
} | [
"protected",
"JNote",
"createAnchorNote",
"(",
"Note",
"note",
",",
"Point2D",
"base",
",",
"ScoreMetrics",
"metrics",
")",
"{",
"//\t\tJNote jNote = new JNote(note, base, metrics);\r",
"JNote",
"jNote",
"=",
"new",
"JChordNote",
"(",
"note",
",",
"getClef",
"(",
")... | The anchor of the chord is the one that present the rhytm (the highest one
in case of stem up, the lowest one in case of stem down) | [
"The",
"anchor",
"of",
"the",
"chord",
"is",
"the",
"one",
"that",
"present",
"the",
"rhytm",
"(",
"the",
"highest",
"one",
"in",
"case",
"of",
"stem",
"up",
"the",
"lowest",
"one",
"in",
"case",
"of",
"stem",
"down",
")"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JChord.java#L141-L146 |
bwkimmel/java-util | src/main/java/ca/eandb/util/io/StreamUtil.java | StreamUtil.writeStream | public static void writeStream(InputStream in, OutputStream out) throws IOException {
"""
Copies the contents of an <code>InputStream</code> to an
<code>OutputStream</code>.
@param in The <code>InputStream</code> to read from.
@param out The <code>OutputStream</code> to write to.
@throws IOException If unable ... | java | public static void writeStream(InputStream in, OutputStream out) throws IOException {
int c;
while ((c = in.read()) >= 0) {
out.write((byte) c);
}
} | [
"public",
"static",
"void",
"writeStream",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"int",
"c",
";",
"while",
"(",
"(",
"c",
"=",
"in",
".",
"read",
"(",
")",
")",
">=",
"0",
")",
"{",
"out",
".",
"wr... | Copies the contents of an <code>InputStream</code> to an
<code>OutputStream</code>.
@param in The <code>InputStream</code> to read from.
@param out The <code>OutputStream</code> to write to.
@throws IOException If unable to read from <code>in</code> or write to
<code>out</code>. | [
"Copies",
"the",
"contents",
"of",
"an",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"to",
"an",
"<code",
">",
"OutputStream<",
"/",
"code",
">",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/io/StreamUtil.java#L82-L87 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeCubicTo | public SVGPath relativeCubicTo(double c1x, double c1y, double c2x, double c2y, double x, double y) {
"""
Cubic Bezier line to the given relative coordinates.
@param c1x first control point x
@param c1y first control point y
@param c2x second control point x
@param c2y second control point y
@param x new coo... | java | public SVGPath relativeCubicTo(double c1x, double c1y, double c2x, double c2y, double x, double y) {
return append(PATH_CUBIC_TO_RELATIVE).append(c1x).append(c1y).append(c2x).append(c2y).append(x).append(y);
} | [
"public",
"SVGPath",
"relativeCubicTo",
"(",
"double",
"c1x",
",",
"double",
"c1y",
",",
"double",
"c2x",
",",
"double",
"c2y",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_CUBIC_TO_RELATIVE",
")",
".",
"append",
"(",
... | Cubic Bezier line to the given relative coordinates.
@param c1x first control point x
@param c1y first control point y
@param c2x second control point x
@param c2y second control point y
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Cubic",
"Bezier",
"line",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L384-L386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.