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 |
|---|---|---|---|---|---|---|---|---|---|---|
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MlCodeGen.java | MlCodeGen.writeClassBody | @Override
public void writeClassBody(Definition def, Writer out) throws IOException {
"""
Output class
@param def definition
@param out Writer
@throws IOException ioException
"""
int indent = 1;
out.write("public interface " + getClassName(def));
writeLeftCurlyBracket(out, 0);
w... | java | @Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
int indent = 1;
out.write("public interface " + getClassName(def));
writeLeftCurlyBracket(out, 0);
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Receive message\n");
... | [
"@",
"Override",
"public",
"void",
"writeClassBody",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"int",
"indent",
"=",
"1",
";",
"out",
".",
"write",
"(",
"\"public interface \"",
"+",
"getClassName",
"(",
"def",
")",
... | Output class
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MlCodeGen.java#L44-L58 |
networknt/light-4j | client/src/main/java/com/networknt/client/ssl/APINameChecker.java | APINameChecker.verifyAndThrow | public static void verifyAndThrow(final Set<String> nameSet, final X509Certificate cert) throws CertificateException {
"""
Perform server identify check using given names and throw CertificateException if the check fails.
@param nameSet - a set of names from the config file
@param cert - the server certificate... | java | public static void verifyAndThrow(final Set<String> nameSet, final X509Certificate cert) throws CertificateException{
if (!verify(nameSet, cert)) {
throw new CertificateException("No name matching " + nameSet + " found");
}
} | [
"public",
"static",
"void",
"verifyAndThrow",
"(",
"final",
"Set",
"<",
"String",
">",
"nameSet",
",",
"final",
"X509Certificate",
"cert",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"!",
"verify",
"(",
"nameSet",
",",
"cert",
")",
")",
"{",
"th... | Perform server identify check using given names and throw CertificateException if the check fails.
@param nameSet - a set of names from the config file
@param cert - the server certificate
@throws CertificateException - throws CertificateException if none of the name in the nameSet matches the names in the cert | [
"Perform",
"server",
"identify",
"check",
"using",
"given",
"names",
"and",
"throw",
"CertificateException",
"if",
"the",
"check",
"fails",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/APINameChecker.java#L41-L45 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java | ChecksumStore.putIfAbsentChecksum | public Long putIfAbsentChecksum(Block blk, Long newChecksum)
throws IOException {
"""
Save the checksum for a raided block into store and compare the old value
with new value, if different throw an exception
@param blk
@param newChecksum
@param oldChecksum
@throws IOException
"""
Long oldChecksu... | java | public Long putIfAbsentChecksum(Block blk, Long newChecksum)
throws IOException {
Long oldChecksum = putIfAbsent(blk, newChecksum);
if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) {
throw new IOException("Block " + blk.toString()
+ " has different checksums " + oldChecksum + "(ol... | [
"public",
"Long",
"putIfAbsentChecksum",
"(",
"Block",
"blk",
",",
"Long",
"newChecksum",
")",
"throws",
"IOException",
"{",
"Long",
"oldChecksum",
"=",
"putIfAbsent",
"(",
"blk",
",",
"newChecksum",
")",
";",
"if",
"(",
"oldChecksum",
"!=",
"null",
"&&",
"!... | Save the checksum for a raided block into store and compare the old value
with new value, if different throw an exception
@param blk
@param newChecksum
@param oldChecksum
@throws IOException | [
"Save",
"the",
"checksum",
"for",
"a",
"raided",
"block",
"into",
"store",
"and",
"compare",
"the",
"old",
"value",
"with",
"new",
"value",
"if",
"different",
"throw",
"an",
"exception"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java#L47-L56 |
tacitknowledge/discovery | src/main/java/com/tacitknowledge/util/discovery/ClasspathUtils.java | ClasspathUtils.getClasspathComponents | public static List getClasspathComponents() {
"""
Returns the classpath as a list directory and archive names.
@return the classpath as a list of directory and archive file names; if
no components can be found then an empty list will be returned
"""
List components = new LinkedList();
// w... | java | public static List getClasspathComponents()
{
List components = new LinkedList();
// walk the classloader hierarchy, trying to get all the components we can
ClassLoader cl = Thread.currentThread().getContextClassLoader();
while ((null != cl) && (cl instanceof URLClassLoader))
... | [
"public",
"static",
"List",
"getClasspathComponents",
"(",
")",
"{",
"List",
"components",
"=",
"new",
"LinkedList",
"(",
")",
";",
"// walk the classloader hierarchy, trying to get all the components we can",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",... | Returns the classpath as a list directory and archive names.
@return the classpath as a list of directory and archive file names; if
no components can be found then an empty list will be returned | [
"Returns",
"the",
"classpath",
"as",
"a",
"list",
"directory",
"and",
"archive",
"names",
"."
] | train | https://github.com/tacitknowledge/discovery/blob/700f5492c9cb5c0146d684acb38b71fd4ef4e97a/src/main/java/com/tacitknowledge/util/discovery/ClasspathUtils.java#L108-L146 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.updateCartItemQuantityUrl | public static MozuUrl updateCartItemQuantityUrl(String cartItemId, Integer quantity, String responseFields) {
"""
Get Resource Url for UpdateCartItemQuantity
@param cartItemId Identifier of the cart item to delete.
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filt... | java | public static MozuUrl updateCartItemQuantityUrl(String cartItemId, Integer quantity, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}/{quantity}?responseFields={responseFields}");
formatter.formatUrl("cartItemId", cartItemId);
formatter.format... | [
"public",
"static",
"MozuUrl",
"updateCartItemQuantityUrl",
"(",
"String",
"cartItemId",
",",
"Integer",
"quantity",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/items/{cartItemId}/{q... | Get Resource Url for UpdateCartItemQuantity
@param cartItemId Identifier of the cart item to delete.
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parame... | [
"Get",
"Resource",
"Url",
"for",
"UpdateCartItemQuantity"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L73-L80 |
xerial/larray | larray-buffer/src/main/java/xerial/larray/buffer/LBufferAPI.java | LBufferAPI.copyTo | public void copyTo(long srcOffset, LBufferAPI dest, long destOffset, long size) {
"""
Copy the contents of this buffer to the destination LBuffer
@param srcOffset
@param dest
@param destOffset
@param size
"""
unsafe.copyMemory(address() + srcOffset, dest.address() + destOffset, size);
} | java | public void copyTo(long srcOffset, LBufferAPI dest, long destOffset, long size) {
unsafe.copyMemory(address() + srcOffset, dest.address() + destOffset, size);
} | [
"public",
"void",
"copyTo",
"(",
"long",
"srcOffset",
",",
"LBufferAPI",
"dest",
",",
"long",
"destOffset",
",",
"long",
"size",
")",
"{",
"unsafe",
".",
"copyMemory",
"(",
"address",
"(",
")",
"+",
"srcOffset",
",",
"dest",
".",
"address",
"(",
")",
"... | Copy the contents of this buffer to the destination LBuffer
@param srcOffset
@param dest
@param destOffset
@param size | [
"Copy",
"the",
"contents",
"of",
"this",
"buffer",
"to",
"the",
"destination",
"LBuffer"
] | train | https://github.com/xerial/larray/blob/9a1462623c0e56ca67c5341ea29832963c29479f/larray-buffer/src/main/java/xerial/larray/buffer/LBufferAPI.java#L255-L257 |
opencb/java-common-libs | commons-lib/src/main/java/org/opencb/commons/utils/FileUtils.java | FileUtils.newInputStream | public static InputStream newInputStream(Path path, OpenOption... options) throws IOException {
"""
This method is able to determine whether a file is GZipped and return an {@link InputStream} in any case.
@param path the path to the file to open
@param options options specifying how the file is opened
... | java | public static InputStream newInputStream(Path path, OpenOption... options) throws IOException {
FileUtils.checkFile(path);
InputStream inputStream = Files.newInputStream(path, options);
if (path.toFile().getName().endsWith(".gz")) {
inputStream = new GZIPInputStream(inputStream);
... | [
"public",
"static",
"InputStream",
"newInputStream",
"(",
"Path",
"path",
",",
"OpenOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"FileUtils",
".",
"checkFile",
"(",
"path",
")",
";",
"InputStream",
"inputStream",
"=",
"Files",
".",
"newInputStre... | This method is able to determine whether a file is GZipped and return an {@link InputStream} in any case.
@param path the path to the file to open
@param options options specifying how the file is opened
@return a new input stream
@throws IOException if an I/O error occurs | [
"This",
"method",
"is",
"able",
"to",
"determine",
"whether",
"a",
"file",
"is",
"GZipped",
"and",
"return",
"an",
"{",
"@link",
"InputStream",
"}",
"in",
"any",
"case",
"."
] | train | https://github.com/opencb/java-common-libs/blob/5c97682530d0be55828e1e4e374ff01fceb5f198/commons-lib/src/main/java/org/opencb/commons/utils/FileUtils.java#L114-L121 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java | TypeQualifierDatabase.getParameter | public TypeQualifierAnnotation getParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) {
"""
Get the TypeQualifierAnnotation on a parameter.
@param methodDesc
the method
@param param
the parameter (0 == first parameter)
@param tqv
the type qualifier
@return the type qualifier annot... | java | public TypeQualifierAnnotation getParameter(MethodDescriptor methodDesc, int param, TypeQualifierValue<?> tqv) {
//
// TODO: handling of overridden methods?
//
Map<TypeQualifierValue<?>, TypeQualifierAnnotation> map = parameterMap.get(methodDesc, param);
if (map == null) {
... | [
"public",
"TypeQualifierAnnotation",
"getParameter",
"(",
"MethodDescriptor",
"methodDesc",
",",
"int",
"param",
",",
"TypeQualifierValue",
"<",
"?",
">",
"tqv",
")",
"{",
"//",
"// TODO: handling of overridden methods?",
"//",
"Map",
"<",
"TypeQualifierValue",
"<",
"... | Get the TypeQualifierAnnotation on a parameter.
@param methodDesc
the method
@param param
the parameter (0 == first parameter)
@param tqv
the type qualifier
@return the type qualifier annotation on the method return value, or null
if no (interesting) type qualifier annotation was computed for
this method | [
"Get",
"the",
"TypeQualifierAnnotation",
"on",
"a",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierDatabase.java#L138-L147 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsAny | public static boolean containsAny (@Nullable final String sInput, @Nonnull final char [] aSearchChars) {
"""
Check if any of the passed searched characters in contained in the input
string.
@param sInput
The input string. May be <code>null</code>.
@param aSearchChars
The char array to search. May not be <co... | java | public static boolean containsAny (@Nullable final String sInput, @Nonnull final char [] aSearchChars)
{
return sInput != null && containsAny (sInput.toCharArray (), aSearchChars);
} | [
"public",
"static",
"boolean",
"containsAny",
"(",
"@",
"Nullable",
"final",
"String",
"sInput",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aSearchChars",
")",
"{",
"return",
"sInput",
"!=",
"null",
"&&",
"containsAny",
"(",
"sInput",
".",
"toCharArray... | Check if any of the passed searched characters in contained in the input
string.
@param sInput
The input string. May be <code>null</code>.
@param aSearchChars
The char array to search. May not be <code>null</code>.
@return <code>true</code> if at least any of the search char is contained in
the input char array, <code... | [
"Check",
"if",
"any",
"of",
"the",
"passed",
"searched",
"characters",
"in",
"contained",
"in",
"the",
"input",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3122-L3125 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.makeMap | public static Map makeMap(Mapper mapper, Enumeration en) {
"""
Create a new Map by using the enumeration objects as keys, and the mapping result as values. Discard keys which
return null values from the mapper.
@param mapper a Mapper to map the values
@param en Enumeration
@return a new Map with values... | java | public static Map makeMap(Mapper mapper, Enumeration en) {
return makeMap(mapper, en, false);
} | [
"public",
"static",
"Map",
"makeMap",
"(",
"Mapper",
"mapper",
",",
"Enumeration",
"en",
")",
"{",
"return",
"makeMap",
"(",
"mapper",
",",
"en",
",",
"false",
")",
";",
"}"
] | Create a new Map by using the enumeration objects as keys, and the mapping result as values. Discard keys which
return null values from the mapper.
@param mapper a Mapper to map the values
@param en Enumeration
@return a new Map with values mapped | [
"Create",
"a",
"new",
"Map",
"by",
"using",
"the",
"enumeration",
"objects",
"as",
"keys",
"and",
"the",
"mapping",
"result",
"as",
"values",
".",
"Discard",
"keys",
"which",
"return",
"null",
"values",
"from",
"the",
"mapper",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L585-L587 |
zandero/http | src/main/java/com/zandero/http/RequestUtils.java | RequestUtils.checkBasicAuth | public static boolean checkBasicAuth(HttpServletRequest servletRequest, String username, String password) {
"""
Checks if request is made by cron job
@param servletRequest must be GET request with cron job basic authorization set
@param username to check agains
@param password to check against
@r... | java | public static boolean checkBasicAuth(HttpServletRequest servletRequest, String username, String password) {
String basicAuth = servletRequest.getHeader("Authorization");
if (StringUtils.isNullOrEmptyTrimmed(basicAuth) || !basicAuth.startsWith("Basic ")) {
return false;
}
String base64Credentials = basicAut... | [
"public",
"static",
"boolean",
"checkBasicAuth",
"(",
"HttpServletRequest",
"servletRequest",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"String",
"basicAuth",
"=",
"servletRequest",
".",
"getHeader",
"(",
"\"Authorization\"",
")",
";",
"if",
... | Checks if request is made by cron job
@param servletRequest must be GET request with cron job basic authorization set
@param username to check agains
@param password to check against
@return true if cron job request, false if not | [
"Checks",
"if",
"request",
"is",
"made",
"by",
"cron",
"job"
] | train | https://github.com/zandero/http/blob/909eb879f1193adf24545360c3b76bd813865f65/src/main/java/com/zandero/http/RequestUtils.java#L162-L179 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java | MCWrapper.enlistRRSXAResource | final XAResource enlistRRSXAResource(int recoveryId, int branchCoupling) throws Exception {
"""
Enlists a RRS XA resource with the transaction manager.
@param recoveryId The recovery id representing the registration of the resource with
the transaction manager.
@param branchCoupling The resource's branch ... | java | final XAResource enlistRRSXAResource(int recoveryId, int branchCoupling) throws Exception {
RRSXAResourceFactory xaFactory = (RRSXAResourceFactory) pm.connectorSvc.rrsXAResFactorySvcRef.getService();
// Make sure that the bundle is active.
if (xaFactory == null) {
throw new IllegalS... | [
"final",
"XAResource",
"enlistRRSXAResource",
"(",
"int",
"recoveryId",
",",
"int",
"branchCoupling",
")",
"throws",
"Exception",
"{",
"RRSXAResourceFactory",
"xaFactory",
"=",
"(",
"RRSXAResourceFactory",
")",
"pm",
".",
"connectorSvc",
".",
"rrsXAResFactorySvcRef",
... | Enlists a RRS XA resource with the transaction manager.
@param recoveryId The recovery id representing the registration of the resource with
the transaction manager.
@param branchCoupling The resource's branch coupling support indicator.
@return The XA resource enlisted with the transaction manager.
@throws Exce... | [
"Enlists",
"a",
"RRS",
"XA",
"resource",
"with",
"the",
"transaction",
"manager",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java#L474-L508 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/Xml.java | Xml.toXML | public static String toXML(Object object, String encoding, boolean nodeMode) throws MarshalException {
"""
将对象生成XML文本
@param object 需要生成XML的对象
@param encoding XML文本编码, 例如UTF-8, GBK
@param nodeMode 是否采用节点模式, 如果采用节点模式将不生成XML属性
@return XML文本
@throws MarshalException 编组异常
"""
Properties properties = ... | java | public static String toXML(Object object, String encoding, boolean nodeMode) throws MarshalException {
Properties properties = new Properties();
properties.put("node", Boolean.toString(nodeMode));
properties.put("lowcase", "true");
properties.put("pretty", "true");
properties.put("cdata", "true");
properti... | [
"public",
"static",
"String",
"toXML",
"(",
"Object",
"object",
",",
"String",
"encoding",
",",
"boolean",
"nodeMode",
")",
"throws",
"MarshalException",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"put",
"(",
... | 将对象生成XML文本
@param object 需要生成XML的对象
@param encoding XML文本编码, 例如UTF-8, GBK
@param nodeMode 是否采用节点模式, 如果采用节点模式将不生成XML属性
@return XML文本
@throws MarshalException 编组异常 | [
"将对象生成XML文本"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/Xml.java#L88-L102 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java | DelegatedClientAuthenticationAction.prepareForLoginPage | protected void prepareForLoginPage(final RequestContext context) {
"""
Prepare the data for the login page.
@param context The current webflow context
"""
val currentService = WebUtils.getService(context);
val service = authenticationRequestServiceSelectionStrategies.resolveService(currentSe... | java | protected void prepareForLoginPage(final RequestContext context) {
val currentService = WebUtils.getService(context);
val service = authenticationRequestServiceSelectionStrategies.resolveService(currentService, WebApplicationService.class);
val request = WebUtils.getHttpServletRequestFromExtern... | [
"protected",
"void",
"prepareForLoginPage",
"(",
"final",
"RequestContext",
"context",
")",
"{",
"val",
"currentService",
"=",
"WebUtils",
".",
"getService",
"(",
"context",
")",
";",
"val",
"service",
"=",
"authenticationRequestServiceSelectionStrategies",
".",
"reso... | Prepare the data for the login page.
@param context The current webflow context | [
"Prepare",
"the",
"data",
"for",
"the",
"login",
"page",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java#L304-L338 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java | DateFormatSymbols.setYearNames | public void setYearNames(String[] yearNames, int context, int width) {
"""
Sets cyclic year name strings, for example: "jia-zi", "yi-chou", etc.
@param yearNames The new cyclic year name strings.
@param context The usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
@param width The na... | java | public void setYearNames(String[] yearNames, int context, int width) {
if (context == FORMAT && width == ABBREVIATED) {
shortYearNames = duplicate(yearNames);
}
} | [
"public",
"void",
"setYearNames",
"(",
"String",
"[",
"]",
"yearNames",
",",
"int",
"context",
",",
"int",
"width",
")",
"{",
"if",
"(",
"context",
"==",
"FORMAT",
"&&",
"width",
"==",
"ABBREVIATED",
")",
"{",
"shortYearNames",
"=",
"duplicate",
"(",
"ye... | Sets cyclic year name strings, for example: "jia-zi", "yi-chou", etc.
@param yearNames The new cyclic year name strings.
@param context The usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
@param width The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported). | [
"Sets",
"cyclic",
"year",
"name",
"strings",
"for",
"example",
":",
"jia",
"-",
"zi",
"yi",
"-",
"chou",
"etc",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java#L1120-L1124 |
jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java | CommandLineBuilder.withLongOption | public CommandLineBuilder withLongOption(String name, String value) {
"""
Add an option with its long name
@param name Long name of the option to add
@param value Value of the option to add
@return Builder itself
"""
cl.addOptionValue(name, value, false);
return this;
} | java | public CommandLineBuilder withLongOption(String name, String value) {
cl.addOptionValue(name, value, false);
return this;
} | [
"public",
"CommandLineBuilder",
"withLongOption",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"cl",
".",
"addOptionValue",
"(",
"name",
",",
"value",
",",
"false",
")",
";",
"return",
"this",
";",
"}"
] | Add an option with its long name
@param name Long name of the option to add
@param value Value of the option to add
@return Builder itself | [
"Add",
"an",
"option",
"with",
"its",
"long",
"name"
] | train | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java#L60-L63 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/AbstractDataAccess.java | AbstractDataAccess.writeHeader | protected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException {
"""
Writes some internal data into the beginning of the specified file.
"""
file.seek(0);
file.writeUTF("GH");
file.writeLong(length);
file.writeInt(segmentSize);
for (in... | java | protected void writeHeader(RandomAccessFile file, long length, int segmentSize) throws IOException {
file.seek(0);
file.writeUTF("GH");
file.writeLong(length);
file.writeInt(segmentSize);
for (int i = 0; i < header.length; i++) {
file.writeInt(header[i]);
}
... | [
"protected",
"void",
"writeHeader",
"(",
"RandomAccessFile",
"file",
",",
"long",
"length",
",",
"int",
"segmentSize",
")",
"throws",
"IOException",
"{",
"file",
".",
"seek",
"(",
"0",
")",
";",
"file",
".",
"writeUTF",
"(",
"\"GH\"",
")",
";",
"file",
"... | Writes some internal data into the beginning of the specified file. | [
"Writes",
"some",
"internal",
"data",
"into",
"the",
"beginning",
"of",
"the",
"specified",
"file",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/AbstractDataAccess.java#L91-L99 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.generateAttributesGroupInterface | private void generateAttributesGroupInterface(Map<String, List<XsdAttribute>> createdAttributes, String attributeGroupName, AttributeHierarchyItem attributeHierarchyItem, String apiName) {
"""
Generates an attribute group interface with all the required methods. It uses the information gathered about in
attribute... | java | private void generateAttributesGroupInterface(Map<String, List<XsdAttribute>> createdAttributes, String attributeGroupName, AttributeHierarchyItem attributeHierarchyItem, String apiName){
String baseClassNameCamelCase = firstToUpper(attributeGroupName);
String[] interfaces = getAttributeGroupObjectInter... | [
"private",
"void",
"generateAttributesGroupInterface",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"XsdAttribute",
">",
">",
"createdAttributes",
",",
"String",
"attributeGroupName",
",",
"AttributeHierarchyItem",
"attributeHierarchyItem",
",",
"String",
"apiName",
")"... | Generates an attribute group interface with all the required methods. It uses the information gathered about in
attributeGroupInterfaces.
@param createdAttributes A list with the names of the attribute classes already created.
@param attributeGroupName The interface name.
@param attributeHierarchyItem An object contain... | [
"Generates",
"an",
"attribute",
"group",
"interface",
"with",
"all",
"the",
"required",
"methods",
".",
"It",
"uses",
"the",
"information",
"gathered",
"about",
"in",
"attributeGroupInterfaces",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L150-L166 |
grails/grails-core | grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java | DataBindingUtils.bindObjectToInstance | public static BindingResult bindObjectToInstance(Object object, Object source, List include, List exclude, String filter) {
"""
Binds the given source object to the given target object performing type conversion if necessary
@param object The object to bind to
@param source The source object
@param include Th... | java | public static BindingResult bindObjectToInstance(Object object, Object source, List include, List exclude, String filter) {
if (include == null && exclude == null) {
include = getBindingIncludeList(object);
}
GrailsApplication application = Holders.findApplication();
Persiste... | [
"public",
"static",
"BindingResult",
"bindObjectToInstance",
"(",
"Object",
"object",
",",
"Object",
"source",
",",
"List",
"include",
",",
"List",
"exclude",
",",
"String",
"filter",
")",
"{",
"if",
"(",
"include",
"==",
"null",
"&&",
"exclude",
"==",
"null... | Binds the given source object to the given target object performing type conversion if necessary
@param object The object to bind to
@param source The source object
@param include The list of properties to include
@param exclude The list of properties to exclude
@param filter The prefix to filter by
@return A Binding... | [
"Binds",
"the",
"given",
"source",
"object",
"to",
"the",
"given",
"target",
"object",
"performing",
"type",
"conversion",
"if",
"necessary"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java#L199-L213 |
structurizr/java | structurizr-core/src/com/structurizr/model/Container.java | Container.addComponent | public Component addComponent(String name, Class type, String description, String technology) {
"""
Adds a component to this container.
@param name the name of the component
@param type a Class instance representing the primary type of the component
@param description a description of the ... | java | public Component addComponent(String name, Class type, String description, String technology) {
return this.addComponent(name, type.getCanonicalName(), description, technology);
} | [
"public",
"Component",
"addComponent",
"(",
"String",
"name",
",",
"Class",
"type",
",",
"String",
"description",
",",
"String",
"technology",
")",
"{",
"return",
"this",
".",
"addComponent",
"(",
"name",
",",
"type",
".",
"getCanonicalName",
"(",
")",
",",
... | Adds a component to this container.
@param name the name of the component
@param type a Class instance representing the primary type of the component
@param description a description of the component
@param technology the technology of the component
@return the resulting Component instance
@thr... | [
"Adds",
"a",
"component",
"to",
"this",
"container",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Container.java#L99-L101 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownPtoN_F32.java | AddBrownPtoN_F32.setDistortion | public AddBrownPtoN_F32 setDistortion( /**/double[] radial, /**/double t1, /**/double t2) {
"""
Specify intrinsic camera parameters
@param radial Radial distortion parameters
"""
params = new RadialTangential_F32(radial, t1, t2);
return this;
} | java | public AddBrownPtoN_F32 setDistortion( /**/double[] radial, /**/double t1, /**/double t2) {
params = new RadialTangential_F32(radial, t1, t2);
return this;
} | [
"public",
"AddBrownPtoN_F32",
"setDistortion",
"(",
"/**/",
"double",
"[",
"]",
"radial",
",",
"/**/",
"double",
"t1",
",",
"/**/",
"double",
"t2",
")",
"{",
"params",
"=",
"new",
"RadialTangential_F32",
"(",
"radial",
",",
"t1",
",",
"t2",
")",
";",
"re... | Specify intrinsic camera parameters
@param radial Radial distortion parameters | [
"Specify",
"intrinsic",
"camera",
"parameters"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownPtoN_F32.java#L67-L70 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The... | java | public Observable<ServiceResponse<UUID>> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoi... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"createEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreateEntityRoleOptionalParameter",
"createEntityRoleOptionalParameter",
")",
... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7800-L7816 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/NumberFunctions.java | NumberFunctions.atan | public static Expression atan(String expression1, String expression2) {
"""
Returned expression results in the arctangent of expression2/expression1.
"""
return atan(x(expression1), x(expression2));
} | java | public static Expression atan(String expression1, String expression2) {
return atan(x(expression1), x(expression2));
} | [
"public",
"static",
"Expression",
"atan",
"(",
"String",
"expression1",
",",
"String",
"expression2",
")",
"{",
"return",
"atan",
"(",
"x",
"(",
"expression1",
")",
",",
"x",
"(",
"expression2",
")",
")",
";",
"}"
] | Returned expression results in the arctangent of expression2/expression1. | [
"Returned",
"expression",
"results",
"in",
"the",
"arctangent",
"of",
"expression2",
"/",
"expression1",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/NumberFunctions.java#L104-L106 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/process/ProcessEngineDriver.java | ProcessEngineDriver.getPackageHandler | private Process getPackageHandler(ProcessInstance masterInstance, Integer eventType) {
"""
Finds the relevant package handler for a master process instance.
"""
Process process = getProcessDefinition(masterInstance);
Process handler = getPackageHandler(process.getPackageName(), eventType);
... | java | private Process getPackageHandler(ProcessInstance masterInstance, Integer eventType) {
Process process = getProcessDefinition(masterInstance);
Process handler = getPackageHandler(process.getPackageName(), eventType);
if (handler != null && handler.getName().equals(process.getName())) {
... | [
"private",
"Process",
"getPackageHandler",
"(",
"ProcessInstance",
"masterInstance",
",",
"Integer",
"eventType",
")",
"{",
"Process",
"process",
"=",
"getProcessDefinition",
"(",
"masterInstance",
")",
";",
"Process",
"handler",
"=",
"getPackageHandler",
"(",
"proces... | Finds the relevant package handler for a master process instance. | [
"Finds",
"the",
"relevant",
"package",
"handler",
"for",
"a",
"master",
"process",
"instance",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/process/ProcessEngineDriver.java#L233-L241 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java | ConfigUtils.emptyIfNotPresent | public static String emptyIfNotPresent(Config config, String path) {
"""
Return string value at <code>path</code> if <code>config</code> has path. If not return an empty string
@param config in which the path may be present
@param path key to look for in the config object
@return string value at <code>path</c... | java | public static String emptyIfNotPresent(Config config, String path) {
return getString(config, path, StringUtils.EMPTY);
} | [
"public",
"static",
"String",
"emptyIfNotPresent",
"(",
"Config",
"config",
",",
"String",
"path",
")",
"{",
"return",
"getString",
"(",
"config",
",",
"path",
",",
"StringUtils",
".",
"EMPTY",
")",
";",
"}"
] | Return string value at <code>path</code> if <code>config</code> has path. If not return an empty string
@param config in which the path may be present
@param path key to look for in the config object
@return string value at <code>path</code> if <code>config</code> has path. If not return an empty string | [
"Return",
"string",
"value",
"at",
"<code",
">",
"path<",
"/",
"code",
">",
"if",
"<code",
">",
"config<",
"/",
"code",
">",
"has",
"path",
".",
"If",
"not",
"return",
"an",
"empty",
"string"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L311-L313 |
google/closure-templates | java/src/com/google/template/soy/data/SoyValueConverter.java | SoyValueConverter.newDictFromMap | public SoyDict newDictFromMap(Map<String, ?> javaStringMap) {
"""
Creates a Soy dictionary from a Java string map. While this is O(n) in the map's shallow size,
the Java values are converted into Soy values lazily and only once.
"""
// Create a dictionary backed by a map which has eagerly converted each v... | java | public SoyDict newDictFromMap(Map<String, ?> javaStringMap) {
// Create a dictionary backed by a map which has eagerly converted each value into a lazy
// value provider. Specifically, the map iteration is done eagerly so that the lazy value
// provider can cache its value.
ImmutableMap.Builder<String, ... | [
"public",
"SoyDict",
"newDictFromMap",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"javaStringMap",
")",
"{",
"// Create a dictionary backed by a map which has eagerly converted each value into a lazy",
"// value provider. Specifically, the map iteration is done eagerly so that the lazy va... | Creates a Soy dictionary from a Java string map. While this is O(n) in the map's shallow size,
the Java values are converted into Soy values lazily and only once. | [
"Creates",
"a",
"Soy",
"dictionary",
"from",
"a",
"Java",
"string",
"map",
".",
"While",
"this",
"is",
"O",
"(",
"n",
")",
"in",
"the",
"map",
"s",
"shallow",
"size",
"the",
"Java",
"values",
"are",
"converted",
"into",
"Soy",
"values",
"lazily",
"and"... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SoyValueConverter.java#L350-L364 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/AppUtil.java | AppUtil.startGalleryApp | public static void startGalleryApp(@NonNull final Context context, @NonNull final File file) {
"""
Starts the gallery app in order to show a specific image. If an error occurs while starting
the gallery app, an {@link ActivityNotFoundException} will be thrown.
@param context
The context, the gallery app shoul... | java | public static void startGalleryApp(@NonNull final Context context, @NonNull final File file) {
Condition.INSTANCE.ensureNotNull(file, "The file may not be null");
Condition.INSTANCE
.ensureFileIsNoDirectory(file, "The file must exist and must not be a directory");
startGalleryApp... | [
"public",
"static",
"void",
"startGalleryApp",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"File",
"file",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"file",
",",
"\"The file may not be null\"",
")",
... | Starts the gallery app in order to show a specific image. If an error occurs while starting
the gallery app, an {@link ActivityNotFoundException} will be thrown.
@param context
The context, the gallery app should be started from, as an instance of the class
{@link Context}. The context may not be null
@param file
The ... | [
"Starts",
"the",
"gallery",
"app",
"in",
"order",
"to",
"show",
"a",
"specific",
"image",
".",
"If",
"an",
"error",
"occurs",
"while",
"starting",
"the",
"gallery",
"app",
"an",
"{",
"@link",
"ActivityNotFoundException",
"}",
"will",
"be",
"thrown",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L136-L141 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/remote/AbstractRemoteConnector.java | AbstractRemoteConnector.createOAuth | protected OAuth createOAuth(String consumerKey, String consumerSecret,
String redirectUri) {
"""
Creates an OAuth object
@param consumerKey the app's consumer key
@param consumerSecret the app's consumer secret
@param redirectUri the location users are redirected to after
they granted the app access
@retur... | java | protected OAuth createOAuth(String consumerKey, String consumerSecret,
String redirectUri) {
return new OAuth1(consumerKey, consumerSecret);
} | [
"protected",
"OAuth",
"createOAuth",
"(",
"String",
"consumerKey",
",",
"String",
"consumerSecret",
",",
"String",
"redirectUri",
")",
"{",
"return",
"new",
"OAuth1",
"(",
"consumerKey",
",",
"consumerSecret",
")",
";",
"}"
] | Creates an OAuth object
@param consumerKey the app's consumer key
@param consumerSecret the app's consumer secret
@param redirectUri the location users are redirected to after
they granted the app access
@return the created object | [
"Creates",
"an",
"OAuth",
"object"
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/remote/AbstractRemoteConnector.java#L97-L100 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getRouteFor | @Override
public Route getRouteFor(String method, String uri, Request request) {
"""
Gets the route for the given method and uri. This implementation delegates to
{@link #getRouteFor(org.wisdom.api.http.HttpMethod, String)}.
@param method the method (must be a valid HTTP method)
@param uri the uri
@... | java | @Override
public Route getRouteFor(String method, String uri, Request request) {
return getRouteFor(HttpMethod.from(method), uri, request);
} | [
"@",
"Override",
"public",
"Route",
"getRouteFor",
"(",
"String",
"method",
",",
"String",
"uri",
",",
"Request",
"request",
")",
"{",
"return",
"getRouteFor",
"(",
"HttpMethod",
".",
"from",
"(",
"method",
")",
",",
"uri",
",",
"request",
")",
";",
"}"
... | Gets the route for the given method and uri. This implementation delegates to
{@link #getRouteFor(org.wisdom.api.http.HttpMethod, String)}.
@param method the method (must be a valid HTTP method)
@param uri the uri
@param request the incoming request
@return the route, {@literal unbound} if no controller handles t... | [
"Gets",
"the",
"route",
"for",
"the",
"given",
"method",
"and",
"uri",
".",
"This",
"implementation",
"delegates",
"to",
"{",
"@link",
"#getRouteFor",
"(",
"org",
".",
"wisdom",
".",
"api",
".",
"http",
".",
"HttpMethod",
"String",
")",
"}",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L43-L46 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/Component.java | Component.getRequiredProperty | protected final Property getRequiredProperty(String name) throws ConstraintViolationException {
"""
Convenience method for retrieving a required named property.
@param name name of the property to retrieve
@return the first matching property in the property list with the specified name
@throws ConstraintViola... | java | protected final Property getRequiredProperty(String name) throws ConstraintViolationException {
Property p = getProperties().getProperty(name);
if (p == null) {
throw new ConstraintViolationException(String.format("Missing %s property", name));
}
return p;
} | [
"protected",
"final",
"Property",
"getRequiredProperty",
"(",
"String",
"name",
")",
"throws",
"ConstraintViolationException",
"{",
"Property",
"p",
"=",
"getProperties",
"(",
")",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"p",
"==",
"null",
")",
... | Convenience method for retrieving a required named property.
@param name name of the property to retrieve
@return the first matching property in the property list with the specified name
@throws ConstraintViolationException when a property is not found | [
"Convenience",
"method",
"for",
"retrieving",
"a",
"required",
"named",
"property",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/Component.java#L201-L207 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.scalarValueToString | public static String scalarValueToString(TableDefinition tableDef, String fieldName, byte[] colValue) {
"""
Convert the given binary scalar field value to string form based on its definition.
This method is the twin of
{@link #scalarValueToBinary(TableDefinition, String, String)}.
@param tableDef TableDe... | java | public static String scalarValueToString(TableDefinition tableDef, String fieldName, byte[] colValue) {
// Only binary fields are treated specially.
FieldDefinition fieldDef = tableDef.getFieldDef(fieldName);
if (fieldDef != null && fieldDef.isBinaryField()) {
return fieldDef.get... | [
"public",
"static",
"String",
"scalarValueToString",
"(",
"TableDefinition",
"tableDef",
",",
"String",
"fieldName",
",",
"byte",
"[",
"]",
"colValue",
")",
"{",
"// Only binary fields are treated specially.\r",
"FieldDefinition",
"fieldDef",
"=",
"tableDef",
".",
"getF... | Convert the given binary scalar field value to string form based on its definition.
This method is the twin of
{@link #scalarValueToBinary(TableDefinition, String, String)}.
@param tableDef TableDefinition that defines field.
@param fieldName Name of a scalar field.
@param colValue Binary column value.
@... | [
"Convert",
"the",
"given",
"binary",
"scalar",
"field",
"value",
"to",
"string",
"form",
"based",
"on",
"its",
"definition",
".",
"This",
"method",
"is",
"the",
"twin",
"of",
"{",
"@link",
"#scalarValueToBinary",
"(",
"TableDefinition",
"String",
"String",
")"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L339-L347 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Timing.java | Timing.report | public long report(String str, PrintWriter writer) {
"""
Print elapsed time (without stopping timer).
@param str Additional prefix string to be printed
@param writer PrintWriter on which to write output
@return Number of milliseconds elapsed
"""
long elapsed = this.report();
writer.println(st... | java | public long report(String str, PrintWriter writer) {
long elapsed = this.report();
writer.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
} | [
"public",
"long",
"report",
"(",
"String",
"str",
",",
"PrintWriter",
"writer",
")",
"{",
"long",
"elapsed",
"=",
"this",
".",
"report",
"(",
")",
";",
"writer",
".",
"println",
"(",
"str",
"+",
"\" Time elapsed: \"",
"+",
"(",
"elapsed",
")",
"+",
"\"... | Print elapsed time (without stopping timer).
@param str Additional prefix string to be printed
@param writer PrintWriter on which to write output
@return Number of milliseconds elapsed | [
"Print",
"elapsed",
"time",
"(",
"without",
"stopping",
"timer",
")",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Timing.java#L89-L93 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.internalCreateRequest | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
"""
Creates RPC request.
@param methodName the method name
@param arguments the arguments
@param id the optional id
@return Jackson request object
"""
final ObjectNode request = mapper.createObjectNode()... | java | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
final ObjectNode request = mapper.createObjectNode();
addId(id, request);
addProtocolAndMethod(methodName, request);
addParameters(arguments, request);
addAdditionalHeaders(request);
notifyBeforeRequestListener(reques... | [
"private",
"ObjectNode",
"internalCreateRequest",
"(",
"String",
"methodName",
",",
"Object",
"arguments",
",",
"String",
"id",
")",
"{",
"final",
"ObjectNode",
"request",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"addId",
"(",
"id",
",",
"request... | Creates RPC request.
@param methodName the method name
@param arguments the arguments
@param id the optional id
@return Jackson request object | [
"Creates",
"RPC",
"request",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L339-L347 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachLine | public static <T> T eachLine(URL url, @ClosureParams(value = FromString.class, options = {
"""
Iterates through the lines read from the URL's associated input stream passing each
line to the given 1 or 2 arg closure. The stream is closed before this method returns.
@param url a URL to open and read
@param... | java | public static <T> T eachLine(URL url, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return eachLine(url, 1, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"URL",
"url",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Closure",
"<",
"T",
">",
"clo... | Iterates through the lines read from the URL's associated input stream passing each
line to the given 1 or 2 arg closure. The stream is closed before this method returns.
@param url a URL to open and read
@param closure a closure to apply on each line (arg 1 is line, optional arg 2 is line number starting at line ... | [
"Iterates",
"through",
"the",
"lines",
"read",
"from",
"the",
"URL",
"s",
"associated",
"input",
"stream",
"passing",
"each",
"line",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"The",
"stream",
"is",
"closed",
"before",
"this",
"method",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L302-L304 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java | PredictionsImpl.predictImageWithServiceResponseAsync | public Observable<ServiceResponse<ImagePrediction>> predictImageWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) {
"""
Predict an image and saves the result.
@param projectId The project id
@param imageData the InputStream value
@param pre... | java | public Observable<ServiceResponse<ImagePrediction>> predictImageWithServiceResponseAsync(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.")... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImagePrediction",
">",
">",
"predictImageWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"byte",
"[",
"]",
"imageData",
",",
"PredictImageOptionalParameter",
"predictImageOptionalParameter",
")",
"{",
"if",
... | Predict an image and saves the result.
@param projectId The project id
@param imageData the InputStream value
@param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obse... | [
"Predict",
"an",
"image",
"and",
"saves",
"the",
"result",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java#L492-L506 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.getHOSECode | public String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres) throws CDKException {
"""
Produces a HOSE code for Atom <code>root</code> in the {@link IAtomContainer} <code>ac</code>. The HOSE
code is produced for the number of spheres given by <code>noOfSpheres</code>.
IMPORTANT: if you want aromatic... | java | public String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres) throws CDKException {
return getHOSECode(ac, root, noOfSpheres, false);
} | [
"public",
"String",
"getHOSECode",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"root",
",",
"int",
"noOfSpheres",
")",
"throws",
"CDKException",
"{",
"return",
"getHOSECode",
"(",
"ac",
",",
"root",
",",
"noOfSpheres",
",",
"false",
")",
";",
"}"
] | Produces a HOSE code for Atom <code>root</code> in the {@link IAtomContainer} <code>ac</code>. The HOSE
code is produced for the number of spheres given by <code>noOfSpheres</code>.
IMPORTANT: if you want aromaticity to be included in the code, you need
to run the IAtomContainer <code>ac</code> to the {@link org.opensc... | [
"Produces",
"a",
"HOSE",
"code",
"for",
"Atom",
"<code",
">",
"root<",
"/",
"code",
">",
"in",
"the",
"{",
"@link",
"IAtomContainer",
"}",
"<code",
">",
"ac<",
"/",
"code",
">",
".",
"The",
"HOSE",
"code",
"is",
"produced",
"for",
"the",
"number",
"o... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L217-L219 |
airlift/slice | src/main/java/io/airlift/slice/SliceUtf8.java | SliceUtf8.rightTrim | public static Slice rightTrim(Slice utf8, int[] whiteSpaceCodePoints) {
"""
Removes all white {@code whiteSpaceCodePoints} from the right side of the string.
<p>
Note: Invalid UTF-8 sequences are not trimmed.
"""
int position = lastNonMatchPosition(utf8, 0, whiteSpaceCodePoints);
return utf8.... | java | public static Slice rightTrim(Slice utf8, int[] whiteSpaceCodePoints)
{
int position = lastNonMatchPosition(utf8, 0, whiteSpaceCodePoints);
return utf8.slice(0, position);
} | [
"public",
"static",
"Slice",
"rightTrim",
"(",
"Slice",
"utf8",
",",
"int",
"[",
"]",
"whiteSpaceCodePoints",
")",
"{",
"int",
"position",
"=",
"lastNonMatchPosition",
"(",
"utf8",
",",
"0",
",",
"whiteSpaceCodePoints",
")",
";",
"return",
"utf8",
".",
"slic... | Removes all white {@code whiteSpaceCodePoints} from the right side of the string.
<p>
Note: Invalid UTF-8 sequences are not trimmed. | [
"Removes",
"all",
"white",
"{"
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/SliceUtf8.java#L461-L465 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/controller/config/XmlPojoServiceParser.java | XmlPojoServiceParser.parsePOJOServiceConfig | private void parsePOJOServiceConfig(Element pojoService, Map<String, TargetMetaDef> mps)
throws Exception {
"""
parse POJOService Config
@param pojoService Element
@param mps Map
@throws Exception
"""
String name = pojoService.getAttributeValue("name");
String className = pojoService.getAttributeV... | java | private void parsePOJOServiceConfig(Element pojoService, Map<String, TargetMetaDef> mps)
throws Exception {
String name = pojoService.getAttributeValue("name");
String className = pojoService.getAttributeValue("class");
Debug.logVerbose("[JdonFramework] pojoService/component name=" + name
+ " class=" ... | [
"private",
"void",
"parsePOJOServiceConfig",
"(",
"Element",
"pojoService",
",",
"Map",
"<",
"String",
",",
"TargetMetaDef",
">",
"mps",
")",
"throws",
"Exception",
"{",
"String",
"name",
"=",
"pojoService",
".",
"getAttributeValue",
"(",
"\"name\"",
")",
";",
... | parse POJOService Config
@param pojoService Element
@param mps Map
@throws Exception | [
"parse",
"POJOService",
"Config"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/controller/config/XmlPojoServiceParser.java#L62-L97 |
alkacon/opencms-core | src/org/opencms/main/OpenCms.java | OpenCms.setRuntimeProperty | public static void setRuntimeProperty(Object key, Object value) {
"""
This method adds an Object to the OpenCms runtime properties.
The runtime properties can be used to store Objects that are shared
in the whole system.<p>
@param key the key to add the Object with
@param value the value of the Object to add... | java | public static void setRuntimeProperty(Object key, Object value) {
OpenCmsCore.getInstance().setRuntimeProperty(key, value);
} | [
"public",
"static",
"void",
"setRuntimeProperty",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"OpenCmsCore",
".",
"getInstance",
"(",
")",
".",
"setRuntimeProperty",
"(",
"key",
",",
"value",
")",
";",
"}"
] | This method adds an Object to the OpenCms runtime properties.
The runtime properties can be used to store Objects that are shared
in the whole system.<p>
@param key the key to add the Object with
@param value the value of the Object to add | [
"This",
"method",
"adds",
"an",
"Object",
"to",
"the",
"OpenCms",
"runtime",
"properties",
".",
"The",
"runtime",
"properties",
"can",
"be",
"used",
"to",
"store",
"Objects",
"that",
"are",
"shared",
"in",
"the",
"whole",
"system",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCms.java#L786-L789 |
sagiegurari/fax4j | src/main/java/org/fax4j/FaxClientFactory.java | FaxClientFactory.createFaxClientImpl | private static FaxClient createFaxClientImpl(String type,Properties configuration) {
"""
This function creates a new fax client based on the provided configuration.
@param type
The fax client type (may be null for default type)
@param configuration
The fax client configuration (may be null)
@return The... | java | private static FaxClient createFaxClientImpl(String type,Properties configuration)
{
//create fax client SPI
FaxClientSpi faxClientSpi=FaxClientSpiFactory.createFaxClientSpi(type,configuration);
//get fax client class name
String className=faxClientSpi.getConfigurationValue(... | [
"private",
"static",
"FaxClient",
"createFaxClientImpl",
"(",
"String",
"type",
",",
"Properties",
"configuration",
")",
"{",
"//create fax client SPI",
"FaxClientSpi",
"faxClientSpi",
"=",
"FaxClientSpiFactory",
".",
"createFaxClientSpi",
"(",
"type",
",",
"configuration... | This function creates a new fax client based on the provided configuration.
@param type
The fax client type (may be null for default type)
@param configuration
The fax client configuration (may be null)
@return The fax client instance | [
"This",
"function",
"creates",
"a",
"new",
"fax",
"client",
"based",
"on",
"the",
"provided",
"configuration",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/FaxClientFactory.java#L188-L216 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java | NodeImpl.doAddNode | private NodeImpl doAddNode(NodeImpl parentNode, InternalQName name, InternalQName primaryTypeName,
NodeDefinitionData nodeDef) throws ItemExistsException, RepositoryException, ConstraintViolationException,
VersionException, LockException {
"""
Do add node internally. If nodeDef not null it is used in g... | java | private NodeImpl doAddNode(NodeImpl parentNode, InternalQName name, InternalQName primaryTypeName,
NodeDefinitionData nodeDef) throws ItemExistsException, RepositoryException, ConstraintViolationException,
VersionException, LockException
{
validateChildNode(parentNode, name, primaryTypeName, nodeDe... | [
"private",
"NodeImpl",
"doAddNode",
"(",
"NodeImpl",
"parentNode",
",",
"InternalQName",
"name",
",",
"InternalQName",
"primaryTypeName",
",",
"NodeDefinitionData",
"nodeDef",
")",
"throws",
"ItemExistsException",
",",
"RepositoryException",
",",
"ConstraintViolationExcepti... | Do add node internally. If nodeDef not null it is used in getNextChildIndex() method to
avoid double calculation. | [
"Do",
"add",
"node",
"internally",
".",
"If",
"nodeDef",
"not",
"null",
"it",
"is",
"used",
"in",
"getNextChildIndex",
"()",
"method",
"to",
"avoid",
"double",
"calculation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java#L3054-L3093 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsMemoryObjectCache.java | CmsVfsMemoryObjectCache.loadVfsObject | public Object loadVfsObject(CmsObject cms, String rootPath, Transformer function) {
"""
Uses a transformer for loading an object from a path if it has not already been cached, and then caches it.<p>
@param cms the CMS context
@param rootPath the root path from which the object should be loaded
@param function... | java | public Object loadVfsObject(CmsObject cms, String rootPath, Transformer function) {
Object result = getCachedObject(cms, rootPath);
if (result == null) {
result = function.transform(rootPath);
putCachedObject(cms, rootPath, result);
}
return result;
} | [
"public",
"Object",
"loadVfsObject",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"Transformer",
"function",
")",
"{",
"Object",
"result",
"=",
"getCachedObject",
"(",
"cms",
",",
"rootPath",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{... | Uses a transformer for loading an object from a path if it has not already been cached, and then caches it.<p>
@param cms the CMS context
@param rootPath the root path from which the object should be loaded
@param function the function which should load the object from VFS if it isn't already cached
@return the loade... | [
"Uses",
"a",
"transformer",
"for",
"loading",
"an",
"object",
"from",
"a",
"path",
"if",
"it",
"has",
"not",
"already",
"been",
"cached",
"and",
"then",
"caches",
"it",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsMemoryObjectCache.java#L105-L113 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitEndElement | @Override
public R visitEndElement(EndElementTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitEndElement(EndElementTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitEndElement",
"(",
"EndElementTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L177-L180 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java | SchedulerUtils.createTrigger | public static Trigger createTrigger(String identity, String groupName, String description, String cron) {
"""
Creates a new quartz scheduler Trigger, which can be used to
schedule a new job by passing it into {@link io.mangoo.scheduler.Scheduler#schedule(JobDetail, Trigger) schedule}
@param identity The name o... | java | public static Trigger createTrigger(String identity, String groupName, String description, String cron) {
Objects.requireNonNull(identity, Required.IDENTITY.toString());
Objects.requireNonNull(groupName, Required.GROUP_NAME.toString());
Objects.requireNonNull(cron, Required.CRON.toString());
... | [
"public",
"static",
"Trigger",
"createTrigger",
"(",
"String",
"identity",
",",
"String",
"groupName",
",",
"String",
"description",
",",
"String",
"cron",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"identity",
",",
"Required",
".",
"IDENTITY",
".",
"toS... | Creates a new quartz scheduler Trigger, which can be used to
schedule a new job by passing it into {@link io.mangoo.scheduler.Scheduler#schedule(JobDetail, Trigger) schedule}
@param identity The name of the trigger
@param groupName The trigger group name
@param description The trigger description
@param cron The cron ... | [
"Creates",
"a",
"new",
"quartz",
"scheduler",
"Trigger",
"which",
"can",
"be",
"used",
"to",
"schedule",
"a",
"new",
"job",
"by",
"passing",
"it",
"into",
"{",
"@link",
"io",
".",
"mangoo",
".",
"scheduler",
".",
"Scheduler#schedule",
"(",
"JobDetail",
"Tr... | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java#L39-L50 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java | JobmanagerInfoServlet.writeJsonForArchive | private void writeJsonForArchive(PrintWriter wrt, List<RecentJobEvent> jobs) {
"""
Writes Json with a list of currently archived jobs, sorted by time
@param wrt
@param jobs
"""
wrt.write("[");
// sort jobs by time
Collections.sort(jobs, new Comparator<RecentJobEvent>() {
@Override
public... | java | private void writeJsonForArchive(PrintWriter wrt, List<RecentJobEvent> jobs) {
wrt.write("[");
// sort jobs by time
Collections.sort(jobs, new Comparator<RecentJobEvent>() {
@Override
public int compare(RecentJobEvent o1, RecentJobEvent o2) {
if(o1.getTimestamp() < o2.getTimestamp()) {
retur... | [
"private",
"void",
"writeJsonForArchive",
"(",
"PrintWriter",
"wrt",
",",
"List",
"<",
"RecentJobEvent",
">",
"jobs",
")",
"{",
"wrt",
".",
"write",
"(",
"\"[\"",
")",
";",
"// sort jobs by time",
"Collections",
".",
"sort",
"(",
"jobs",
",",
"new",
"Compara... | Writes Json with a list of currently archived jobs, sorted by time
@param wrt
@param jobs | [
"Writes",
"Json",
"with",
"a",
"list",
"of",
"currently",
"archived",
"jobs",
"sorted",
"by",
"time"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java#L180-L217 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java | FileHelper.isFileNewer | public static boolean isFileNewer (@Nonnull final File aFile1, @Nonnull final File aFile2) {
"""
Returns <code>true</code> if the first file is newer than the second file.
Returns <code>true</code> if the first file exists and the second file does
not exist. Returns <code>false</code> if the first file is older ... | java | public static boolean isFileNewer (@Nonnull final File aFile1, @Nonnull final File aFile2)
{
ValueEnforcer.notNull (aFile1, "File1");
ValueEnforcer.notNull (aFile2, "aFile2");
// Compare with the same file?
if (aFile1.equals (aFile2))
return false;
// if the first file does not exists, alw... | [
"public",
"static",
"boolean",
"isFileNewer",
"(",
"@",
"Nonnull",
"final",
"File",
"aFile1",
",",
"@",
"Nonnull",
"final",
"File",
"aFile2",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aFile1",
",",
"\"File1\"",
")",
";",
"ValueEnforcer",
".",
"notNull... | Returns <code>true</code> if the first file is newer than the second file.
Returns <code>true</code> if the first file exists and the second file does
not exist. Returns <code>false</code> if the first file is older than the
second file. Returns <code>false</code> if the first file does not exists
but the second does. ... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"first",
"file",
"is",
"newer",
"than",
"the",
"second",
"file",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"first",
"file",
"exists",
"and",
"the",
"second",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java#L535-L554 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/grid/GridBuffer.java | GridBuffer.addElement | public void addElement(int iTargetPosition, Object bookmark, GridList gridList) {
"""
Add this record's unique info to current buffer.
@param iTargetPosition The position to add the bookmark at.
@param bookmark The bookmark to add.
@param gridList The gridlist to update with this bookmark.
"""
int i... | java | public void addElement(int iTargetPosition, Object bookmark, GridList gridList)
{
int iArrayIndex = this.bufferToArrayIndex(iTargetPosition);
if (!this.inBufferArray(iTargetPosition))
iArrayIndex = this.newBufferStartsAt(iTargetPosition, gridList); // Add code to adjust the buffer to ... | [
"public",
"void",
"addElement",
"(",
"int",
"iTargetPosition",
",",
"Object",
"bookmark",
",",
"GridList",
"gridList",
")",
"{",
"int",
"iArrayIndex",
"=",
"this",
".",
"bufferToArrayIndex",
"(",
"iTargetPosition",
")",
";",
"if",
"(",
"!",
"this",
".",
"inB... | Add this record's unique info to current buffer.
@param iTargetPosition The position to add the bookmark at.
@param bookmark The bookmark to add.
@param gridList The gridlist to update with this bookmark. | [
"Add",
"this",
"record",
"s",
"unique",
"info",
"to",
"current",
"buffer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/grid/GridBuffer.java#L63-L71 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.shutdownDomain | public static void shutdownDomain(final ModelControllerClient client, final int timeout) throws IOException, OperationExecutionException {
"""
Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.
@param client the client used to communicate with the server... | java | public static void shutdownDomain(final ModelControllerClient client, final int timeout) throws IOException, OperationExecutionException {
// Note the following two operations used to shutdown a domain don't seem to work well in a composite operation.
// The operation occasionally sees a java.util.concu... | [
"public",
"static",
"void",
"shutdownDomain",
"(",
"final",
"ModelControllerClient",
"client",
",",
"final",
"int",
"timeout",
")",
"throws",
"IOException",
",",
"OperationExecutionException",
"{",
"// Note the following two operations used to shutdown a domain don't seem to work... | Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.
@param client the client used to communicate with the server
@param timeout the graceful shutdown timeout, a value of {@code -1} will wait indefinitely and a value of
{@code 0} will not attempt a graceful shutd... | [
"Shuts",
"down",
"a",
"managed",
"domain",
"container",
".",
"The",
"servers",
"are",
"first",
"stopped",
"then",
"the",
"host",
"controller",
"is",
"shutdown",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L221-L256 |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.longitudeDiff | public static double longitudeDiff(double a, double b) {
"""
Returns the difference between two longitude values. The returned value
is always >=0.
@param a
@param b
@return
"""
a = to180(a);
b = to180(b);
return Math.abs(to180(a - b));
} | java | public static double longitudeDiff(double a, double b) {
a = to180(a);
b = to180(b);
return Math.abs(to180(a - b));
} | [
"public",
"static",
"double",
"longitudeDiff",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"a",
"=",
"to180",
"(",
"a",
")",
";",
"b",
"=",
"to180",
"(",
"b",
")",
";",
"return",
"Math",
".",
"abs",
"(",
"to180",
"(",
"a",
"-",
"b",
")",
... | Returns the difference between two longitude values. The returned value
is always >=0.
@param a
@param b
@return | [
"Returns",
"the",
"difference",
"between",
"two",
"longitude",
"values",
".",
"The",
"returned",
"value",
"is",
"always",
">",
"=",
"0",
"."
] | train | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L568-L572 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarEntry.java | TarEntry.nameTarHeader | public void nameTarHeader(TarHeader hdr, String name) {
"""
Fill in a TarHeader given only the entry's name.
@param hdr
The TarHeader to fill in.
@param name
The tar entry name.
"""
boolean isDir = name.endsWith("/");
this.gnuFormat = false;
this.ustarFormat = true;
... | java | public void nameTarHeader(TarHeader hdr, String name) {
boolean isDir = name.endsWith("/");
this.gnuFormat = false;
this.ustarFormat = true;
this.unixFormat = false;
hdr.checkSum = 0;
hdr.devMajor = 0;
hdr.devMinor = 0;
hdr.name = new StringB... | [
"public",
"void",
"nameTarHeader",
"(",
"TarHeader",
"hdr",
",",
"String",
"name",
")",
"{",
"boolean",
"isDir",
"=",
"name",
".",
"endsWith",
"(",
"\"/\"",
")",
";",
"this",
".",
"gnuFormat",
"=",
"false",
";",
"this",
".",
"ustarFormat",
"=",
"true",
... | Fill in a TarHeader given only the entry's name.
@param hdr
The TarHeader to fill in.
@param name
The tar entry name. | [
"Fill",
"in",
"a",
"TarHeader",
"given",
"only",
"the",
"entry",
"s",
"name",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarEntry.java#L822-L850 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/service/AbstractProfileService.java | AbstractProfileService.convertProfileAndPasswordToAttributes | protected Map<String, Object> convertProfileAndPasswordToAttributes(final U profile, final String password) {
"""
Convert a profile and a password into a map of attributes for the storage.
@param profile the profile
@param password the password
@return the attributes
"""
final Map<String, Object> ... | java | protected Map<String, Object> convertProfileAndPasswordToAttributes(final U profile, final String password) {
final Map<String, Object> storageAttributes = new HashMap<>();
storageAttributes.put(getIdAttribute(), profile.getId());
storageAttributes.put(LINKEDID, profile.getLinkedId());
s... | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"convertProfileAndPasswordToAttributes",
"(",
"final",
"U",
"profile",
",",
"final",
"String",
"password",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"storageAttributes",
"=",
"new",
"Has... | Convert a profile and a password into a map of attributes for the storage.
@param profile the profile
@param password the password
@return the attributes | [
"Convert",
"a",
"profile",
"and",
"a",
"password",
"into",
"a",
"map",
"of",
"attributes",
"for",
"the",
"storage",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/service/AbstractProfileService.java#L122-L148 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsShowResourceTable.java | CmsShowResourceTable.getPrincipal | private CmsPrincipal getPrincipal(CmsObject cms, DialogType type, CmsUUID id) throws CmsException {
"""
Get principal from id.<p>
@param cms CmsObject
@param type user or group
@param id id of principal
@return Principal
@throws CmsException exception
"""
if (type.equals(DialogType.Group)) {
... | java | private CmsPrincipal getPrincipal(CmsObject cms, DialogType type, CmsUUID id) throws CmsException {
if (type.equals(DialogType.Group)) {
return cms.readGroup(id);
}
if (type.equals(DialogType.User)) {
return cms.readUser(id);
}
return null;
} | [
"private",
"CmsPrincipal",
"getPrincipal",
"(",
"CmsObject",
"cms",
",",
"DialogType",
"type",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"DialogType",
".",
"Group",
")",
")",
"{",
"return",
"cms",
".",... | Get principal from id.<p>
@param cms CmsObject
@param type user or group
@param id id of principal
@return Principal
@throws CmsException exception | [
"Get",
"principal",
"from",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsShowResourceTable.java#L299-L308 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java | PJsonObject.optJSONObject | public final PJsonObject optJSONObject(final String key) {
"""
Get a property as a json object or null.
@param key the property name
"""
final JSONObject val = this.obj.optJSONObject(key);
return val != null ? new PJsonObject(this, val, key) : null;
} | java | public final PJsonObject optJSONObject(final String key) {
final JSONObject val = this.obj.optJSONObject(key);
return val != null ? new PJsonObject(this, val, key) : null;
} | [
"public",
"final",
"PJsonObject",
"optJSONObject",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"JSONObject",
"val",
"=",
"this",
".",
"obj",
".",
"optJSONObject",
"(",
"key",
")",
";",
"return",
"val",
"!=",
"null",
"?",
"new",
"PJsonObject",
"(",
... | Get a property as a json object or null.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"json",
"object",
"or",
"null",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java#L145-L148 |
kohsuke/jcifs | src/jcifs/smb/SmbFile.java | SmbFile.renameTo | public void renameTo( SmbFile dest ) throws SmbException {
"""
Changes the name of the file this <code>SmbFile</code> represents to the name
designated by the <code>SmbFile</code> argument.
<p/>
<i>Remember: <code>SmbFile</code>s are immutible and therefore
the path associated with this <code>SmbFile</code> ob... | java | public void renameTo( SmbFile dest ) throws SmbException {
if( getUncPath0().length() == 1 || dest.getUncPath0().length() == 1 ) {
throw new SmbException( "Invalid operation for workgroups, servers, or shares" );
}
resolveDfs(null);
dest.resolveDfs(null);
if... | [
"public",
"void",
"renameTo",
"(",
"SmbFile",
"dest",
")",
"throws",
"SmbException",
"{",
"if",
"(",
"getUncPath0",
"(",
")",
".",
"length",
"(",
")",
"==",
"1",
"||",
"dest",
".",
"getUncPath0",
"(",
")",
".",
"length",
"(",
")",
"==",
"1",
")",
"... | Changes the name of the file this <code>SmbFile</code> represents to the name
designated by the <code>SmbFile</code> argument.
<p/>
<i>Remember: <code>SmbFile</code>s are immutible and therefore
the path associated with this <code>SmbFile</code> object will not
change). To access the renamed file it is necessary to con... | [
"Changes",
"the",
"name",
"of",
"the",
"file",
"this",
"<code",
">",
"SmbFile<",
"/",
"code",
">",
"represents",
"to",
"the",
"name",
"designated",
"by",
"the",
"<code",
">",
"SmbFile<",
"/",
"code",
">",
"argument",
".",
"<p",
"/",
">",
"<i",
">",
"... | train | https://github.com/kohsuke/jcifs/blob/7751f4e4826c35614d237a70c2582553f95b58de/src/jcifs/smb/SmbFile.java#L2057-L2080 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java | ApplicationsInner.beginCreateAsync | public Observable<ApplicationInner> beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) {
"""
Creates applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@pa... | java | public Observable<ApplicationInner> beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1<ServiceResponse<ApplicationInner>, Appli... | [
"public",
"Observable",
"<",
"ApplicationInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"applicationName",
",",
"ApplicationInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
... | Creates applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param applicationName The constant value for the application name.
@param parameters The application create request.
@throws IllegalArgumentException thrown if parameter... | [
"Creates",
"applications",
"for",
"the",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java#L435-L442 |
fcrepo3/fcrepo | fcrepo-webapp/fcrepo-webapp-fop/src/main/java/org/fcrepo/localservices/fop/FOPServlet.java | FOPServlet.renderFO | protected void renderFO(String fo, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
"""
Renders an XSL-FO file into a PDF file. The PDF is written to a byte
array that is returned as the method's result.
@param fo the XSL-FO file
@param response HTTP respons... | java | protected void renderFO(String fo, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
//Setup source
Source foSrc = convertString2Source(fo);
//Setup the identity transformation
Transformer transformer = this.transFactory.newTransform... | [
"protected",
"void",
"renderFO",
"(",
"String",
"fo",
",",
"HttpServletResponse",
"response",
")",
"throws",
"FOPException",
",",
"TransformerException",
",",
"IOException",
"{",
"//Setup source",
"Source",
"foSrc",
"=",
"convertString2Source",
"(",
"fo",
")",
";",
... | Renders an XSL-FO file into a PDF file. The PDF is written to a byte
array that is returned as the method's result.
@param fo the XSL-FO file
@param response HTTP response object
@throws FOPException If an error occurs during the rendering of the
XSL-FO
@throws TransformerException If an error occurs while parsing the ... | [
"Renders",
"an",
"XSL",
"-",
"FO",
"file",
"into",
"a",
"PDF",
"file",
".",
"The",
"PDF",
"is",
"written",
"to",
"a",
"byte",
"array",
"that",
"is",
"returned",
"as",
"the",
"method",
"s",
"result",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-webapp/fcrepo-webapp-fop/src/main/java/org/fcrepo/localservices/fop/FOPServlet.java#L139-L151 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createConsumer | protected void createConsumer(ConsumerConnectionContext context, String messageSelector) throws JMSException {
"""
Creates a message consumer using the context's session and destination.
@param context the context where the new consumer is stored
@param messageSelector the message selector expression that the ... | java | protected void createConsumer(ConsumerConnectionContext context, String messageSelector) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Session session = context.getSession();
if (session == null) {
throw new... | [
"protected",
"void",
"createConsumer",
"(",
"ConsumerConnectionContext",
"context",
",",
"String",
"messageSelector",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The context is null... | Creates a message consumer using the context's session and destination.
@param context the context where the new consumer is stored
@param messageSelector the message selector expression that the consumer will use to filter messages
@throws JMSException any error
@throws IllegalStateException if the context is null or... | [
"Creates",
"a",
"message",
"consumer",
"using",
"the",
"context",
"s",
"session",
"and",
"destination",
"."
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L381-L395 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.isSameScriptEngine | public static boolean isSameScriptEngine(String name, String engineName, String engineLanguage) {
"""
Tells whether or not the given {@code name} matches the given {@code engineName} and {@code engineLanguage}.
@param name the name that will be checked against the given {@code engineName} and {@code engineLangu... | java | public static boolean isSameScriptEngine(String name, String engineName, String engineLanguage) {
if (name == null) {
return false;
}
// In the configs we just use the engine name, in the UI we use the language name as well
if (name.indexOf(LANG_ENGINE_SEP) > 0) {
if (name.equals(engineLanguage + ... | [
"public",
"static",
"boolean",
"isSameScriptEngine",
"(",
"String",
"name",
",",
"String",
"engineName",
",",
"String",
"engineLanguage",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// In the configs we just use the engine na... | Tells whether or not the given {@code name} matches the given {@code engineName} and {@code engineLanguage}.
@param name the name that will be checked against the given {@code engineName} and {@code engineLanguage}.
@param engineName the name of the script engine.
@param engineLanguage the language of the script engin... | [
"Tells",
"whether",
"or",
"not",
"the",
"given",
"{",
"@code",
"name",
"}",
"matches",
"the",
"given",
"{",
"@code",
"engineName",
"}",
"and",
"{",
"@code",
"engineLanguage",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L365-L379 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_fax_serviceName_campaigns_id_GET | public OvhFaxCampaign billingAccount_fax_serviceName_campaigns_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/fax/{serviceName}/campaigns/{id}
@param billingAccount [required] The name of your billingAccount
... | java | public OvhFaxCampaign billingAccount_fax_serviceName_campaigns_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/campaigns/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
String resp = exec(qPath, "... | [
"public",
"OvhFaxCampaign",
"billingAccount_fax_serviceName_campaigns_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/fax/{serviceName}/campaigns... | Get this object properties
REST: GET /telephony/{billingAccount}/fax/{serviceName}/campaigns/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4292-L4297 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.feedForwardWithKeySingle | public <K> JavaPairRDD<K, INDArray> feedForwardWithKeySingle(JavaPairRDD<K, INDArray> featuresData, int batchSize) {
"""
Feed-forward the specified data, with the given keys. i.e., get the network output/predictions for the specified data
@param featuresData Features data to feed through the network
@param bat... | java | public <K> JavaPairRDD<K, INDArray> feedForwardWithKeySingle(JavaPairRDD<K, INDArray> featuresData, int batchSize) {
if (network.getNumInputArrays() != 1 || network.getNumOutputArrays() != 1) {
throw new IllegalStateException(
"Cannot use this method with computation grap... | [
"public",
"<",
"K",
">",
"JavaPairRDD",
"<",
"K",
",",
"INDArray",
">",
"feedForwardWithKeySingle",
"(",
"JavaPairRDD",
"<",
"K",
",",
"INDArray",
">",
"featuresData",
",",
"int",
"batchSize",
")",
"{",
"if",
"(",
"network",
".",
"getNumInputArrays",
"(",
... | Feed-forward the specified data, with the given keys. i.e., get the network output/predictions for the specified data
@param featuresData Features data to feed through the network
@param batchSize Batch size to use when doing feed forward operations
@param <K> Type of data for key - may be anything
@return... | [
"Feed",
"-",
"forward",
"the",
"specified",
"data",
"with",
"the",
"given",
"keys",
".",
"i",
".",
"e",
".",
"get",
"the",
"network",
"output",
"/",
"predictions",
"for",
"the",
"specified",
"data"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L514-L524 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/Workbook.java | Workbook.getWorkbook | public static Workbook getWorkbook(String filename, InputStream stream)
throws IOException {
"""
Returns an existing workbook object.
@param filename The filename of the workbook
@param stream The input stream for the workbook
@return The existing workbook object
@throws IOException if the file cannot... | java | public static Workbook getWorkbook(String filename, InputStream stream)
throws IOException
{
Workbook ret = null;
String lowerFilename = filename.toLowerCase();
if(lowerFilename.endsWith("."+CommonFiles.XLS_EXT))
{
ret = XlsWorkbook.getWorkbook(stream);
}... | [
"public",
"static",
"Workbook",
"getWorkbook",
"(",
"String",
"filename",
",",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"Workbook",
"ret",
"=",
"null",
";",
"String",
"lowerFilename",
"=",
"filename",
".",
"toLowerCase",
"(",
")",
";",
"if",... | Returns an existing workbook object.
@param filename The filename of the workbook
@param stream The input stream for the workbook
@return The existing workbook object
@throws IOException if the file cannot be read | [
"Returns",
"an",
"existing",
"workbook",
"object",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/Workbook.java#L66-L81 |
ebourgeois/common-java | src/main/java/ca/jeb/common/infra/JReflectionUtils.java | JReflectionUtils.getMethodByName | public static Method getMethodByName(Class<?> clazz, String name) {
"""
Retrieve a Method object with the provided <i>name</i> on the class, <i>clazz</i>.
@param clazz
@param name
@return Method
"""
final List<Method> methods = JReflectionUtils.getAllMethods(new ArrayList<Method>(), clazz);
for (... | java | public static Method getMethodByName(Class<?> clazz, String name)
{
final List<Method> methods = JReflectionUtils.getAllMethods(new ArrayList<Method>(), clazz);
for (Method method : methods)
{
if (method.getName().equals(name))
{
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"getMethodByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"final",
"List",
"<",
"Method",
">",
"methods",
"=",
"JReflectionUtils",
".",
"getAllMethods",
"(",
"new",
"ArrayList",
"<",
"Method",
"... | Retrieve a Method object with the provided <i>name</i> on the class, <i>clazz</i>.
@param clazz
@param name
@return Method | [
"Retrieve",
"a",
"Method",
"object",
"with",
"the",
"provided",
"<i",
">",
"name<",
"/",
"i",
">",
"on",
"the",
"class",
"<i",
">",
"clazz<",
"/",
"i",
">",
"."
] | train | https://github.com/ebourgeois/common-java/blob/8ba7e05b1228aad1ec2949b5707ac4b5e8889f92/src/main/java/ca/jeb/common/infra/JReflectionUtils.java#L193-L205 |
EdwardRaff/JSAT | JSAT/src/jsat/math/decayrates/ExponetialDecay.java | ExponetialDecay.setMaxTime | public void setMaxTime(double maxTime) {
"""
Sets the maximum amount of time to allow in the rate decay. Any time
value larger will be treated as the set maximum.<br>
<br>
Any calls to {@link #rate(double, double, double) } will use the value
provided in that method call instead.
@param maxTime the maximum am... | java | public void setMaxTime(double maxTime)
{
if(maxTime <= 0 || Double.isInfinite(maxTime) || Double.isNaN(maxTime))
throw new RuntimeException("maxTime should be positive, not " + maxTime);
this.maxTime = maxTime;
} | [
"public",
"void",
"setMaxTime",
"(",
"double",
"maxTime",
")",
"{",
"if",
"(",
"maxTime",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"maxTime",
")",
"||",
"Double",
".",
"isNaN",
"(",
"maxTime",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
... | Sets the maximum amount of time to allow in the rate decay. Any time
value larger will be treated as the set maximum.<br>
<br>
Any calls to {@link #rate(double, double, double) } will use the value
provided in that method call instead.
@param maxTime the maximum amount of time to allow | [
"Sets",
"the",
"maximum",
"amount",
"of",
"time",
"to",
"allow",
"in",
"the",
"rate",
"decay",
".",
"Any",
"time",
"value",
"larger",
"will",
"be",
"treated",
"as",
"the",
"set",
"maximum",
".",
"<br",
">",
"<br",
">",
"Any",
"calls",
"to",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/decayrates/ExponetialDecay.java#L89-L94 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java | ST_GeomFromGML.toGeometry | public static Geometry toGeometry(String gmlFile, int srid) throws SAXException, IOException, ParserConfigurationException {
"""
Read the GML representation with a specified SRID
@param gmlFile
@param srid
@return
@throws org.xml.sax.SAXException
@throws java.io.IOException
@throws javax.xml.parsers.Parser... | java | public static Geometry toGeometry(String gmlFile, int srid) throws SAXException, IOException, ParserConfigurationException {
if (gmlFile == null) {
return null;
}
if (gf == null) {
gf = new GeometryFactory(new PrecisionModel(), srid);
}
GMLReader gMLReader... | [
"public",
"static",
"Geometry",
"toGeometry",
"(",
"String",
"gmlFile",
",",
"int",
"srid",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"if",
"(",
"gmlFile",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Read the GML representation with a specified SRID
@param gmlFile
@param srid
@return
@throws org.xml.sax.SAXException
@throws java.io.IOException
@throws javax.xml.parsers.ParserConfigurationException | [
"Read",
"the",
"GML",
"representation",
"with",
"a",
"specified",
"SRID"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/ST_GeomFromGML.java#L74-L83 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/JsonPath.java | JsonPath.read | @SuppressWarnings( {
"""
Creates a new JsonPath and applies it to the provided Json object
@param jsonInputStream json input stream
@param jsonPath the json path
@param filters filters to be applied to the filter place holders [?] in the path
@param <T> expected return type
@retu... | java | @SuppressWarnings({"unchecked"})
public static <T> T read(InputStream jsonInputStream, String jsonPath, Predicate... filters) throws IOException {
return new ParseContextImpl().parse(jsonInputStream).read(jsonPath, filters);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"read",
"(",
"InputStream",
"jsonInputStream",
",",
"String",
"jsonPath",
",",
"Predicate",
"...",
"filters",
")",
"throws",
"IOException",
"{",
"return",
"... | Creates a new JsonPath and applies it to the provided Json object
@param jsonInputStream json input stream
@param jsonPath the json path
@param filters filters to be applied to the filter place holders [?] in the path
@param <T> expected return type
@return list of objects matched by the gi... | [
"Creates",
"a",
"new",
"JsonPath",
"and",
"applies",
"it",
"to",
"the",
"provided",
"Json",
"object"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java#L540-L543 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.matchString | private static int matchString(String str, CharSequence src, int begin, int end) {
"""
Matches (part of) a character sequence against a pattern string.
@param str the pattern string.
@param src the input sequence. Must not be null.
@param begin start of index to scan characters from <code>src</code>.
... | java | private static int matchString(String str, CharSequence src, int begin, int end) {
final int patternLength = str.length();
int i = 0;
for (; (i < patternLength) && ((begin + i) < end); i++) {
final char exp = str.charAt(i);
final char enc = src.charAt(begin + i);
if (exp != enc) return Pat... | [
"private",
"static",
"int",
"matchString",
"(",
"String",
"str",
",",
"CharSequence",
"src",
",",
"int",
"begin",
",",
"int",
"end",
")",
"{",
"final",
"int",
"patternLength",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"i",
"=",
"0",
";",
"for"... | Matches (part of) a character sequence against a pattern string.
@param str the pattern string.
@param src the input sequence. Must not be null.
@param begin start of index to scan characters from <code>src</code>.
@param end end of index to scan characters from <code>src</code>.
@return the number of chara... | [
"Matches",
"(",
"part",
"of",
")",
"a",
"character",
"sequence",
"against",
"a",
"pattern",
"string",
"."
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L598-L607 |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java | JdbcExtractor.updatePrimaryKeyConfig | private void updatePrimaryKeyConfig(String srcColumnName, String tgtColumnName) {
"""
Update primary key column property if there is an alias defined in query
@param srcColumnName source column name
@param tgtColumnName target column name
"""
if (this.workUnitState.contains(ConfigurationKeys.EXTRACT_PR... | java | private void updatePrimaryKeyConfig(String srcColumnName, String tgtColumnName) {
if (this.workUnitState.contains(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY)) {
String primarykey = this.workUnitState.getProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY);
this.workUnitState.setProp(Configuratio... | [
"private",
"void",
"updatePrimaryKeyConfig",
"(",
"String",
"srcColumnName",
",",
"String",
"tgtColumnName",
")",
"{",
"if",
"(",
"this",
".",
"workUnitState",
".",
"contains",
"(",
"ConfigurationKeys",
".",
"EXTRACT_PRIMARY_KEY_FIELDS_KEY",
")",
")",
"{",
"String",... | Update primary key column property if there is an alias defined in query
@param srcColumnName source column name
@param tgtColumnName target column name | [
"Update",
"primary",
"key",
"column",
"property",
"if",
"there",
"is",
"an",
"alias",
"defined",
"in",
"query"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java#L523-L529 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putCredential | public static void putCredential(final RequestContext context, final Credential c) {
"""
Puts credential into the context.
@param context the context
@param c the c
"""
if (c == null) {
context.getRequestScope().remove(PARAMETER_CREDENTIAL);
context.getFlowScope().remo... | java | public static void putCredential(final RequestContext context, final Credential c) {
if (c == null) {
context.getRequestScope().remove(PARAMETER_CREDENTIAL);
context.getFlowScope().remove(PARAMETER_CREDENTIAL);
context.getConversationScope().remove(PARAMETER_CREDENTIAL);
... | [
"public",
"static",
"void",
"putCredential",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"Credential",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"context",
".",
"getRequestScope",
"(",
")",
".",
"remove",
"(",
"PARAMETER_CREDENTIAL"... | Puts credential into the context.
@param context the context
@param c the c | [
"Puts",
"credential",
"into",
"the",
"context",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L403-L413 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/controller/FrameworkController.java | FrameworkController.getController | public static Object getController(BaseComponent comp, boolean recurse) {
"""
Returns the controller associated with the specified component, if any.
@param comp The component whose controller is sought.
@param recurse If true, search up the parent chain until a controller is found.
@return The associated con... | java | public static Object getController(BaseComponent comp, boolean recurse) {
return recurse ? comp.findAttribute(Constants.ATTR_COMPOSER) : comp.getAttribute(Constants.ATTR_COMPOSER);
} | [
"public",
"static",
"Object",
"getController",
"(",
"BaseComponent",
"comp",
",",
"boolean",
"recurse",
")",
"{",
"return",
"recurse",
"?",
"comp",
".",
"findAttribute",
"(",
"Constants",
".",
"ATTR_COMPOSER",
")",
":",
"comp",
".",
"getAttribute",
"(",
"Const... | Returns the controller associated with the specified component, if any.
@param comp The component whose controller is sought.
@param recurse If true, search up the parent chain until a controller is found.
@return The associated controller, or null if none found. | [
"Returns",
"the",
"controller",
"associated",
"with",
"the",
"specified",
"component",
"if",
"any",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/controller/FrameworkController.java#L114-L116 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/utils/FastDatePrinter.java | FastDatePrinter.applyRules | @Deprecated
protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) {
"""
Performs the formatting by applying the rules to the
specified calendar.
@param calendar the calendar to format
@param buf the buffer to format into
@return the specified string buffer
@deprecated u... | java | @Deprecated
protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) {
return (StringBuffer) applyRules(calendar, (Appendable) buf);
} | [
"@",
"Deprecated",
"protected",
"StringBuffer",
"applyRules",
"(",
"final",
"Calendar",
"calendar",
",",
"final",
"StringBuffer",
"buf",
")",
"{",
"return",
"(",
"StringBuffer",
")",
"applyRules",
"(",
"calendar",
",",
"(",
"Appendable",
")",
"buf",
")",
";",
... | Performs the formatting by applying the rules to the
specified calendar.
@param calendar the calendar to format
@param buf the buffer to format into
@return the specified string buffer
@deprecated use {@link #format(Calendar)} or {@link #format(Calendar, Appendable)} | [
"Performs",
"the",
"formatting",
"by",
"applying",
"the",
"rules",
"to",
"the",
"specified",
"calendar",
"."
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/utils/FastDatePrinter.java#L625-L628 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.pages_getInfo | public T pages_getInfo(Collection<Long> pageIds, EnumSet<PageProfileField> fields)
throws FacebookException, IOException {
"""
Retrieves the requested profile fields for the Facebook Pages with the given
<code>pageIds</code>. Can be called for pages that have added the application
without establishing a sess... | java | public T pages_getInfo(Collection<Long> pageIds, EnumSet<PageProfileField> fields)
throws FacebookException, IOException {
if (pageIds == null || pageIds.isEmpty()) {
throw new IllegalArgumentException("pageIds cannot be empty or null");
}
if (fields == null || fields.isEmpty()) {
throw new ... | [
"public",
"T",
"pages_getInfo",
"(",
"Collection",
"<",
"Long",
">",
"pageIds",
",",
"EnumSet",
"<",
"PageProfileField",
">",
"fields",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"if",
"(",
"pageIds",
"==",
"null",
"||",
"pageIds",
".",
"is... | Retrieves the requested profile fields for the Facebook Pages with the given
<code>pageIds</code>. Can be called for pages that have added the application
without establishing a session.
@param pageIds the page IDs
@param fields a set of page profile fields
@return a T consisting of a list of pages, with each page elem... | [
"Retrieves",
"the",
"requested",
"profile",
"fields",
"for",
"the",
"Facebook",
"Pages",
"with",
"the",
"given",
"<code",
">",
"pageIds<",
"/",
"code",
">",
".",
"Can",
"be",
"called",
"for",
"pages",
"that",
"have",
"added",
"the",
"application",
"without",... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L2078-L2091 |
otto-de/edison-microservice | edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java | AbstractMongoRepository.byId | protected Document byId(final K key) {
"""
Returns a query that is selecting documents by ID.
@param key the document's key
@return query Document
"""
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be... | java | protected Document byId(final K key) {
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be null");
}
} | [
"protected",
"Document",
"byId",
"(",
"final",
"K",
"key",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"return",
"new",
"Document",
"(",
"ID",
",",
"key",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"NullPointerEx... | Returns a query that is selecting documents by ID.
@param key the document's key
@return query Document | [
"Returns",
"a",
"query",
"that",
"is",
"selecting",
"documents",
"by",
"ID",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java#L323-L329 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/DateTimeField.java | DateTimeField.setDateTime | public int setDateTime(java.util.Date date, boolean bDisplayOption, int iMoveMode) {
"""
Change the date and time of day.
@param date The date to set.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
"""
if (date != nul... | java | public int setDateTime(java.util.Date date, boolean bDisplayOption, int iMoveMode)
{
if (date != null)
return this.setValue(date.getTime(), bDisplayOption, iMoveMode);
else
return this.setData(null, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"setDateTime",
"(",
"java",
".",
"util",
".",
"Date",
"date",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"date",
"!=",
"null",
")",
"return",
"this",
".",
"setValue",
"(",
"date",
".",
"getTime",
"(... | Change the date and time of day.
@param date The date to set.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"Change",
"the",
"date",
"and",
"time",
"of",
"day",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DateTimeField.java#L285-L291 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.withVersion | public MessageProtocol withVersion(String version) {
"""
Return a copy of this message protocol with the version set to the given version.
@param version The version to set.
@return A copy of this message protocol.
"""
return new MessageProtocol(contentType, charset, Optional.ofNullable(version));
... | java | public MessageProtocol withVersion(String version) {
return new MessageProtocol(contentType, charset, Optional.ofNullable(version));
} | [
"public",
"MessageProtocol",
"withVersion",
"(",
"String",
"version",
")",
"{",
"return",
"new",
"MessageProtocol",
"(",
"contentType",
",",
"charset",
",",
"Optional",
".",
"ofNullable",
"(",
"version",
")",
")",
";",
"}"
] | Return a copy of this message protocol with the version set to the given version.
@param version The version to set.
@return A copy of this message protocol. | [
"Return",
"a",
"copy",
"of",
"this",
"message",
"protocol",
"with",
"the",
"version",
"set",
"to",
"the",
"given",
"version",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L119-L121 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/UsersApi.java | UsersApi.getUsers | public ApiSuccessResponse getUsers(String searchTerm, BigDecimal groupId, String sort, String sortBy, BigDecimal limit, BigDecimal offset, String channels) throws ApiException {
"""
Search for users.
Search for users with the specified filters.
@param searchTerm The text to search. (optional)
@param groupId The... | java | public ApiSuccessResponse getUsers(String searchTerm, BigDecimal groupId, String sort, String sortBy, BigDecimal limit, BigDecimal offset, String channels) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = getUsersWithHttpInfo(searchTerm, groupId, sort, sortBy, limit, offset, channels);
retur... | [
"public",
"ApiSuccessResponse",
"getUsers",
"(",
"String",
"searchTerm",
",",
"BigDecimal",
"groupId",
",",
"String",
"sort",
",",
"String",
"sortBy",
",",
"BigDecimal",
"limit",
",",
"BigDecimal",
"offset",
",",
"String",
"channels",
")",
"throws",
"ApiException"... | Search for users.
Search for users with the specified filters.
@param searchTerm The text to search. (optional)
@param groupId The ID of the group where the user belongs. (optional)
@param sort The sort order, either `asc` (ascending) or `desc` (descending). The default is `asc`. (optional... | [
"Search",
"for",
"users",
".",
"Search",
"for",
"users",
"with",
"the",
"specified",
"filters",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/UsersApi.java#L152-L155 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.getAtManagementGroupAsync | public Observable<PolicyDefinitionInner> getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) {
"""
Gets the policy definition at management group level.
@param policyDefinitionName The name of the policy definition to get.
@param managementGroupId The ID of the management group.
@... | java | public Observable<PolicyDefinitionInner> getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) {
return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<PolicyDefinitionInner>, PolicyDefinitionInner>() {
@O... | [
"public",
"Observable",
"<",
"PolicyDefinitionInner",
">",
"getAtManagementGroupAsync",
"(",
"String",
"policyDefinitionName",
",",
"String",
"managementGroupId",
")",
"{",
"return",
"getAtManagementGroupWithServiceResponseAsync",
"(",
"policyDefinitionName",
",",
"managementGr... | Gets the policy definition at management group level.
@param policyDefinitionName The name of the policy definition to get.
@param managementGroupId The ID of the management group.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PolicyDefinitionInner object | [
"Gets",
"the",
"policy",
"definition",
"at",
"management",
"group",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L648-L655 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/storage/StorageUtil.java | StorageUtil.resolvedTree | public static <S> StorageTree resolvedTree(S context, ExtTree<S, ResourceMeta> authStorage) {
"""
Create a StorageTree using authorization context and authorizing tree
@param context auth context
@param authStorage authorizing storage tree
@param <S> context type
@return StorageTree for the authorization conte... | java | public static <S> StorageTree resolvedTree(S context, ExtTree<S, ResourceMeta> authStorage) {
return ResolvedExtTree.with(context, authStorage);
} | [
"public",
"static",
"<",
"S",
">",
"StorageTree",
"resolvedTree",
"(",
"S",
"context",
",",
"ExtTree",
"<",
"S",
",",
"ResourceMeta",
">",
"authStorage",
")",
"{",
"return",
"ResolvedExtTree",
".",
"with",
"(",
"context",
",",
"authStorage",
")",
";",
"}"
... | Create a StorageTree using authorization context and authorizing tree
@param context auth context
@param authStorage authorizing storage tree
@param <S> context type
@return StorageTree for the authorization context | [
"Create",
"a",
"StorageTree",
"using",
"authorization",
"context",
"and",
"authorizing",
"tree"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/storage/StorageUtil.java#L184-L186 |
ehcache/ehcache3 | clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java | ClusterTierManagerClientEntityFactory.abandonFetchHolds | private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
"""
Proactively abandon any READ holds before closing connection.
@param entityIdentifier the master entity identifier
@return true of abandoned false otherwise
"""
Hold hold = fetchHolds.remove(entityIdentifier);
... | java | private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
Hold hold = fetchHolds.remove(entityIdentifier);
return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
} | [
"private",
"boolean",
"abandonFetchHolds",
"(",
"String",
"entityIdentifier",
",",
"boolean",
"healthyConnection",
")",
"{",
"Hold",
"hold",
"=",
"fetchHolds",
".",
"remove",
"(",
"entityIdentifier",
")",
";",
"return",
"(",
"hold",
"!=",
"null",
")",
"&&",
"h... | Proactively abandon any READ holds before closing connection.
@param entityIdentifier the master entity identifier
@return true of abandoned false otherwise | [
"Proactively",
"abandon",
"any",
"READ",
"holds",
"before",
"closing",
"connection",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java#L105-L108 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java | AdaptiveTableLayout.removeKeys | private void removeKeys(List<Integer> keysToRemove, SparseArrayCompat<ViewHolder> headers) {
"""
Remove recycled viewholders from sparseArray
@param keysToRemove List of ViewHolders keys that we need to remove
@param headers SparseArray of viewHolders from where we need to remove
"""
for (Inte... | java | private void removeKeys(List<Integer> keysToRemove, SparseArrayCompat<ViewHolder> headers) {
for (Integer key : keysToRemove) {
headers.remove(key);
}
} | [
"private",
"void",
"removeKeys",
"(",
"List",
"<",
"Integer",
">",
"keysToRemove",
",",
"SparseArrayCompat",
"<",
"ViewHolder",
">",
"headers",
")",
"{",
"for",
"(",
"Integer",
"key",
":",
"keysToRemove",
")",
"{",
"headers",
".",
"remove",
"(",
"key",
")"... | Remove recycled viewholders from sparseArray
@param keysToRemove List of ViewHolders keys that we need to remove
@param headers SparseArray of viewHolders from where we need to remove | [
"Remove",
"recycled",
"viewholders",
"from",
"sparseArray"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java#L832-L836 |
petergeneric/stdlib | guice/common/src/main/java/com/peterphi/std/guice/common/retry/retry/RetryManager.java | RetryManager.finalAttemptFailed | protected <T> T finalAttemptFailed(final Retryable<T> operation, final int attempt, final Throwable e) throws Exception {
"""
Called when the final attempt at a retryable operation failed
<p/>
Allows extending classes to customise behaviour or throw custom exceptions
@param operation
- the operation being at... | java | protected <T> T finalAttemptFailed(final Retryable<T> operation, final int attempt, final Throwable e) throws Exception
{
log.error("Final attempt #" + attempt + " of " + operation + " failed.", e);
if (e instanceof Exception)
throw (Exception) e;
else if (e instanceof Error)
throw (Error) e;
else
th... | [
"protected",
"<",
"T",
">",
"T",
"finalAttemptFailed",
"(",
"final",
"Retryable",
"<",
"T",
">",
"operation",
",",
"final",
"int",
"attempt",
",",
"final",
"Throwable",
"e",
")",
"throws",
"Exception",
"{",
"log",
".",
"error",
"(",
"\"Final attempt #\"",
... | Called when the final attempt at a retryable operation failed
<p/>
Allows extending classes to customise behaviour or throw custom exceptions
@param operation
- the operation being attempted
@param attempt
- the attempt number that failed
@param e
- the exception thrown when the operation failed
@throws Exception | [
"Called",
"when",
"the",
"final",
"attempt",
"at",
"a",
"retryable",
"operation",
"failed",
"<p",
"/",
">",
"Allows",
"extending",
"classes",
"to",
"customise",
"behaviour",
"or",
"throw",
"custom",
"exceptions"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/common/retry/retry/RetryManager.java#L108-L118 |
eclipse/xtext-core | org.eclipse.xtext/src-gen/org/eclipse/xtext/serializer/XtextSemanticSequencer.java | XtextSemanticSequencer.sequence_Conjunction | protected void sequence_Conjunction(ISerializationContext context, Conjunction semanticObject) {
"""
Contexts:
Disjunction returns Conjunction
Disjunction.Disjunction_1_0 returns Conjunction
Conjunction returns Conjunction
Conjunction.Conjunction_1_0 returns Conjunction
Negation returns Conjunction
Atom retu... | java | protected void sequence_Conjunction(ISerializationContext context, Conjunction semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XtextPackage.Literals.COMPOSITE_CONDITION__LEFT) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMi... | [
"protected",
"void",
"sequence_Conjunction",
"(",
"ISerializationContext",
"context",
",",
"Conjunction",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanticObject",
",... | Contexts:
Disjunction returns Conjunction
Disjunction.Disjunction_1_0 returns Conjunction
Conjunction returns Conjunction
Conjunction.Conjunction_1_0 returns Conjunction
Negation returns Conjunction
Atom returns Conjunction
ParenthesizedCondition returns Conjunction
Constraint:
(left=Conjunction_Conjunction_1_0 right=... | [
"Contexts",
":",
"Disjunction",
"returns",
"Conjunction",
"Disjunction",
".",
"Disjunction_1_0",
"returns",
"Conjunction",
"Conjunction",
"returns",
"Conjunction",
"Conjunction",
".",
"Conjunction_1_0",
"returns",
"Conjunction",
"Negation",
"returns",
"Conjunction",
"Atom",... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src-gen/org/eclipse/xtext/serializer/XtextSemanticSequencer.java#L673-L684 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectPool.java | ObjectPool.getInstance | public synchronized Object getInstance() {
"""
Get an instance of the given object in this pool
@return An instance of the given object
"""
// Check if the pool is empty.
if (freeStack.isEmpty())
{
// Create a new object if so.
try
{
return objectType.newInstance();... | java | public synchronized Object getInstance()
{
// Check if the pool is empty.
if (freeStack.isEmpty())
{
// Create a new object if so.
try
{
return objectType.newInstance();
}
catch (InstantiationException ex){}
catch (IllegalAccessException ex){}
// Throw ... | [
"public",
"synchronized",
"Object",
"getInstance",
"(",
")",
"{",
"// Check if the pool is empty.",
"if",
"(",
"freeStack",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Create a new object if so.",
"try",
"{",
"return",
"objectType",
".",
"newInstance",
"(",
")",
";",
... | Get an instance of the given object in this pool
@return An instance of the given object | [
"Get",
"an",
"instance",
"of",
"the",
"given",
"object",
"in",
"this",
"pool"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectPool.java#L126-L152 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.sameHqDeleteBySign | public JSONObject sameHqDeleteBySign(String contSign, HashMap<String, String> options) {
"""
相同图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest req... | java | public JSONObject sameHqDeleteBySign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request.s... | [
"public",
"JSONObject",
"sameHqDeleteBySign",
"(",
"String",
"contSign",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"requ... | 相同图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"相同图检索—删除接口",
"**",
"删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L345-L356 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasDocument.java | BaasDocument.put | public BaasDocument put(String name, JsonArray value) {
"""
Associate <code>name</code> key to the {@link com.baasbox.android.json.JsonArray} <code>value</code>
in this document.
@param name a non <code>null</code> key
@param value a {@link com.baasbox.android.json.JsonArray}
@return this document with the ... | java | public BaasDocument put(String name, JsonArray value) {
data.put(checkKey(name), value);
return this;
} | [
"public",
"BaasDocument",
"put",
"(",
"String",
"name",
",",
"JsonArray",
"value",
")",
"{",
"data",
".",
"put",
"(",
"checkKey",
"(",
"name",
")",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Associate <code>name</code> key to the {@link com.baasbox.android.json.JsonArray} <code>value</code>
in this document.
@param name a non <code>null</code> key
@param value a {@link com.baasbox.android.json.JsonArray}
@return this document with the new mapping created | [
"Associate",
"<code",
">",
"name<",
"/",
"code",
">",
"key",
"to",
"the",
"{",
"@link",
"com",
".",
"baasbox",
".",
"android",
".",
"json",
".",
"JsonArray",
"}",
"<code",
">",
"value<",
"/",
"code",
">",
"in",
"this",
"document",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L1061-L1064 |
camunda/camunda-bpm-platform | engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java | ActivitiStateHandlerRegistry.findRegistrationForProcessAndState | public ActivitiStateHandlerRegistration findRegistrationForProcessAndState(String processName, String stateName) {
"""
this scours the registry looking for candidate registrations that match a given process name and/ or state nanme
@param processName the name of the process
@param stateName the name of the st... | java | public ActivitiStateHandlerRegistration findRegistrationForProcessAndState(String processName, String stateName) {
ActivitiStateHandlerRegistration r = null;
String key = registrationKey(processName, stateName);
Collection<ActivitiStateHandlerRegistration> rs = this.findRegistrationsForProcessAndState(
pro... | [
"public",
"ActivitiStateHandlerRegistration",
"findRegistrationForProcessAndState",
"(",
"String",
"processName",
",",
"String",
"stateName",
")",
"{",
"ActivitiStateHandlerRegistration",
"r",
"=",
"null",
";",
"String",
"key",
"=",
"registrationKey",
"(",
"processName",
... | this scours the registry looking for candidate registrations that match a given process name and/ or state nanme
@param processName the name of the process
@param stateName the name of the state
@return an unambiguous {@link org.camunda.bpm.engine.test.spring.components.registry.ActivitiStateHandlerRegistry} or null | [
"this",
"scours",
"the",
"registry",
"looking",
"for",
"candidate",
"registrations",
"that",
"match",
"a",
"given",
"process",
"name",
"and",
"/",
"or",
"state",
"nanme"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java#L123-L153 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/EditService.java | EditService.removePathnameFromProfile | public void removePathnameFromProfile(int path_id, int profileId) {
"""
Remove a path from a profile
@param path_id path ID to remove
@param profileId profile ID to remove path from
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
... | java | public void removePathnameFromProfile(int path_id, int profileId) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
... | [
"public",
"void",
"removePathnameFromProfile",
"(",
"int",
"path_id",
",",
"int",
"profileId",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
... | Remove a path from a profile
@param path_id path ID to remove
@param profileId profile ID to remove path from | [
"Remove",
"a",
"path",
"from",
"a",
"profile"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/EditService.java#L150-L177 |
jenkinsci/jenkins | core/src/main/java/jenkins/mvn/SettingsProvider.java | SettingsProvider.getSettingsFilePath | public static FilePath getSettingsFilePath(SettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) {
"""
Convenience method handling all <code>null</code> checks. Provides the path on the (possible) remote settings file.
@param settings
the provider to be used
@param build
the active bui... | java | public static FilePath getSettingsFilePath(SettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) {
FilePath settingsPath = null;
if (settings != null) {
settingsPath = settings.supplySettings(build, listener);
}
return settingsPath;
} | [
"public",
"static",
"FilePath",
"getSettingsFilePath",
"(",
"SettingsProvider",
"settings",
",",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"FilePath",
"settingsPath",
"=",
"null",
";",
"if",
"(",
"settings",
... | Convenience method handling all <code>null</code> checks. Provides the path on the (possible) remote settings file.
@param settings
the provider to be used
@param build
the active build
@param listener
the listener of the current build
@return the path to the settings.xml | [
"Convenience",
"method",
"handling",
"all",
"<code",
">",
"null<",
"/",
"code",
">",
"checks",
".",
"Provides",
"the",
"path",
"on",
"the",
"(",
"possible",
")",
"remote",
"settings",
"file",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/mvn/SettingsProvider.java#L50-L56 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDocument.java | MutableDocument.setLong | @NonNull
@Override
public MutableDocument setLong(@NonNull String key, long value) {
"""
Set a long value for the given key
@param key the key.
@param key the long value.
@return this MutableDocument instance
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDocument setLong(@NonNull String key, long value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDocument",
"setLong",
"(",
"@",
"NonNull",
"String",
"key",
",",
"long",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a long value for the given key
@param key the key.
@param key the long value.
@return this MutableDocument instance | [
"Set",
"a",
"long",
"value",
"for",
"the",
"given",
"key"
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L197-L201 |
j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java | CacheManagerFactory.getCacheManager | public static JawrCacheManager getCacheManager(JawrConfig config, String resourceType) {
"""
Retrieves the cache manager for a resource type
@param config
the jawr config
@param resourceType
the resource type
@return the cache manager for a resource type
"""
String cacheMgrAttributeName = CACHE_ATTR_... | java | public static JawrCacheManager getCacheManager(JawrConfig config, String resourceType) {
String cacheMgrAttributeName = CACHE_ATTR_PREFIX + resourceType.toUpperCase() + CACHE_ATTR_SUFFIX;
JawrCacheManager cacheManager = (JawrCacheManager) config.getContext().getAttribute(cacheMgrAttributeName);
if (cacheManager ... | [
"public",
"static",
"JawrCacheManager",
"getCacheManager",
"(",
"JawrConfig",
"config",
",",
"String",
"resourceType",
")",
"{",
"String",
"cacheMgrAttributeName",
"=",
"CACHE_ATTR_PREFIX",
"+",
"resourceType",
".",
"toUpperCase",
"(",
")",
"+",
"CACHE_ATTR_SUFFIX",
"... | Retrieves the cache manager for a resource type
@param config
the jawr config
@param resourceType
the resource type
@return the cache manager for a resource type | [
"Retrieves",
"the",
"cache",
"manager",
"for",
"a",
"resource",
"type"
] | train | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java#L44-L55 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/KeyRangeIterable.java | KeyRangeIterable.addProjected | private static Iterator<MarkerRange.Builder> addProjected(
Predicate projected, String name,
Iterator<MarkerRange.Builder> inner) {
"""
Convenience function to add the correct {@link StackedIterator} to the key
range Iterator stack.
This method is used to add a <em>single</em> <em>projected</em> co... | java | private static Iterator<MarkerRange.Builder> addProjected(
Predicate projected, String name,
Iterator<MarkerRange.Builder> inner) {
if (projected instanceof In) {
return new SetIterator((In) projected, name, inner);
} else if (projected instanceof Range) {
return new RangeIterator(name, ... | [
"private",
"static",
"Iterator",
"<",
"MarkerRange",
".",
"Builder",
">",
"addProjected",
"(",
"Predicate",
"projected",
",",
"String",
"name",
",",
"Iterator",
"<",
"MarkerRange",
".",
"Builder",
">",
"inner",
")",
"{",
"if",
"(",
"projected",
"instanceof",
... | Convenience function to add the correct {@link StackedIterator} to the key
range Iterator stack.
This method is used to add a <em>single</em> <em>projected</em> constraint
to the stack. | [
"Convenience",
"function",
"to",
"add",
"the",
"correct",
"{",
"@link",
"StackedIterator",
"}",
"to",
"the",
"key",
"range",
"Iterator",
"stack",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/KeyRangeIterable.java#L190-L200 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/Log.java | Log.wtf | public static int wtf(String tag, String msg) {
"""
What a Terrible Failure: Report a condition that should never happen.
The error will always be logged at level ASSERT with the call stack.
@param tag Used to identify the source of a log message.
@param msg The message you would like logged.
"""
re... | java | public static int wtf(String tag, String msg) {
return wtf(LOG_ID_MAIN, tag, msg, null, false);
} | [
"public",
"static",
"int",
"wtf",
"(",
"String",
"tag",
",",
"String",
"msg",
")",
"{",
"return",
"wtf",
"(",
"LOG_ID_MAIN",
",",
"tag",
",",
"msg",
",",
"null",
",",
"false",
")",
";",
"}"
] | What a Terrible Failure: Report a condition that should never happen.
The error will always be logged at level ASSERT with the call stack.
@param tag Used to identify the source of a log message.
@param msg The message you would like logged. | [
"What",
"a",
"Terrible",
"Failure",
":",
"Report",
"a",
"condition",
"that",
"should",
"never",
"happen",
".",
"The",
"error",
"will",
"always",
"be",
"logged",
"at",
"level",
"ASSERT",
"with",
"the",
"call",
"stack",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/Log.java#L303-L305 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.ensureSparseFeature | public int ensureSparseFeature(String featureName, String index) {
"""
An optimization, this lets clients inform the ConcatVectorNamespace of how many sparse feature components to
expect, again so that we can avoid resizing ConcatVectors.
@param featureName the feature to use in our index
@param index the spars... | java | public int ensureSparseFeature(String featureName, String index) {
ensureFeature(featureName);
ObjectIntMap<String> sparseIndex = sparseFeatureIndex.get(featureName);
IntObjectMap<String> reverseSparseIndex = reverseSparseFeatureIndex.get(featureName);
if (sparseIndex == null || reverseS... | [
"public",
"int",
"ensureSparseFeature",
"(",
"String",
"featureName",
",",
"String",
"index",
")",
"{",
"ensureFeature",
"(",
"featureName",
")",
";",
"ObjectIntMap",
"<",
"String",
">",
"sparseIndex",
"=",
"sparseFeatureIndex",
".",
"get",
"(",
"featureName",
"... | An optimization, this lets clients inform the ConcatVectorNamespace of how many sparse feature components to
expect, again so that we can avoid resizing ConcatVectors.
@param featureName the feature to use in our index
@param index the sparse value to ensure is available | [
"An",
"optimization",
"this",
"lets",
"clients",
"inform",
"the",
"ConcatVectorNamespace",
"of",
"how",
"many",
"sparse",
"feature",
"components",
"to",
"expect",
"again",
"so",
"that",
"we",
"can",
"avoid",
"resizing",
"ConcatVectors",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L85-L114 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeHelper.java | TypeHelper.replaceWithMoreSpecificType | protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
"""
Replaces the types in the callSiteType parameter if more specific types
given through the arguments. This is in general the case, unless
the argument is null.
"""
for (int i=0; i<args.length; i++) {
... | java | protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
for (int i=0; i<args.length; i++) {
// if argument null, take the static type
if (args[i]==null) continue;
if (callSiteType.parameterType(i).isPrimitive()) continue;
... | [
"protected",
"static",
"MethodType",
"replaceWithMoreSpecificType",
"(",
"Object",
"[",
"]",
"args",
",",
"MethodType",
"callSiteType",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
"{",
"// if arg... | Replaces the types in the callSiteType parameter if more specific types
given through the arguments. This is in general the case, unless
the argument is null. | [
"Replaces",
"the",
"types",
"in",
"the",
"callSiteType",
"parameter",
"if",
"more",
"specific",
"types",
"given",
"through",
"the",
"arguments",
".",
"This",
"is",
"in",
"general",
"the",
"case",
"unless",
"the",
"argument",
"is",
"null",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeHelper.java#L77-L86 |
ReactiveX/RxJavaComputationExpressions | src/main/java/rx/Statement.java | Statement.switchCase | public static <K, R> Observable<R> switchCase(Func0<? extends K> caseSelector,
Map<? super K, ? extends Observable<? extends R>> mapOfCases, Scheduler scheduler) {
"""
Return a particular one of several possible Observables based on a case
selector and run it on the designated scheduler.
<p>
<img wi... | java | public static <K, R> Observable<R> switchCase(Func0<? extends K> caseSelector,
Map<? super K, ? extends Observable<? extends R>> mapOfCases, Scheduler scheduler) {
return switchCase(caseSelector, mapOfCases, Observable.<R> empty().subscribeOn(scheduler));
} | [
"public",
"static",
"<",
"K",
",",
"R",
">",
"Observable",
"<",
"R",
">",
"switchCase",
"(",
"Func0",
"<",
"?",
"extends",
"K",
">",
"caseSelector",
",",
"Map",
"<",
"?",
"super",
"K",
",",
"?",
"extends",
"Observable",
"<",
"?",
"extends",
"R",
">... | Return a particular one of several possible Observables based on a case
selector and run it on the designated scheduler.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchCase.s.png" alt="">
@param <K>
the case key type
@param <R>
the result value type
@param caseSelector... | [
"Return",
"a",
"particular",
"one",
"of",
"several",
"possible",
"Observables",
"based",
"on",
"a",
"case",
"selector",
"and",
"run",
"it",
"on",
"the",
"designated",
"scheduler",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//... | train | https://github.com/ReactiveX/RxJavaComputationExpressions/blob/f9d04ab762223b36fad47402ac36ce7969320d69/src/main/java/rx/Statement.java#L75-L78 |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.expandPanel | public boolean expandPanel(float mSlideOffset) {
"""
Partially expand the sliding panel up to a specific offset
@param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
@return true if the pane was slideable and is now expanded/in the process of expanding
"""
if (mSlideableView ==... | java | public boolean expandPanel(float mSlideOffset) {
if (mSlideableView == null || mSlideState == SlideState.EXPANDED) return false;
mSlideableView.setVisibility(View.VISIBLE);
return expandPanel(mSlideableView, 0, mSlideOffset);
} | [
"public",
"boolean",
"expandPanel",
"(",
"float",
"mSlideOffset",
")",
"{",
"if",
"(",
"mSlideableView",
"==",
"null",
"||",
"mSlideState",
"==",
"SlideState",
".",
"EXPANDED",
")",
"return",
"false",
";",
"mSlideableView",
".",
"setVisibility",
"(",
"View",
"... | Partially expand the sliding panel up to a specific offset
@param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
@return true if the pane was slideable and is now expanded/in the process of expanding | [
"Partially",
"expand",
"the",
"sliding",
"panel",
"up",
"to",
"a",
"specific",
"offset"
] | train | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L736-L740 |
albfernandez/itext2 | src/main/java/com/lowagie/text/ImgWMF.java | ImgWMF.readWMF | public void readWMF(PdfTemplate template) throws IOException, DocumentException {
"""
Reads the WMF into a template.
@param template the template to read to
@throws IOException on error
@throws DocumentException on error
"""
setTemplateData(template);
template.setWidth(getWidth());
t... | java | public void readWMF(PdfTemplate template) throws IOException, DocumentException {
setTemplateData(template);
template.setWidth(getWidth());
template.setHeight(getHeight());
InputStream is = null;
try {
if (rawData == null){
is = url.openStream();
... | [
"public",
"void",
"readWMF",
"(",
"PdfTemplate",
"template",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"setTemplateData",
"(",
"template",
")",
";",
"template",
".",
"setWidth",
"(",
"getWidth",
"(",
")",
")",
";",
"template",
".",
"setHeigh... | Reads the WMF into a template.
@param template the template to read to
@throws IOException on error
@throws DocumentException on error | [
"Reads",
"the",
"WMF",
"into",
"a",
"template",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/ImgWMF.java#L169-L189 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigImpl.java | ConfigImpl.setTempDirectory | protected void setTempDirectory(Resource tempDirectory, boolean flush) throws ExpressionException {
"""
sets the temp directory
@param tempDirectory temp directory
@throws ExpressionException
"""
if (!isDirectory(tempDirectory) || !tempDirectory.isWriteable()) {
SystemOut.printDate(getErrWriter(),
... | java | protected void setTempDirectory(Resource tempDirectory, boolean flush) throws ExpressionException {
if (!isDirectory(tempDirectory) || !tempDirectory.isWriteable()) {
SystemOut.printDate(getErrWriter(),
"temp directory [" + tempDirectory + "] is not writable or can not be created, using directory [" + Syste... | [
"protected",
"void",
"setTempDirectory",
"(",
"Resource",
"tempDirectory",
",",
"boolean",
"flush",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"!",
"isDirectory",
"(",
"tempDirectory",
")",
"||",
"!",
"tempDirectory",
".",
"isWriteable",
"(",
")",
")"... | sets the temp directory
@param tempDirectory temp directory
@throws ExpressionException | [
"sets",
"the",
"temp",
"directory"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigImpl.java#L1634-L1645 |
spring-projects/spring-flex | spring-flex-core/src/main/java/org/springframework/flex/security3/SpringSecurityLoginCommand.java | SpringSecurityLoginCommand.setDetails | protected void setDetails(HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest) {
"""
Provided so that subclasses may configure what is put into the authentication request's details
property.
@param request that an authentication request is being created for
@param authRequest the authe... | java | protected void setDetails(HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest) {
try {
authRequest.setDetails(authenticationDetailsSource.buildDetails(request));
} catch (Exception e) {
// This would happen e.g. for LCDS NIO Endpoints, which only have a "shell" request.
// Don't ... | [
"protected",
"void",
"setDetails",
"(",
"HttpServletRequest",
"request",
",",
"UsernamePasswordAuthenticationToken",
"authRequest",
")",
"{",
"try",
"{",
"authRequest",
".",
"setDetails",
"(",
"authenticationDetailsSource",
".",
"buildDetails",
"(",
"request",
")",
")",... | Provided so that subclasses may configure what is put into the authentication request's details
property.
@param request that an authentication request is being created for
@param authRequest the authentication request object that should have its details set | [
"Provided",
"so",
"that",
"subclasses",
"may",
"configure",
"what",
"is",
"put",
"into",
"the",
"authentication",
"request",
"s",
"details",
"property",
"."
] | train | https://github.com/spring-projects/spring-flex/blob/85f2bff300d74e2d77d565f97a09d12d18e19adc/spring-flex-core/src/main/java/org/springframework/flex/security3/SpringSecurityLoginCommand.java#L248-L255 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java | ToUnknownStream.addAttribute | public void addAttribute(String rawName, String value) {
"""
Adds an attribute to the currenly open tag
@param rawName the attribute name, with prefix (if any)
@param value the value of the parameter
@see ExtendedContentHandler#addAttribute(String, String)
"""
if (m_firstTagNotEmitted)
{
... | java | public void addAttribute(String rawName, String value)
{
if (m_firstTagNotEmitted)
{
flush();
}
m_handler.addAttribute(rawName, value);
} | [
"public",
"void",
"addAttribute",
"(",
"String",
"rawName",
",",
"String",
"value",
")",
"{",
"if",
"(",
"m_firstTagNotEmitted",
")",
"{",
"flush",
"(",
")",
";",
"}",
"m_handler",
".",
"addAttribute",
"(",
"rawName",
",",
"value",
")",
";",
"}"
] | Adds an attribute to the currenly open tag
@param rawName the attribute name, with prefix (if any)
@param value the value of the parameter
@see ExtendedContentHandler#addAttribute(String, String) | [
"Adds",
"an",
"attribute",
"to",
"the",
"currenly",
"open",
"tag"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java#L287-L295 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java | CachingTemplate.withCaching | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCaching(KEY key, Supplier<VALUE> cacheableOperation) {
"""
Implementation of the look-aside cache pattern.
This caching data access operation first attempts to locate an entry in the {@link Cache}
with the given {@link KEY key}, returning the {@li... | java | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCaching(KEY key, Supplier<VALUE> cacheableOperation) {
Assert.notNull(key, "Key is required");
Assert.notNull(cacheableOperation, "Supplier is required");
ReadWriteLock lock = getLock();
return (T) Optional.ofNullable(read(lock, key)).or... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"VALUE",
">",
"T",
"withCaching",
"(",
"KEY",
"key",
",",
"Supplier",
"<",
"VALUE",
">",
"cacheableOperation",
")",
"{",
"Assert",
".",
"notNull",
"(",
"key",
",",
"\"Key is... | Implementation of the look-aside cache pattern.
This caching data access operation first attempts to locate an entry in the {@link Cache}
with the given {@link KEY key}, returning the {@link VALUE value} of the entry if present.
If an entry with the given {@link KEY key} is not present in the {@link Cache} then the s... | [
"Implementation",
"of",
"the",
"look",
"-",
"aside",
"cache",
"pattern",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java#L265-L277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.