repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
BoltsFramework/Bolts-Android | bolts-applinks/src/main/java/bolts/AppLinkNavigation.java | AppLinkNavigation.navigateInBackground | public static Task<NavigationResult> navigateInBackground(Context context,
String destinationUrl,
AppLinkResolver resolver) {
return navigateInBackground(context, Uri.parse(destinationUrl), resolv... | java | public static Task<NavigationResult> navigateInBackground(Context context,
String destinationUrl,
AppLinkResolver resolver) {
return navigateInBackground(context, Uri.parse(destinationUrl), resolv... | [
"public",
"static",
"Task",
"<",
"NavigationResult",
">",
"navigateInBackground",
"(",
"Context",
"context",
",",
"String",
"destinationUrl",
",",
"AppLinkResolver",
"resolver",
")",
"{",
"return",
"navigateInBackground",
"(",
"context",
",",
"Uri",
".",
"parse",
... | Navigates to an {@link AppLink} for the given destination using the App Link resolution
strategy specified.
@param context the Context from which the navigation should be performed.
@param destinationUrl the destination URL for the App Link.
@param resolver the resolver to use for fetching App Link metada... | [
"Navigates",
"to",
"an",
"{",
"@link",
"AppLink",
"}",
"for",
"the",
"given",
"destination",
"using",
"the",
"App",
"Link",
"resolution",
"strategy",
"specified",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-applinks/src/main/java/bolts/AppLinkNavigation.java#L422-L426 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArray | public static <T> Level0ArrayOperator<String[],String> onArray(final String[] target) {
return onArrayOf(Types.STRING, target);
} | java | public static <T> Level0ArrayOperator<String[],String> onArray(final String[] target) {
return onArrayOf(Types.STRING, target);
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"String",
"[",
"]",
",",
"String",
">",
"onArray",
"(",
"final",
"String",
"[",
"]",
"target",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"STRING",
",",
"target",
")",
";",
"}"
] | <p>
Creates an <i>operation expression</i> on the specified target object.
</p>
@param target the target object on which the expression will execute
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"the",
"specified",
"target",
"object",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L767-L769 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java | UnImplNode.getAttributeNodeNS | public Attr getAttributeNodeNS(String namespaceURI, String localName)
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNodeNS not supported!");
return null;
} | java | public Attr getAttributeNodeNS(String namespaceURI, String localName)
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNodeNS not supported!");
return null;
} | [
"public",
"Attr",
"getAttributeNodeNS",
"(",
"String",
"namespaceURI",
",",
"String",
"localName",
")",
"{",
"error",
"(",
"XMLErrorResources",
".",
"ER_FUNCTION_NOT_SUPPORTED",
")",
";",
"//\"getAttributeNodeNS not supported!\");",
"return",
"null",
";",
"}"
] | Unimplemented. See org.w3c.dom.Element
@param namespaceURI Namespace URI of attribute node to get
@param localName Local part of qualified name of attribute node to get
@return null | [
"Unimplemented",
".",
"See",
"org",
".",
"w3c",
".",
"dom",
".",
"Element"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java#L459-L465 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java | CSL.makeBibliography | public Bibliography makeBibliography(SelectionMode mode, CSLItemData... selection) {
return makeBibliography(mode, selection, null);
} | java | public Bibliography makeBibliography(SelectionMode mode, CSLItemData... selection) {
return makeBibliography(mode, selection, null);
} | [
"public",
"Bibliography",
"makeBibliography",
"(",
"SelectionMode",
"mode",
",",
"CSLItemData",
"...",
"selection",
")",
"{",
"return",
"makeBibliography",
"(",
"mode",
",",
"selection",
",",
"null",
")",
";",
"}"
] | Generates a bibliography for the registered citations. Depending
on the selection mode selects, includes, or excludes bibliography
items whose fields and field values match the fields and field values
from the given example item data objects.
@param mode the selection mode
@param selection the example item data objects... | [
"Generates",
"a",
"bibliography",
"for",
"the",
"registered",
"citations",
".",
"Depending",
"on",
"the",
"selection",
"mode",
"selects",
"includes",
"or",
"excludes",
"bibliography",
"items",
"whose",
"fields",
"and",
"field",
"values",
"match",
"the",
"fields",
... | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java#L739-L741 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/TaskInfo.java | TaskInfo.deserializeThreadContext | public ThreadContextDescriptor deserializeThreadContext(Map<String, String> execProps) throws IOException, ClassNotFoundException {
return threadContextBytes == null ? null : ThreadContextDeserializer.deserialize(threadContextBytes, execProps);
} | java | public ThreadContextDescriptor deserializeThreadContext(Map<String, String> execProps) throws IOException, ClassNotFoundException {
return threadContextBytes == null ? null : ThreadContextDeserializer.deserialize(threadContextBytes, execProps);
} | [
"public",
"ThreadContextDescriptor",
"deserializeThreadContext",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"execProps",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"threadContextBytes",
"==",
"null",
"?",
"null",
":",
"ThreadContex... | Returns the thread context that was captured at the point when the task was submitted.
@param execProps execution properties for the persistent task.
@return the thread context that was captured at the point when the task was submitted.
@throws IOException
@throws ClassNotFoundException | [
"Returns",
"the",
"thread",
"context",
"that",
"was",
"captured",
"at",
"the",
"point",
"when",
"the",
"task",
"was",
"submitted",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/TaskInfo.java#L151-L153 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.bufferLocalFileHeader | private boolean bufferLocalFileHeader() throws IOException {
buffer.reset();
JarEntry jarEntry = virtualJarInputStream.getNextJarEntry();
if (jarEntry == null) { return false; }
currentEntry = new ProcessedEntry(jarEntry, totalRead);
processedEntries.add(currentEntry);
... | java | private boolean bufferLocalFileHeader() throws IOException {
buffer.reset();
JarEntry jarEntry = virtualJarInputStream.getNextJarEntry();
if (jarEntry == null) { return false; }
currentEntry = new ProcessedEntry(jarEntry, totalRead);
processedEntries.add(currentEntry);
... | [
"private",
"boolean",
"bufferLocalFileHeader",
"(",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"reset",
"(",
")",
";",
"JarEntry",
"jarEntry",
"=",
"virtualJarInputStream",
".",
"getNextJarEntry",
"(",
")",
";",
"if",
"(",
"jarEntry",
"==",
"null",
")",... | Buffer the content of the local file header for a single entry.
@return true if the next local file header was buffered
@throws IOException if any problems occur | [
"Buffer",
"the",
"content",
"of",
"the",
"local",
"file",
"header",
"for",
"a",
"single",
"entry",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L120-L143 |
cryptomator/native-functions | JNI/src/main/java/org/cryptomator/jni/MacKeychainAccess.java | MacKeychainAccess.storePassword | public void storePassword(String account, CharSequence password) {
ByteBuffer pwBuf = UTF_8.encode(CharBuffer.wrap(password));
byte[] pwBytes = new byte[pwBuf.remaining()];
pwBuf.get(pwBytes);
int errorCode = storePassword0(account.getBytes(UTF_8), pwBytes);
Arrays.fill(pwBytes, (byte) 0x00);
Arrays.fill(pw... | java | public void storePassword(String account, CharSequence password) {
ByteBuffer pwBuf = UTF_8.encode(CharBuffer.wrap(password));
byte[] pwBytes = new byte[pwBuf.remaining()];
pwBuf.get(pwBytes);
int errorCode = storePassword0(account.getBytes(UTF_8), pwBytes);
Arrays.fill(pwBytes, (byte) 0x00);
Arrays.fill(pw... | [
"public",
"void",
"storePassword",
"(",
"String",
"account",
",",
"CharSequence",
"password",
")",
"{",
"ByteBuffer",
"pwBuf",
"=",
"UTF_8",
".",
"encode",
"(",
"CharBuffer",
".",
"wrap",
"(",
"password",
")",
")",
";",
"byte",
"[",
"]",
"pwBytes",
"=",
... | Associates the specified password with the specified key in the system keychain.
@param account Unique account identifier
@param password Passphrase to store | [
"Associates",
"the",
"specified",
"password",
"with",
"the",
"specified",
"key",
"in",
"the",
"system",
"keychain",
"."
] | train | https://github.com/cryptomator/native-functions/blob/764cb1edbffbc2a4129c71011941adcbd4c12292/JNI/src/main/java/org/cryptomator/jni/MacKeychainAccess.java#L28-L38 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotateLocalX | public Matrix4x3d rotateLocalX(double ang, Matrix4x3d dest) {
double sin = Math.sin(ang);
double cos = Math.cosFromSin(sin, ang);
double nm01 = cos * m01 - sin * m02;
double nm02 = sin * m01 + cos * m02;
double nm11 = cos * m11 - sin * m12;
double nm12 = sin * m11 + cos *... | java | public Matrix4x3d rotateLocalX(double ang, Matrix4x3d dest) {
double sin = Math.sin(ang);
double cos = Math.cosFromSin(sin, ang);
double nm01 = cos * m01 - sin * m02;
double nm02 = sin * m01 + cos * m02;
double nm11 = cos * m11 - sin * m12;
double nm12 = sin * m11 + cos *... | [
"public",
"Matrix4x3d",
"rotateLocalX",
"(",
"double",
"ang",
",",
"Matrix4x3d",
"dest",
")",
"{",
"double",
"sin",
"=",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"double",
"cos",
"=",
"Math",
".",
"cosFromSin",
"(",
"sin",
",",
"ang",
")",
";",
"dou... | Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the ... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"around",
"the",
"X",
"axis",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"X",
"axis",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L3584-L3609 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_calls_id_eavesdrop_POST | public OvhTask billingAccount_line_serviceName_calls_id_eavesdrop_POST(String billingAccount, String serviceName, Long id, String number) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/calls/{id}/eavesdrop";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Hash... | java | public OvhTask billingAccount_line_serviceName_calls_id_eavesdrop_POST(String billingAccount, String serviceName, Long id, String number) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/calls/{id}/eavesdrop";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Hash... | [
"public",
"OvhTask",
"billingAccount_line_serviceName_calls_id_eavesdrop_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
",",
"String",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAcco... | Eavesdrop on a call
REST: POST /telephony/{billingAccount}/line/{serviceName}/calls/{id}/eavesdrop
@param number [required] Phone number that will be called and bridged in the communication
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the obj... | [
"Eavesdrop",
"on",
"a",
"call"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1932-L1939 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_scatter.java | DZcs_scatter.cs_scatter | public static int cs_scatter(DZcs A, int j, double[] beta, int[] w, DZcsa x, int mark, DZcs C, int nz)
{
int i, p, Ap[], Ai[], Ci[] ;
DZcsa Ax = new DZcsa() ;
if (!CS_CSC(A) || (w == null) || !CS_CSC(C)) return (-1) ; /* check inputs */
Ap = A.p ; Ai = A.i ; Ax.x = A.x ; Ci = C.i ;
for (p = Ap [j]; p <... | java | public static int cs_scatter(DZcs A, int j, double[] beta, int[] w, DZcsa x, int mark, DZcs C, int nz)
{
int i, p, Ap[], Ai[], Ci[] ;
DZcsa Ax = new DZcsa() ;
if (!CS_CSC(A) || (w == null) || !CS_CSC(C)) return (-1) ; /* check inputs */
Ap = A.p ; Ai = A.i ; Ax.x = A.x ; Ci = C.i ;
for (p = Ap [j]; p <... | [
"public",
"static",
"int",
"cs_scatter",
"(",
"DZcs",
"A",
",",
"int",
"j",
",",
"double",
"[",
"]",
"beta",
",",
"int",
"[",
"]",
"w",
",",
"DZcsa",
"x",
",",
"int",
"mark",
",",
"DZcs",
"C",
",",
"int",
"nz",
")",
"{",
"int",
"i",
",",
"p",... | Scatters and sums a sparse vector A(:,j) into a dense vector,
x = x + beta * A(:,j).
@param A
the sparse vector is A(:,j)
@param j
the column of A to use
@param beta
scalar multiplied by A(:,j)
@param w
size m, node i is marked if w[i] = mark
@param x
size m, ignored if null
@param mark
mark value of w
@param C
patter... | [
"Scatters",
"and",
"sums",
"a",
"sparse",
"vector",
"A",
"(",
":",
"j",
")",
"into",
"a",
"dense",
"vector",
"x",
"=",
"x",
"+",
"beta",
"*",
"A",
"(",
":",
"j",
")",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_scatter.java#L65-L87 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java | AbstractTreeWriter.addTree | protected void addTree(SortedSet<TypeElement> sset, String heading, HtmlTree div) {
addTree(sset, heading, div, false);
} | java | protected void addTree(SortedSet<TypeElement> sset, String heading, HtmlTree div) {
addTree(sset, heading, div, false);
} | [
"protected",
"void",
"addTree",
"(",
"SortedSet",
"<",
"TypeElement",
">",
"sset",
",",
"String",
"heading",
",",
"HtmlTree",
"div",
")",
"{",
"addTree",
"(",
"sset",
",",
"heading",
",",
"div",
",",
"false",
")",
";",
"}"
] | Add the heading for the tree depending upon tree type if it's a
Class Tree or Interface tree.
@param sset classes which are at the most base level, all the
other classes in this run will derive from these classes
@param heading heading for the tree
@param div the content tree to which the tree will be added | [
"Add",
"the",
"heading",
"for",
"the",
"tree",
"depending",
"upon",
"tree",
"type",
"if",
"it",
"s",
"a",
"Class",
"Tree",
"or",
"Interface",
"tree",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java#L111-L113 |
codahale/xsalsa20poly1305 | src/main/java/com/codahale/xsalsa20poly1305/SecretBox.java | SecretBox.open | public Optional<byte[]> open(byte[] nonce, byte[] ciphertext) {
final XSalsa20Engine xsalsa20 = new XSalsa20Engine();
final Poly1305 poly1305 = new Poly1305();
// initialize XSalsa20
xsalsa20.init(false, new ParametersWithIV(new KeyParameter(key), nonce));
// generate mac subkey
final byte[] s... | java | public Optional<byte[]> open(byte[] nonce, byte[] ciphertext) {
final XSalsa20Engine xsalsa20 = new XSalsa20Engine();
final Poly1305 poly1305 = new Poly1305();
// initialize XSalsa20
xsalsa20.init(false, new ParametersWithIV(new KeyParameter(key), nonce));
// generate mac subkey
final byte[] s... | [
"public",
"Optional",
"<",
"byte",
"[",
"]",
">",
"open",
"(",
"byte",
"[",
"]",
"nonce",
",",
"byte",
"[",
"]",
"ciphertext",
")",
"{",
"final",
"XSalsa20Engine",
"xsalsa20",
"=",
"new",
"XSalsa20Engine",
"(",
")",
";",
"final",
"Poly1305",
"poly1305",
... | Decrypt a ciphertext using the given key and nonce.
@param nonce a 24-byte nonce
@param ciphertext the encrypted message
@return an {@link Optional} of the original plaintext, or if either the key, nonce, or
ciphertext was modified, an empty {@link Optional}
@see #nonce(byte[])
@see #nonce() | [
"Decrypt",
"a",
"ciphertext",
"using",
"the",
"given",
"key",
"and",
"nonce",
"."
] | train | https://github.com/codahale/xsalsa20poly1305/blob/f3c1ab2f05b17df137ed8fbb66da2b417066729a/src/main/java/com/codahale/xsalsa20poly1305/SecretBox.java#L104-L136 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/transfer/importer/MultiEntityImporter.java | MultiEntityImporter.addEntity | public void addEntity(String alias, Class<?> entityClass) {
EntityType entityType = Model.getType(entityClass);
if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityClass); }
entityTypes.put(alias, entityType);
} | java | public void addEntity(String alias, Class<?> entityClass) {
EntityType entityType = Model.getType(entityClass);
if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityClass); }
entityTypes.put(alias, entityType);
} | [
"public",
"void",
"addEntity",
"(",
"String",
"alias",
",",
"Class",
"<",
"?",
">",
"entityClass",
")",
"{",
"EntityType",
"entityType",
"=",
"Model",
".",
"getType",
"(",
"entityClass",
")",
";",
"if",
"(",
"null",
"==",
"entityType",
")",
"{",
"throw",... | <p>
addEntity.
</p>
@param alias a {@link java.lang.String} object.
@param entityClass a {@link java.lang.Class} object. | [
"<p",
">",
"addEntity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/transfer/importer/MultiEntityImporter.java#L169-L173 |
kaazing/java.client | net.api/src/main/java/org/kaazing/net/URLFactory.java | URLFactory.createURL | public static URL createURL(String protocol,
String host,
int port,
String file) throws MalformedURLException {
URLStreamHandlerFactory factory = _factories.get(protocol);
// If there is no URLStreamHandlerF... | java | public static URL createURL(String protocol,
String host,
int port,
String file) throws MalformedURLException {
URLStreamHandlerFactory factory = _factories.get(protocol);
// If there is no URLStreamHandlerF... | [
"public",
"static",
"URL",
"createURL",
"(",
"String",
"protocol",
",",
"String",
"host",
",",
"int",
"port",
",",
"String",
"file",
")",
"throws",
"MalformedURLException",
"{",
"URLStreamHandlerFactory",
"factory",
"=",
"_factories",
".",
"get",
"(",
"protocol"... | Creates a URL from the specified protocol name, host name, port number,
and file name.
<p/>
No validation of the inputs is performed by this method.
@param protocol the name of the protocol to use
@param host the name of the host
@param port the port number
@param file the file on the host
@return URL crea... | [
"Creates",
"a",
"URL",
"from",
"the",
"specified",
"protocol",
"name",
"host",
"name",
"port",
"number",
"and",
"file",
"name",
".",
"<p",
"/",
">",
"No",
"validation",
"of",
"the",
"inputs",
"is",
"performed",
"by",
"this",
"method",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/net.api/src/main/java/org/kaazing/net/URLFactory.java#L182-L199 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java | ResourceUtil.toResourceExistingParent | public static Resource toResourceExistingParent(PageContext pc, String destination) throws ExpressionException {
return toResourceExistingParent(pc, destination, pc.getConfig().allowRealPath());
} | java | public static Resource toResourceExistingParent(PageContext pc, String destination) throws ExpressionException {
return toResourceExistingParent(pc, destination, pc.getConfig().allowRealPath());
} | [
"public",
"static",
"Resource",
"toResourceExistingParent",
"(",
"PageContext",
"pc",
",",
"String",
"destination",
")",
"throws",
"ExpressionException",
"{",
"return",
"toResourceExistingParent",
"(",
"pc",
",",
"destination",
",",
"pc",
".",
"getConfig",
"(",
")",... | cast a String (argument destination) to a File Object, if destination is not a absolute, file
object will be relative to current position (get from PageContext) at least parent must exist
@param pc Page Context to the current position in filesystem
@param destination relative or absolute path for file object
@return f... | [
"cast",
"a",
"String",
"(",
"argument",
"destination",
")",
"to",
"a",
"File",
"Object",
"if",
"destination",
"is",
"not",
"a",
"absolute",
"file",
"object",
"will",
"be",
"relative",
"to",
"current",
"position",
"(",
"get",
"from",
"PageContext",
")",
"at... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L261-L263 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java | UnifiedResponseDefaultSettings.setXFrameOptions | public static void setXFrameOptions (@Nullable final EXFrameOptionType eType, @Nullable final ISimpleURL aDomain)
{
if (eType != null && eType.isURLRequired ())
ValueEnforcer.notNull (aDomain, "Domain");
if (eType == null)
{
removeResponseHeaders (CHttpHeader.X_FRAME_OPTIONS);
}
else
... | java | public static void setXFrameOptions (@Nullable final EXFrameOptionType eType, @Nullable final ISimpleURL aDomain)
{
if (eType != null && eType.isURLRequired ())
ValueEnforcer.notNull (aDomain, "Domain");
if (eType == null)
{
removeResponseHeaders (CHttpHeader.X_FRAME_OPTIONS);
}
else
... | [
"public",
"static",
"void",
"setXFrameOptions",
"(",
"@",
"Nullable",
"final",
"EXFrameOptionType",
"eType",
",",
"@",
"Nullable",
"final",
"ISimpleURL",
"aDomain",
")",
"{",
"if",
"(",
"eType",
"!=",
"null",
"&&",
"eType",
".",
"isURLRequired",
"(",
")",
")... | The X-Frame-Options HTTP response header can be used to indicate whether or
not a browser should be allowed to render a page in a <frame>,
<iframe> or <object> . Sites can use this to avoid clickjacking
attacks, by ensuring that their content is not embedded into other sites.
Example:
<pre>
X-Frame-O... | [
"The",
"X",
"-",
"Frame",
"-",
"Options",
"HTTP",
"response",
"header",
"can",
"be",
"used",
"to",
"indicate",
"whether",
"or",
"not",
"a",
"browser",
"should",
"be",
"allowed",
"to",
"render",
"a",
"page",
"in",
"a",
"<",
";",
"frame>",
";",
"<"... | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java#L174-L191 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.inner | public Table inner(Table table2, String col2Name) {
return inner(table2, false, col2Name);
} | java | public Table inner(Table table2, String col2Name) {
return inner(table2, false, col2Name);
} | [
"public",
"Table",
"inner",
"(",
"Table",
"table2",
",",
"String",
"col2Name",
")",
"{",
"return",
"inner",
"(",
"table2",
",",
"false",
",",
"col2Name",
")",
";",
"}"
] | Joins the joiner to the table2, using the given column for the second table and returns the resulting table
@param table2 The table to join with
@param col2Name The column to join on. If col2Name refers to a double column, the join is performed after
rounding to integers.
@return The resulting table | [
"Joins",
"the",
"joiner",
"to",
"the",
"table2",
"using",
"the",
"given",
"column",
"for",
"the",
"second",
"table",
"and",
"returns",
"the",
"resulting",
"table"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L103-L105 |
99soft/lifegycle | src/main/java/org/nnsoft/guice/lifegycle/AbstractMethodTypeListener.java | AbstractMethodTypeListener.hear | private <I> void hear( Class<? super I> type, TypeEncounter<I> encounter )
{
if ( type == null || type.getPackage().getName().startsWith( JAVA_PACKAGE ) )
{
return;
}
for ( Method method : type.getDeclaredMethods() )
{
if ( method.isAnnotationPresent(... | java | private <I> void hear( Class<? super I> type, TypeEncounter<I> encounter )
{
if ( type == null || type.getPackage().getName().startsWith( JAVA_PACKAGE ) )
{
return;
}
for ( Method method : type.getDeclaredMethods() )
{
if ( method.isAnnotationPresent(... | [
"private",
"<",
"I",
">",
"void",
"hear",
"(",
"Class",
"<",
"?",
"super",
"I",
">",
"type",
",",
"TypeEncounter",
"<",
"I",
">",
"encounter",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"type",
".",
"getPackage",
"(",
")",
".",
"getName",
"... | Allows traverse the input type hierarchy.
@param type encountered by Guice.
@param encounter the injection context. | [
"Allows",
"traverse",
"the",
"input",
"type",
"hierarchy",
"."
] | train | https://github.com/99soft/lifegycle/blob/0adde20bcf32e90fe995bb493630b77fa6ce6361/src/main/java/org/nnsoft/guice/lifegycle/AbstractMethodTypeListener.java#L67-L89 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.isHavePathSelfConfig | public static boolean isHavePathSelfConfig(IConfigKeyWithPath key) {
String configAbsoluteClassPath = key.getConfigPath();
return isSelfConfig(configAbsoluteClassPath, key);
} | java | public static boolean isHavePathSelfConfig(IConfigKeyWithPath key) {
String configAbsoluteClassPath = key.getConfigPath();
return isSelfConfig(configAbsoluteClassPath, key);
} | [
"public",
"static",
"boolean",
"isHavePathSelfConfig",
"(",
"IConfigKeyWithPath",
"key",
")",
"{",
"String",
"configAbsoluteClassPath",
"=",
"key",
".",
"getConfigPath",
"(",
")",
";",
"return",
"isSelfConfig",
"(",
"configAbsoluteClassPath",
",",
"key",
")",
";",
... | Get self config boolean value
@param key config key with configAbsoluteClassPath in config file
@return true/false. If not add config file or not config in config file, return false.
@see #addSelfConfigs(String, OneProperties) | [
"Get",
"self",
"config",
"boolean",
"value"
] | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L365-L368 |
ModeShape/modeshape | connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/CmisConnector.java | CmisConnector.jcrBinaryContent | private ContentStream jcrBinaryContent( Document document ) {
// pickup node properties
Document props = document.getDocument("properties").getDocument(JcrLexicon.Namespace.URI);
// extract binary value and content
Binary value = props.getBinary("data");
if (value == null) {
... | java | private ContentStream jcrBinaryContent( Document document ) {
// pickup node properties
Document props = document.getDocument("properties").getDocument(JcrLexicon.Namespace.URI);
// extract binary value and content
Binary value = props.getBinary("data");
if (value == null) {
... | [
"private",
"ContentStream",
"jcrBinaryContent",
"(",
"Document",
"document",
")",
"{",
"// pickup node properties",
"Document",
"props",
"=",
"document",
".",
"getDocument",
"(",
"\"properties\"",
")",
".",
"getDocument",
"(",
"JcrLexicon",
".",
"Namespace",
".",
"U... | Creates content stream using JCR node.
@param document JCR node representation
@return CMIS content stream object | [
"Creates",
"content",
"stream",
"using",
"JCR",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/CmisConnector.java#L952-L973 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/css/CSSFactory.java | CSSFactory.assignDOM | public static final StyleMap assignDOM(Document doc, String encoding,
URL base, String media, boolean useInheritance, final MatchCondition matchCond) {
return assignDOM(doc, encoding, base, new MediaSpec(media), useInheritance, matchCond);
} | java | public static final StyleMap assignDOM(Document doc, String encoding,
URL base, String media, boolean useInheritance, final MatchCondition matchCond) {
return assignDOM(doc, encoding, base, new MediaSpec(media), useInheritance, matchCond);
} | [
"public",
"static",
"final",
"StyleMap",
"assignDOM",
"(",
"Document",
"doc",
",",
"String",
"encoding",
",",
"URL",
"base",
",",
"String",
"media",
",",
"boolean",
"useInheritance",
",",
"final",
"MatchCondition",
"matchCond",
")",
"{",
"return",
"assignDOM",
... | This is the same as {@link CSSFactory#assignDOM(Document, String, URL, MediaSpec, boolean)} but only the
media type is provided instead of the complete media specification.
@param doc
DOM tree
@param encoding
The default encoding used for the referenced style sheets
@param base
Base URL against which all files are sea... | [
"This",
"is",
"the",
"same",
"as",
"{",
"@link",
"CSSFactory#assignDOM",
"(",
"Document",
"String",
"URL",
"MediaSpec",
"boolean",
")",
"}",
"but",
"only",
"the",
"media",
"type",
"is",
"provided",
"instead",
"of",
"the",
"complete",
"media",
"specification",
... | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/css/CSSFactory.java#L770-L774 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java | ArmeriaHttpUtil.toNettyHttp2 | public static Http2Headers toNettyHttp2(HttpHeaders in, boolean server) {
final Http2Headers out = new DefaultHttp2Headers(false, in.size());
// Trailing headers if it does not have :status.
if (server && in.status() == null) {
for (Entry<AsciiString, String> entry : in) {
... | java | public static Http2Headers toNettyHttp2(HttpHeaders in, boolean server) {
final Http2Headers out = new DefaultHttp2Headers(false, in.size());
// Trailing headers if it does not have :status.
if (server && in.status() == null) {
for (Entry<AsciiString, String> entry : in) {
... | [
"public",
"static",
"Http2Headers",
"toNettyHttp2",
"(",
"HttpHeaders",
"in",
",",
"boolean",
"server",
")",
"{",
"final",
"Http2Headers",
"out",
"=",
"new",
"DefaultHttp2Headers",
"(",
"false",
",",
"in",
".",
"size",
"(",
")",
")",
";",
"// Trailing headers ... | Converts the specified Armeria HTTP/2 headers into Netty HTTP/2 headers. | [
"Converts",
"the",
"specified",
"Armeria",
"HTTP",
"/",
"2",
"headers",
"into",
"Netty",
"HTTP",
"/",
"2",
"headers",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java#L748-L779 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_envVar_key_PUT | public void serviceName_envVar_key_PUT(String serviceName, String key, OvhEnvVar body) throws IOException {
String qPath = "/hosting/web/{serviceName}/envVar/{key}";
StringBuilder sb = path(qPath, serviceName, key);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_envVar_key_PUT(String serviceName, String key, OvhEnvVar body) throws IOException {
String qPath = "/hosting/web/{serviceName}/envVar/{key}";
StringBuilder sb = path(qPath, serviceName, key);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_envVar_key_PUT",
"(",
"String",
"serviceName",
",",
"String",
"key",
",",
"OvhEnvVar",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/envVar/{key}\"",
";",
"StringBuilder",
"sb",
"=",
"pa... | Alter this object properties
REST: PUT /hosting/web/{serviceName}/envVar/{key}
@param body [required] New object properties
@param serviceName [required] The internal name of your hosting
@param key [required] Name of the variable | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1787-L1791 |
microfocus-idol/java-parametric-databases | hod/src/main/java/com/hp/autonomy/hod/databases/AbstractResourceMapper.java | AbstractResourceMapper.databaseForResource | protected Database databaseForResource(final TokenProxy<?, TokenType.Simple> tokenProxy, final Resource resource, final String domain) throws HodErrorException {
final ResourceIdentifier resourceIdentifier = new ResourceIdentifier(domain, resource.getResource());
final Set<String> parametricFields;
... | java | protected Database databaseForResource(final TokenProxy<?, TokenType.Simple> tokenProxy, final Resource resource, final String domain) throws HodErrorException {
final ResourceIdentifier resourceIdentifier = new ResourceIdentifier(domain, resource.getResource());
final Set<String> parametricFields;
... | [
"protected",
"Database",
"databaseForResource",
"(",
"final",
"TokenProxy",
"<",
"?",
",",
"TokenType",
".",
"Simple",
">",
"tokenProxy",
",",
"final",
"Resource",
"resource",
",",
"final",
"String",
"domain",
")",
"throws",
"HodErrorException",
"{",
"final",
"R... | Converts the given resource name to a database
@param tokenProxy The token proxy to use to retrieve parametric fields
@param resource The resource
@param domain The domain of the resource
@return A database representation of the resource
@throws HodErrorException | [
"Converts",
"the",
"given",
"resource",
"name",
"to",
"a",
"database"
] | train | https://github.com/microfocus-idol/java-parametric-databases/blob/378a246a1857f911587106241712d16c2e118af2/hod/src/main/java/com/hp/autonomy/hod/databases/AbstractResourceMapper.java#L36-L54 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java | ConsoleMenu.addMenuItem | public void addMenuItem(final String menuDisplay, final String methodName, final boolean repeat) {
menu.add(menuDisplay);
methods.add(methodName);
askForRepeat.add(Boolean.valueOf(repeat));
} | java | public void addMenuItem(final String menuDisplay, final String methodName, final boolean repeat) {
menu.add(menuDisplay);
methods.add(methodName);
askForRepeat.add(Boolean.valueOf(repeat));
} | [
"public",
"void",
"addMenuItem",
"(",
"final",
"String",
"menuDisplay",
",",
"final",
"String",
"methodName",
",",
"final",
"boolean",
"repeat",
")",
"{",
"menu",
".",
"add",
"(",
"menuDisplay",
")",
";",
"methods",
".",
"add",
"(",
"methodName",
")",
";",... | add an entry in the menu, sequentially
@param menuDisplay
how the entry will be displayed in the menu
@param methodName
name of the public method
@param repeat call back for repeat | [
"add",
"an",
"entry",
"in",
"the",
"menu",
"sequentially"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java#L94-L98 |
VoltDB/voltdb | src/frontend/org/voltdb/types/GeographyPointValue.java | GeographyPointValue.unflattenFromBuffer | public static GeographyPointValue unflattenFromBuffer(ByteBuffer inBuffer, int offset) {
double lng = inBuffer.getDouble(offset);
double lat = inBuffer.getDouble(offset + BYTES_IN_A_COORD);
if (lat == 360.0 && lng == 360.0) {
// This is a null point.
return null;
... | java | public static GeographyPointValue unflattenFromBuffer(ByteBuffer inBuffer, int offset) {
double lng = inBuffer.getDouble(offset);
double lat = inBuffer.getDouble(offset + BYTES_IN_A_COORD);
if (lat == 360.0 && lng == 360.0) {
// This is a null point.
return null;
... | [
"public",
"static",
"GeographyPointValue",
"unflattenFromBuffer",
"(",
"ByteBuffer",
"inBuffer",
",",
"int",
"offset",
")",
"{",
"double",
"lng",
"=",
"inBuffer",
".",
"getDouble",
"(",
"offset",
")",
";",
"double",
"lat",
"=",
"inBuffer",
".",
"getDouble",
"(... | Deserializes a point from a ByteBuffer, at an absolute offset.
@param inBuffer The ByteBuffer from which to read the bytes for a point.
@param offset Absolute offset of point data in buffer.
@return A new instance of GeographyPointValue. | [
"Deserializes",
"a",
"point",
"from",
"a",
"ByteBuffer",
"at",
"an",
"absolute",
"offset",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/types/GeographyPointValue.java#L230-L239 |
filosganga/geogson | core/src/main/java/com/github/filosganga/geogson/model/Polygon.java | Polygon.of | public static Polygon of(LinearRing perimeter, Stream<LinearRing> holes) {
return new Polygon(AreaPositions.builder()
.addLinearPosition(perimeter.positions())
.addLinearPositions(holes
.map(LinearRing::positions)::iterator)
.build());
... | java | public static Polygon of(LinearRing perimeter, Stream<LinearRing> holes) {
return new Polygon(AreaPositions.builder()
.addLinearPosition(perimeter.positions())
.addLinearPositions(holes
.map(LinearRing::positions)::iterator)
.build());
... | [
"public",
"static",
"Polygon",
"of",
"(",
"LinearRing",
"perimeter",
",",
"Stream",
"<",
"LinearRing",
">",
"holes",
")",
"{",
"return",
"new",
"Polygon",
"(",
"AreaPositions",
".",
"builder",
"(",
")",
".",
"addLinearPosition",
"(",
"perimeter",
".",
"posit... | Creates a Polygon from the given perimeter and holes.
@param perimeter The perimeter {@link LinearRing}.
@param holes The holes {@link LinearRing} Stream.
@return Polygon | [
"Creates",
"a",
"Polygon",
"from",
"the",
"given",
"perimeter",
"and",
"holes",
"."
] | train | https://github.com/filosganga/geogson/blob/f0c7b0adfecc174caa8a03a6c19d301c7a47d4a0/core/src/main/java/com/github/filosganga/geogson/model/Polygon.java#L76-L83 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/Util.java | Util.checkIfMultipleOf8AndGT0 | public static void checkIfMultipleOf8AndGT0(final long v, final String argName) {
if (((v & 0X7L) == 0L) && (v > 0L)) {
return;
}
throw new SketchesArgumentException("The value of the parameter \"" + argName
+ "\" must be a positive multiple of 8 and greater than zero: " + v);
} | java | public static void checkIfMultipleOf8AndGT0(final long v, final String argName) {
if (((v & 0X7L) == 0L) && (v > 0L)) {
return;
}
throw new SketchesArgumentException("The value of the parameter \"" + argName
+ "\" must be a positive multiple of 8 and greater than zero: " + v);
} | [
"public",
"static",
"void",
"checkIfMultipleOf8AndGT0",
"(",
"final",
"long",
"v",
",",
"final",
"String",
"argName",
")",
"{",
"if",
"(",
"(",
"(",
"v",
"&",
"0X7",
"L",
")",
"==",
"0L",
")",
"&&",
"(",
"v",
">",
"0L",
")",
")",
"{",
"return",
"... | Checks if parameter v is a multiple of 8 and greater than zero.
@param v The parameter to check
@param argName This name will be part of the error message if the check fails. | [
"Checks",
"if",
"parameter",
"v",
"is",
"a",
"multiple",
"of",
"8",
"and",
"greater",
"than",
"zero",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/Util.java#L330-L336 |
jinahya/hex-codec | src/main/java/com/github/jinahya/codec/HexDecoder.java | HexDecoder.decodeToString | public String decodeToString(final byte[] input, final String outputCharset)
throws UnsupportedEncodingException {
return new String(decode(input), outputCharset);
} | java | public String decodeToString(final byte[] input, final String outputCharset)
throws UnsupportedEncodingException {
return new String(decode(input), outputCharset);
} | [
"public",
"String",
"decodeToString",
"(",
"final",
"byte",
"[",
"]",
"input",
",",
"final",
"String",
"outputCharset",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"new",
"String",
"(",
"decode",
"(",
"input",
")",
",",
"outputCharset",
")",
... | Decodes given sequence of nibbles into a string.
@param input the nibbles to decode
@param outputCharset the charset name to encode output string
@return the decoded string.
@throws UnsupportedEncodingException if outputCharset is not supported | [
"Decodes",
"given",
"sequence",
"of",
"nibbles",
"into",
"a",
"string",
"."
] | train | https://github.com/jinahya/hex-codec/blob/159aa54010821655496177e76a3ef35a49fbd433/src/main/java/com/github/jinahya/codec/HexDecoder.java#L218-L222 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getRequstURIPath | public float getRequstURIPath(String prefix, float defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Float.parseFloat(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | java | public float getRequstURIPath(String prefix, float defvalue) {
String val = getRequstURIPath(prefix, null);
try {
return val == null ? defvalue : Float.parseFloat(val);
} catch (NumberFormatException e) {
return defvalue;
}
} | [
"public",
"float",
"getRequstURIPath",
"(",
"String",
"prefix",
",",
"float",
"defvalue",
")",
"{",
"String",
"val",
"=",
"getRequstURIPath",
"(",
"prefix",
",",
"null",
")",
";",
"try",
"{",
"return",
"val",
"==",
"null",
"?",
"defvalue",
":",
"Float",
... | 获取请求URL分段中含prefix段的float值 <br>
例如请求URL /pipes/record/query/point:40.0 <br>
获取time参数: float point = request.getRequstURIPath("point:", 0.0f);
@param prefix prefix段前缀
@param defvalue 默认float值
@return float值 | [
"获取请求URL分段中含prefix段的float值",
"<br",
">",
"例如请求URL",
"/",
"pipes",
"/",
"record",
"/",
"query",
"/",
"point",
":",
"40",
".",
"0",
"<br",
">",
"获取time参数",
":",
"float",
"point",
"=",
"request",
".",
"getRequstURIPath",
"(",
"point",
":",
"0",
".",
"0f",
... | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L897-L904 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deleteIfExists | public static void deleteIfExists(FileSystem fs, Path path, boolean recursive) throws IOException {
if (fs.exists(path)) {
deletePath(fs, path, recursive);
}
} | java | public static void deleteIfExists(FileSystem fs, Path path, boolean recursive) throws IOException {
if (fs.exists(path)) {
deletePath(fs, path, recursive);
}
} | [
"public",
"static",
"void",
"deleteIfExists",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
".",
"exists",
"(",
"path",
")",
")",
"{",
"deletePath",
"(",
"fs",
",",
"path",
... | A wrapper around {@link FileSystem#delete(Path, boolean)} that only deletes a given {@link Path} if it is present
on the given {@link FileSystem}. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L171-L175 |
lets-blade/blade | src/main/java/com/blade/kit/AsmKit.java | AsmKit.sameType | private static boolean sameType(Type[] types, Class<?>[] classes) {
if (types.length != classes.length) return false;
for (int i = 0; i < types.length; i++) {
if (!Type.getType(classes[i]).equals(types[i])) return false;
}
return true;
} | java | private static boolean sameType(Type[] types, Class<?>[] classes) {
if (types.length != classes.length) return false;
for (int i = 0; i < types.length; i++) {
if (!Type.getType(classes[i]).equals(types[i])) return false;
}
return true;
} | [
"private",
"static",
"boolean",
"sameType",
"(",
"Type",
"[",
"]",
"types",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
")",
"{",
"if",
"(",
"types",
".",
"length",
"!=",
"classes",
".",
"length",
")",
"return",
"false",
";",
"for",
"(",
"int... | Compare whether the parameter type is consistent
@param types the type of the asm({@link Type})
@param classes java type({@link Class})
@return return param type equals | [
"Compare",
"whether",
"the",
"parameter",
"type",
"is",
"consistent"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/AsmKit.java#L49-L55 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java | RespokeClient.buildGroupMessage | private RespokeGroupMessage buildGroupMessage(JSONObject source) throws JSONException {
if (source == null) {
throw new IllegalArgumentException("source cannot be null");
}
final JSONObject header = source.getJSONObject("header");
final String endpointID = header.getString("... | java | private RespokeGroupMessage buildGroupMessage(JSONObject source) throws JSONException {
if (source == null) {
throw new IllegalArgumentException("source cannot be null");
}
final JSONObject header = source.getJSONObject("header");
final String endpointID = header.getString("... | [
"private",
"RespokeGroupMessage",
"buildGroupMessage",
"(",
"JSONObject",
"source",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"source cannot be null\"",
")",
";",
"}",
"final"... | Build a group message from a JSON object. The format of the JSON object would be the
format that comes over the wire from Respoke when receiving a pubsub message. This same
format is used when retrieving message history.
@param source The source JSON object to build the RespokeGroupMessage from
@return The built Respo... | [
"Build",
"a",
"group",
"message",
"from",
"a",
"JSON",
"object",
".",
"The",
"format",
"of",
"the",
"JSON",
"object",
"would",
"be",
"the",
"format",
"that",
"comes",
"over",
"the",
"wire",
"from",
"Respoke",
"when",
"receiving",
"a",
"pubsub",
"message",
... | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java#L1576-L1604 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerState.java | PaymentChannelServerState.storeChannelInWallet | public synchronized void storeChannelInWallet(@Nullable PaymentChannelServer connectedHandler) {
stateMachine.checkState(State.READY);
if (storedServerChannel != null)
return;
log.info("Storing state with contract hash {}.", getContract().getTxId());
StoredPaymentChannelServ... | java | public synchronized void storeChannelInWallet(@Nullable PaymentChannelServer connectedHandler) {
stateMachine.checkState(State.READY);
if (storedServerChannel != null)
return;
log.info("Storing state with contract hash {}.", getContract().getTxId());
StoredPaymentChannelServ... | [
"public",
"synchronized",
"void",
"storeChannelInWallet",
"(",
"@",
"Nullable",
"PaymentChannelServer",
"connectedHandler",
")",
"{",
"stateMachine",
".",
"checkState",
"(",
"State",
".",
"READY",
")",
";",
"if",
"(",
"storedServerChannel",
"!=",
"null",
")",
"ret... | Stores this channel's state in the wallet as a part of a {@link StoredPaymentChannelServerStates} wallet
extension and keeps it up-to-date each time payment is incremented. This will be automatically removed when
a call to {@link PaymentChannelV1ServerState#close()} completes successfully. A channel may only be stored ... | [
"Stores",
"this",
"channel",
"s",
"state",
"in",
"the",
"wallet",
"as",
"a",
"part",
"of",
"a",
"{",
"@link",
"StoredPaymentChannelServerStates",
"}",
"wallet",
"extension",
"and",
"keeps",
"it",
"up",
"-",
"to",
"-",
"date",
"each",
"time",
"payment",
"is... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerState.java#L366-L378 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/text/word/TextAnalyzer.java | TextAnalyzer.createInstance | static public TextAnalyzer createInstance(int type,
String dictionaryPath,
Map<String, ? extends Object> keywordDefinitions,
Map<Integer, ? extends Object> lengthDefinitions){
switch(type){
case TYPE_MMSEG_COMPLEX:
case TYPE_MMSEG_MAXWORD:
case TYPE_MMSEG_SIMPLE:
return new MmsegTextAnaly... | java | static public TextAnalyzer createInstance(int type,
String dictionaryPath,
Map<String, ? extends Object> keywordDefinitions,
Map<Integer, ? extends Object> lengthDefinitions){
switch(type){
case TYPE_MMSEG_COMPLEX:
case TYPE_MMSEG_MAXWORD:
case TYPE_MMSEG_SIMPLE:
return new MmsegTextAnaly... | [
"static",
"public",
"TextAnalyzer",
"createInstance",
"(",
"int",
"type",
",",
"String",
"dictionaryPath",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"keywordDefinitions",
",",
"Map",
"<",
"Integer",
",",
"?",
"extends",
"Object",
">",
"l... | Create an instance of TextAnalyzer.<br>
创建一个文本分析器实例。
@param type {@link #TYPE_MMSEG_SIMPLE} | {@link #TYPE_MMSEG_COMPLEX} | {@link #TYPE_MMSEG_MAXWORD} | {@link #TYPE_FAST}
@param dictionaryPath 字典文件路径,如果为null,则表示使用缺省位置的字典文件
@param keywordDefinitions 关键词字的定义
@param lengthDefinitions 文本长度类别定义
@return A new instance... | [
"Create",
"an",
"instance",
"of",
"TextAnalyzer",
".",
"<br",
">",
"创建一个文本分析器实例。"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/word/TextAnalyzer.java#L61-L75 |
dnsjava/dnsjava | org/xbill/DNS/ZoneTransferIn.java | ZoneTransferIn.newAXFR | public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
return newAXFR(zone, host, 0, key);
} | java | public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
return newAXFR(zone, host, 0, key);
} | [
"public",
"static",
"ZoneTransferIn",
"newAXFR",
"(",
"Name",
"zone",
",",
"String",
"host",
",",
"TSIG",
"key",
")",
"throws",
"UnknownHostException",
"{",
"return",
"newAXFR",
"(",
"zone",
",",
"host",
",",
"0",
",",
"key",
")",
";",
"}"
] | Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
@param zone The zone to transfer.
@param host The host from which to transfer the zone.
@param key The TSIG key used to authenticate the transfer, or null.
@return The ZoneTransferIn object.
@throws UnknownHostException The host does not exist. | [
"Instantiates",
"a",
"ZoneTransferIn",
"object",
"to",
"do",
"an",
"AXFR",
"(",
"full",
"zone",
"transfer",
")",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ZoneTransferIn.java#L231-L236 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.listNoteOccurrences | public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) {
ListNoteOccurrencesRequest request =
ListNoteOccurrencesRequest.newBuilder().setName(name).setFilter(filter).build();
return listNoteOccurrences(request);
} | java | public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) {
ListNoteOccurrencesRequest request =
ListNoteOccurrencesRequest.newBuilder().setName(name).setFilter(filter).build();
return listNoteOccurrences(request);
} | [
"public",
"final",
"ListNoteOccurrencesPagedResponse",
"listNoteOccurrences",
"(",
"String",
"name",
",",
"String",
"filter",
")",
"{",
"ListNoteOccurrencesRequest",
"request",
"=",
"ListNoteOccurrencesRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
... | Lists occurrences referencing the specified note. Provider projects can use this method to get
all occurrences across consumer projects referencing the specified note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]",... | [
"Lists",
"occurrences",
"referencing",
"the",
"specified",
"note",
".",
"Provider",
"projects",
"can",
"use",
"this",
"method",
"to",
"get",
"all",
"occurrences",
"across",
"consumer",
"projects",
"referencing",
"the",
"specified",
"note",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1649-L1653 |
joniles/mpxj | src/main/java/net/sf/mpxj/reader/UniversalProjectReader.java | UniversalProjectReader.matchesFingerprint | private boolean matchesFingerprint(byte[] buffer, Pattern fingerprint)
{
return fingerprint.matcher(m_charset == null ? new String(buffer) : new String(buffer, m_charset)).matches();
} | java | private boolean matchesFingerprint(byte[] buffer, Pattern fingerprint)
{
return fingerprint.matcher(m_charset == null ? new String(buffer) : new String(buffer, m_charset)).matches();
} | [
"private",
"boolean",
"matchesFingerprint",
"(",
"byte",
"[",
"]",
"buffer",
",",
"Pattern",
"fingerprint",
")",
"{",
"return",
"fingerprint",
".",
"matcher",
"(",
"m_charset",
"==",
"null",
"?",
"new",
"String",
"(",
"buffer",
")",
":",
"new",
"String",
"... | Determine if the buffer, when expressed as text, matches a fingerprint regular expression.
@param buffer bytes from file
@param fingerprint fingerprint regular expression
@return true if the file matches the fingerprint | [
"Determine",
"if",
"the",
"buffer",
"when",
"expressed",
"as",
"text",
"matches",
"a",
"fingerprint",
"regular",
"expression",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/reader/UniversalProjectReader.java#L341-L344 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java | ClasspathScanDescriptorProvider.scanPackage | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader) {
return scanPackage(packageName, recursive, classLoader, true);
} | java | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader) {
return scanPackage(packageName, recursive, classLoader, true);
} | [
"public",
"ClasspathScanDescriptorProvider",
"scanPackage",
"(",
"final",
"String",
"packageName",
",",
"final",
"boolean",
"recursive",
",",
"final",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"scanPackage",
"(",
"packageName",
",",
"recursive",
",",
"classLoa... | Scans a package in the classpath (of a particular classloader) for annotated components.
@param packageName the package name to scan
@param recursive whether or not to scan subpackages recursively
@param classLoader the classloader to use
@return | [
"Scans",
"a",
"package",
"in",
"the",
"classpath",
"(",
"of",
"a",
"particular",
"classloader",
")",
"for",
"annotated",
"components",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java#L191-L194 |
upwork/java-upwork | src/com/Upwork/api/Routers/Hr/Submissions.java | Submissions.requestApproval | public JSONObject requestApproval(HashMap<String, String> params) throws JSONException {
return oClient.post("/hr/v3/fp/submissions", params);
} | java | public JSONObject requestApproval(HashMap<String, String> params) throws JSONException {
return oClient.post("/hr/v3/fp/submissions", params);
} | [
"public",
"JSONObject",
"requestApproval",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"post",
"(",
"\"/hr/v3/fp/submissions\"",
",",
"params",
")",
";",
"}"
] | Freelancer submits work for the client to approve
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Freelancer",
"submits",
"work",
"for",
"the",
"client",
"to",
"approve"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Submissions.java#L53-L55 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.execute | public int execute(String sql, Object... params) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.execute(conn, sql, params);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | java | public int execute(String sql, Object... params) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.execute(conn, sql, params);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | [
"public",
"int",
"execute",
"(",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"this",
".",
"getConnection",
"(",
")",
";",
"return",
"SqlExecutor",
"... | 执行非查询语句<br>
语句包括 插入、更新、删除
@param sql SQL
@param params 参数
@return 影响行数
@throws SQLException SQL执行异常 | [
"执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L165-L175 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/ShareIntents.java | ShareIntents.newShareTextIntent | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType(MIME_TYPE_T... | java | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType(MIME_TYPE_T... | [
"public",
"static",
"Intent",
"newShareTextIntent",
"(",
"String",
"subject",
",",
"String",
"message",
",",
"String",
"chooserDialogTitle",
")",
"{",
"Intent",
"shareIntent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";",
"shareIntent",
".",... | Creates a chooser to share some data.
@param subject The subject to share (might be discarded, for instance if the user picks an SMS app)
@param message The message to share
@param chooserDialogTitle The title for the chooser dialog
@return the intent | [
"Creates",
"a",
"chooser",
"to",
"share",
"some",
"data",
"."
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/ShareIntents.java#L36-L42 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.withDefault | public static <T> List<T> withDefault(List<T> self, Closure init) {
return withLazyDefault(self, init);
} | java | public static <T> List<T> withDefault(List<T> self, Closure init) {
return withLazyDefault(self, init);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"withDefault",
"(",
"List",
"<",
"T",
">",
"self",
",",
"Closure",
"init",
")",
"{",
"return",
"withLazyDefault",
"(",
"self",
",",
"init",
")",
";",
"}"
] | An alias for <code>withLazyDefault</code> which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
@param self a List
@param init a Closure with the target index as parameter which generates the default value
@return the decorated List
@see #withLazyDefault(java.util.Lis... | [
"An",
"alias",
"for",
"<code",
">",
"withLazyDefault<",
"/",
"code",
">",
"which",
"decorates",
"a",
"list",
"allowing",
"it",
"to",
"grow",
"when",
"called",
"with",
"index",
"values",
"outside",
"the",
"normal",
"list",
"bounds",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L7764-L7766 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java | FeatureUtilities.doVectorize | @SuppressWarnings("unchecked")
public static Collection<Polygon> doVectorize( GridCoverage2D src, Map<String, Object> args ) {
if (args == null) {
args = new HashMap<String, Object>();
}
ParameterBlockJAI pb = new ParameterBlockJAI("Vectorize");
pb.setSource("source0", s... | java | @SuppressWarnings("unchecked")
public static Collection<Polygon> doVectorize( GridCoverage2D src, Map<String, Object> args ) {
if (args == null) {
args = new HashMap<String, Object>();
}
ParameterBlockJAI pb = new ParameterBlockJAI("Vectorize");
pb.setSource("source0", s... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Collection",
"<",
"Polygon",
">",
"doVectorize",
"(",
"GridCoverage2D",
"src",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
... | Helper function to run the Vectorize operation with given parameters and
retrieve the vectors.
@param src the source {@link GridCoverage2D}.
@param args a {@code Map} of parameter names and values or <code>null</code>.
@return the generated vectors as JTS Polygons | [
"Helper",
"function",
"to",
"run",
"the",
"Vectorize",
"operation",
"with",
"given",
"parameters",
"and",
"retrieve",
"the",
"vectors",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureUtilities.java#L729-L760 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java | URLMatchingUtils.isPathNameMatch | public static boolean isPathNameMatch(String uri, String urlPattern) {
if (urlPattern.startsWith("/") && urlPattern.endsWith("/*")) {
String s = urlPattern.substring(0, urlPattern.length() - 1);
/**
* First case,urlPattern
* /a/b/c/ matches /a/b/c/*
... | java | public static boolean isPathNameMatch(String uri, String urlPattern) {
if (urlPattern.startsWith("/") && urlPattern.endsWith("/*")) {
String s = urlPattern.substring(0, urlPattern.length() - 1);
/**
* First case,urlPattern
* /a/b/c/ matches /a/b/c/*
... | [
"public",
"static",
"boolean",
"isPathNameMatch",
"(",
"String",
"uri",
",",
"String",
"urlPattern",
")",
"{",
"if",
"(",
"urlPattern",
".",
"startsWith",
"(",
"\"/\"",
")",
"&&",
"urlPattern",
".",
"endsWith",
"(",
"\"/*\"",
")",
")",
"{",
"String",
"s",
... | Determine if the urlPattern is a path name match for the uri.
@param uri
@param urlPattern
@return | [
"Determine",
"if",
"the",
"urlPattern",
"is",
"a",
"path",
"name",
"match",
"for",
"the",
"uri",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/URLMatchingUtils.java#L85-L113 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/topology/TopologyComparators.java | TopologyComparators.isChanged | public static boolean isChanged(Partitions o1, Partitions o2) {
if (o1.size() != o2.size()) {
return true;
}
for (RedisClusterNode base : o2) {
if (!essentiallyEqualsTo(base, o1.getPartitionByNodeId(base.getNodeId()))) {
return true;
}
... | java | public static boolean isChanged(Partitions o1, Partitions o2) {
if (o1.size() != o2.size()) {
return true;
}
for (RedisClusterNode base : o2) {
if (!essentiallyEqualsTo(base, o1.getPartitionByNodeId(base.getNodeId()))) {
return true;
}
... | [
"public",
"static",
"boolean",
"isChanged",
"(",
"Partitions",
"o1",
",",
"Partitions",
"o2",
")",
"{",
"if",
"(",
"o1",
".",
"size",
"(",
")",
"!=",
"o2",
".",
"size",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"RedisClusterNode",
... | Check if properties changed which are essential for cluster operations.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@return {@literal true} if {@code MASTER} or {@code SLAVE} flags changed or the responsible slots changed. | [
"Check",
"if",
"properties",
"changed",
"which",
"are",
"essential",
"for",
"cluster",
"operations",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/topology/TopologyComparators.java#L121-L134 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.getByResourceGroupAsync | public Observable<VirtualNetworkTapInner> getByResourceGroupAsync(String resourceGroupName, String tapName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInner>() {
@Override
public ... | java | public Observable<VirtualNetworkTapInner> getByResourceGroupAsync(String resourceGroupName, String tapName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"VirtualNetworkTapInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"map"... | Gets information about the specified virtual network tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of virtual network tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualNetworkTapInner object | [
"Gets",
"information",
"about",
"the",
"specified",
"virtual",
"network",
"tap",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L302-L309 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.fastNormP | public static double fastNormP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return fastNormP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
... | java | public static double fastNormP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return fastNormP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
... | [
"public",
"static",
"double",
"fastNormP",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"1",
")",
"{",
"return",
"normP1",
"(",
"A",
")",
";",
"}",
"else",
"if",
"(",
"p",
"==",
"2",
")",
"{",
"return",
"fastNormP2... | An unsafe but faster version of {@link #normP} that calls routines which are faster
but more prone to overflow/underflow problems.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed norm. | [
"An",
"unsafe",
"but",
"faster",
"version",
"of",
"{",
"@link",
"#normP",
"}",
"that",
"calls",
"routines",
"which",
"are",
"faster",
"but",
"more",
"prone",
"to",
"overflow",
"/",
"underflow",
"problems",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L308-L321 |
LearnLib/automatalib | commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/ArrayUtil.java | ArrayUtil.computeNewCapacity | public static int computeNewCapacity(int length, int requiredCapacity, int nextCapacityHint) {
if (requiredCapacity < length) {
return length;
}
int newCapacity = (length * 3) / 2 + 1;
if (newCapacity < nextCapacityHint) {
newCapacity = nextCapacityHint;
... | java | public static int computeNewCapacity(int length, int requiredCapacity, int nextCapacityHint) {
if (requiredCapacity < length) {
return length;
}
int newCapacity = (length * 3) / 2 + 1;
if (newCapacity < nextCapacityHint) {
newCapacity = nextCapacityHint;
... | [
"public",
"static",
"int",
"computeNewCapacity",
"(",
"int",
"length",
",",
"int",
"requiredCapacity",
",",
"int",
"nextCapacityHint",
")",
"{",
"if",
"(",
"requiredCapacity",
"<",
"length",
")",
"{",
"return",
"length",
";",
"}",
"int",
"newCapacity",
"=",
... | Computes the size of an array that is required to hold {@code requiredCapacity} number of elements.
<p>
This method first tries to increase the size of the array by a factor of 1.5 to prevent a sequence of successive
increases by 1. It then evaluates the {@code nextCapacityHint} parameter as well as the {@code required... | [
"Computes",
"the",
"size",
"of",
"an",
"array",
"that",
"is",
"required",
"to",
"hold",
"{",
"@code",
"requiredCapacity",
"}",
"number",
"of",
"elements",
".",
"<p",
">",
"This",
"method",
"first",
"tries",
"to",
"increase",
"the",
"size",
"of",
"the",
"... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/ArrayUtil.java#L61-L77 |
VoltDB/voltdb | src/frontend/org/voltdb/importer/ImporterStatsCollector.java | ImporterStatsCollector.reportFailure | public void reportFailure(String importerName, String procName, boolean decrementPending) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
statsInfo.m_pendingCount.decrementAndGet();
}
statsInfo.m_failureCount.incrementAndGet();
} | java | public void reportFailure(String importerName, String procName, boolean decrementPending) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
if (decrementPending) {
statsInfo.m_pendingCount.decrementAndGet();
}
statsInfo.m_failureCount.incrementAndGet();
} | [
"public",
"void",
"reportFailure",
"(",
"String",
"importerName",
",",
"String",
"procName",
",",
"boolean",
"decrementPending",
")",
"{",
"StatsInfo",
"statsInfo",
"=",
"getStatsInfo",
"(",
"importerName",
",",
"procName",
")",
";",
"if",
"(",
"decrementPending",... | Use this when the insert fails even before the request is queued by the InternalConnectionHandler | [
"Use",
"this",
"when",
"the",
"insert",
"fails",
"even",
"before",
"the",
"request",
"is",
"queued",
"by",
"the",
"InternalConnectionHandler"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/ImporterStatsCollector.java#L85-L91 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java | CacheProxy.deleteAllToCacheWriter | private @Nullable CacheWriterException deleteAllToCacheWriter(Set<? extends K> keys) {
if (!configuration.isWriteThrough() || keys.isEmpty()) {
return null;
}
List<K> keysToDelete = new ArrayList<>(keys);
try {
writer.deleteAll(keysToDelete);
return null;
} catch (CacheWriterExcept... | java | private @Nullable CacheWriterException deleteAllToCacheWriter(Set<? extends K> keys) {
if (!configuration.isWriteThrough() || keys.isEmpty()) {
return null;
}
List<K> keysToDelete = new ArrayList<>(keys);
try {
writer.deleteAll(keysToDelete);
return null;
} catch (CacheWriterExcept... | [
"private",
"@",
"Nullable",
"CacheWriterException",
"deleteAllToCacheWriter",
"(",
"Set",
"<",
"?",
"extends",
"K",
">",
"keys",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isWriteThrough",
"(",
")",
"||",
"keys",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Deletes all of the entries using the cache writer, retaining only the keys that succeeded. | [
"Deletes",
"all",
"of",
"the",
"entries",
"using",
"the",
"cache",
"writer",
"retaining",
"only",
"the",
"keys",
"that",
"succeeded",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java#L1032-L1047 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java | MemorizeTransactionProxy.runWithPossibleProxySwap | private Object runWithPossibleProxySwap(Method method, Object target, Object[] args)
throws IllegalAccessException, InvocationTargetException {
Object result;
// swap with proxies to these too.
if (method.getName().equals("createStatement")){
result = memorize((Statement)method.invoke(target, args), this.co... | java | private Object runWithPossibleProxySwap(Method method, Object target, Object[] args)
throws IllegalAccessException, InvocationTargetException {
Object result;
// swap with proxies to these too.
if (method.getName().equals("createStatement")){
result = memorize((Statement)method.invoke(target, args), this.co... | [
"private",
"Object",
"runWithPossibleProxySwap",
"(",
"Method",
"method",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Object",
"result",
";",
"// swap with proxies to these to... | Runs the given method with the specified arguments, substituting with proxies where necessary
@param method
@param target proxy target
@param args
@return Proxy-fied result for statements, actual call result otherwise
@throws IllegalAccessException
@throws InvocationTargetException | [
"Runs",
"the",
"given",
"method",
"with",
"the",
"specified",
"arguments",
"substituting",
"with",
"proxies",
"where",
"necessary"
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java#L246-L261 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResult.java | UpdateRouteResult.withRequestModels | public UpdateRouteResult withRequestModels(java.util.Map<String, String> requestModels) {
setRequestModels(requestModels);
return this;
} | java | public UpdateRouteResult withRequestModels(java.util.Map<String, String> requestModels) {
setRequestModels(requestModels);
return this;
} | [
"public",
"UpdateRouteResult",
"withRequestModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestModels",
")",
"{",
"setRequestModels",
"(",
"requestModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The request models for the route.
</p>
@param requestModels
The request models for the route.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"request",
"models",
"for",
"the",
"route",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResult.java#L486-L489 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addPerson | @Nonnull
public Person addPerson(Location location, @Nonnull String name, @Nullable String description) {
if (getPersonWithName(name) == null) {
Person person = new Person();
person.setLocation(location);
person.setName(name);
person.setDescription(description... | java | @Nonnull
public Person addPerson(Location location, @Nonnull String name, @Nullable String description) {
if (getPersonWithName(name) == null) {
Person person = new Person();
person.setLocation(location);
person.setName(name);
person.setDescription(description... | [
"@",
"Nonnull",
"public",
"Person",
"addPerson",
"(",
"Location",
"location",
",",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
")",
"{",
"if",
"(",
"getPersonWithName",
"(",
"name",
")",
"==",
"null",
")",
"{",
"Person"... | Creates a person and adds it to the model.
@param location the location of the person (e.g. internal, external, etc)
@param name the name of the person (e.g. "Admin User" or "Bob the Business User")
@param description a short description of the person
@return the Person instance created and added to the mode... | [
"Creates",
"a",
"person",
"and",
"adds",
"it",
"to",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L109-L126 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResourceGroupLevelPolicyAssignmentAsync | public Observable<SummarizeResultsInner> summarizeForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroupName, policyAssignmentName).map(... | java | public Observable<SummarizeResultsInner> summarizeForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroupName, policyAssignmentName).map(... | [
"public",
"Observable",
"<",
"SummarizeResultsInner",
">",
"summarizeForResourceGroupLevelPolicyAssignmentAsync",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
")",
"{",
"return",
"summarizeForResourceGroupLevelPolicyA... | Summarizes policy states for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param policyAssignmentName Policy assignment name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L3136-L3143 |
rimerosolutions/ant-git-tasks | src/main/java/com/rimerosolutions/ant/git/tasks/TagListTask.java | TagListTask.processReferencesAndOutput | protected void processReferencesAndOutput(List<Ref> refList) {
List<String> refNames = new ArrayList<String>(refList.size());
for (Ref ref : refList) {
refNames.add(GitTaskUtils.sanitizeRefName(ref.getName()));
}
if (!namesToCheck... | java | protected void processReferencesAndOutput(List<Ref> refList) {
List<String> refNames = new ArrayList<String>(refList.size());
for (Ref ref : refList) {
refNames.add(GitTaskUtils.sanitizeRefName(ref.getName()));
}
if (!namesToCheck... | [
"protected",
"void",
"processReferencesAndOutput",
"(",
"List",
"<",
"Ref",
">",
"refList",
")",
"{",
"List",
"<",
"String",
">",
"refNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"refList",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Ref... | Processes a list of references, check references names and output to a file if requested.
@param refList The list of references to process | [
"Processes",
"a",
"list",
"of",
"references",
"check",
"references",
"names",
"and",
"output",
"to",
"a",
"file",
"if",
"requested",
"."
] | train | https://github.com/rimerosolutions/ant-git-tasks/blob/bfb32fe68afe6b9dcfd0a5194497d748ef3e8a6f/src/main/java/com/rimerosolutions/ant/git/tasks/TagListTask.java#L104-L134 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java | CheckedMemorySegment.putChar | public final CheckedMemorySegment putChar(int index, char value) {
if (index >= 0 && index < this.size - 1) {
this.memory[this.offset + index + 0] = (byte) (value >> 8);
this.memory[this.offset + index + 1] = (byte) value;
return this;
} else {
throw new IndexOutOfBoundsException();
}
} | java | public final CheckedMemorySegment putChar(int index, char value) {
if (index >= 0 && index < this.size - 1) {
this.memory[this.offset + index + 0] = (byte) (value >> 8);
this.memory[this.offset + index + 1] = (byte) value;
return this;
} else {
throw new IndexOutOfBoundsException();
}
} | [
"public",
"final",
"CheckedMemorySegment",
"putChar",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"this",
".",
"size",
"-",
"1",
")",
"{",
"this",
".",
"memory",
"[",
"this",
".",
"offset",
... | Writes two memory containing the given char value, in the current byte
order, into this buffer at the given position.
@param position The position at which the memory will be written.
@param value The char value to be written.
@return This view itself.
@throws IndexOutOfBoundsException Thrown, if the index is negativ... | [
"Writes",
"two",
"memory",
"containing",
"the",
"given",
"char",
"value",
"in",
"the",
"current",
"byte",
"order",
"into",
"this",
"buffer",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java#L386-L394 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java | KeyChainGroup.createBasic | public static KeyChainGroup createBasic(NetworkParameters params) {
return new KeyChainGroup(params, new BasicKeyChain(), null, -1, -1, null, null);
} | java | public static KeyChainGroup createBasic(NetworkParameters params) {
return new KeyChainGroup(params, new BasicKeyChain(), null, -1, -1, null, null);
} | [
"public",
"static",
"KeyChainGroup",
"createBasic",
"(",
"NetworkParameters",
"params",
")",
"{",
"return",
"new",
"KeyChainGroup",
"(",
"params",
",",
"new",
"BasicKeyChain",
"(",
")",
",",
"null",
",",
"-",
"1",
",",
"-",
"1",
",",
"null",
",",
"null",
... | Creates a keychain group with just a basic chain. No deterministic chains will be created automatically. | [
"Creates",
"a",
"keychain",
"group",
"with",
"just",
"a",
"basic",
"chain",
".",
"No",
"deterministic",
"chains",
"will",
"be",
"created",
"automatically",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java#L198-L200 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java | WTemplate.addParameter | public void addParameter(final String tag, final Object value) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided");
}
TemplateModel model = getOrCreateComponentModel();
if (model.parameters == null) {
model.parameters = new HashMap<>();
}
model.parameters.put(tag, va... | java | public void addParameter(final String tag, final Object value) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided");
}
TemplateModel model = getOrCreateComponentModel();
if (model.parameters == null) {
model.parameters = new HashMap<>();
}
model.parameters.put(tag, va... | [
"public",
"void",
"addParameter",
"(",
"final",
"String",
"tag",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"tag",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A tag must be provided\"",
")",
";",
... | Add a template parameter.
@param tag the tag for the template parameter
@param value the value for the template parameter | [
"Add",
"a",
"template",
"parameter",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L223-L233 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_plesk_serviceName_upgrade_GET | public ArrayList<String> license_plesk_serviceName_upgrade_GET(String serviceName, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, B... | java | public ArrayList<String> license_plesk_serviceName_upgrade_GET(String serviceName, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, B... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_plesk_serviceName_upgrade_GET",
"(",
"String",
"serviceName",
",",
"OvhOrderableAntispamEnum",
"antispam",
",",
"OvhOrderableAntivirusEnum",
"antivirus",
",",
"OvhPleskApplicationSetEnum",
"applicationSet",
",",
"OvhOrderableP... | Get allowed durations for 'upgrade' option
REST: GET /order/license/plesk/{serviceName}/upgrade
@param antispam [required] The antispam currently enabled on this Plesk License
@param resellerManagement [required] Reseller management option activation
@param languagePackNumber [required] The amount (between 0 and 5) of... | [
"Get",
"allowed",
"durations",
"for",
"upgrade",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1863-L1877 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putServiceOriginalUrlIntoRequestScope | public static void putServiceOriginalUrlIntoRequestScope(final RequestContext requestContext, final WebApplicationService service) {
requestContext.getRequestScope().put("originalUrl", service.getOriginalUrl());
} | java | public static void putServiceOriginalUrlIntoRequestScope(final RequestContext requestContext, final WebApplicationService service) {
requestContext.getRequestScope().put("originalUrl", service.getOriginalUrl());
} | [
"public",
"static",
"void",
"putServiceOriginalUrlIntoRequestScope",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"WebApplicationService",
"service",
")",
"{",
"requestContext",
".",
"getRequestScope",
"(",
")",
".",
"put",
"(",
"\"originalUrl\"",
","... | Put service original url into request scope.
@param requestContext the request context
@param service the service | [
"Put",
"service",
"original",
"url",
"into",
"request",
"scope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L773-L775 |
forge/core | shell/impl/src/main/java/org/jboss/forge/addon/shell/util/ShellUtil.java | ShellUtil.colorizeResource | public static String colorizeResource(FileResource<?> resource)
{
String name = resource.getName();
if (resource.isDirectory())
{
name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
}
else if (resource.isExecutable())
{
name ... | java | public static String colorizeResource(FileResource<?> resource)
{
String name = resource.getName();
if (resource.isDirectory())
{
name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
}
else if (resource.isExecutable())
{
name ... | [
"public",
"static",
"String",
"colorizeResource",
"(",
"FileResource",
"<",
"?",
">",
"resource",
")",
"{",
"String",
"name",
"=",
"resource",
".",
"getName",
"(",
")",
";",
"if",
"(",
"resource",
".",
"isDirectory",
"(",
")",
")",
"{",
"name",
"=",
"n... | Applies ANSI colors in a specific resource
@param resource
@return | [
"Applies",
"ANSI",
"colors",
"in",
"a",
"specific",
"resource"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/shell/impl/src/main/java/org/jboss/forge/addon/shell/util/ShellUtil.java#L64-L76 |
spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java | AbstractFilePickerFragment.onClickCheckable | public void onClickCheckable(@NonNull View view, @NonNull CheckableViewHolder viewHolder) {
if (isDir(viewHolder.file)) {
goToDir(viewHolder.file);
} else {
onLongClickCheckable(view, viewHolder);
if (singleClick) {
onClickOk(view);
}
... | java | public void onClickCheckable(@NonNull View view, @NonNull CheckableViewHolder viewHolder) {
if (isDir(viewHolder.file)) {
goToDir(viewHolder.file);
} else {
onLongClickCheckable(view, viewHolder);
if (singleClick) {
onClickOk(view);
}
... | [
"public",
"void",
"onClickCheckable",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"CheckableViewHolder",
"viewHolder",
")",
"{",
"if",
"(",
"isDir",
"(",
"viewHolder",
".",
"file",
")",
")",
"{",
"goToDir",
"(",
"viewHolder",
".",
"file",
")"... | Called when a selectable item is clicked. This might be either a file or a directory.
@param view that was clicked. Not used in default implementation.
@param viewHolder for the clicked view | [
"Called",
"when",
"a",
"selectable",
"item",
"is",
"clicked",
".",
"This",
"might",
"be",
"either",
"a",
"file",
"or",
"a",
"directory",
"."
] | train | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java#L765-L774 |
GumTreeDiff/gumtree | core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java | SequenceAlgorithms.longestCommonSubsequence | public static List<int[]> longestCommonSubsequence(String s0, String s1) {
int[][] lengths = new int[s0.length() + 1][s1.length() + 1];
for (int i = 0; i < s0.length(); i++)
for (int j = 0; j < s1.length(); j++)
if (s0.charAt(i) == (s1.charAt(j)))
lengths[... | java | public static List<int[]> longestCommonSubsequence(String s0, String s1) {
int[][] lengths = new int[s0.length() + 1][s1.length() + 1];
for (int i = 0; i < s0.length(); i++)
for (int j = 0; j < s1.length(); j++)
if (s0.charAt(i) == (s1.charAt(j)))
lengths[... | [
"public",
"static",
"List",
"<",
"int",
"[",
"]",
">",
"longestCommonSubsequence",
"(",
"String",
"s0",
",",
"String",
"s1",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"lengths",
"=",
"new",
"int",
"[",
"s0",
".",
"length",
"(",
")",
"+",
"1",
"]",
"["... | Returns the longest common subsequence between two strings.
@return a list of size 2 int arrays that corresponds
to match of index in sequence 1 to index in sequence 2. | [
"Returns",
"the",
"longest",
"common",
"subsequence",
"between",
"two",
"strings",
"."
] | train | https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java#L38-L48 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java | GuildWars2.setInstance | public static void setInstance(Cache cache) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(cache);
} | java | public static void setInstance(Cache cache) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(cache);
} | [
"public",
"static",
"void",
"setInstance",
"(",
"Cache",
"cache",
")",
"throws",
"GuildWars2Exception",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"throw",
"new",
"GuildWars2Exception",
"(",
"ErrorCode",
".",
"Other",
",",
"\"Instance already initialized\"",
"... | Use this to initialize instance with custom cache
@param cache {@link Cache}
@throws GuildWars2Exception instance already exist | [
"Use",
"this",
"to",
"initialize",
"instance",
"with",
"custom",
"cache"
] | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java#L74-L78 |
DDTH/ddth-zookeeper | src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java | ZooKeeperClient.removeNode | public boolean removeNode(String path, boolean removeChildren) throws ZooKeeperException {
try {
if (removeChildren) {
curatorFramework.delete().deletingChildrenIfNeeded().forPath(path);
} else {
curatorFramework.delete().forPath(path);
}
... | java | public boolean removeNode(String path, boolean removeChildren) throws ZooKeeperException {
try {
if (removeChildren) {
curatorFramework.delete().deletingChildrenIfNeeded().forPath(path);
} else {
curatorFramework.delete().forPath(path);
}
... | [
"public",
"boolean",
"removeNode",
"(",
"String",
"path",
",",
"boolean",
"removeChildren",
")",
"throws",
"ZooKeeperException",
"{",
"try",
"{",
"if",
"(",
"removeChildren",
")",
"{",
"curatorFramework",
".",
"delete",
"(",
")",
".",
"deletingChildrenIfNeeded",
... | Removes an existing node.
@param path
@param removeChildren
{@code true} to indicate that child nodes should be removed
too
@return {@code true} if node has been removed successfully, {@code false}
otherwise (maybe node is not empty)
@since 0.4.1
@throws ZooKeeperException | [
"Removes",
"an",
"existing",
"node",
"."
] | train | https://github.com/DDTH/ddth-zookeeper/blob/0994eea8b25fa3d885f3da4579768b7d08c1c32b/src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java#L610-L630 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java | GradientToEdgeFeatures.nonMaxSuppression8 | static public GrayF32 nonMaxSuppression8(GrayF32 intensity , GrayS8 direction , GrayF32 output )
{
InputSanityCheck.checkSameShape(intensity,direction);
output = InputSanityCheck.checkDeclare(intensity,output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEdgeNonMaxSuppression_MT.inner8(intensity, direction, o... | java | static public GrayF32 nonMaxSuppression8(GrayF32 intensity , GrayS8 direction , GrayF32 output )
{
InputSanityCheck.checkSameShape(intensity,direction);
output = InputSanityCheck.checkDeclare(intensity,output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEdgeNonMaxSuppression_MT.inner8(intensity, direction, o... | [
"static",
"public",
"GrayF32",
"nonMaxSuppression8",
"(",
"GrayF32",
"intensity",
",",
"GrayS8",
"direction",
",",
"GrayF32",
"output",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"intensity",
",",
"direction",
")",
";",
"output",
"=",
"InputSanityCh... | <p>
Sets edge intensities to zero if the pixel has an intensity which is less than either of
the two adjacent pixels. Pixel adjacency is determined by the gradients discretized direction.
</p>
@param intensity Edge intensities. Not modified.
@param direction 8-Discretized direction. See {@link #discretizeDirection8(... | [
"<p",
">",
"Sets",
"edge",
"intensities",
"to",
"zero",
"if",
"the",
"pixel",
"has",
"an",
"intensity",
"which",
"is",
"less",
"than",
"either",
"of",
"the",
"two",
"adjacent",
"pixels",
".",
"Pixel",
"adjacency",
"is",
"determined",
"by",
"the",
"gradient... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java#L494-L508 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java | MavenArtifactHelper.setCoordinates | public static void setCoordinates(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) {
artifactDescriptor.setGroup(coordinates.getGroup());
artifactDescriptor.setName(coordinates.getName());
artifactDescriptor.setVersion(coordinates.getVersion());
artifactDescriptor.set... | java | public static void setCoordinates(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) {
artifactDescriptor.setGroup(coordinates.getGroup());
artifactDescriptor.setName(coordinates.getName());
artifactDescriptor.setVersion(coordinates.getVersion());
artifactDescriptor.set... | [
"public",
"static",
"void",
"setCoordinates",
"(",
"MavenArtifactDescriptor",
"artifactDescriptor",
",",
"Coordinates",
"coordinates",
")",
"{",
"artifactDescriptor",
".",
"setGroup",
"(",
"coordinates",
".",
"getGroup",
"(",
")",
")",
";",
"artifactDescriptor",
".",
... | Apply the given coordinates to an artifact descriptor.
@param artifactDescriptor
The artifact descriptor.
@param coordinates
The coordinates. | [
"Apply",
"the",
"given",
"coordinates",
"to",
"an",
"artifact",
"descriptor",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java#L29-L35 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java | JRDF.sameSubject | public static boolean sameSubject(SubjectNode s1, String s2) {
if (s1 instanceof URIReference) {
return sameResource((URIReference) s1, s2);
} else {
return false;
}
} | java | public static boolean sameSubject(SubjectNode s1, String s2) {
if (s1 instanceof URIReference) {
return sameResource((URIReference) s1, s2);
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"sameSubject",
"(",
"SubjectNode",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
"instanceof",
"URIReference",
")",
"{",
"return",
"sameResource",
"(",
"(",
"URIReference",
")",
"s1",
",",
"s2",
")",
";",
"}",
"else... | Tells whether the given subjects are equivalent, with one given as a URI
string.
@param s1
first subject.
@param s2
second subject, given as a URI string.
@return true if equivalent, false otherwise. | [
"Tells",
"whether",
"the",
"given",
"subjects",
"are",
"equivalent",
"with",
"one",
"given",
"as",
"a",
"URI",
"string",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java#L151-L157 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.getDouble | public static double getDouble(@NotNull ServletRequest request, @NotNull String param, double defaultValue) {
String value = request.getParameter(param);
return NumberUtils.toDouble(value, defaultValue);
} | java | public static double getDouble(@NotNull ServletRequest request, @NotNull String param, double defaultValue) {
String value = request.getParameter(param);
return NumberUtils.toDouble(value, defaultValue);
} | [
"public",
"static",
"double",
"getDouble",
"(",
"@",
"NotNull",
"ServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"param",
",",
"double",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"request",
".",
"getParameter",
"(",
"param",
")",
";",
"ret... | Returns a request parameter as double.
@param request Request.
@param param Parameter name.
@param defaultValue Default value.
@return Parameter value or default value if it does not exist or is not a number. | [
"Returns",
"a",
"request",
"parameter",
"as",
"double",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L222-L225 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getConfigurationsAt | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
try {
return config.configurationsA... | java | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
try {
return config.configurationsA... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"HierarchicalConfiguration",
">",
"getConfigurationsAt",
"(",
"HierarchicalConfiguration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"... | Returns the sub-configuration tree whose root is the specified key.
@param config the configuration
@param key the key of the configuration tree
@return the sub-configuration tree, or null if not found
@throws DeployerConfigurationException if an error occurs | [
"Returns",
"the",
"sub",
"-",
"configuration",
"tree",
"whose",
"root",
"is",
"the",
"specified",
"key",
"."
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L270-L279 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/components/ExposureEstimator.java | ExposureEstimator.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
final RandomVariable one = model.getRandomVariableForConstant(1.0);
final RandomVariable zero = model.getRandomVariableForConstant(0.0);
RandomVariable values = underlying.ge... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
final RandomVariable one = model.getRandomVariableForConstant(1.0);
final RandomVariable zero = model.getRandomVariableForConstant(0.0);
RandomVariable values = underlying.ge... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"final",
"RandomVariable",
"one",
"=",
"model",
".",
"getRandomVariableForConstant",
... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/components/ExposureEstimator.java#L77-L117 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java | CfCodeGen.writeConnection | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get connection from factory\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent,
" * @return " + de... | java | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get connection from factory\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent,
" * @return " + de... | [
"private",
"void",
"writeConnection",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/** \\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"in... | Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Connection",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java#L131-L151 |
networknt/json-schema-validator | src/main/java/com/networknt/schema/url/URLFactory.java | URLFactory.toURL | public static URL toURL(final String pURL) throws MalformedURLException {
return new URL(null, pURL, sClasspathURLStreamHandler.supports(pURL) ? sClasspathURLStreamHandler : null);
} | java | public static URL toURL(final String pURL) throws MalformedURLException {
return new URL(null, pURL, sClasspathURLStreamHandler.supports(pURL) ? sClasspathURLStreamHandler : null);
} | [
"public",
"static",
"URL",
"toURL",
"(",
"final",
"String",
"pURL",
")",
"throws",
"MalformedURLException",
"{",
"return",
"new",
"URL",
"(",
"null",
",",
"pURL",
",",
"sClasspathURLStreamHandler",
".",
"supports",
"(",
"pURL",
")",
"?",
"sClasspathURLStreamHand... | Creates an {@link URL} based on the provided string
@param pURL the url
@return a {@link URL}
@throws MalformedURLException if the url is not a proper URL | [
"Creates",
"an",
"{"
] | train | https://github.com/networknt/json-schema-validator/blob/d2a3a8d2085e72eb5c25c2fd8c8c9e641a62376d/src/main/java/com/networknt/schema/url/URLFactory.java#L41-L43 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlNode.java | XmlNode.addAttribute | public void addAttribute(final String _name, final String _value) {
this.attributes.put(_name, new XmlNode() {
{
this.name = _name;
this.value = _value;
this.valid = true;
this.type = XmlNode.ATTRIBUTE_NODE;
}
});
... | java | public void addAttribute(final String _name, final String _value) {
this.attributes.put(_name, new XmlNode() {
{
this.name = _name;
this.value = _value;
this.valid = true;
this.type = XmlNode.ATTRIBUTE_NODE;
}
});
... | [
"public",
"void",
"addAttribute",
"(",
"final",
"String",
"_name",
",",
"final",
"String",
"_value",
")",
"{",
"this",
".",
"attributes",
".",
"put",
"(",
"_name",
",",
"new",
"XmlNode",
"(",
")",
"{",
"{",
"this",
".",
"name",
"=",
"_name",
";",
"th... | Adds the attribute
@param _name
the attribute name
@param _value
the attribute name | [
"Adds",
"the",
"attribute"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlNode.java#L155-L164 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.invokeTargetedScript | public void invokeTargetedScript(ScriptWrapper script, HttpMessage msg) {
validateScriptType(script, TYPE_TARGETED);
Writer writer = getWriters(script);
try {
// Dont need to check if enabled as it can only be invoked manually
TargetedScript s = this.getInterface(script, TargetedScript.class);
... | java | public void invokeTargetedScript(ScriptWrapper script, HttpMessage msg) {
validateScriptType(script, TYPE_TARGETED);
Writer writer = getWriters(script);
try {
// Dont need to check if enabled as it can only be invoked manually
TargetedScript s = this.getInterface(script, TargetedScript.class);
... | [
"public",
"void",
"invokeTargetedScript",
"(",
"ScriptWrapper",
"script",
",",
"HttpMessage",
"msg",
")",
"{",
"validateScriptType",
"(",
"script",
",",
"TYPE_TARGETED",
")",
";",
"Writer",
"writer",
"=",
"getWriters",
"(",
"script",
")",
";",
"try",
"{",
"// ... | Invokes the given {@code script}, synchronously, as a {@link TargetedScript}, handling any {@code Exception} thrown
during the invocation.
<p>
The context class loader of caller thread is replaced with the class loader {@code AddOnLoader} to allow the script to
access classes of add-ons.
@param script the script to in... | [
"Invokes",
"the",
"given",
"{",
"@code",
"script",
"}",
"synchronously",
"as",
"a",
"{",
"@link",
"TargetedScript",
"}",
"handling",
"any",
"{",
"@code",
"Exception",
"}",
"thrown",
"during",
"the",
"invocation",
".",
"<p",
">",
"The",
"context",
"class",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L1390-L1408 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/action/terms/collector/NumericTermStream.java | NumericTermStream.get | public static NumericTermStream get(IndexReader reader, IndexFieldData indexFieldData) {
if (indexFieldData instanceof IndexNumericFieldData) {
IndexNumericFieldData numFieldData = (IndexNumericFieldData) indexFieldData;
if (!numFieldData.getNumericType().isFloatingPoint()) {
return new LongTerm... | java | public static NumericTermStream get(IndexReader reader, IndexFieldData indexFieldData) {
if (indexFieldData instanceof IndexNumericFieldData) {
IndexNumericFieldData numFieldData = (IndexNumericFieldData) indexFieldData;
if (!numFieldData.getNumericType().isFloatingPoint()) {
return new LongTerm... | [
"public",
"static",
"NumericTermStream",
"get",
"(",
"IndexReader",
"reader",
",",
"IndexFieldData",
"indexFieldData",
")",
"{",
"if",
"(",
"indexFieldData",
"instanceof",
"IndexNumericFieldData",
")",
"{",
"IndexNumericFieldData",
"numFieldData",
"=",
"(",
"IndexNumeri... | Instantiates a new reusable {@link NumericTermStream} based on the field type. | [
"Instantiates",
"a",
"new",
"reusable",
"{"
] | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/collector/NumericTermStream.java#L38-L51 |
alkacon/opencms-core | src/org/opencms/ui/dataview/CmsDataViewPanel.java | CmsDataViewPanel.refreshData | public void refreshData(boolean resetPaging, String textQuery) {
String fullTextQuery = textQuery != null ? textQuery : m_fullTextSearch.getValue();
LinkedHashMap<String, String> filterValues = new LinkedHashMap<String, String>();
for (Map.Entry<String, CmsDataViewFilter> entry : m_filterMap.en... | java | public void refreshData(boolean resetPaging, String textQuery) {
String fullTextQuery = textQuery != null ? textQuery : m_fullTextSearch.getValue();
LinkedHashMap<String, String> filterValues = new LinkedHashMap<String, String>();
for (Map.Entry<String, CmsDataViewFilter> entry : m_filterMap.en... | [
"public",
"void",
"refreshData",
"(",
"boolean",
"resetPaging",
",",
"String",
"textQuery",
")",
"{",
"String",
"fullTextQuery",
"=",
"textQuery",
"!=",
"null",
"?",
"textQuery",
":",
"m_fullTextSearch",
".",
"getValue",
"(",
")",
";",
"LinkedHashMap",
"<",
"S... | Updates the data displayed in the table.<p>
@param resetPaging true if we should go back to page 1
@param textQuery the text query to use | [
"Updates",
"the",
"data",
"displayed",
"in",
"the",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dataview/CmsDataViewPanel.java#L396-L425 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/DefaultAttributeMarshaller.java | DefaultAttributeMarshaller.marshallAsElement | @Deprecated
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException {
marshallAsElement(attribute, resourceModel, true, writer);
} | java | @Deprecated
public void marshallAsElement(AttributeDefinition attribute, ModelNode resourceModel, XMLStreamWriter writer) throws XMLStreamException {
marshallAsElement(attribute, resourceModel, true, writer);
} | [
"@",
"Deprecated",
"public",
"void",
"marshallAsElement",
"(",
"AttributeDefinition",
"attribute",
",",
"ModelNode",
"resourceModel",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"XMLStreamException",
"{",
"marshallAsElement",
"(",
"attribute",
",",
"resourceModel",
... | Use {@link #marshallAsElement(AttributeDefinition, ModelNode, boolean, XMLStreamWriter)} instead. | [
"Use",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/DefaultAttributeMarshaller.java#L45-L48 |
casmi/casmi | src/main/java/casmi/image/Image.java | Image.getColor | public final Color getColor(int x, int y) {
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int idx = x + y * width;
return new RGBColor((pixels[idx] >> 16 & 0x000000ff) / 255.0,
(pixels[idx] >> 8 & 0x000000ff) / 255.0,
... | java | public final Color getColor(int x, int y) {
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int idx = x + y * width;
return new RGBColor((pixels[idx] >> 16 & 0x000000ff) / 255.0,
(pixels[idx] >> 8 & 0x000000ff) / 255.0,
... | [
"public",
"final",
"Color",
"getColor",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"[",
"]",
"pixels",
"=",
"(",
"(",
"DataBufferInt",
")",
"img",
".",
"getRaster",
"(",
")",
".",
"getDataBuffer",
"(",
")",
")",
".",
"getData",
"(",
")",
... | Returns the pixel color of this Image.
@param x
The x-coordinate of the pixel.
@param y
The y-coordinate of the pixel.
@return
The color of the pixel. | [
"Returns",
"the",
"pixel",
"color",
"of",
"this",
"Image",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/image/Image.java#L251-L259 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.saveProperties | public static void saveProperties(
CmsObject cms,
Element parentElement,
Map<String, String> properties,
Map<String, CmsXmlContentProperty> propertiesConf) {
// remove old entries
for (Object propElement : parentElement.elements(CmsXmlContentProperty.XmlNode.Properties.n... | java | public static void saveProperties(
CmsObject cms,
Element parentElement,
Map<String, String> properties,
Map<String, CmsXmlContentProperty> propertiesConf) {
// remove old entries
for (Object propElement : parentElement.elements(CmsXmlContentProperty.XmlNode.Properties.n... | [
"public",
"static",
"void",
"saveProperties",
"(",
"CmsObject",
"cms",
",",
"Element",
"parentElement",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
",",
"Map",
"<",
"String",
",",
"CmsXmlContentProperty",
">",
"propertiesConf",
")",
"{",
"// r... | Saves the given properties to the given xml element.<p>
@param cms the current CMS context
@param parentElement the parent xml element
@param properties the properties to save, if there is a list of resources, every entry can be a site path or a UUID
@param propertiesConf the configuration of the properties | [
"Saves",
"the",
"given",
"properties",
"to",
"the",
"given",
"xml",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L724-L763 |
forge/core | facets/api/src/main/java/org/jboss/forge/addon/facets/constraints/FacetInspector.java | FacetInspector.getOptionalFacets | public static <FACETTYPE extends Facet<?>> Set<Class<FACETTYPE>> getOptionalFacets(final Class<?> inspectedType)
{
return getRelatedFacets(inspectedType, FacetConstraintType.OPTIONAL);
} | java | public static <FACETTYPE extends Facet<?>> Set<Class<FACETTYPE>> getOptionalFacets(final Class<?> inspectedType)
{
return getRelatedFacets(inspectedType, FacetConstraintType.OPTIONAL);
} | [
"public",
"static",
"<",
"FACETTYPE",
"extends",
"Facet",
"<",
"?",
">",
">",
"Set",
"<",
"Class",
"<",
"FACETTYPE",
">",
">",
"getOptionalFacets",
"(",
"final",
"Class",
"<",
"?",
">",
"inspectedType",
")",
"{",
"return",
"getRelatedFacets",
"(",
"inspect... | Inspect the given {@link Class} for any {@link FacetConstraintType#OPTIONAL} dependency {@link Facet} types. | [
"Inspect",
"the",
"given",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/facets/api/src/main/java/org/jboss/forge/addon/facets/constraints/FacetInspector.java#L63-L66 |
visallo/vertexium | security/src/main/java/org/vertexium/security/ByteSequence.java | ByteSequence.compareBytes | public static int compareBytes(ByteSequence bs1, ByteSequence bs2) {
int minLen = Math.min(bs1.length(), bs2.length());
for (int i = 0; i < minLen; i++) {
int a = (bs1.byteAt(i) & 0xff);
int b = (bs2.byteAt(i) & 0xff);
if (a != b) {
return a - b;
... | java | public static int compareBytes(ByteSequence bs1, ByteSequence bs2) {
int minLen = Math.min(bs1.length(), bs2.length());
for (int i = 0; i < minLen; i++) {
int a = (bs1.byteAt(i) & 0xff);
int b = (bs2.byteAt(i) & 0xff);
if (a != b) {
return a - b;
... | [
"public",
"static",
"int",
"compareBytes",
"(",
"ByteSequence",
"bs1",
",",
"ByteSequence",
"bs2",
")",
"{",
"int",
"minLen",
"=",
"Math",
".",
"min",
"(",
"bs1",
".",
"length",
"(",
")",
",",
"bs2",
".",
"length",
"(",
")",
")",
";",
"for",
"(",
"... | Compares the two given byte sequences, byte by byte, returning a negative,
zero, or positive result if the first sequence is less than, equal to, or
greater than the second. The comparison is performed starting with the
first byte of each sequence, and proceeds until a pair of bytes differs,
or one sequence runs out of... | [
"Compares",
"the",
"two",
"given",
"byte",
"sequences",
"byte",
"by",
"byte",
"returning",
"a",
"negative",
"zero",
"or",
"positive",
"result",
"if",
"the",
"first",
"sequence",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
... | train | https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/security/src/main/java/org/vertexium/security/ByteSequence.java#L90-L104 |
pushbit/sprockets | src/main/java/net/sf/sprockets/sql/Statements.java | Statements.setLongs | public static PreparedStatement setLongs(int index, PreparedStatement stmt, long... params)
throws SQLException {
return set(index, stmt, null, params, null);
} | java | public static PreparedStatement setLongs(int index, PreparedStatement stmt, long... params)
throws SQLException {
return set(index, stmt, null, params, null);
} | [
"public",
"static",
"PreparedStatement",
"setLongs",
"(",
"int",
"index",
",",
"PreparedStatement",
"stmt",
",",
"long",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"set",
"(",
"index",
",",
"stmt",
",",
"null",
",",
"params",
",",
"null",... | Set the statement parameters, starting at the index, in the order of the params.
@since 3.0.0 | [
"Set",
"the",
"statement",
"parameters",
"starting",
"at",
"the",
"index",
"in",
"the",
"order",
"of",
"the",
"params",
"."
] | train | https://github.com/pushbit/sprockets/blob/5d967317cbb2374c69d33271d3c7b7311e1ea4ac/src/main/java/net/sf/sprockets/sql/Statements.java#L80-L83 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.before | public static Betner before(String target, String separator) {
return betn(target).before(separator);
} | java | public static Betner before(String target, String separator) {
return betn(target).before(separator);
} | [
"public",
"static",
"Betner",
"before",
"(",
"String",
"target",
",",
"String",
"separator",
")",
"{",
"return",
"betn",
"(",
"target",
")",
".",
"before",
"(",
"separator",
")",
";",
"}"
] | Returns a {@code String} between matcher that matches any character in the beginning and given right
@param target
@param separator
@return | [
"Returns",
"a",
"{",
"@code",
"String",
"}",
"between",
"matcher",
"that",
"matches",
"any",
"character",
"in",
"the",
"beginning",
"and",
"given",
"right"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L477-L479 |
VoltDB/voltdb | src/frontend/org/voltdb/expressions/ComparisonExpression.java | ComparisonExpression.rangeFilterFromPrefixLike | static private ComparisonExpression rangeFilterFromPrefixLike(AbstractExpression leftExpr, ExpressionType rangeComparator, String comparand) {
ConstantValueExpression cve = new ConstantValueExpression();
cve.setValueType(VoltType.STRING);
cve.setValue(comparand);
cve.setValueSize(compara... | java | static private ComparisonExpression rangeFilterFromPrefixLike(AbstractExpression leftExpr, ExpressionType rangeComparator, String comparand) {
ConstantValueExpression cve = new ConstantValueExpression();
cve.setValueType(VoltType.STRING);
cve.setValue(comparand);
cve.setValueSize(compara... | [
"static",
"private",
"ComparisonExpression",
"rangeFilterFromPrefixLike",
"(",
"AbstractExpression",
"leftExpr",
",",
"ExpressionType",
"rangeComparator",
",",
"String",
"comparand",
")",
"{",
"ConstantValueExpression",
"cve",
"=",
"new",
"ConstantValueExpression",
"(",
")"... | Construct the upper or lower bound expression that is implied by a prefix LIKE operator, given its required elements.
@param leftExpr - the LIKE operator's (and the result's) lhs expression
@param rangeComparator - a GTE or LT operator to indicate lower or upper bound, respectively,
@param comparand - a string operand ... | [
"Construct",
"the",
"upper",
"or",
"lower",
"bound",
"expression",
"that",
"is",
"implied",
"by",
"a",
"prefix",
"LIKE",
"operator",
"given",
"its",
"required",
"elements",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/expressions/ComparisonExpression.java#L144-L151 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java | StringUtils.bytesToHex | public static String bytesToHex(byte[] bytes, int size) {
size=Math.min(bytes.length, size);
char[] hexChars = new char[size * 2];
for ( int j = 0; j < size; j++ ) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
... | java | public static String bytesToHex(byte[] bytes, int size) {
size=Math.min(bytes.length, size);
char[] hexChars = new char[size * 2];
for ( int j = 0; j < size; j++ ) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
... | [
"public",
"static",
"String",
"bytesToHex",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"size",
")",
"{",
"size",
"=",
"Math",
".",
"min",
"(",
"bytes",
".",
"length",
",",
"size",
")",
";",
"char",
"[",
"]",
"hexChars",
"=",
"new",
"char",
"[",
... | Bytes to hex.
@param bytes the bytes
@param size the size
@return the string | [
"Bytes",
"to",
"hex",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L102-L111 |
aws/aws-sdk-java | aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchv2/model/ListDomainNamesResult.java | ListDomainNamesResult.withDomainNames | public ListDomainNamesResult withDomainNames(java.util.Map<String, String> domainNames) {
setDomainNames(domainNames);
return this;
} | java | public ListDomainNamesResult withDomainNames(java.util.Map<String, String> domainNames) {
setDomainNames(domainNames);
return this;
} | [
"public",
"ListDomainNamesResult",
"withDomainNames",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"domainNames",
")",
"{",
"setDomainNames",
"(",
"domainNames",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The names of the search domains owned by an account.
</p>
@param domainNames
The names of the search domains owned by an account.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"names",
"of",
"the",
"search",
"domains",
"owned",
"by",
"an",
"account",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchv2/model/ListDomainNamesResult.java#L71-L74 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showOKDialog | public static VisDialog showOKDialog (Stage stage, String title, String text) {
final VisDialog dialog = new VisDialog(title);
dialog.closeOnEscape();
dialog.text(text);
dialog.button(ButtonType.OK.getText()).padBottom(3);
dialog.pack();
dialog.centerWindow();
dialog.addListener(new InputListener() {
@... | java | public static VisDialog showOKDialog (Stage stage, String title, String text) {
final VisDialog dialog = new VisDialog(title);
dialog.closeOnEscape();
dialog.text(text);
dialog.button(ButtonType.OK.getText()).padBottom(3);
dialog.pack();
dialog.centerWindow();
dialog.addListener(new InputListener() {
@... | [
"public",
"static",
"VisDialog",
"showOKDialog",
"(",
"Stage",
"stage",
",",
"String",
"title",
",",
"String",
"text",
")",
"{",
"final",
"VisDialog",
"dialog",
"=",
"new",
"VisDialog",
"(",
"title",
")",
";",
"dialog",
".",
"closeOnEscape",
"(",
")",
";",... | Dialog with given text and single OK button.
@param title dialog title | [
"Dialog",
"with",
"given",
"text",
"and",
"single",
"OK",
"button",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L53-L72 |
netty/netty | buffer/src/main/java/io/netty/buffer/Unpooled.java | Unpooled.wrappedBuffer | public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) {
switch (buffers.length) {
case 0:
break;
case 1:
ByteBuf buffer = buffers[0];
if (buffer.isReadable()) {
return wrappedBuffer(buffer.order(BIG_ENDIAN));
... | java | public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) {
switch (buffers.length) {
case 0:
break;
case 1:
ByteBuf buffer = buffers[0];
if (buffer.isReadable()) {
return wrappedBuffer(buffer.order(BIG_ENDIAN));
... | [
"public",
"static",
"ByteBuf",
"wrappedBuffer",
"(",
"int",
"maxNumComponents",
",",
"ByteBuf",
"...",
"buffers",
")",
"{",
"switch",
"(",
"buffers",
".",
"length",
")",
"{",
"case",
"0",
":",
"break",
";",
"case",
"1",
":",
"ByteBuf",
"buffer",
"=",
"bu... | Creates a new big-endian composite buffer which wraps the readable bytes of the
specified buffers without copying them. A modification on the content
of the specified buffers will be visible to the returned buffer.
@param maxNumComponents Advisement as to how many independent buffers are allowed to exist before
consol... | [
"Creates",
"a",
"new",
"big",
"-",
"endian",
"composite",
"buffer",
"which",
"wraps",
"the",
"readable",
"bytes",
"of",
"the",
"specified",
"buffers",
"without",
"copying",
"them",
".",
"A",
"modification",
"on",
"the",
"content",
"of",
"the",
"specified",
"... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L306-L329 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ContentNegotiationFilter.java | ContentNegotiationFilter.adjustQualityFromImage | private static void adjustQualityFromImage(Map<String, Float> pFormatQuality, BufferedImage pImage) {
// NOTE: The values are all made-up. May need tuning.
// If pImage.getColorModel() instanceof IndexColorModel
// JPEG qs*=0.6
// If NOT binary or 2 color index
// ... | java | private static void adjustQualityFromImage(Map<String, Float> pFormatQuality, BufferedImage pImage) {
// NOTE: The values are all made-up. May need tuning.
// If pImage.getColorModel() instanceof IndexColorModel
// JPEG qs*=0.6
// If NOT binary or 2 color index
// ... | [
"private",
"static",
"void",
"adjustQualityFromImage",
"(",
"Map",
"<",
"String",
",",
"Float",
">",
"pFormatQuality",
",",
"BufferedImage",
"pImage",
")",
"{",
"// NOTE: The values are all made-up. May need tuning.\r",
"// If pImage.getColorModel() instanceof IndexColorModel\r",... | Adjusts source quality settings from image properties.
@param pFormatQuality the format to quality mapping
@param pImage the image | [
"Adjusts",
"source",
"quality",
"settings",
"from",
"image",
"properties",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ContentNegotiationFilter.java#L375-L410 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getAttributes | @Override
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"ResultSet",
"getAttributes",
"(",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"typeNamePattern",
",",
"String",
"attributeNamePattern",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"... | Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog. | [
"Retrieves",
"a",
"description",
"of",
"the",
"given",
"attribute",
"of",
"the",
"given",
"type",
"for",
"a",
"user",
"-",
"defined",
"type",
"(",
"UDT",
")",
"that",
"is",
"available",
"in",
"the",
"given",
"schema",
"and",
"catalog",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L139-L144 |
zandero/http | src/main/java/com/zandero/http/HttpUtils.java | HttpUtils.executeAsync | public static void executeAsync(Executor executor, HttpRequestBase request, FutureCallback<HttpResponse> callback) {
try {
executor.execute(new AsyncHttpCall(request, callback));
}
catch (Exception e) {
log.error("Failed to execute asynchronously: " + request.getMethod() + " " + request.getURI().toString()... | java | public static void executeAsync(Executor executor, HttpRequestBase request, FutureCallback<HttpResponse> callback) {
try {
executor.execute(new AsyncHttpCall(request, callback));
}
catch (Exception e) {
log.error("Failed to execute asynchronously: " + request.getMethod() + " " + request.getURI().toString()... | [
"public",
"static",
"void",
"executeAsync",
"(",
"Executor",
"executor",
",",
"HttpRequestBase",
"request",
",",
"FutureCallback",
"<",
"HttpResponse",
">",
"callback",
")",
"{",
"try",
"{",
"executor",
".",
"execute",
"(",
"new",
"AsyncHttpCall",
"(",
"request"... | Step 2. execute request asynchronously
@param executor thread executor to be used
@param request to be executed
@param callback to be invoked when request is completed or failes | [
"Step",
"2",
".",
"execute",
"request",
"asynchronously"
] | train | https://github.com/zandero/http/blob/909eb879f1193adf24545360c3b76bd813865f65/src/main/java/com/zandero/http/HttpUtils.java#L304-L312 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.runAfter | public static TimerTask runAfter(Timer timer, int delay, final Closure closure) {
TimerTask timerTask = new TimerTask() {
public void run() {
closure.call();
}
};
timer.schedule(timerTask, delay);
return timerTask;
} | java | public static TimerTask runAfter(Timer timer, int delay, final Closure closure) {
TimerTask timerTask = new TimerTask() {
public void run() {
closure.call();
}
};
timer.schedule(timerTask, delay);
return timerTask;
} | [
"public",
"static",
"TimerTask",
"runAfter",
"(",
"Timer",
"timer",
",",
"int",
"delay",
",",
"final",
"Closure",
"closure",
")",
"{",
"TimerTask",
"timerTask",
"=",
"new",
"TimerTask",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"closure",
".... | Allows a simple syntax for using timers. This timer will execute the
given closure after the given delay.
@param timer a timer object
@param delay the delay in milliseconds before running the closure code
@param closure the closure to invoke
@return The timer task which has been scheduled.
@since 1.5.0 | [
"Allows",
"a",
"simple",
"syntax",
"for",
"using",
"timers",
".",
"This",
"timer",
"will",
"execute",
"the",
"given",
"closure",
"after",
"the",
"given",
"delay",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16651-L16659 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsConfigurationReader.java | CmsConfigurationReader.parseDetailPage | protected void parseDetailPage(I_CmsXmlContentLocation node) throws CmsException {
I_CmsXmlContentValueLocation pageLoc = node.getSubValue(N_PAGE);
String typeName = getString(node.getSubValue(N_TYPE));
try {
String page = pageLoc.asString(m_cms);
CmsResource detailPageR... | java | protected void parseDetailPage(I_CmsXmlContentLocation node) throws CmsException {
I_CmsXmlContentValueLocation pageLoc = node.getSubValue(N_PAGE);
String typeName = getString(node.getSubValue(N_TYPE));
try {
String page = pageLoc.asString(m_cms);
CmsResource detailPageR... | [
"protected",
"void",
"parseDetailPage",
"(",
"I_CmsXmlContentLocation",
"node",
")",
"throws",
"CmsException",
"{",
"I_CmsXmlContentValueLocation",
"pageLoc",
"=",
"node",
".",
"getSubValue",
"(",
"N_PAGE",
")",
";",
"String",
"typeName",
"=",
"getString",
"(",
"nod... | Parses the detail pages from an XML content node.<p>
@param node the XML content node
@throws CmsException if something goes wrong | [
"Parses",
"the",
"detail",
"pages",
"from",
"an",
"XML",
"content",
"node",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsConfigurationReader.java#L817-L844 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.executeFlow | public AzkabanExecuteFlowStatus executeFlow(String projectName,
String flowName,
Map<String, String> flowParameters) throws AzkabanClientException {
return executeFlowWithOptions(projectName, flowName, null, flowParameters);... | java | public AzkabanExecuteFlowStatus executeFlow(String projectName,
String flowName,
Map<String, String> flowParameters) throws AzkabanClientException {
return executeFlowWithOptions(projectName, flowName, null, flowParameters);... | [
"public",
"AzkabanExecuteFlowStatus",
"executeFlow",
"(",
"String",
"projectName",
",",
"String",
"flowName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"flowParameters",
")",
"throws",
"AzkabanClientException",
"{",
"return",
"executeFlowWithOptions",
"(",
"proje... | Execute a flow with flow parameters. The project and flow should be created first.
@param projectName project name
@param flowName flow name
@param flowParameters flow parameters
@return The status object which contains success status and execution id. | [
"Execute",
"a",
"flow",
"with",
"flow",
"parameters",
".",
"The",
"project",
"and",
"flow",
"should",
"be",
"created",
"first",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L366-L370 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/RSAUtils.java | RSAUtils.signMessage | public static byte[] signMessage(RSAPrivateKey key, byte[] message)
throws InvalidKeyException, NoSuchAlgorithmException, SignatureException {
return signMessage(key, message, DEFAULT_SIGNATURE_ALGORITHM);
} | java | public static byte[] signMessage(RSAPrivateKey key, byte[] message)
throws InvalidKeyException, NoSuchAlgorithmException, SignatureException {
return signMessage(key, message, DEFAULT_SIGNATURE_ALGORITHM);
} | [
"public",
"static",
"byte",
"[",
"]",
"signMessage",
"(",
"RSAPrivateKey",
"key",
",",
"byte",
"[",
"]",
"message",
")",
"throws",
"InvalidKeyException",
",",
"NoSuchAlgorithmException",
",",
"SignatureException",
"{",
"return",
"signMessage",
"(",
"key",
",",
"... | Sign a message with RSA private key, using {@link #DEFAULT_SIGNATURE_ALGORITHM}.
@param key
@param message
@return the signature
@throws InvalidKeyException
@throws NoSuchAlgorithmException
@throws SignatureException | [
"Sign",
"a",
"message",
"with",
"RSA",
"private",
"key",
"using",
"{",
"@link",
"#DEFAULT_SIGNATURE_ALGORITHM",
"}",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/RSAUtils.java#L183-L186 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/MasterCatalogUrl.java | MasterCatalogUrl.getMasterCatalogUrl | public static MozuUrl getMasterCatalogUrl(Integer masterCatalogId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/mastercatalogs/{masterCatalogId}?responseFields={responseFields}");
formatter.formatUrl("masterCatalogId", masterCatalogId);
formatter.formatUrl("... | java | public static MozuUrl getMasterCatalogUrl(Integer masterCatalogId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/mastercatalogs/{masterCatalogId}?responseFields={responseFields}");
formatter.formatUrl("masterCatalogId", masterCatalogId);
formatter.formatUrl("... | [
"public",
"static",
"MozuUrl",
"getMasterCatalogUrl",
"(",
"Integer",
"masterCatalogId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/mastercatalogs/{masterCatalogId}?responseFields={respon... | Get Resource Url for GetMasterCatalog
@param masterCatalogId Unique identifier for the master catalog. The master catalog contains all products accessible per catalogs and the site/tenant.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON ob... | [
"Get",
"Resource",
"Url",
"for",
"GetMasterCatalog"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/MasterCatalogUrl.java#L34-L40 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BoundsOnRatiosInSampledSets.java | BoundsOnRatiosInSampledSets.getLowerBoundForBoverA | public static double getLowerBoundForBoverA(final long a, final long b, final double f) {
checkInputs(a, b, f);
if (a == 0) { return 0.0; }
if (f == 1.0) { return (double) b / a; }
return approximateLowerBoundOnP(a, b, NUM_STD_DEVS * hackyAdjuster(f));
} | java | public static double getLowerBoundForBoverA(final long a, final long b, final double f) {
checkInputs(a, b, f);
if (a == 0) { return 0.0; }
if (f == 1.0) { return (double) b / a; }
return approximateLowerBoundOnP(a, b, NUM_STD_DEVS * hackyAdjuster(f));
} | [
"public",
"static",
"double",
"getLowerBoundForBoverA",
"(",
"final",
"long",
"a",
",",
"final",
"long",
"b",
",",
"final",
"double",
"f",
")",
"{",
"checkInputs",
"(",
"a",
",",
"b",
",",
"f",
")",
";",
"if",
"(",
"a",
"==",
"0",
")",
"{",
"return... | Return the approximate lower bound based on a 95% confidence interval
@param a See class javadoc
@param b See class javadoc
@param f the inclusion probability used to produce the set with size <i>a</i> and should
generally be less than 0.5. Above this value, the results not be reliable.
When <i>f</i> = 1.0 this returns... | [
"Return",
"the",
"approximate",
"lower",
"bound",
"based",
"on",
"a",
"95%",
"confidence",
"interval"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BoundsOnRatiosInSampledSets.java#L38-L43 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.element | public JSONObject element( String key, double value ) {
verifyIsNull();
Double d = new Double( value );
JSONUtils.testValidity( d );
return element( key, d );
} | java | public JSONObject element( String key, double value ) {
verifyIsNull();
Double d = new Double( value );
JSONUtils.testValidity( d );
return element( key, d );
} | [
"public",
"JSONObject",
"element",
"(",
"String",
"key",
",",
"double",
"value",
")",
"{",
"verifyIsNull",
"(",
")",
";",
"Double",
"d",
"=",
"new",
"Double",
"(",
"value",
")",
";",
"JSONUtils",
".",
"testValidity",
"(",
"d",
")",
";",
"return",
"elem... | Put a key/double pair in the JSONObject.
@param key A key string.
@param value A double which is the value.
@return this.
@throws JSONException If the key is null or if the number is invalid. | [
"Put",
"a",
"key",
"/",
"double",
"pair",
"in",
"the",
"JSONObject",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1612-L1617 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.