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 |
|---|---|---|---|---|---|---|---|---|---|---|
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java | ReflectionUtils.resolveType | private static Type resolveType(Class<?> rootClass, Type[] parameters, Class<?> targetClass) {
"""
Find the real generic parameters of the passed target class from the extending/implementing root class and create
a Type from it.
@param rootClass the root class from which to start searching
@param parameters t... | java | private static Type resolveType(Class<?> rootClass, Type[] parameters, Class<?> targetClass)
{
// Look at super interfaces
for (Type interfaceType : rootClass.getGenericInterfaces()) {
Type type = resolveType(interfaceType, rootClass, parameters, targetClass);
if (type != nul... | [
"private",
"static",
"Type",
"resolveType",
"(",
"Class",
"<",
"?",
">",
"rootClass",
",",
"Type",
"[",
"]",
"parameters",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"// Look at super interfaces",
"for",
"(",
"Type",
"interfaceType",
":",
"rootCla... | Find the real generic parameters of the passed target class from the extending/implementing root class and create
a Type from it.
@param rootClass the root class from which to start searching
@param parameters the parameters of the root class
@param targetClass the class from which to resolve the generic parameters
@r... | [
"Find",
"the",
"real",
"generic",
"parameters",
"of",
"the",
"passed",
"target",
"class",
"from",
"the",
"extending",
"/",
"implementing",
"root",
"class",
"and",
"create",
"a",
"Type",
"from",
"it",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-api/src/main/java/org/xwiki/component/util/ReflectionUtils.java#L425-L441 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java | Configuration.getResource | public Content getResource(String key, Object o0, Object o1, Object o2) {
"""
Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o1 string or content argument added to configuration text
@param o2 string or content argument added to configuration text
... | java | public Content getResource(String key, Object o0, Object o1, Object o2) {
Content c = newContent();
Pattern p = Pattern.compile("\\{([012])\\}");
String text = getText(key);
Matcher m = p.matcher(text);
int start = 0;
while (m.find(start)) {
c.addContent(text.... | [
"public",
"Content",
"getResource",
"(",
"String",
"key",
",",
"Object",
"o0",
",",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"Content",
"c",
"=",
"newContent",
"(",
")",
";",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"\"\\\\{([012])\\\\}... | Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o1 string or content argument added to configuration text
@param o2 string or content argument added to configuration text
@return a content tree for the text | [
"Get",
"the",
"configuration",
"string",
"as",
"a",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java#L801-L830 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/attributes/AttributesColumn.java | AttributesColumn.createColumn | public static AttributesColumn createColumn(int index, String name,
GeoPackageDataType type, boolean notNull, Object defaultValue) {
"""
Create a new column
@param index
index
@param name
name
@param type
data type
@param notNull
not null flag
@param defaultValue
default value
@return attributes co... | java | public static AttributesColumn createColumn(int index, String name,
GeoPackageDataType type, boolean notNull, Object defaultValue) {
return createColumn(index, name, type, null, notNull, defaultValue);
} | [
"public",
"static",
"AttributesColumn",
"createColumn",
"(",
"int",
"index",
",",
"String",
"name",
",",
"GeoPackageDataType",
"type",
",",
"boolean",
"notNull",
",",
"Object",
"defaultValue",
")",
"{",
"return",
"createColumn",
"(",
"index",
",",
"name",
",",
... | Create a new column
@param index
index
@param name
name
@param type
data type
@param notNull
not null flag
@param defaultValue
default value
@return attributes column | [
"Create",
"a",
"new",
"column"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/attributes/AttributesColumn.java#L43-L46 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performSPARQLQuery | public InputStream performSPARQLQuery(String queryString, SPARQLQueryBindingSet bindings, long start, long pageLength, Transaction tx, boolean includeInferred, String baseURI) throws JsonProcessingException {
"""
executes SPARQLQuery
@param queryString
@param bindings
@param start
@param pageLength
@param t... | java | public InputStream performSPARQLQuery(String queryString, SPARQLQueryBindingSet bindings, long start, long pageLength, Transaction tx, boolean includeInferred, String baseURI) throws JsonProcessingException {
return performSPARQLQuery(queryString, bindings, new InputStreamHandle(), start, pageLength, tx, includ... | [
"public",
"InputStream",
"performSPARQLQuery",
"(",
"String",
"queryString",
",",
"SPARQLQueryBindingSet",
"bindings",
",",
"long",
"start",
",",
"long",
"pageLength",
",",
"Transaction",
"tx",
",",
"boolean",
"includeInferred",
",",
"String",
"baseURI",
")",
"throw... | executes SPARQLQuery
@param queryString
@param bindings
@param start
@param pageLength
@param tx
@param includeInferred
@param baseURI
@return
@throws JsonProcessingException | [
"executes",
"SPARQLQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L135-L137 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java | SubnetsInner.beginCreateOrUpdateAsync | public Observable<SubnetInner> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) {
"""
Creates or updates a subnet in the specified virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName Th... | java | public Observable<SubnetInner> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1<ServiceResponse<Su... | [
"public",
"Observable",
"<",
"SubnetInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"String",
"subnetName",
",",
"SubnetInner",
"subnetParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResp... | Creates or updates a subnet in the specified virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param subnetName The name of the subnet.
@param subnetParameters Parameters supplied to the create or update subnet operation.
@throws Illeg... | [
"Creates",
"or",
"updates",
"a",
"subnet",
"in",
"the",
"specified",
"virtual",
"network",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java#L562-L569 |
btaz/data-util | src/main/java/com/btaz/util/unit/ResourceUtil.java | ResourceUtil.readFromInputStreamIntoString | public static String readFromInputStreamIntoString(InputStream inputStream) throws IOException {
"""
This method reads all data from an {@code InputStream} into a String object. This method will close the stream.
@param inputStream {@code InputStream} to read text from
@return <code>String</code> containing all ... | java | public static String readFromInputStreamIntoString(InputStream inputStream) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
StringBuilder text = new StringBuilder();
String line;
while( (line = reader.readLine()) != null) {
... | [
"public",
"static",
"String",
"readFromInputStreamIntoString",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"inputStream",
",",
"\"UTF-8\"",
")",
"... | This method reads all data from an {@code InputStream} into a String object. This method will close the stream.
@param inputStream {@code InputStream} to read text from
@return <code>String</code> containing all input stream data
@throws IOException IO exception | [
"This",
"method",
"reads",
"all",
"data",
"from",
"an",
"{"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/unit/ResourceUtil.java#L63-L74 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/Directories.java | Directories.getKSChildDirectories | public static List<File> getKSChildDirectories(String ksName) {
"""
Recursively finds all the sub directories in the KS directory.
"""
List<File> result = new ArrayList<>();
for (DataDirectory dataDirectory : dataDirectories)
{
File ksDir = new File(dataDirectory.location, k... | java | public static List<File> getKSChildDirectories(String ksName)
{
List<File> result = new ArrayList<>();
for (DataDirectory dataDirectory : dataDirectories)
{
File ksDir = new File(dataDirectory.location, ksName);
File[] cfDirs = ksDir.listFiles();
if (cfDir... | [
"public",
"static",
"List",
"<",
"File",
">",
"getKSChildDirectories",
"(",
"String",
"ksName",
")",
"{",
"List",
"<",
"File",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"DataDirectory",
"dataDirectory",
":",
"dataDirectories",
... | Recursively finds all the sub directories in the KS directory. | [
"Recursively",
"finds",
"all",
"the",
"sub",
"directories",
"in",
"the",
"KS",
"directory",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Directories.java#L665-L681 |
xebialabs/overcast | src/main/java/com/xebialabs/overcast/support/libvirt/jdom/FilesystemXml.java | FilesystemXml.getFilesystems | public static Map<String, Filesystem> getFilesystems(Document domainXml) {
"""
Get map of {@link Filesystem}s. The key in the map is the target inside the domain. This will only return
filesystems of type 'mount'.
"""
Map<String, Filesystem> ret = new HashMap<>();
XPathFactory xpf = XPathFacto... | java | public static Map<String, Filesystem> getFilesystems(Document domainXml) {
Map<String, Filesystem> ret = new HashMap<>();
XPathFactory xpf = XPathFactory.instance();
XPathExpression<Element> fsExpr = xpf.compile(XPATH_FILESYSTEM, Filters.element());
List<Element> filesystems = fsExpr.eva... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Filesystem",
">",
"getFilesystems",
"(",
"Document",
"domainXml",
")",
"{",
"Map",
"<",
"String",
",",
"Filesystem",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"XPathFactory",
"xpf",
"=",
"XPat... | Get map of {@link Filesystem}s. The key in the map is the target inside the domain. This will only return
filesystems of type 'mount'. | [
"Get",
"map",
"of",
"{"
] | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/jdom/FilesystemXml.java#L65-L79 |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java | TypeSignatureFactory.getTypeSignature | public static FullTypeSignature getTypeSignature(Class<?> clazz, Class<?>[] typeArgs) {
"""
get the TypeSignature corresponding to given class with given type
arguments
@param clazz
@param typeArgs
@return
"""
ClassTypeSignature rawClassTypeSignature = (ClassTypeSignature) javaTypeToTypeSignature
.... | java | public static FullTypeSignature getTypeSignature(Class<?> clazz, Class<?>[] typeArgs) {
ClassTypeSignature rawClassTypeSignature = (ClassTypeSignature) javaTypeToTypeSignature
.getTypeSignature(clazz);
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[typeArgs.length];
for (int i = 0; i < typeArgs.l... | [
"public",
"static",
"FullTypeSignature",
"getTypeSignature",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"typeArgs",
")",
"{",
"ClassTypeSignature",
"rawClassTypeSignature",
"=",
"(",
"ClassTypeSignature",
")",
"javaTypeToTypeSigna... | get the TypeSignature corresponding to given class with given type
arguments
@param clazz
@param typeArgs
@return | [
"get",
"the",
"TypeSignature",
"corresponding",
"to",
"given",
"class",
"with",
"given",
"type",
"arguments"
] | train | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/TypeSignatureFactory.java#L112-L127 |
b3log/latke | latke-core/src/main/java/org/json/JSONArray.java | JSONArray.optString | public String optString(int index, String defaultValue) {
"""
Get the optional string associated with an index. The defaultValue is
returned if the key is not found.
@param index
The index must be between 0 and length() - 1.
@param defaultValue
The default value.
@return A String value.
"""
Obj... | java | public String optString(int index, String defaultValue) {
Object object = this.opt(index);
return JSONObject.NULL.equals(object) ? defaultValue : object
.toString();
} | [
"public",
"String",
"optString",
"(",
"int",
"index",
",",
"String",
"defaultValue",
")",
"{",
"Object",
"object",
"=",
"this",
".",
"opt",
"(",
"index",
")",
";",
"return",
"JSONObject",
".",
"NULL",
".",
"equals",
"(",
"object",
")",
"?",
"defaultValue... | Get the optional string associated with an index. The defaultValue is
returned if the key is not found.
@param index
The index must be between 0 and length() - 1.
@param defaultValue
The default value.
@return A String value. | [
"Get",
"the",
"optional",
"string",
"associated",
"with",
"an",
"index",
".",
"The",
"defaultValue",
"is",
"returned",
"if",
"the",
"key",
"is",
"not",
"found",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L860-L864 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java | Evidence.compareTo | @SuppressWarnings("deprecation")
@Override
public int compareTo(Evidence o) {
"""
Implementation of the comparable interface.
@param o the evidence being compared
@return an integer indicating the ordering of the two objects
"""
if (o == null) {
throw new IllegalArgumentExceptio... | java | @SuppressWarnings("deprecation")
@Override
public int compareTo(Evidence o) {
if (o == null) {
throw new IllegalArgumentException("Unable to compare null evidence");
}
if (StringUtils.equalsIgnoreCase(source, o.source)) {
if (StringUtils.equalsIgnoreCase(name, o.n... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"Evidence",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unable to compare null evidence\"",
"... | Implementation of the comparable interface.
@param o the evidence being compared
@return an integer indicating the ordering of the two objects | [
"Implementation",
"of",
"the",
"comparable",
"interface",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java#L207-L232 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java | ReferrerURLCookieHandler.invalidateReferrerURLCookie | public void invalidateReferrerURLCookie(HttpServletRequest req, HttpServletResponse res, String cookieName) {
"""
Invalidate (clear) the referrer URL cookie in the HttpServletResponse.
Setting age to 0 invalidates it.
@param res
"""
invalidateCookie(req, res, cookieName, true);
} | java | public void invalidateReferrerURLCookie(HttpServletRequest req, HttpServletResponse res, String cookieName) {
invalidateCookie(req, res, cookieName, true);
} | [
"public",
"void",
"invalidateReferrerURLCookie",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"String",
"cookieName",
")",
"{",
"invalidateCookie",
"(",
"req",
",",
"res",
",",
"cookieName",
",",
"true",
")",
";",
"}"
] | Invalidate (clear) the referrer URL cookie in the HttpServletResponse.
Setting age to 0 invalidates it.
@param res | [
"Invalidate",
"(",
"clear",
")",
"the",
"referrer",
"URL",
"cookie",
"in",
"the",
"HttpServletResponse",
".",
"Setting",
"age",
"to",
"0",
"invalidates",
"it",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java#L120-L122 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java | A_CmsSelectBox.setFormValue | public void setFormValue(Object value, boolean fireEvents) {
"""
Sets the form value of this select box.<p>
@param value the new value
@param fireEvents true if change events should be fired
"""
if (value == null) {
value = "";
}
if (!"".equals(value) && !m_selectCells.... | java | public void setFormValue(Object value, boolean fireEvents) {
if (value == null) {
value = "";
}
if (!"".equals(value) && !m_selectCells.containsKey(value)) {
OPTION option = createUnknownOption((String)value);
if (option != null) {
addOption(o... | [
"public",
"void",
"setFormValue",
"(",
"Object",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"\"\"",
";",
"}",
"if",
"(",
"!",
"\"\"",
".",
"equals",
"(",
"value",
")",
"&&",
"!",
"m_se... | Sets the form value of this select box.<p>
@param value the new value
@param fireEvents true if change events should be fired | [
"Sets",
"the",
"form",
"value",
"of",
"this",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java#L431-L446 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_config_update_POST | public OvhConfiguration serviceName_config_update_POST(String serviceName, OvhSafeKeyValue<String>[] parameters) throws IOException {
"""
Update the configuration
REST: POST /hosting/privateDatabase/{serviceName}/config/update
@param parameters [required] Array of instance configuration parameters
@param serv... | java | public OvhConfiguration serviceName_config_update_POST(String serviceName, OvhSafeKeyValue<String>[] parameters) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/config/update";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addB... | [
"public",
"OvhConfiguration",
"serviceName_config_update_POST",
"(",
"String",
"serviceName",
",",
"OvhSafeKeyValue",
"<",
"String",
">",
"[",
"]",
"parameters",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{serviceName}/config/upda... | Update the configuration
REST: POST /hosting/privateDatabase/{serviceName}/config/update
@param parameters [required] Array of instance configuration parameters
@param serviceName [required] The internal name of your private database | [
"Update",
"the",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L716-L723 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java | ArchetypeBuilder.generateArchetypesFromGitRepoList | public void generateArchetypesFromGitRepoList(File file, File outputDir, List<String> dirs) throws IOException {
"""
Iterates through all projects in the given properties file adn generate an archetype for it
"""
File cloneParentDir = new File(outputDir, "../git-clones");
if (cloneParentDir.exi... | java | public void generateArchetypesFromGitRepoList(File file, File outputDir, List<String> dirs) throws IOException {
File cloneParentDir = new File(outputDir, "../git-clones");
if (cloneParentDir.exists()) {
Files.recursiveDelete(cloneParentDir);
}
Properties properties = new Pr... | [
"public",
"void",
"generateArchetypesFromGitRepoList",
"(",
"File",
"file",
",",
"File",
"outputDir",
",",
"List",
"<",
"String",
">",
"dirs",
")",
"throws",
"IOException",
"{",
"File",
"cloneParentDir",
"=",
"new",
"File",
"(",
"outputDir",
",",
"\"../git-clone... | Iterates through all projects in the given properties file adn generate an archetype for it | [
"Iterates",
"through",
"all",
"projects",
"in",
"the",
"given",
"properties",
"file",
"adn",
"generate",
"an",
"archetype",
"for",
"it"
] | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L110-L127 |
jingwei/krati | krati-main/src/main/java/krati/core/array/basic/AbstractRecoverableArray.java | AbstractRecoverableArray.openArrayFile | protected final ArrayFile openArrayFile(File file, int initialLength, int elementSize) throws IOException {
"""
Opens the {@link ArrayFile} with the specified initial length and the element size.
@param file - the file backing up the array.
@param initialLength - the initial length of the array.
@par... | java | protected final ArrayFile openArrayFile(File file, int initialLength, int elementSize) throws IOException {
boolean isNew = true;
if (file.exists()) {
isNew = false;
}
ArrayFile arrayFile = new ArrayFile(file, initialLength, elementSize);
if (isNew) {
... | [
"protected",
"final",
"ArrayFile",
"openArrayFile",
"(",
"File",
"file",
",",
"int",
"initialLength",
",",
"int",
"elementSize",
")",
"throws",
"IOException",
"{",
"boolean",
"isNew",
"=",
"true",
";",
"if",
"(",
"file",
".",
"exists",
"(",
")",
")",
"{",
... | Opens the {@link ArrayFile} with the specified initial length and the element size.
@param file - the file backing up the array.
@param initialLength - the initial length of the array.
@param elementSize - the number of bytes per element.
@return the instance of {@link ArrayFile}.
@throws IOException if thi... | [
"Opens",
"the",
"{",
"@link",
"ArrayFile",
"}",
"with",
"the",
"specified",
"initial",
"length",
"and",
"the",
"element",
"size",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/basic/AbstractRecoverableArray.java#L134-L146 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByCommons | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, String logName) {
"""
Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param logName commons logger name
@return build... | java | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, String logName) {
return logSlowQueryByCommons(thresholdTime, timeUnit, null, logName);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByCommons",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
",",
"String",
"logName",
")",
"{",
"return",
"logSlowQueryByCommons",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"logName",
")",
";... | Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param logName commons logger name
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"CommonsSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L259-L261 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newLabel | public static <T> Label newLabel(final String id, final IModel<T> model) {
"""
Factory method for create a new {@link Label} with a {@link IModel}.
@param <T>
the generic type of the model
@param id
the id
@param model
the {@link IModel} for the label.
@return the new {@link Label}
"""
final Label l... | java | public static <T> Label newLabel(final String id, final IModel<T> model)
{
final Label label = new Label(id, model);
label.setOutputMarkupId(true);
return label;
} | [
"public",
"static",
"<",
"T",
">",
"Label",
"newLabel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"Label",
"label",
"=",
"new",
"Label",
"(",
"id",
",",
"model",
")",
";",
"label",
".",
"setOut... | Factory method for create a new {@link Label} with a {@link IModel}.
@param <T>
the generic type of the model
@param id
the id
@param model
the {@link IModel} for the label.
@return the new {@link Label} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Label",
"}",
"with",
"a",
"{",
"@link",
"IModel",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L408-L413 |
Waikato/moa | moa/src/main/java/com/github/javacliparser/AbstractClassOption.java | AbstractClassOption.stripPackagePrefix | public static String stripPackagePrefix(String className, Class<?> expectedType) {
"""
Gets the class name without its package name prefix.
@param className the name of the class
@param expectedType the type of the class
@return the class name without its package name prefix
"""
if (className.star... | java | public static String stripPackagePrefix(String className, Class<?> expectedType) {
if (className.startsWith(expectedType.getPackage().getName())) {
return className.substring(expectedType.getPackage().getName().length() + 1);
}
return className;
} | [
"public",
"static",
"String",
"stripPackagePrefix",
"(",
"String",
"className",
",",
"Class",
"<",
"?",
">",
"expectedType",
")",
"{",
"if",
"(",
"className",
".",
"startsWith",
"(",
"expectedType",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
")... | Gets the class name without its package name prefix.
@param className the name of the class
@param expectedType the type of the class
@return the class name without its package name prefix | [
"Gets",
"the",
"class",
"name",
"without",
"its",
"package",
"name",
"prefix",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/github/javacliparser/AbstractClassOption.java#L221-L226 |
lucee/Lucee | core/src/main/java/lucee/commons/io/IOUtil.java | IOUtil.getMimeType | public static String getMimeType(byte[] barr, String defaultValue) {
"""
return the mime type of a file, dont check extension
@param barr
@return mime type of the file
@throws IOException
"""
PrintStream out = System.out;
try {
Tika tika = new Tika();
return tika.detect(barr);
}
catch (Throw... | java | public static String getMimeType(byte[] barr, String defaultValue) {
PrintStream out = System.out;
try {
Tika tika = new Tika();
return tika.detect(barr);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
return defaultValue;
}
} | [
"public",
"static",
"String",
"getMimeType",
"(",
"byte",
"[",
"]",
"barr",
",",
"String",
"defaultValue",
")",
"{",
"PrintStream",
"out",
"=",
"System",
".",
"out",
";",
"try",
"{",
"Tika",
"tika",
"=",
"new",
"Tika",
"(",
")",
";",
"return",
"tika",
... | return the mime type of a file, dont check extension
@param barr
@return mime type of the file
@throws IOException | [
"return",
"the",
"mime",
"type",
"of",
"a",
"file",
"dont",
"check",
"extension"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L1056-L1066 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.createDocument | public static CmsXmlContainerPage createDocument(CmsObject cms, Locale locale, String modelUri)
throws CmsException {
"""
Create a new instance of an container page based on the given default content,
that will have all language nodes of the default content and ensures the presence of the given locale.<p>
... | java | public static CmsXmlContainerPage createDocument(CmsObject cms, Locale locale, String modelUri)
throws CmsException {
// create the XML content
CmsXmlContainerPage content = new CmsXmlContainerPage(cms, locale, modelUri);
// call prepare for use content handler and return the result
... | [
"public",
"static",
"CmsXmlContainerPage",
"createDocument",
"(",
"CmsObject",
"cms",
",",
"Locale",
"locale",
",",
"String",
"modelUri",
")",
"throws",
"CmsException",
"{",
"// create the XML content",
"CmsXmlContainerPage",
"content",
"=",
"new",
"CmsXmlContainerPage",
... | Create a new instance of an container page based on the given default content,
that will have all language nodes of the default content and ensures the presence of the given locale.<p>
The given encoding is used when marshalling the XML again later.<p>
@param cms the current users OpenCms content
@param locale the lo... | [
"Create",
"a",
"new",
"instance",
"of",
"an",
"container",
"page",
"based",
"on",
"the",
"given",
"default",
"content",
"that",
"will",
"have",
"all",
"language",
"nodes",
"of",
"the",
"default",
"content",
"and",
"ensures",
"the",
"presence",
"of",
"the",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L84-L91 |
robocup-atan/atan | src/main/java/com/github/robocup_atan/atan/model/CommandFactory.java | CommandFactory.addPlayerInitCommand | public void addPlayerInitCommand(String teamName, boolean isGoalie) {
"""
This is used to initialise a player.
@param teamName The team the player belongs to.
@param isGoalie If the player is a goalie. Note: Only one goalie per team.
"""
StringBuilder buf = new StringBuilder();
buf.append("... | java | public void addPlayerInitCommand(String teamName, boolean isGoalie) {
StringBuilder buf = new StringBuilder();
buf.append("(init ");
buf.append(teamName);
buf.append(" (version ");
if (isGoalie) {
buf.append(serverVersion);
buf.append(") (goalie))");
... | [
"public",
"void",
"addPlayerInitCommand",
"(",
"String",
"teamName",
",",
"boolean",
"isGoalie",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"\"(init \"",
")",
";",
"buf",
".",
"append",
"(",
"te... | This is used to initialise a player.
@param teamName The team the player belongs to.
@param isGoalie If the player is a goalie. Note: Only one goalie per team. | [
"This",
"is",
"used",
"to",
"initialise",
"a",
"player",
"."
] | train | https://github.com/robocup-atan/atan/blob/52237b468b09ba5b7c52d290984dbe0326c96df7/src/main/java/com/github/robocup_atan/atan/model/CommandFactory.java#L61-L74 |
Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createHDFSRDD | public RDD<Cells> createHDFSRDD(ExtractorConfig<Cells> config) {
"""
Returns a Cells RDD from HDFS.
@param config HDFS ExtractorConfig.
@return Cells RDD.
"""
Serializable host = config.getValues().get(ExtractorConstants.HOST);
Serializable port = config.getValues().get(ExtractorConstants.PO... | java | public RDD<Cells> createHDFSRDD(ExtractorConfig<Cells> config) {
Serializable host = config.getValues().get(ExtractorConstants.HOST);
Serializable port = config.getValues().get(ExtractorConstants.PORT);
Serializable path = config.getValues().get(ExtractorConstants.FS_FILE_PATH);
final ... | [
"public",
"RDD",
"<",
"Cells",
">",
"createHDFSRDD",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"{",
"Serializable",
"host",
"=",
"config",
".",
"getValues",
"(",
")",
".",
"get",
"(",
"ExtractorConstants",
".",
"HOST",
")",
";",
"Serializab... | Returns a Cells RDD from HDFS.
@param config HDFS ExtractorConfig.
@return Cells RDD. | [
"Returns",
"a",
"Cells",
"RDD",
"from",
"HDFS",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L277-L291 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/session/AbstractProxySessionManager.java | AbstractProxySessionManager.releaseSession | public final void releaseSession(RaftGroupId groupId, long id, int count) {
"""
Decrements acquire count of the session.
Returns silently if no session exists for the given id.
"""
SessionState session = sessions.get(groupId);
if (session != null && session.id == id) {
session.rele... | java | public final void releaseSession(RaftGroupId groupId, long id, int count) {
SessionState session = sessions.get(groupId);
if (session != null && session.id == id) {
session.release(count);
}
} | [
"public",
"final",
"void",
"releaseSession",
"(",
"RaftGroupId",
"groupId",
",",
"long",
"id",
",",
"int",
"count",
")",
"{",
"SessionState",
"session",
"=",
"sessions",
".",
"get",
"(",
"groupId",
")",
";",
"if",
"(",
"session",
"!=",
"null",
"&&",
"ses... | Decrements acquire count of the session.
Returns silently if no session exists for the given id. | [
"Decrements",
"acquire",
"count",
"of",
"the",
"session",
".",
"Returns",
"silently",
"if",
"no",
"session",
"exists",
"for",
"the",
"given",
"id",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/session/AbstractProxySessionManager.java#L145-L150 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTransitionExtractor.java | MapTransitionExtractor.getNeighborGroup | private String getNeighborGroup(Tile tile, Tile neighbor) {
"""
Get the neighbor group depending if it is a transition tile.
@param tile The current tile.
@param neighbor The neighbor tile.
@return The neighbor group, <code>null</code> if none.
"""
final String neighborGroup;
if (isTrans... | java | private String getNeighborGroup(Tile tile, Tile neighbor)
{
final String neighborGroup;
if (isTransition(neighbor))
{
if (isTransition(tile))
{
neighborGroup = getOtherGroup(tile, neighbor);
}
else
{
... | [
"private",
"String",
"getNeighborGroup",
"(",
"Tile",
"tile",
",",
"Tile",
"neighbor",
")",
"{",
"final",
"String",
"neighborGroup",
";",
"if",
"(",
"isTransition",
"(",
"neighbor",
")",
")",
"{",
"if",
"(",
"isTransition",
"(",
"tile",
")",
")",
"{",
"n... | Get the neighbor group depending if it is a transition tile.
@param tile The current tile.
@param neighbor The neighbor tile.
@return The neighbor group, <code>null</code> if none. | [
"Get",
"the",
"neighbor",
"group",
"depending",
"if",
"it",
"is",
"a",
"transition",
"tile",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTransitionExtractor.java#L184-L203 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java | PJsonObject.optJSONArray | public final PJsonArray optJSONArray(final String key, final PJsonArray defaultValue) {
"""
Get a property as a json array or default.
@param key the property name
@param defaultValue default
"""
PJsonArray result = optJSONArray(key);
return result != null ? result : defaultValue;
} | java | public final PJsonArray optJSONArray(final String key, final PJsonArray defaultValue) {
PJsonArray result = optJSONArray(key);
return result != null ? result : defaultValue;
} | [
"public",
"final",
"PJsonArray",
"optJSONArray",
"(",
"final",
"String",
"key",
",",
"final",
"PJsonArray",
"defaultValue",
")",
"{",
"PJsonArray",
"result",
"=",
"optJSONArray",
"(",
"key",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"result",
":",
"de... | Get a property as a json array or default.
@param key the property name
@param defaultValue default | [
"Get",
"a",
"property",
"as",
"a",
"json",
"array",
"or",
"default",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java#L195-L198 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.newLdaptiveSearchExecutor | public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery,
final List<String> params,
final List<String> returnAttributes) {
"""
New ldaptive search execu... | java | public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery,
final List<String> params,
final List<String> returnAttributes) {
return newLdaptiveSearchEx... | [
"public",
"static",
"SearchExecutor",
"newLdaptiveSearchExecutor",
"(",
"final",
"String",
"baseDn",
",",
"final",
"String",
"filterQuery",
",",
"final",
"List",
"<",
"String",
">",
"params",
",",
"final",
"List",
"<",
"String",
">",
"returnAttributes",
")",
"{"... | New ldaptive search executor search executor.
@param baseDn the base dn
@param filterQuery the filter query
@param params the params
@param returnAttributes the return attributes
@return the search executor | [
"New",
"ldaptive",
"search",
"executor",
"search",
"executor",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L589-L593 |
junit-team/junit4 | src/main/java/org/junit/runner/FilterFactories.java | FilterFactories.createFilterFromFilterSpec | public static Filter createFilterFromFilterSpec(Request request, String filterSpec)
throws FilterFactory.FilterNotCreatedException {
"""
Creates a {@link Filter}.
A filter specification is of the form "package.of.FilterFactory=args-to-filter-factory" or
"package.of.FilterFactory".
@param reques... | java | public static Filter createFilterFromFilterSpec(Request request, String filterSpec)
throws FilterFactory.FilterNotCreatedException {
Description topLevelDescription = request.getRunner().getDescription();
String[] tuple;
if (filterSpec.contains("=")) {
tuple = filt... | [
"public",
"static",
"Filter",
"createFilterFromFilterSpec",
"(",
"Request",
"request",
",",
"String",
"filterSpec",
")",
"throws",
"FilterFactory",
".",
"FilterNotCreatedException",
"{",
"Description",
"topLevelDescription",
"=",
"request",
".",
"getRunner",
"(",
")",
... | Creates a {@link Filter}.
A filter specification is of the form "package.of.FilterFactory=args-to-filter-factory" or
"package.of.FilterFactory".
@param request the request that will be filtered
@param filterSpec the filter specification
@throws org.junit.runner.FilterFactory.FilterNotCreatedException | [
"Creates",
"a",
"{",
"@link",
"Filter",
"}",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/FilterFactories.java#L21-L33 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/CartUrl.java | CartUrl.getUserCartSummaryUrl | public static MozuUrl getUserCartSummaryUrl(String responseFields, String userId) {
"""
Get Resource Url for GetUserCartSummary
@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 da... | java | public static MozuUrl getUserCartSummaryUrl(String responseFields, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/user/{userId}/summary?responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("userId", userId);
return n... | [
"public",
"static",
"MozuUrl",
"getUserCartSummaryUrl",
"(",
"String",
"responseFields",
",",
"String",
"userId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/user/{userId}/summary?responseFields={responseFields}\"",
")",
";",... | Get Resource Url for GetUserCartSummary
@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 to update data using this parameter may cause data loss.
@param userId Unique i... | [
"Get",
"Resource",
"Url",
"for",
"GetUserCartSummary"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/CartUrl.java#L60-L66 |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/builder/AbstractFFmpegStreamBuilder.java | AbstractFFmpegStreamBuilder.addMetaTag | public T addMetaTag(String key, String value) {
"""
Add metadata on output streams. Which keys are possible depends on the used codec.
@param key Metadata key, e.g. "comment"
@param value Value to set for key
@return this
"""
checkValidKey(key);
checkNotEmpty(value, "value must not be empty");
... | java | public T addMetaTag(String key, String value) {
checkValidKey(key);
checkNotEmpty(value, "value must not be empty");
meta_tags.add("-metadata");
meta_tags.add(key + "=" + value);
return getThis();
} | [
"public",
"T",
"addMetaTag",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkValidKey",
"(",
"key",
")",
";",
"checkNotEmpty",
"(",
"value",
",",
"\"value must not be empty\"",
")",
";",
"meta_tags",
".",
"add",
"(",
"\"-metadata\"",
")",
";",
... | Add metadata on output streams. Which keys are possible depends on the used codec.
@param key Metadata key, e.g. "comment"
@param value Value to set for key
@return this | [
"Add",
"metadata",
"on",
"output",
"streams",
".",
"Which",
"keys",
"are",
"possible",
"depends",
"on",
"the",
"used",
"codec",
"."
] | train | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/builder/AbstractFFmpegStreamBuilder.java#L329-L335 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createIdentity | public static Identity createIdentity(IdentityType type, String name, String admDom,
String otherTypeDef) {
"""
Create an identity identifier.
<br/><br/>
<b>Note: otherTypeDef != null should imply type {@link IdentityType#other}.</b>
@param type the type of the identity identifier
@param name the name of ... | java | public static Identity createIdentity(IdentityType type, String name, String admDom,
String otherTypeDef) {
return new Identity(type, name, admDom, otherTypeDef);
} | [
"public",
"static",
"Identity",
"createIdentity",
"(",
"IdentityType",
"type",
",",
"String",
"name",
",",
"String",
"admDom",
",",
"String",
"otherTypeDef",
")",
"{",
"return",
"new",
"Identity",
"(",
"type",
",",
"name",
",",
"admDom",
",",
"otherTypeDef",
... | Create an identity identifier.
<br/><br/>
<b>Note: otherTypeDef != null should imply type {@link IdentityType#other}.</b>
@param type the type of the identity identifier
@param name the name of the identity identifier
@param admDom the administrative-domain of the identity identifier
@param otherTypeDef vendor specifi... | [
"Create",
"an",
"identity",
"identifier",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"<b",
">",
"Note",
":",
"otherTypeDef",
"!",
"=",
"null",
"should",
"imply",
"type",
"{",
"@link",
"IdentityType#other",
"}",
".",
"<",
"/",
"b",
">"
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L541-L544 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.println | public static void println(PrintWriter self, Object value) {
"""
Print a value formatted Groovy style (followed by a newline) to the print writer.
@param self a PrintWriter
@param value the value to print
@since 1.0
"""
self.println(InvokerHelper.toString(value));
} | java | public static void println(PrintWriter self, Object value) {
self.println(InvokerHelper.toString(value));
} | [
"public",
"static",
"void",
"println",
"(",
"PrintWriter",
"self",
",",
"Object",
"value",
")",
"{",
"self",
".",
"println",
"(",
"InvokerHelper",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Print a value formatted Groovy style (followed by a newline) to the print writer.
@param self a PrintWriter
@param value the value to print
@since 1.0 | [
"Print",
"a",
"value",
"formatted",
"Groovy",
"style",
"(",
"followed",
"by",
"a",
"newline",
")",
"to",
"the",
"print",
"writer",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L814-L816 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/RationalQuadraticKernel.java | RationalQuadraticKernel.setC | public void setC(double c) {
"""
Sets the positive additive coefficient
@param c the positive additive coefficient
"""
if(c <= 0 || Double.isNaN(c) || Double.isInfinite(c))
throw new IllegalArgumentException("coefficient must be in (0, Inf), not " + c);
this.c = c;
} | java | public void setC(double c)
{
if(c <= 0 || Double.isNaN(c) || Double.isInfinite(c))
throw new IllegalArgumentException("coefficient must be in (0, Inf), not " + c);
this.c = c;
} | [
"public",
"void",
"setC",
"(",
"double",
"c",
")",
"{",
"if",
"(",
"c",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"c",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"c",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"coefficient must ... | Sets the positive additive coefficient
@param c the positive additive coefficient | [
"Sets",
"the",
"positive",
"additive",
"coefficient"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/RationalQuadraticKernel.java#L36-L41 |
dyu/protostuff-1.0.x | protostuff-core/src/main/java/com/dyuproject/protostuff/ProtostuffIOUtil.java | ProtostuffIOUtil.mergeFrom | public static <T> void mergeFrom(byte[] data, T message, Schema<T> schema) {
"""
Merges the {@code message} with the byte array using the given {@code schema}.
"""
IOUtil.mergeFrom(data, 0, data.length, message, schema, true);
} | java | public static <T> void mergeFrom(byte[] data, T message, Schema<T> schema)
{
IOUtil.mergeFrom(data, 0, data.length, message, schema, true);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"mergeFrom",
"(",
"byte",
"[",
"]",
"data",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"{",
"IOUtil",
".",
"mergeFrom",
"(",
"data",
",",
"0",
",",
"data",
".",
"length",
",",
"mes... | Merges the {@code message} with the byte array using the given {@code schema}. | [
"Merges",
"the",
"{"
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-core/src/main/java/com/dyuproject/protostuff/ProtostuffIOUtil.java#L94-L97 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.reimageAsync | public Observable<Void> reimageAsync(String poolId, String nodeId) {
"""
Reinstalls the operating system on the specified compute node.
You can reinstall the operating system on a node only if it is in an idle or running state. This API can be invoked only on pools created with the cloud service configuration pro... | java | public Observable<Void> reimageAsync(String poolId, String nodeId) {
return reimageWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeReimageHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, ComputeNodeReimageH... | [
"public",
"Observable",
"<",
"Void",
">",
"reimageAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"reimageWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeader... | Reinstalls the operating system on the specified compute node.
You can reinstall the operating system on a node only if it is in an idle or running state. This API can be invoked only on pools created with the cloud service configuration property.
@param poolId The ID of the pool that contains the compute node.
@param... | [
"Reinstalls",
"the",
"operating",
"system",
"on",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"reinstall",
"the",
"operating",
"system",
"on",
"a",
"node",
"only",
"if",
"it",
"is",
"in",
"an",
"idle",
"or",
"running",
"state",
".",
"This",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1310-L1317 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Chebyshev | public static double Chebyshev(double[] p, double[] q) {
"""
Gets the Chebyshev distance between two points.
@param p A point in space.
@param q A point in space.
@return The Chebyshev distance between x and y.
"""
double max = Math.abs(p[0] - q[0]);
for (int i = 1; i < p.length; i++) {
... | java | public static double Chebyshev(double[] p, double[] q) {
double max = Math.abs(p[0] - q[0]);
for (int i = 1; i < p.length; i++) {
double abs = Math.abs(p[i] - q[i]);
if (abs > max) max = abs;
}
return max;
} | [
"public",
"static",
"double",
"Chebyshev",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"max",
"=",
"Math",
".",
"abs",
"(",
"p",
"[",
"0",
"]",
"-",
"q",
"[",
"0",
"]",
")",
";",
"for",
"(",
"int",
"i",
"... | Gets the Chebyshev distance between two points.
@param p A point in space.
@param q A point in space.
@return The Chebyshev distance between x and y. | [
"Gets",
"the",
"Chebyshev",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L178-L187 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRandom.java | SDRandom.normalTruncated | public SDVariable normalTruncated(String name, double mean, double stddev, long... shape) {
"""
Generate a new random SDVariable, where values are randomly sampled according to a Gaussian (normal) distribution,
N(mean, stdev). However, any values more than 1 standard deviation from the mean are dropped and re-sam... | java | public SDVariable normalTruncated(String name, double mean, double stddev, long... shape) {
SDVariable ret = f().randomNormalTruncated(mean, stddev, shape);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"normalTruncated",
"(",
"String",
"name",
",",
"double",
"mean",
",",
"double",
"stddev",
",",
"long",
"...",
"shape",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"randomNormalTruncated",
"(",
"mean",
",",
"stddev",
",",... | Generate a new random SDVariable, where values are randomly sampled according to a Gaussian (normal) distribution,
N(mean, stdev). However, any values more than 1 standard deviation from the mean are dropped and re-sampled<br>
@param name Name of the new SDVariable
@param mean Mean value for the random array
@para... | [
"Generate",
"a",
"new",
"random",
"SDVariable",
"where",
"values",
"are",
"randomly",
"sampled",
"according",
"to",
"a",
"Gaussian",
"(",
"normal",
")",
"distribution",
"N",
"(",
"mean",
"stdev",
")",
".",
"However",
"any",
"values",
"more",
"than",
"1",
"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRandom.java#L212-L215 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.getModulePromotionReport | public PromotionEvaluationReport getModulePromotionReport(final String name, final String version) throws GrapesCommunicationException {
"""
Check if a module can be promoted in the Grapes server
@param name
@param version
@return a boolean which is true only if the module can be promoted
@throws GrapesCommu... | java | public PromotionEvaluationReport getModulePromotionReport(final String name, final String version) throws GrapesCommunicationException {
return getModulePromotionReportRaw(name, version, false, PromotionEvaluationReport.class);
} | [
"public",
"PromotionEvaluationReport",
"getModulePromotionReport",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"version",
")",
"throws",
"GrapesCommunicationException",
"{",
"return",
"getModulePromotionReportRaw",
"(",
"name",
",",
"version",
",",
"false",
... | Check if a module can be promoted in the Grapes server
@param name
@param version
@return a boolean which is true only if the module can be promoted
@throws GrapesCommunicationException | [
"Check",
"if",
"a",
"module",
"can",
"be",
"promoted",
"in",
"the",
"Grapes",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L405-L407 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newSpecializationOf | @Override
public SpecializationOf newSpecializationOf(QualifiedName specific, QualifiedName general) {
"""
A factory method to create an instance of a specialization {@link SpecializationOf}
@param specific an identifier ({@link QualifiedName}) for the specific {@link Entity}
@param general an identifier ({... | java | @Override
public SpecializationOf newSpecializationOf(QualifiedName specific, QualifiedName general) {
SpecializationOf res = of.createSpecializationOf();
res.setSpecificEntity(specific);
res.setGeneralEntity(general);
return res;
} | [
"@",
"Override",
"public",
"SpecializationOf",
"newSpecializationOf",
"(",
"QualifiedName",
"specific",
",",
"QualifiedName",
"general",
")",
"{",
"SpecializationOf",
"res",
"=",
"of",
".",
"createSpecializationOf",
"(",
")",
";",
"res",
".",
"setSpecificEntity",
"(... | A factory method to create an instance of a specialization {@link SpecializationOf}
@param specific an identifier ({@link QualifiedName}) for the specific {@link Entity}
@param general an identifier ({@link QualifiedName}) for the general {@link Entity}
@return an instance of {@link SpecializationOf} | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"a",
"specialization",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L886-L892 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.createProductDelivery | public void createProductDelivery(final String productLogicalName, final Delivery delivery, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Create an Product delivery
@throws AuthenticationException, GrapesCommunicationException, IOException
""" ... | java | public void createProductDelivery(final String productLogicalName, final Delivery delivery, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL)... | [
"public",
"void",
"createProductDelivery",
"(",
"final",
"String",
"productLogicalName",
",",
"final",
"Delivery",
"delivery",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationExceptio... | Create an Product delivery
@throws AuthenticationException, GrapesCommunicationException, IOException | [
"Create",
"an",
"Product",
"delivery"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L940-L953 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java | JobsInner.resumeAsync | public Observable<Void> resumeAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
"""
Resume the job identified by jobId.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@throws Illegal... | java | public Observable<Void> resumeAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
return resumeWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void>... | [
"public",
"Observable",
"<",
"Void",
">",
"resumeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobId",
")",
"{",
"return",
"resumeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
... | Resume the job identified by jobId.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Resume",
"the",
"job",
"identified",
"by",
"jobId",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java#L938-L945 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java | PropertyUtil.findGetter | public static Method findGetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
"""
Returns the requested getter method from an object instance.
@param methodName Name of the getter method.
@param instance Object instance to search.
@param valueClass The return value ty... | java | public static Method findGetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, false);
} | [
"public",
"static",
"Method",
"findGetter",
"(",
"String",
"methodName",
",",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"valueClass",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"findMethod",
"(",
"methodName",
",",
"instance",
",",
"valueCla... | Returns the requested getter method from an object instance.
@param methodName Name of the getter method.
@param instance Object instance to search.
@param valueClass The return value type (null if don't care).
@return The getter method.
@throws NoSuchMethodException If method was not found. | [
"Returns",
"the",
"requested",
"getter",
"method",
"from",
"an",
"object",
"instance",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java#L59-L61 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/util/ResourceReader.java | ResourceReader.getFileStream | public InputStreamReader getFileStream(File file, String encoding)
throws NoSuchPathException, UnmarshalException {
"""
将文件读出为输出流
@param file 需要读取的文件
@param encoding 文件编码
@return 文件内容输出流
@throws NoSuchPathException 无法找到对应的文件或者路径
@throws UnmarshalException 解组失败(通常由于编码问题引起)
"""
try {
return ne... | java | public InputStreamReader getFileStream(File file, String encoding)
throws NoSuchPathException, UnmarshalException{
try {
return new InputStreamReader(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
throw new NoSuchPathException(e);
} catch (UnsupportedEncodingException e){
th... | [
"public",
"InputStreamReader",
"getFileStream",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"throws",
"NoSuchPathException",
",",
"UnmarshalException",
"{",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
... | 将文件读出为输出流
@param file 需要读取的文件
@param encoding 文件编码
@return 文件内容输出流
@throws NoSuchPathException 无法找到对应的文件或者路径
@throws UnmarshalException 解组失败(通常由于编码问题引起) | [
"将文件读出为输出流"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/util/ResourceReader.java#L120-L129 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.setupRequest | protected HttpUriRequest setupRequest(final String path, final String method, final Map<String, Object> params) {
"""
Helper method to build the request to the server.
@param path the path.
@param method the method.
@param params the parameters.
@return the request.
"""
final HttpUriRequest reque... | java | protected HttpUriRequest setupRequest(final String path, final String method, final Map<String, Object> params) {
final HttpUriRequest request = buildMethod(method, path, params);
request.addHeader(new BasicHeader("Accept", "application/json"));
request.addHeader(new BasicHeader("Accept-Charset"... | [
"protected",
"HttpUriRequest",
"setupRequest",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"method",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"final",
"HttpUriRequest",
"request",
"=",
"buildMethod",
"(",
"method"... | Helper method to build the request to the server.
@param path the path.
@param method the method.
@param params the parameters.
@return the request. | [
"Helper",
"method",
"to",
"build",
"the",
"request",
"to",
"the",
"server",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L539-L545 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicy_binding.java | transformpolicy_binding.get | public static transformpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch transformpolicy_binding resource of given name .
"""
transformpolicy_binding obj = new transformpolicy_binding();
obj.set_name(name);
transformpolicy_binding response = (transformpol... | java | public static transformpolicy_binding get(nitro_service service, String name) throws Exception{
transformpolicy_binding obj = new transformpolicy_binding();
obj.set_name(name);
transformpolicy_binding response = (transformpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"transformpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"transformpolicy_binding",
"obj",
"=",
"new",
"transformpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"nam... | Use this API to fetch transformpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"transformpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicy_binding.java#L136-L141 |
micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.setSerialization | public void setSerialization(Map<SerializationFeature, Boolean> serialization) {
"""
Sets the serialization features to use.
@param serialization The serialization features.
"""
if (CollectionUtils.isNotEmpty(serialization)) {
this.serialization = serialization;
}
} | java | public void setSerialization(Map<SerializationFeature, Boolean> serialization) {
if (CollectionUtils.isNotEmpty(serialization)) {
this.serialization = serialization;
}
} | [
"public",
"void",
"setSerialization",
"(",
"Map",
"<",
"SerializationFeature",
",",
"Boolean",
">",
"serialization",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"serialization",
")",
")",
"{",
"this",
".",
"serialization",
"=",
"serialization... | Sets the serialization features to use.
@param serialization The serialization features. | [
"Sets",
"the",
"serialization",
"features",
"to",
"use",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L235-L239 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/utils/IoUtils.java | IoUtils.copyStream | public static boolean copyStream(InputStream is, OutputStream os, CopyListener listener, int bufferSize)
throws IOException {
"""
Copies stream, fires progress events by listener, can be interrupted by listener.
@param is Input stream
@param os Output stream
@param listener null-ok; Liste... | java | public static boolean copyStream(InputStream is, OutputStream os, CopyListener listener, int bufferSize)
throws IOException {
int current = 0;
int total = is.available();
if (total <= 0) {
total = DEFAULT_IMAGE_TOTAL_SIZE;
}
final byte[] bytes = new byte[bufferSize];
int count;
if (shouldStopLoadin... | [
"public",
"static",
"boolean",
"copyStream",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"CopyListener",
"listener",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"int",
"current",
"=",
"0",
";",
"int",
"total",
"=",
"is",
".",
... | Copies stream, fires progress events by listener, can be interrupted by listener.
@param is Input stream
@param os Output stream
@param listener null-ok; Listener of copying progress and controller of copying interrupting
@param bufferSize Buffer size for copying, also represents a step for firing pr... | [
"Copies",
"stream",
"fires",
"progress",
"events",
"by",
"listener",
"can",
"be",
"interrupted",
"by",
"listener",
"."
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/utils/IoUtils.java#L66-L84 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java | XBaseGridScreen.printEndRecordGridData | public void printEndRecordGridData(PrintWriter out, int iPrintOptions) {
"""
Display the end grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
out.println(Utility.endTag(XMLTags.FILE));
... | java | public void printEndRecordGridData(PrintWriter out, int iPrintOptions)
{
out.println(Utility.endTag(XMLTags.FILE));
out.println(Utility.endTag(XMLTags.DETAIL));
} | [
"public",
"void",
"printEndRecordGridData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"out",
".",
"println",
"(",
"Utility",
".",
"endTag",
"(",
"XMLTags",
".",
"FILE",
")",
")",
";",
"out",
".",
"println",
"(",
"Utility",
".",
"e... | Display the end grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"the",
"end",
"grid",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java#L196-L200 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.createFirstSequenceInterface | private void createFirstSequenceInterface(ClassWriter classWriter, String className, String nextTypeName, String apiName, List<XsdElement> elements) {
"""
Adds a method to the element which contains the sequence.
@param classWriter The {@link ClassWriter} of the class which contains the sequence.
@param classNam... | java | private void createFirstSequenceInterface(ClassWriter classWriter, String className, String nextTypeName, String apiName, List<XsdElement> elements){
elements.forEach(element -> generateSequenceMethod(classWriter, className, getJavaType(element.getType()), getCleanName(element.getName()), className, nextTypeNam... | [
"private",
"void",
"createFirstSequenceInterface",
"(",
"ClassWriter",
"classWriter",
",",
"String",
"className",
",",
"String",
"nextTypeName",
",",
"String",
"apiName",
",",
"List",
"<",
"XsdElement",
">",
"elements",
")",
"{",
"elements",
".",
"forEach",
"(",
... | Adds a method to the element which contains the sequence.
@param classWriter The {@link ClassWriter} of the class which contains the sequence.
@param className The name of the class which contains the sequence.
@param nextTypeName The next sequence type name.
@param apiName The name of the generated fluent interface.
@... | [
"Adds",
"a",
"method",
"to",
"the",
"element",
"which",
"contains",
"the",
"sequence",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L453-L457 |
alkacon/opencms-core | src/org/opencms/workflow/A_CmsWorkflowManager.java | A_CmsWorkflowManager.getParameter | protected String getParameter(String key, String defaultValue) {
"""
Gets the configuration parameter for a given key, and if it doesn't find one, returns a default value.<p>
@param key the configuration key
@param defaultValue the default value to use when the configuration entry isn't found
@return the co... | java | protected String getParameter(String key, String defaultValue) {
String result = m_parameters.get(key);
if (result == null) {
result = defaultValue;
}
return result;
} | [
"protected",
"String",
"getParameter",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"m_parameters",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"defaultValue",
"... | Gets the configuration parameter for a given key, and if it doesn't find one, returns a default value.<p>
@param key the configuration key
@param defaultValue the default value to use when the configuration entry isn't found
@return the configuration value | [
"Gets",
"the",
"configuration",
"parameter",
"for",
"a",
"given",
"key",
"and",
"if",
"it",
"doesn",
"t",
"find",
"one",
"returns",
"a",
"default",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/A_CmsWorkflowManager.java#L101-L108 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java | NetUtil.getUsableLocalPort | public static int getUsableLocalPort(int minPort, int maxPort) {
"""
查找指定范围内的可用端口<br>
此方法只检测给定范围内的随机一个端口,检测maxPort-minPort次<br>
来自org.springframework.util.SocketUtils
@param minPort 端口最小值(包含)
@param maxPort 端口最大值(包含)
@return 可用的端口
@since 4.5.4
"""
for (int i = minPort; i <= maxPort; i++) {
if (i... | java | public static int getUsableLocalPort(int minPort, int maxPort) {
for (int i = minPort; i <= maxPort; i++) {
if (isUsableLocalPort(RandomUtil.randomInt(minPort, maxPort + 1))) {
return i;
}
}
throw new UtilException("Could not find an available port in the range [{}, {}] after {} attempts", minPo... | [
"public",
"static",
"int",
"getUsableLocalPort",
"(",
"int",
"minPort",
",",
"int",
"maxPort",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"minPort",
";",
"i",
"<=",
"maxPort",
";",
"i",
"++",
")",
"{",
"if",
"(",
"isUsableLocalPort",
"(",
"RandomUtil",
"."... | 查找指定范围内的可用端口<br>
此方法只检测给定范围内的随机一个端口,检测maxPort-minPort次<br>
来自org.springframework.util.SocketUtils
@param minPort 端口最小值(包含)
@param maxPort 端口最大值(包含)
@return 可用的端口
@since 4.5.4 | [
"查找指定范围内的可用端口<br",
">",
"此方法只检测给定范围内的随机一个端口,检测maxPort",
"-",
"minPort次<br",
">",
"来自org",
".",
"springframework",
".",
"util",
".",
"SocketUtils"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java#L157-L165 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java | StencilEngine.renderInline | public void renderInline(String text, Map<String, Object> parameters, Writer out, GlobalScope... extraGlobalScopes) throws IOException, ParseException {
"""
Renders given text with the provided parameters to the given character
stream.
@param text Template text to render
@param parameters Parameters to pass t... | java | public void renderInline(String text, Map<String, Object> parameters, Writer out, GlobalScope... extraGlobalScopes) throws IOException, ParseException {
render(loadInline(text), parameters, out, extraGlobalScopes);
} | [
"public",
"void",
"renderInline",
"(",
"String",
"text",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
",",
"Writer",
"out",
",",
"GlobalScope",
"...",
"extraGlobalScopes",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"render",
"(",... | Renders given text with the provided parameters to the given character
stream.
@param text Template text to render
@param parameters Parameters to pass to template
@param out Character stream to write to
@param extraGlobalScopes Any extra global scopes to make available
@throws IOException
@throws ParseException | [
"Renders",
"given",
"text",
"with",
"the",
"provided",
"parameters",
"to",
"the",
"given",
"character",
"stream",
"."
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java#L174-L176 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java | CpnlElFunctions.unmappedUrl | public static String unmappedUrl(SlingHttpServletRequest request, String path) {
"""
Builds the URL for a repository path using the LinkUtil.getUnmappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested d... | java | public static String unmappedUrl(SlingHttpServletRequest request, String path) {
return LinkUtil.getUnmappedUrl(request, path);
} | [
"public",
"static",
"String",
"unmappedUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"path",
")",
"{",
"return",
"LinkUtil",
".",
"getUnmappedUrl",
"(",
"request",
",",
"path",
")",
";",
"}"
] | Builds the URL for a repository path using the LinkUtil.getUnmappedURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested domain host | [
"Builds",
"the",
"URL",
"for",
"a",
"repository",
"path",
"using",
"the",
"LinkUtil",
".",
"getUnmappedURL",
"()",
"method",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java#L198-L200 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.sizeDp | @NonNull
public IconicsDrawable sizeDp(@Dimension(unit = DP) int sizeDp) {
"""
Set the size of the drawable.
@param sizeDp The size in density-independent pixels (dp).
@return The current IconicsDrawable for chaining.
"""
return sizePx(Utils.convertDpToPx(mContext, sizeDp));
} | java | @NonNull
public IconicsDrawable sizeDp(@Dimension(unit = DP) int sizeDp) {
return sizePx(Utils.convertDpToPx(mContext, sizeDp));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"sizeDp",
"(",
"@",
"Dimension",
"(",
"unit",
"=",
"DP",
")",
"int",
"sizeDp",
")",
"{",
"return",
"sizePx",
"(",
"Utils",
".",
"convertDpToPx",
"(",
"mContext",
",",
"sizeDp",
")",
")",
";",
"}"
] | Set the size of the drawable.
@param sizeDp The size in density-independent pixels (dp).
@return The current IconicsDrawable for chaining. | [
"Set",
"the",
"size",
"of",
"the",
"drawable",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L644-L647 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java | Utils.dateTimeToString | public static String dateTimeToString(DateTime input, String format, String timezone) {
"""
Convert joda time to a string in the given format
@param input timestamp
@param format expected format
@param timezone time zone of timestamp
@return string format of timestamp
"""
String tz = StringUtils.defaul... | java | public static String dateTimeToString(DateTime input, String format, String timezone) {
String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE);
DateTimeZone dateTimeZone = getTimeZone(tz);
DateTimeFormatter outputDtFormat = DateTimeFormat.forPattern(format).withZone(dateT... | [
"public",
"static",
"String",
"dateTimeToString",
"(",
"DateTime",
"input",
",",
"String",
"format",
",",
"String",
"timezone",
")",
"{",
"String",
"tz",
"=",
"StringUtils",
".",
"defaultString",
"(",
"timezone",
",",
"ConfigurationKeys",
".",
"DEFAULT_SOURCE_TIME... | Convert joda time to a string in the given format
@param input timestamp
@param format expected format
@param timezone time zone of timestamp
@return string format of timestamp | [
"Convert",
"joda",
"time",
"to",
"a",
"string",
"in",
"the",
"given",
"format"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L308-L313 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/tools/Model.java | Model.setRange | public void setRange(final double MIN_VALUE, final double MAX_VALUE) {
"""
Sets the minimum and maximum value for the calculation of the
nice minimum and nice maximum values.
@param MIN_VALUE
@param MAX_VALUE
"""
maxValue = MAX_VALUE;
minValue = MIN_VALUE;
calculate();
valida... | java | public void setRange(final double MIN_VALUE, final double MAX_VALUE) {
maxValue = MAX_VALUE;
minValue = MIN_VALUE;
calculate();
validate();
calcAngleStep();
fireStateChanged();
} | [
"public",
"void",
"setRange",
"(",
"final",
"double",
"MIN_VALUE",
",",
"final",
"double",
"MAX_VALUE",
")",
"{",
"maxValue",
"=",
"MAX_VALUE",
";",
"minValue",
"=",
"MIN_VALUE",
";",
"calculate",
"(",
")",
";",
"validate",
"(",
")",
";",
"calcAngleStep",
... | Sets the minimum and maximum value for the calculation of the
nice minimum and nice maximum values.
@param MIN_VALUE
@param MAX_VALUE | [
"Sets",
"the",
"minimum",
"and",
"maximum",
"value",
"for",
"the",
"calculation",
"of",
"the",
"nice",
"minimum",
"and",
"nice",
"maximum",
"values",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/Model.java#L418-L425 |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Utilities.java | Utilities.findElement | public static WebElement findElement(WebDriver webDriver, String applicationKey, String code, Object... args) {
"""
Find the first {@link WebElement} using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matchi... | java | public static WebElement findElement(WebDriver webDriver, String applicationKey, String code, Object... args) {
return webDriver.findElement(getLocator(applicationKey, code, args));
} | [
"public",
"static",
"WebElement",
"findElement",
"(",
"WebDriver",
"webDriver",
",",
"String",
"applicationKey",
",",
"String",
"code",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"webDriver",
".",
"findElement",
"(",
"getLocator",
"(",
"applicationKey",
"... | Find the first {@link WebElement} using the given method.
This method is affected by the 'implicit wait' times in force at the time of execution.
The findElement(..) invocation will return a matching row, or try again repeatedly until
the configured timeout is reached.
@param webDriver
instance of webDriver
@param app... | [
"Find",
"the",
"first",
"{",
"@link",
"WebElement",
"}",
"using",
"the",
"given",
"method",
".",
"This",
"method",
"is",
"affected",
"by",
"the",
"implicit",
"wait",
"times",
"in",
"force",
"at",
"the",
"time",
"of",
"execution",
".",
"The",
"findElement",... | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Utilities.java#L159-L161 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaManagementApi.java | MediaManagementApi.getSnapshotContent | public ApiSuccessResponse getSnapshotContent(String snapshotId, GetSnapshotContentData getSnapshotContentData) throws ApiException {
"""
Get the content of snapshot specified by startIndex and size.
Get the content of snapshot specified by startIndex and size.
@param snapshotId Id of the snapshot (required)
@pa... | java | public ApiSuccessResponse getSnapshotContent(String snapshotId, GetSnapshotContentData getSnapshotContentData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = getSnapshotContentWithHttpInfo(snapshotId, getSnapshotContentData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"getSnapshotContent",
"(",
"String",
"snapshotId",
",",
"GetSnapshotContentData",
"getSnapshotContentData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"getSnapshotContentWithHttpInfo",
"(",
... | Get the content of snapshot specified by startIndex and size.
Get the content of snapshot specified by startIndex and size.
@param snapshotId Id of the snapshot (required)
@param getSnapshotContentData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deser... | [
"Get",
"the",
"content",
"of",
"snapshot",
"specified",
"by",
"startIndex",
"and",
"size",
".",
"Get",
"the",
"content",
"of",
"snapshot",
"specified",
"by",
"startIndex",
"and",
"size",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaManagementApi.java#L389-L392 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java | RegistriesInner.getBuildSourceUploadUrlAsync | public Observable<SourceUploadDefinitionInner> getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) {
"""
Get the upload location for the user to be able to upload the source.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registry... | java | public Observable<SourceUploadDefinitionInner> getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) {
return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1<ServiceResponse<SourceUploadDefinitionInner>, SourceUploadDefinitionInner>() {
... | [
"public",
"Observable",
"<",
"SourceUploadDefinitionInner",
">",
"getBuildSourceUploadUrlAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
")",
"{",
"return",
"getBuildSourceUploadUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryNam... | Get the upload location for the user to be able to upload the source.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable... | [
"Get",
"the",
"upload",
"location",
"for",
"the",
"user",
"to",
"be",
"able",
"to",
"upload",
"the",
"source",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java#L1919-L1926 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/components/Numeraire.java | Numeraire.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value c... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
return model.getNumeraire(evaluationTime);
} | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"return",
"model",
".",
"getNumeraire",
"(",
"evaluationTime",
")",
";",
"}"
] | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
cash-flows prior evaluationTim... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/components/Numeraire.java#L44-L49 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Scheduler.java | Scheduler.durationMinutes | public static double durationMinutes(LocalDateTime start, LocalDateTime end) {
"""
1 seconds = 1/60 minutes
@param start between time
@param end finish time
@return duration in minutes
"""
return Duration.between(start, end).toMinutes();
} | java | public static double durationMinutes(LocalDateTime start, LocalDateTime end)
{
return Duration.between(start, end).toMinutes();
} | [
"public",
"static",
"double",
"durationMinutes",
"(",
"LocalDateTime",
"start",
",",
"LocalDateTime",
"end",
")",
"{",
"return",
"Duration",
".",
"between",
"(",
"start",
",",
"end",
")",
".",
"toMinutes",
"(",
")",
";",
"}"
] | 1 seconds = 1/60 minutes
@param start between time
@param end finish time
@return duration in minutes | [
"1",
"seconds",
"=",
"1",
"/",
"60",
"minutes"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Scheduler.java#L110-L114 |
RestComm/load-balancer | jar/src/main/java/org/mobicents/tools/http/balancer/WebsocketModifyServerPipelineFactory.java | WebsocketModifyServerPipelineFactory.upgradeServerPipelineFactory | public void upgradeServerPipelineFactory(ChannelPipeline p, String wsVersion) {
"""
Upgrade the Server ChannelPipelineFactory. This method should be called from the HttpResponseHandler.messageReceived(ChannelHandlerContext, MessageEvent)
when the handler detects that the response contains WebSocket header "Sec-We... | java | public void upgradeServerPipelineFactory(ChannelPipeline p, String wsVersion) {
if (p.get(HttpChunkAggregator.class) != null) {
p.remove(HttpChunkAggregator.class);
}
p.get(HttpRequestDecoder.class).replace("wsdecoder",
new WebSocket13FrameDecoder(true, true, Long.MAX_VALUE));
p.replace(HttpResponseEnco... | [
"public",
"void",
"upgradeServerPipelineFactory",
"(",
"ChannelPipeline",
"p",
",",
"String",
"wsVersion",
")",
"{",
"if",
"(",
"p",
".",
"get",
"(",
"HttpChunkAggregator",
".",
"class",
")",
"!=",
"null",
")",
"{",
"p",
".",
"remove",
"(",
"HttpChunkAggrega... | Upgrade the Server ChannelPipelineFactory. This method should be called from the HttpResponseHandler.messageReceived(ChannelHandlerContext, MessageEvent)
when the handler detects that the response contains WebSocket header "Sec-WebSocket-Protocol"
@param ChannelPipeline p
@param String WebSocket version | [
"Upgrade",
"the",
"Server",
"ChannelPipelineFactory",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"the",
"HttpResponseHandler",
".",
"messageReceived",
"(",
"ChannelHandlerContext",
"MessageEvent",
")",
"when",
"the",
"handler",
"detects",
"that",
"the",
... | train | https://github.com/RestComm/load-balancer/blob/54768d0b81004b2653d429720016ad2617fe754f/jar/src/main/java/org/mobicents/tools/http/balancer/WebsocketModifyServerPipelineFactory.java#L24-L32 |
google/closure-compiler | src/com/google/javascript/jscomp/TemplateAstMatcher.java | TemplateAstMatcher.createTemplateParameterNode | private Node createTemplateParameterNode(int index, JSType type, boolean isStringLiteral) {
"""
Creates a template parameter or string literal template node.
"""
checkState(index >= 0);
checkNotNull(type);
Node n = Node.newNumber(index);
if (isStringLiteral) {
n.setToken(TEMPLATE_STRING_L... | java | private Node createTemplateParameterNode(int index, JSType type, boolean isStringLiteral) {
checkState(index >= 0);
checkNotNull(type);
Node n = Node.newNumber(index);
if (isStringLiteral) {
n.setToken(TEMPLATE_STRING_LITERAL);
} else {
n.setToken(TEMPLATE_TYPE_PARAM);
}
n.setJST... | [
"private",
"Node",
"createTemplateParameterNode",
"(",
"int",
"index",
",",
"JSType",
"type",
",",
"boolean",
"isStringLiteral",
")",
"{",
"checkState",
"(",
"index",
">=",
"0",
")",
";",
"checkNotNull",
"(",
"type",
")",
";",
"Node",
"n",
"=",
"Node",
"."... | Creates a template parameter or string literal template node. | [
"Creates",
"a",
"template",
"parameter",
"or",
"string",
"literal",
"template",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TemplateAstMatcher.java#L293-L304 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java | CPFriendlyURLEntryPersistenceImpl.findByUUID_G | @Override
public CPFriendlyURLEntry findByUUID_G(String uuid, long groupId)
throws NoSuchCPFriendlyURLEntryException {
"""
Returns the cp friendly url entry where uuid = ? and groupId = ? or throws a {@link NoSuchCPFriendlyURLEntryException} if it could not be found.
@param uuid the uuid
@param grou... | java | @Override
public CPFriendlyURLEntry findByUUID_G(String uuid, long groupId)
throws NoSuchCPFriendlyURLEntryException {
CPFriendlyURLEntry cpFriendlyURLEntry = fetchByUUID_G(uuid, groupId);
if (cpFriendlyURLEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
... | [
"@",
"Override",
"public",
"CPFriendlyURLEntry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPFriendlyURLEntryException",
"{",
"CPFriendlyURLEntry",
"cpFriendlyURLEntry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
... | Returns the cp friendly url entry where uuid = ? and groupId = ? or throws a {@link NoSuchCPFriendlyURLEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp friendly url entry
@throws NoSuchCPFriendlyURLEntryException if a matching cp friendly url en... | [
"Returns",
"the",
"cp",
"friendly",
"url",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPFriendlyURLEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L671-L697 |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/utils/TypeUtils.java | TypeUtils.typeGenericOf | public static TypeDef typeGenericOf(TypeDef base, TypeParamDef... parameters) {
"""
Sets one {@link io.sundr.codegen.model.TypeDef} as a generic of an other.
@param base The base type.
@param parameters The parameter types.
@return The generic type.
"""
return new TypeDefB... | java | public static TypeDef typeGenericOf(TypeDef base, TypeParamDef... parameters) {
return new TypeDefBuilder(base)
.withParameters(parameters)
.build();
} | [
"public",
"static",
"TypeDef",
"typeGenericOf",
"(",
"TypeDef",
"base",
",",
"TypeParamDef",
"...",
"parameters",
")",
"{",
"return",
"new",
"TypeDefBuilder",
"(",
"base",
")",
".",
"withParameters",
"(",
"parameters",
")",
".",
"build",
"(",
")",
";",
"}"
] | Sets one {@link io.sundr.codegen.model.TypeDef} as a generic of an other.
@param base The base type.
@param parameters The parameter types.
@return The generic type. | [
"Sets",
"one",
"{",
"@link",
"io",
".",
"sundr",
".",
"codegen",
".",
"model",
".",
"TypeDef",
"}",
"as",
"a",
"generic",
"of",
"an",
"other",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/utils/TypeUtils.java#L147-L151 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsBasicDialog.java | CmsBasicDialog.addButton | public void addButton(Component button, boolean right) {
"""
Adds a button to the button bar.<p>
@param button the button to add
@param right to align the button right
"""
if (right) {
m_buttonPanelRight.addComponent(button);
} else {
m_buttonPanelLeft.addComponent(... | java | public void addButton(Component button, boolean right) {
if (right) {
m_buttonPanelRight.addComponent(button);
} else {
m_buttonPanelLeft.addComponent(button);
m_buttonPanelLeft.setVisible(true);
}
} | [
"public",
"void",
"addButton",
"(",
"Component",
"button",
",",
"boolean",
"right",
")",
"{",
"if",
"(",
"right",
")",
"{",
"m_buttonPanelRight",
".",
"addComponent",
"(",
"button",
")",
";",
"}",
"else",
"{",
"m_buttonPanelLeft",
".",
"addComponent",
"(",
... | Adds a button to the button bar.<p>
@param button the button to add
@param right to align the button right | [
"Adds",
"a",
"button",
"to",
"the",
"button",
"bar",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsBasicDialog.java#L232-L240 |
oasp/oasp4j | modules/security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java | AbstractAccessControlProvider.checkForCyclicDependencies | protected void checkForCyclicDependencies(AccessControlGroup group, List<AccessControlGroup> groupList) {
"""
Checks that the given {@link AccessControlGroup} has no cyclic {@link AccessControlGroup#getInherits() inheritance
graph}.
@param group is the {@link AccessControlGroup} to check.
@param groupList the... | java | protected void checkForCyclicDependencies(AccessControlGroup group, List<AccessControlGroup> groupList) {
for (AccessControlGroup inheritedGroup : group.getInherits()) {
if (groupList.contains(inheritedGroup)) {
StringBuilder sb = new StringBuilder("A cyclic dependency of access control groups has be... | [
"protected",
"void",
"checkForCyclicDependencies",
"(",
"AccessControlGroup",
"group",
",",
"List",
"<",
"AccessControlGroup",
">",
"groupList",
")",
"{",
"for",
"(",
"AccessControlGroup",
"inheritedGroup",
":",
"group",
".",
"getInherits",
"(",
")",
")",
"{",
"if... | Checks that the given {@link AccessControlGroup} has no cyclic {@link AccessControlGroup#getInherits() inheritance
graph}.
@param group is the {@link AccessControlGroup} to check.
@param groupList the {@link List} of visited {@link AccessControlGroup}s used to detect cycles. | [
"Checks",
"that",
"the",
"given",
"{",
"@link",
"AccessControlGroup",
"}",
"has",
"no",
"cyclic",
"{",
"@link",
"AccessControlGroup#getInherits",
"()",
"inheritance",
"graph",
"}",
"."
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java#L70-L89 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/AngleCalc.java | AngleCalc.convertAzimuth2xaxisAngle | public double convertAzimuth2xaxisAngle(double azimuth) {
"""
convert north based clockwise azimuth (0, 360) into x-axis/east based angle (-Pi, Pi)
"""
if (Double.compare(azimuth, 360) > 0 || Double.compare(azimuth, 0) < 0) {
throw new IllegalArgumentException("Azimuth " + azimuth + " must ... | java | public double convertAzimuth2xaxisAngle(double azimuth) {
if (Double.compare(azimuth, 360) > 0 || Double.compare(azimuth, 0) < 0) {
throw new IllegalArgumentException("Azimuth " + azimuth + " must be in (0, 360)");
}
double angleXY = PI_2 - azimuth / 180. * Math.PI;
if (angle... | [
"public",
"double",
"convertAzimuth2xaxisAngle",
"(",
"double",
"azimuth",
")",
"{",
"if",
"(",
"Double",
".",
"compare",
"(",
"azimuth",
",",
"360",
")",
">",
"0",
"||",
"Double",
".",
"compare",
"(",
"azimuth",
",",
"0",
")",
"<",
"0",
")",
"{",
"t... | convert north based clockwise azimuth (0, 360) into x-axis/east based angle (-Pi, Pi) | [
"convert",
"north",
"based",
"clockwise",
"azimuth",
"(",
"0",
"360",
")",
"into",
"x",
"-",
"axis",
"/",
"east",
"based",
"angle",
"(",
"-",
"Pi",
"Pi",
")"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/AngleCalc.java#L77-L87 |
galaxyproject/blend4j | src/main/java/com/github/jmchilton/blend4j/BaseClient.java | BaseClient.deleteResponse | protected ClientResponse deleteResponse(final WebResource webResource, java.lang.Object requestEntity) {
"""
Gets the response for a DELETE request.
@param webResource The {@link WebResource} to send the request to.
@param requestEntity The request entity.
@return The {@link ClientResponse} for this request.
@... | java | protected ClientResponse deleteResponse(final WebResource webResource, java.lang.Object requestEntity) {
return deleteResponse(webResource, requestEntity, true);
} | [
"protected",
"ClientResponse",
"deleteResponse",
"(",
"final",
"WebResource",
"webResource",
",",
"java",
".",
"lang",
".",
"Object",
"requestEntity",
")",
"{",
"return",
"deleteResponse",
"(",
"webResource",
",",
"requestEntity",
",",
"true",
")",
";",
"}"
] | Gets the response for a DELETE request.
@param webResource The {@link WebResource} to send the request to.
@param requestEntity The request entity.
@return The {@link ClientResponse} for this request.
@throws ResponseException If the response was not successful. | [
"Gets",
"the",
"response",
"for",
"a",
"DELETE",
"request",
"."
] | train | https://github.com/galaxyproject/blend4j/blob/a2ec4e412be40013bb88a3a2cf2478abd19ce162/src/main/java/com/github/jmchilton/blend4j/BaseClient.java#L78-L80 |
dyu/protostuff-1.0.x | protostuff-runtime/src/main/java/com/dyuproject/protostuff/runtime/DefaultIdStrategy.java | DefaultIdStrategy.registerPojo | public <T> boolean registerPojo(Class<T> typeClass, Schema<T> schema) {
"""
Registers a pojo.
Returns true if registration is successful or if the same exact schema
was previously registered.
Used by {@link RuntimeSchema#register(Class, Schema)}.
"""
assert typeClass != null && schema != null;
... | java | public <T> boolean registerPojo(Class<T> typeClass, Schema<T> schema)
{
assert typeClass != null && schema != null;
final HasSchema<?> last = pojoMapping.putIfAbsent(typeClass.getName(),
new Registered<T>(schema));
return last == null || (last instanceof Re... | [
"public",
"<",
"T",
">",
"boolean",
"registerPojo",
"(",
"Class",
"<",
"T",
">",
"typeClass",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"{",
"assert",
"typeClass",
"!=",
"null",
"&&",
"schema",
"!=",
"null",
";",
"final",
"HasSchema",
"<",
"?",
">... | Registers a pojo.
Returns true if registration is successful or if the same exact schema
was previously registered.
Used by {@link RuntimeSchema#register(Class, Schema)}. | [
"Registers",
"a",
"pojo",
".",
"Returns",
"true",
"if",
"registration",
"is",
"successful",
"or",
"if",
"the",
"same",
"exact",
"schema",
"was",
"previously",
"registered",
".",
"Used",
"by",
"{"
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-runtime/src/main/java/com/dyuproject/protostuff/runtime/DefaultIdStrategy.java#L84-L93 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java | ClassPath.newInstance | public static <T> T newInstance(Class<?> aClass, Object... initargs)
throws SetupException {
"""
Create a new instance of a given object
@param aClass the class the create
@param initargs the initial constructor arguments
@param <T> the type class
@return the create instance
@throws SetupException when an ... | java | public static <T> T newInstance(Class<?> aClass, Object... initargs)
throws SetupException
{
Class<?>[] parameterTypes = null;
if(initargs != null && initargs.length > 0)
{
parameterTypes = new Class<?>[initargs.length];
for (int i = 0; i < initargs.length; i++)
{
if(initargs[i] ... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Object",
"...",
"initargs",
")",
"throws",
"SetupException",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
"null",
";",
"if",
"(",
"in... | Create a new instance of a given object
@param aClass the class the create
@param initargs the initial constructor arguments
@param <T> the type class
@return the create instance
@throws SetupException when an initialize issue occurs | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"given",
"object"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java#L194-L213 |
lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setMenuButtonText | public void setMenuButtonText(MenuButton button, String text) {
"""
Set text displayed under a menu button
@param button
@param text
"""
switch (button) {
case MID:
mMidText.setText(text);
break;
case LEFT:
mLeftText.setText(te... | java | public void setMenuButtonText(MenuButton button, String text) {
switch (button) {
case MID:
mMidText.setText(text);
break;
case LEFT:
mLeftText.setText(text);
break;
case RIGHT:
mRightText.setText... | [
"public",
"void",
"setMenuButtonText",
"(",
"MenuButton",
"button",
",",
"String",
"text",
")",
"{",
"switch",
"(",
"button",
")",
"{",
"case",
"MID",
":",
"mMidText",
".",
"setText",
"(",
"text",
")",
";",
"break",
";",
"case",
"LEFT",
":",
"mLeftText",... | Set text displayed under a menu button
@param button
@param text | [
"Set",
"text",
"displayed",
"under",
"a",
"menu",
"button"
] | train | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L226-L238 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/KMeansPlusPlusInitialMeans.java | KMeansPlusPlusInitialMeans.initialWeights | static double initialWeights(WritableDoubleDataStore weights, DBIDs ids, NumberVector first, DistanceQuery<? super NumberVector> distQ) {
"""
Initialize the weight list.
@param weights Weight list
@param ids IDs
@param first Added ID
@param distQ Distance query
@return Weight sum
"""
double weightsu... | java | static double initialWeights(WritableDoubleDataStore weights, DBIDs ids, NumberVector first, DistanceQuery<? super NumberVector> distQ) {
double weightsum = 0.;
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
// Distance will usually already be squared
double weight = distQ.distance(first,... | [
"static",
"double",
"initialWeights",
"(",
"WritableDoubleDataStore",
"weights",
",",
"DBIDs",
"ids",
",",
"NumberVector",
"first",
",",
"DistanceQuery",
"<",
"?",
"super",
"NumberVector",
">",
"distQ",
")",
"{",
"double",
"weightsum",
"=",
"0.",
";",
"for",
"... | Initialize the weight list.
@param weights Weight list
@param ids IDs
@param first Added ID
@param distQ Distance query
@return Weight sum | [
"Initialize",
"the",
"weight",
"list",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/KMeansPlusPlusInitialMeans.java#L119-L128 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/adapter/TextAdapterActivity.java | TextAdapterActivity.handleConnectionException | protected void handleConnectionException(int errorCode, Throwable originalCause)
throws ActivityException {
"""
Typically you should not override this method. ConnectionPoolAdapter
does override this with internal MDW logic.
@param errorCode
@throws ActivityException
"""
InternalEvent message = ... | java | protected void handleConnectionException(int errorCode, Throwable originalCause)
throws ActivityException {
InternalEvent message = InternalEvent.createActivityStartMessage(getActivityId(),
getProcessInstanceId(), getWorkTransitionInstanceId(), getMasterRequestId(),
COMPCODE_... | [
"protected",
"void",
"handleConnectionException",
"(",
"int",
"errorCode",
",",
"Throwable",
"originalCause",
")",
"throws",
"ActivityException",
"{",
"InternalEvent",
"message",
"=",
"InternalEvent",
".",
"createActivityStartMessage",
"(",
"getActivityId",
"(",
")",
",... | Typically you should not override this method. ConnectionPoolAdapter
does override this with internal MDW logic.
@param errorCode
@throws ActivityException | [
"Typically",
"you",
"should",
"not",
"override",
"this",
"method",
".",
"ConnectionPoolAdapter",
"does",
"override",
"this",
"with",
"internal",
"MDW",
"logic",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/adapter/TextAdapterActivity.java#L414-L428 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/building/utilities/Padding.java | Padding.setPadding | public static Table setPadding (final Padding padding, final Table table) {
"""
Allows to set Table's padding with the Padding object, which has be done externally, as it's not part
of the standard libGDX API.
@param padding contains data of padding sizes.
@param table will have the padding set according to the... | java | public static Table setPadding (final Padding padding, final Table table) {
table.pad(padding.getTop(), padding.getLeft(), padding.getBottom(), padding.getRight());
return table;
} | [
"public",
"static",
"Table",
"setPadding",
"(",
"final",
"Padding",
"padding",
",",
"final",
"Table",
"table",
")",
"{",
"table",
".",
"pad",
"(",
"padding",
".",
"getTop",
"(",
")",
",",
"padding",
".",
"getLeft",
"(",
")",
",",
"padding",
".",
"getBo... | Allows to set Table's padding with the Padding object, which has be done externally, as it's not part
of the standard libGDX API.
@param padding contains data of padding sizes.
@param table will have the padding set according to the given data.
@return the given table for chaining. | [
"Allows",
"to",
"set",
"Table",
"s",
"padding",
"with",
"the",
"Padding",
"object",
"which",
"has",
"be",
"done",
"externally",
"as",
"it",
"s",
"not",
"part",
"of",
"the",
"standard",
"libGDX",
"API",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/building/utilities/Padding.java#L177-L180 |
ACRA/acra | acra-core/src/main/java/org/acra/collector/LogCatCollector.java | LogCatCollector.streamToString | @NonNull
private String streamToString(@NonNull CoreConfiguration config, @NonNull InputStream input, @Nullable Predicate<String> filter, int limit) throws IOException {
"""
Reads an InputStream into a string respecting blocking settings.
@param input the stream
@param filter should return false for lines... | java | @NonNull
private String streamToString(@NonNull CoreConfiguration config, @NonNull InputStream input, @Nullable Predicate<String> filter, int limit) throws IOException {
final StreamReader reader = new StreamReader(input).setFilter(filter).setLimit(limit);
if (config.logcatReadNonBlocking()) {
... | [
"@",
"NonNull",
"private",
"String",
"streamToString",
"(",
"@",
"NonNull",
"CoreConfiguration",
"config",
",",
"@",
"NonNull",
"InputStream",
"input",
",",
"@",
"Nullable",
"Predicate",
"<",
"String",
">",
"filter",
",",
"int",
"limit",
")",
"throws",
"IOExce... | Reads an InputStream into a string respecting blocking settings.
@param input the stream
@param filter should return false for lines which should be excluded
@param limit the maximum number of lines to read (the last x lines are kept)
@return the String that was read.
@throws IOException if the stream cannot be read... | [
"Reads",
"an",
"InputStream",
"into",
"a",
"string",
"respecting",
"blocking",
"settings",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/collector/LogCatCollector.java#L135-L142 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsEntityObserver.java | CmsEntityObserver.safeExecuteChangeListener | protected void safeExecuteChangeListener(CmsEntity entity, I_CmsEntityChangeListener listener) {
"""
Calls an entity change listener, catching any errors.<p>
@param entity the entity with which the change listener should be called
@param listener the change listener
"""
try {
liste... | java | protected void safeExecuteChangeListener(CmsEntity entity, I_CmsEntityChangeListener listener) {
try {
listener.onEntityChange(entity);
} catch (Exception e) {
String stack = CmsClientStringUtil.getStackTrace(e, "<br />");
CmsDebugLog.getInstance().printLine("<... | [
"protected",
"void",
"safeExecuteChangeListener",
"(",
"CmsEntity",
"entity",
",",
"I_CmsEntityChangeListener",
"listener",
")",
"{",
"try",
"{",
"listener",
".",
"onEntityChange",
"(",
"entity",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"String",... | Calls an entity change listener, catching any errors.<p>
@param entity the entity with which the change listener should be called
@param listener the change listener | [
"Calls",
"an",
"entity",
"change",
"listener",
"catching",
"any",
"errors",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsEntityObserver.java#L145-L153 |
beanshell/beanshell | src/main/java/bsh/engine/BshScriptEngine.java | BshScriptEngine.getEngineNameSpace | private static NameSpace getEngineNameSpace(ScriptContext scriptContext) {
"""
/*
Check the context for an existing global namespace embedded
in the script context engine scope. If none exists, ininitialize the
context with one.
"""
Map<String, Object> engineView = new ScriptContextEngineView(scrip... | java | private static NameSpace getEngineNameSpace(ScriptContext scriptContext) {
Map<String, Object> engineView = new ScriptContextEngineView(scriptContext);
NameSpace ns = (NameSpace) engineView.get(engineNameSpaceKey);
if (!engineView.containsKey(engineNameSpaceKey)) {
// Create a globa... | [
"private",
"static",
"NameSpace",
"getEngineNameSpace",
"(",
"ScriptContext",
"scriptContext",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"engineView",
"=",
"new",
"ScriptContextEngineView",
"(",
"scriptContext",
")",
";",
"NameSpace",
"ns",
"=",
"(",
"... | /*
Check the context for an existing global namespace embedded
in the script context engine scope. If none exists, ininitialize the
context with one. | [
"/",
"*",
"Check",
"the",
"context",
"for",
"an",
"existing",
"global",
"namespace",
"embedded",
"in",
"the",
"script",
"context",
"engine",
"scope",
".",
"If",
"none",
"exists",
"ininitialize",
"the",
"context",
"with",
"one",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/BshScriptEngine.java#L136-L147 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitContext | public void submitContext(final String evaluatorConfiguration, final String contextConfiguration) {
"""
Submit Context with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param contextConfiguration
""... | java | public void submitContext(final String evaluatorConfiguration, final String contextConfiguration) {
launchWithConfigurationString(evaluatorConfiguration, contextConfiguration, Optional.<String>empty(),
Optional.<String>empty());
} | [
"public",
"void",
"submitContext",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
")",
"{",
"launchWithConfigurationString",
"(",
"evaluatorConfiguration",
",",
"contextConfiguration",
",",
"Optional",
".",
"<",
"String",... | Submit Context with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param contextConfiguration | [
"Submit",
"Context",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L135-L138 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/SimpleStyleUtilities.java | SimpleStyleUtilities.createSimpleLineRule | public static Rule createSimpleLineRule( Color color, float width ) {
"""
Creates a simple {@link Rule} for a line.
@param color
the color.
@param width
the line width.
@return the rule.
"""
LineSymbolizer lineSymbolizer = StyleUtilities.sf.createLineSymbolizer();
lineSymbolizer.setStrok... | java | public static Rule createSimpleLineRule( Color color, float width ) {
LineSymbolizer lineSymbolizer = StyleUtilities.sf.createLineSymbolizer();
lineSymbolizer.setStroke(StyleUtilities.sf.createStroke(
StyleUtilities.ff.literal("#" + Integer.toHexString(color.getRGB() & 0xffffff)), StyleU... | [
"public",
"static",
"Rule",
"createSimpleLineRule",
"(",
"Color",
"color",
",",
"float",
"width",
")",
"{",
"LineSymbolizer",
"lineSymbolizer",
"=",
"StyleUtilities",
".",
"sf",
".",
"createLineSymbolizer",
"(",
")",
";",
"lineSymbolizer",
".",
"setStroke",
"(",
... | Creates a simple {@link Rule} for a line.
@param color
the color.
@param width
the line width.
@return the rule. | [
"Creates",
"a",
"simple",
"{",
"@link",
"Rule",
"}",
"for",
"a",
"line",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/SimpleStyleUtilities.java#L74-L84 |
buschmais/jqa-javaee6-plugin | src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/WebXmlScannerPlugin.java | WebXmlScannerPlugin.createSessionConfig | private SessionConfigDescriptor createSessionConfig(SessionConfigType sessionConfigType, Store store) {
"""
Create a session config descriptor.
@param sessionConfigType
The XML session config type.
@param store
The store.
@return The session config descriptor.
"""
SessionConfigDescriptor session... | java | private SessionConfigDescriptor createSessionConfig(SessionConfigType sessionConfigType, Store store) {
SessionConfigDescriptor sessionConfigDescriptor = store.create(SessionConfigDescriptor.class);
XsdIntegerType sessionTimeout = sessionConfigType.getSessionTimeout();
if (sessionTimeout != null... | [
"private",
"SessionConfigDescriptor",
"createSessionConfig",
"(",
"SessionConfigType",
"sessionConfigType",
",",
"Store",
"store",
")",
"{",
"SessionConfigDescriptor",
"sessionConfigDescriptor",
"=",
"store",
".",
"create",
"(",
"SessionConfigDescriptor",
".",
"class",
")",... | Create a session config descriptor.
@param sessionConfigType
The XML session config type.
@param store
The store.
@return The session config descriptor. | [
"Create",
"a",
"session",
"config",
"descriptor",
"."
] | train | https://github.com/buschmais/jqa-javaee6-plugin/blob/f5776604d9255206807e5aca90b8767bde494e14/src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/WebXmlScannerPlugin.java#L516-L523 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java | LayoutParser.parseElement | private LayoutElement parseElement(Element node, LayoutElement parent) {
"""
Parse a layout element node.
@param node The DOM node.
@param parent The parent layout element.
@return The newly created layout element.
"""
LayoutElement layoutElement = newLayoutElement(node, parent, null);
par... | java | private LayoutElement parseElement(Element node, LayoutElement parent) {
LayoutElement layoutElement = newLayoutElement(node, parent, null);
parseChildren(node, layoutElement, Tag.ELEMENT, Tag.TRIGGER);
return layoutElement;
} | [
"private",
"LayoutElement",
"parseElement",
"(",
"Element",
"node",
",",
"LayoutElement",
"parent",
")",
"{",
"LayoutElement",
"layoutElement",
"=",
"newLayoutElement",
"(",
"node",
",",
"parent",
",",
"null",
")",
";",
"parseChildren",
"(",
"node",
",",
"layout... | Parse a layout element node.
@param node The DOM node.
@param parent The parent layout element.
@return The newly created layout element. | [
"Parse",
"a",
"layout",
"element",
"node",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java#L273-L277 |
yoojia/NextInputs-Android | inputs/src/main/java/com/github/yoojia/inputs/NextInputs.java | NextInputs.add | public NextInputs add(Input input, Scheme... schemes) {
"""
添加输入条目及测试模式。
@param input 输入条目
@param schemes 测试模式
@return NextInputs
"""
if (schemes == null || schemes.length == 0) {
throw new IllegalArgumentException("Test schemes is required !");
}
Arrays.sort(schemes,... | java | public NextInputs add(Input input, Scheme... schemes) {
if (schemes == null || schemes.length == 0) {
throw new IllegalArgumentException("Test schemes is required !");
}
Arrays.sort(schemes, ORDERING);
mInputSpecs.add(new InputSpec(input, schemes));
return this;
} | [
"public",
"NextInputs",
"add",
"(",
"Input",
"input",
",",
"Scheme",
"...",
"schemes",
")",
"{",
"if",
"(",
"schemes",
"==",
"null",
"||",
"schemes",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Test schemes is requ... | 添加输入条目及测试模式。
@param input 输入条目
@param schemes 测试模式
@return NextInputs | [
"添加输入条目及测试模式。"
] | train | https://github.com/yoojia/NextInputs-Android/blob/9ca90cf47e84c41ac226d04694194334d2923252/inputs/src/main/java/com/github/yoojia/inputs/NextInputs.java#L74-L81 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java | RouteTablesInner.getByResourceGroup | public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) {
"""
Gets the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param expand Expands referenced resources.
@throws Illeg... | java | public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().body();
} | [
"public",
"RouteTableInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeTableName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"routeTableName",
",",
"expand",... | Gets the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by s... | [
"Gets",
"the",
"specified",
"route",
"table",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java#L356-L358 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java | SoyExpression.coerceToDouble | public SoyExpression coerceToDouble() {
"""
Coerce this expression to a double value. Useful for float-int comparisons.
"""
if (!isBoxed()) {
if (soyRuntimeType.isKnownFloat()) {
return this;
}
if (soyRuntimeType.isKnownInt()) {
return forFloat(BytecodeUtils.numericConvers... | java | public SoyExpression coerceToDouble() {
if (!isBoxed()) {
if (soyRuntimeType.isKnownFloat()) {
return this;
}
if (soyRuntimeType.isKnownInt()) {
return forFloat(BytecodeUtils.numericConversion(delegate, Type.DOUBLE_TYPE));
}
throw new UnsupportedOperationException("Can'... | [
"public",
"SoyExpression",
"coerceToDouble",
"(",
")",
"{",
"if",
"(",
"!",
"isBoxed",
"(",
")",
")",
"{",
"if",
"(",
"soyRuntimeType",
".",
"isKnownFloat",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"soyRuntimeType",
".",
"isKnownInt",
... | Coerce this expression to a double value. Useful for float-int comparisons. | [
"Coerce",
"this",
"expression",
"to",
"a",
"double",
"value",
".",
"Useful",
"for",
"float",
"-",
"int",
"comparisons",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L408-L422 |
marvinlabs/android-floatinglabel-widgets | library/src/main/java/com/marvinlabs/widget/floatinglabel/instantpicker/DatePickerFragment.java | DatePickerFragment.newInstance | public static <DateInstantT extends DateInstant> DatePickerFragment newInstance(int pickerId, DateInstantT selectedInstant) {
"""
Create a new date picker
@param pickerId The id of the item picker
@param selectedInstant The positions of the items already selected
@return The arguments bundle
"""
... | java | public static <DateInstantT extends DateInstant> DatePickerFragment newInstance(int pickerId, DateInstantT selectedInstant) {
DatePickerFragment f = new DatePickerFragment();
Bundle args = new Bundle();
args.putInt(ARG_PICKER_ID, pickerId);
args.putParcelable(ARG_SELECTED_INSTANT, selec... | [
"public",
"static",
"<",
"DateInstantT",
"extends",
"DateInstant",
">",
"DatePickerFragment",
"newInstance",
"(",
"int",
"pickerId",
",",
"DateInstantT",
"selectedInstant",
")",
"{",
"DatePickerFragment",
"f",
"=",
"new",
"DatePickerFragment",
"(",
")",
";",
"Bundle... | Create a new date picker
@param pickerId The id of the item picker
@param selectedInstant The positions of the items already selected
@return The arguments bundle | [
"Create",
"a",
"new",
"date",
"picker"
] | train | https://github.com/marvinlabs/android-floatinglabel-widgets/blob/bb89889f1e75ed9b228b77d3ba895ceeeb41fe4f/library/src/main/java/com/marvinlabs/widget/floatinglabel/instantpicker/DatePickerFragment.java#L30-L39 |
haifengl/smile | graph/src/main/java/smile/graph/AdjacencyMatrix.java | AdjacencyMatrix.dfs | private void dfs(int v, int[] cc, int id) {
"""
Depth-first search connected components of graph.
@param v the start vertex.
@param cc the array to store the connected component id of vertices.
@param id the current component id.
"""
cc[v] = id;
for (int t = 0; t < n; t++) {
if (... | java | private void dfs(int v, int[] cc, int id) {
cc[v] = id;
for (int t = 0; t < n; t++) {
if (graph[v][t] != 0.0) {
if (cc[t] == -1) {
dfs(t, cc, id);
}
}
}
} | [
"private",
"void",
"dfs",
"(",
"int",
"v",
",",
"int",
"[",
"]",
"cc",
",",
"int",
"id",
")",
"{",
"cc",
"[",
"v",
"]",
"=",
"id",
";",
"for",
"(",
"int",
"t",
"=",
"0",
";",
"t",
"<",
"n",
";",
"t",
"++",
")",
"{",
"if",
"(",
"graph",
... | Depth-first search connected components of graph.
@param v the start vertex.
@param cc the array to store the connected component id of vertices.
@param id the current component id. | [
"Depth",
"-",
"first",
"search",
"connected",
"components",
"of",
"graph",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/graph/src/main/java/smile/graph/AdjacencyMatrix.java#L296-L305 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.listWorkspaceFolderItems | public WorkspaceFolderContents listWorkspaceFolderItems(String accountId, String workspaceId, String folderId) throws ApiException {
"""
List Workspace Folder Contents
Retrieves workspace folder contents, which can include sub folders and files.
@param accountId The external account number (int) or account ID Gu... | java | public WorkspaceFolderContents listWorkspaceFolderItems(String accountId, String workspaceId, String folderId) throws ApiException {
return listWorkspaceFolderItems(accountId, workspaceId, folderId, null);
} | [
"public",
"WorkspaceFolderContents",
"listWorkspaceFolderItems",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
")",
"throws",
"ApiException",
"{",
"return",
"listWorkspaceFolderItems",
"(",
"accountId",
",",
"workspaceId",
",",
"fo... | List Workspace Folder Contents
Retrieves workspace folder contents, which can include sub folders and files.
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@r... | [
"List",
"Workspace",
"Folder",
"Contents",
"Retrieves",
"workspace",
"folder",
"contents",
"which",
"can",
"include",
"sub",
"folders",
"and",
"files",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L643-L645 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java | MutateRowsAttemptCallable.handleAttemptError | private void handleAttemptError(Throwable rpcError) {
"""
Handle an RPC level failure by generating a {@link FailedMutation} for each expected entry. The
newly generated {@link FailedMutation}s will be combined with the permanentFailures to give the
caller the whole picture since the first call. This method will... | java | private void handleAttemptError(Throwable rpcError) {
ApiException entryError = createSyntheticErrorForRpcFailure(rpcError);
ImmutableList.Builder<FailedMutation> allFailures = ImmutableList.builder();
MutateRowsRequest lastRequest = currentRequest;
allFailures.addAll(permanentFailures);
Builder b... | [
"private",
"void",
"handleAttemptError",
"(",
"Throwable",
"rpcError",
")",
"{",
"ApiException",
"entryError",
"=",
"createSyntheticErrorForRpcFailure",
"(",
"rpcError",
")",
";",
"ImmutableList",
".",
"Builder",
"<",
"FailedMutation",
">",
"allFailures",
"=",
"Immuta... | Handle an RPC level failure by generating a {@link FailedMutation} for each expected entry. The
newly generated {@link FailedMutation}s will be combined with the permanentFailures to give the
caller the whole picture since the first call. This method will always throw a {@link
MutateRowsException}. | [
"Handle",
"an",
"RPC",
"level",
"failure",
"by",
"generating",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java#L215-L245 |
google/closure-compiler | src/com/google/javascript/jscomp/AstFactory.java | AstFactory.createFunction | Node createFunction(String name, Node paramList, Node body, JSType type) {
"""
Creates a function `function name(paramList) { body }`
@param name STRING node - empty string if no name
@param paramList PARAM_LIST node
@param body BLOCK node
@param type type to apply to the function itself
"""
Node nam... | java | Node createFunction(String name, Node paramList, Node body, JSType type) {
Node nameNode = createName(name, type);
Node result = IR.function(nameNode, paramList, body);
if (isAddingTypes()) {
checkArgument(type.isFunctionType(), type);
result.setJSType(type);
}
return result;
} | [
"Node",
"createFunction",
"(",
"String",
"name",
",",
"Node",
"paramList",
",",
"Node",
"body",
",",
"JSType",
"type",
")",
"{",
"Node",
"nameNode",
"=",
"createName",
"(",
"name",
",",
"type",
")",
";",
"Node",
"result",
"=",
"IR",
".",
"function",
"(... | Creates a function `function name(paramList) { body }`
@param name STRING node - empty string if no name
@param paramList PARAM_LIST node
@param body BLOCK node
@param type type to apply to the function itself | [
"Creates",
"a",
"function",
"function",
"name",
"(",
"paramList",
")",
"{",
"body",
"}"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L712-L720 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.countByC_C_T | @Override
public int countByC_C_T(long CPDefinitionId, long CProductId, String type) {
"""
Returns the number of cp definition links where CPDefinitionId = ? and CProductId = ? and type = ?.
@param CPDefinitionId the cp definition ID
@param CProductId the c product ID
@param type the type
@retur... | java | @Override
public int countByC_C_T(long CPDefinitionId, long CProductId, String type) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C_T;
Object[] finderArgs = new Object[] { CPDefinitionId, CProductId, type };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
... | [
"@",
"Override",
"public",
"int",
"countByC_C_T",
"(",
"long",
"CPDefinitionId",
",",
"long",
"CProductId",
",",
"String",
"type",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_C_C_T",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object... | Returns the number of cp definition links where CPDefinitionId = ? and CProductId = ? and type = ?.
@param CPDefinitionId the cp definition ID
@param CProductId the c product ID
@param type the type
@return the number of matching cp definition links | [
"Returns",
"the",
"number",
"of",
"cp",
"definition",
"links",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"CProductId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3898-L3963 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optByte | public static byte optByte(@Nullable Bundle bundle, @Nullable String key, byte fallback) {
"""
Returns a optional byte value. In other words, returns the value mapped by key if it exists and is a byte.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
... | java | public static byte optByte(@Nullable Bundle bundle, @Nullable String key, byte fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getByte(key, fallback);
} | [
"public",
"static",
"byte",
"optByte",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"byte",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"fallback",
";",
"}",
"return",
"bundle",
... | Returns a optional byte value. In other words, returns the value mapped by key if it exists and is a byte.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
@param bundle a bundle. If the bundle is null, this method will return a fallback value.
@param key a... | [
"Returns",
"a",
"optional",
"byte",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"byte",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L226-L231 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java | Buckets.initializeState | void initializeState(final ListState<byte[]> bucketStates, final ListState<Long> partCounterState) throws Exception {
"""
Initializes the state after recovery from a failure.
<p>During this process:
<ol>
<li>we set the initial value for part counter to the maximum value used before across all tasks and bucket... | java | void initializeState(final ListState<byte[]> bucketStates, final ListState<Long> partCounterState) throws Exception {
initializePartCounter(partCounterState);
LOG.info("Subtask {} initializing its state (max part counter={}).", subtaskIndex, maxPartCounter);
initializeActiveBuckets(bucketStates);
} | [
"void",
"initializeState",
"(",
"final",
"ListState",
"<",
"byte",
"[",
"]",
">",
"bucketStates",
",",
"final",
"ListState",
"<",
"Long",
">",
"partCounterState",
")",
"throws",
"Exception",
"{",
"initializePartCounter",
"(",
"partCounterState",
")",
";",
"LOG",... | Initializes the state after recovery from a failure.
<p>During this process:
<ol>
<li>we set the initial value for part counter to the maximum value used before across all tasks and buckets.
This guarantees that we do not overwrite valid data,</li>
<li>we commit any pending files for previous checkpoints (previous to ... | [
"Initializes",
"the",
"state",
"after",
"recovery",
"from",
"a",
"failure",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java#L143-L150 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.minByLong | public OptionalDouble minByLong(DoubleToLongFunction keyExtractor) {
"""
Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalDouble} describing the... | java | public OptionalDouble minByLong(DoubleToLongFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, d) -> {
long key = keyExtractor.applyAsLong(d);
if (!box.b || box.l > key) {
box.b = true;
box.l = key;
box.d = d;
... | [
"public",
"OptionalDouble",
"minByLong",
"(",
"DoubleToLongFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"d",
")",
"->",
"{",
"long",
"key",
"=",
"keyExtractor",
".",
"applyAsLong",
"(",
"d"... | Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalDouble} describing the first element of this
stream for which the lowest value was returned by key extracto... | [
"Returns",
"the",
"minimum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L925-L934 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/StringUtilities.java | StringUtilities.similarDamerauLevenshtein | public static double similarDamerauLevenshtein(String s1, String s2) {
"""
Checks to see how similar two strings are using the Damerau-Levenshtein distance algorithm.
@param s1 The first string to compare against.
@param s2 The second string to compare against.
@return A value between 0 and 1.0, where 1.0 is ... | java | public static double similarDamerauLevenshtein(String s1, String s2) {
if (s1.equals(s2)) {
return 1.0;
}
// Make sure s1 is the longest string
if (s1.length() < s2.length()) {
String swap = s1;
s1 = s2;
s2 = swap;
}
int b... | [
"public",
"static",
"double",
"similarDamerauLevenshtein",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
".",
"equals",
"(",
"s2",
")",
")",
"{",
"return",
"1.0",
";",
"}",
"// Make sure s1 is the longest string",
"if",
"(",
"s1",
".... | Checks to see how similar two strings are using the Damerau-Levenshtein distance algorithm.
@param s1 The first string to compare against.
@param s2 The second string to compare against.
@return A value between 0 and 1.0, where 1.0 is an exact match and 0 is no match at all. | [
"Checks",
"to",
"see",
"how",
"similar",
"two",
"strings",
"are",
"using",
"the",
"Damerau",
"-",
"Levenshtein",
"distance",
"algorithm",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/StringUtilities.java#L388-L402 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java | TemperatureConversion.convertFromKelvin | public static double convertFromKelvin(TemperatureScale to, double temperature) {
"""
Convert a temperature value from the Kelvin temperature scale to another.
@param to TemperatureScale
@param temperature value in Kelvin
@return converted temperature value in the requested to scale
"""
switch(to... | java | public static double convertFromKelvin(TemperatureScale to, double temperature) {
switch(to) {
case FARENHEIT:
return convertKelvinToFarenheit(temperature);
case CELSIUS:
return convertKelvinToCelsius(temperature);
case KELVIN:
... | [
"public",
"static",
"double",
"convertFromKelvin",
"(",
"TemperatureScale",
"to",
",",
"double",
"temperature",
")",
"{",
"switch",
"(",
"to",
")",
"{",
"case",
"FARENHEIT",
":",
"return",
"convertKelvinToFarenheit",
"(",
"temperature",
")",
";",
"case",
"CELSIU... | Convert a temperature value from the Kelvin temperature scale to another.
@param to TemperatureScale
@param temperature value in Kelvin
@return converted temperature value in the requested to scale | [
"Convert",
"a",
"temperature",
"value",
"from",
"the",
"Kelvin",
"temperature",
"scale",
"to",
"another",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java#L169-L184 |
structurizr/java | structurizr-analysis/src/com/structurizr/analysis/TypeUtils.java | TypeUtils.getCategory | public static TypeCategory getCategory(TypeRepository typeRepository, String typeName) {
"""
Finds the category of a given type.
@param typeRepository the repository where types should be loaded from
@param typeName the fully qualified type name
@return a TypeCategory object representing t... | java | public static TypeCategory getCategory(TypeRepository typeRepository, String typeName) {
try {
Class<?> type = typeRepository.loadClass(typeName);
if (type.isInterface()) {
return TypeCategory.INTERFACE;
} else if (type.isEnum()) {
return TypeC... | [
"public",
"static",
"TypeCategory",
"getCategory",
"(",
"TypeRepository",
"typeRepository",
",",
"String",
"typeName",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"typeRepository",
".",
"loadClass",
"(",
"typeName",
")",
";",
"if",
"(",
"type"... | Finds the category of a given type.
@param typeRepository the repository where types should be loaded from
@param typeName the fully qualified type name
@return a TypeCategory object representing the category (e.g. class, interface, enum, etc) | [
"Finds",
"the",
"category",
"of",
"a",
"given",
"type",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-analysis/src/com/structurizr/analysis/TypeUtils.java#L51-L69 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_conference_serviceName_webAccess_POST | public OvhConferenceWebAccess billingAccount_conference_serviceName_webAccess_POST(String billingAccount, String serviceName, OvhConferenceWebAccessTypeEnum type) throws IOException {
"""
Add a public web access to your conference
REST: POST /telephony/{billingAccount}/conference/{serviceName}/webAccess
@param... | java | public OvhConferenceWebAccess billingAccount_conference_serviceName_webAccess_POST(String billingAccount, String serviceName, OvhConferenceWebAccessTypeEnum type) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/webAccess";
StringBuilder sb = path(qPath, billingAccount, serv... | [
"public",
"OvhConferenceWebAccess",
"billingAccount_conference_serviceName_webAccess_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhConferenceWebAccessTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{bi... | Add a public web access to your conference
REST: POST /telephony/{billingAccount}/conference/{serviceName}/webAccess
@param type [required] The type of the conference web access : read or write
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Add",
"a",
"public",
"web",
"access",
"to",
"your",
"conference"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4807-L4814 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java | WebAppSecurityCollaboratorImpl.handleException | @Override
public void handleException(HttpServletRequest req, HttpServletResponse rsp, Throwable wse) throws ServletException, IOException, ClassCastException {
"""
Handle exceptions raised from <code>preInvoke</code> while
performing a servlet dispatch.
"""
WebReply reply = ((WebSecurityCollabora... | java | @Override
public void handleException(HttpServletRequest req, HttpServletResponse rsp, Throwable wse) throws ServletException, IOException, ClassCastException {
WebReply reply = ((WebSecurityCollaboratorException) (wse)).getWebReply();
int sc = reply.getStatusCode();
// Throw an exception i... | [
"@",
"Override",
"public",
"void",
"handleException",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
",",
"Throwable",
"wse",
")",
"throws",
"ServletException",
",",
"IOException",
",",
"ClassCastException",
"{",
"WebReply",
"reply",
"=",
"(",
... | Handle exceptions raised from <code>preInvoke</code> while
performing a servlet dispatch. | [
"Handle",
"exceptions",
"raised",
"from",
"<code",
">",
"preInvoke<",
"/",
"code",
">",
"while",
"performing",
"a",
"servlet",
"dispatch",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java#L437-L459 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.notNullOrEmpty | public static void notNullOrEmpty(Object[] parameter, String name) throws IllegalArgumentException {
"""
Test if array parameter is not null or empty.
@param parameter invocation array parameter,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> array is ... | java | public static void notNullOrEmpty(Object[] parameter, String name) throws IllegalArgumentException {
if (parameter == null || parameter.length == 0) {
throw new IllegalArgumentException(name + " parameter is empty.");
}
} | [
"public",
"static",
"void",
"notNullOrEmpty",
"(",
"Object",
"[",
"]",
"parameter",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"==",
"null",
"||",
"parameter",
".",
"length",
"==",
"0",
")",
"{",
"throw",
... | Test if array parameter is not null or empty.
@param parameter invocation array parameter,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> array is null or empty. | [
"Test",
"if",
"array",
"parameter",
"is",
"not",
"null",
"or",
"empty",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L120-L124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.