repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
vkostyukov/la4j | src/main/java/org/la4j/Vectors.java | Vectors.mkEuclideanNormAccumulator | public static VectorAccumulator mkEuclideanNormAccumulator() {
"""
Makes an Euclidean norm accumulator that allows to use
{@link org.la4j.Vector#fold(org.la4j.vector.functor.VectorAccumulator)} method for norm calculation.
@return an Euclidean norm accumulator
"""
return new VectorAccumulator() {
... | java | public static VectorAccumulator mkEuclideanNormAccumulator() {
return new VectorAccumulator() {
private BigDecimal result = BigDecimal.valueOf(0.0);
@Override
public void update(int i, double value) {
result = result.add(BigDecimal.valueOf(value * value));
... | [
"public",
"static",
"VectorAccumulator",
"mkEuclideanNormAccumulator",
"(",
")",
"{",
"return",
"new",
"VectorAccumulator",
"(",
")",
"{",
"private",
"BigDecimal",
"result",
"=",
"BigDecimal",
".",
"valueOf",
"(",
"0.0",
")",
";",
"@",
"Override",
"public",
"voi... | Makes an Euclidean norm accumulator that allows to use
{@link org.la4j.Vector#fold(org.la4j.vector.functor.VectorAccumulator)} method for norm calculation.
@return an Euclidean norm accumulator | [
"Makes",
"an",
"Euclidean",
"norm",
"accumulator",
"that",
"allows",
"to",
"use",
"{",
"@link",
"org",
".",
"la4j",
".",
"Vector#fold",
"(",
"org",
".",
"la4j",
".",
"vector",
".",
"functor",
".",
"VectorAccumulator",
")",
"}",
"method",
"for",
"norm",
"... | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L329-L345 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setClob | @Override
public void setClob(int parameterIndex, Clob x) throws SQLException {
"""
Method setClob.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setClob(int, Clob)
"""
internalStmt.setClob(parameterIndex, x);
} | java | @Override
public void setClob(int parameterIndex, Clob x) throws SQLException {
internalStmt.setClob(parameterIndex, x);
} | [
"@",
"Override",
"public",
"void",
"setClob",
"(",
"int",
"parameterIndex",
",",
"Clob",
"x",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setClob",
"(",
"parameterIndex",
",",
"x",
")",
";",
"}"
] | Method setClob.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setClob(int, Clob) | [
"Method",
"setClob",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L671-L674 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java | EJSHome.getBean | public EJBObject getBean(String type, Object primaryKey, Object data)
throws FinderException,
RemoteException {
"""
Return the <code>EJBObject</code> associated with the specified
type, primary key and data. <p>
If the bean defined by the (type, primaryKey) tuple is alre... | java | public EJBObject getBean(String type, Object primaryKey, Object data)
throws FinderException,
RemoteException
{
return ivEntityHelper.getBean(this, type, primaryKey, data);
} | [
"public",
"EJBObject",
"getBean",
"(",
"String",
"type",
",",
"Object",
"primaryKey",
",",
"Object",
"data",
")",
"throws",
"FinderException",
",",
"RemoteException",
"{",
"return",
"ivEntityHelper",
".",
"getBean",
"(",
"this",
",",
"type",
",",
"primaryKey",
... | Return the <code>EJBObject</code> associated with the specified
type, primary key and data. <p>
If the bean defined by the (type, primaryKey) tuple is already
active then return the active instance. <p>
Otherwise, activate the bean and hydrate it with the given data. <p>
@param type a <code>String</code> defining th... | [
"Return",
"the",
"<code",
">",
"EJBObject<",
"/",
"code",
">",
"associated",
"with",
"the",
"specified",
"type",
"primary",
"key",
"and",
"data",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java#L2310-L2315 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCommandLineRunner.java | AbstractCommandLineRunner.expandCommandLinePath | @GwtIncompatible("Unnecessary")
private String expandCommandLinePath(String path, JSModule forModule) {
"""
Expand a file path specified on the command-line.
<p>Most file paths on the command-line allow an %outname% placeholder. The placeholder will
expand to a different value depending on the current output... | java | @GwtIncompatible("Unnecessary")
private String expandCommandLinePath(String path, JSModule forModule) {
String sub;
if (forModule != null) {
sub = config.moduleOutputPathPrefix + forModule.getName() + ".js";
} else if (!config.module.isEmpty()) {
sub = config.moduleOutputPathPrefix;
} else... | [
"@",
"GwtIncompatible",
"(",
"\"Unnecessary\"",
")",
"private",
"String",
"expandCommandLinePath",
"(",
"String",
"path",
",",
"JSModule",
"forModule",
")",
"{",
"String",
"sub",
";",
"if",
"(",
"forModule",
"!=",
"null",
")",
"{",
"sub",
"=",
"config",
".",... | Expand a file path specified on the command-line.
<p>Most file paths on the command-line allow an %outname% placeholder. The placeholder will
expand to a different value depending on the current output mode. There are three scenarios:
<p>1) Single JS output, single extra output: sub in jsOutputPath. 2) Multiple JS ou... | [
"Expand",
"a",
"file",
"path",
"specified",
"on",
"the",
"command",
"-",
"line",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1685-L1696 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.executePost | private HttpResponse executePost(String bucketName, String objectName, Map<String,String> headerMap,
Map<String,String> queryParamMap, Object data)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, ... | java | private HttpResponse executePost(String bucketName, String objectName, Map<String,String> headerMap,
Map<String,String> queryParamMap, Object data)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, ... | [
"private",
"HttpResponse",
"executePost",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerMap",
",",
"Map",
"<",
"String",
",",
"String",
">",
"queryParamMap",
",",
"Object",
"data",
")",
"throw... | Executes POST method for given request parameters.
@param bucketName Bucket name.
@param objectName Object name in the bucket.
@param headerMap Map of HTTP headers for the request.
@param queryParamMap Map of HTTP query parameters of the request.
@param data HTTP request body data. | [
"Executes",
"POST",
"method",
"for",
"given",
"request",
"parameters",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L1363-L1369 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getField | private static Field getField(String fieldName, Class<?> where) {
"""
Gets the field.
@param fieldName the field name
@param where the where
@return the field
"""
if (where == null) {
throw new IllegalArgumentException("where cannot be null");
}
Field field = null;... | java | private static Field getField(String fieldName, Class<?> where) {
if (where == null) {
throw new IllegalArgumentException("where cannot be null");
}
Field field = null;
try {
field = where.getDeclaredField(fieldName);
field.setAccessible(true);
... | [
"private",
"static",
"Field",
"getField",
"(",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"if",
"(",
"where",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"where cannot be null\"",
")",
";",
"}",
"F... | Gets the field.
@param fieldName the field name
@param where the where
@return the field | [
"Gets",
"the",
"field",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L2254-L2268 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigFileMonitor.java | ConfigFileMonitor.updateFileMonitor | void updateFileMonitor(Long monitorInterval, String fileMonitorType) {
"""
Update FileMonitor service with a new monitoring interval and monitor type. Both parameters must not be <code>null</code>.
"""
if (this.monitorInterval.equals(monitorInterval) && this.monitorType.equals(fileMonitorType)) {
... | java | void updateFileMonitor(Long monitorInterval, String fileMonitorType) {
if (this.monitorInterval.equals(monitorInterval) && this.monitorType.equals(fileMonitorType)) {
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Updating File... | [
"void",
"updateFileMonitor",
"(",
"Long",
"monitorInterval",
",",
"String",
"fileMonitorType",
")",
"{",
"if",
"(",
"this",
".",
"monitorInterval",
".",
"equals",
"(",
"monitorInterval",
")",
"&&",
"this",
".",
"monitorType",
".",
"equals",
"(",
"fileMonitorType... | Update FileMonitor service with a new monitoring interval and monitor type. Both parameters must not be <code>null</code>. | [
"Update",
"FileMonitor",
"service",
"with",
"a",
"new",
"monitoring",
"interval",
"and",
"monitor",
"type",
".",
"Both",
"parameters",
"must",
"not",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigFileMonitor.java#L86-L100 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.saveSession | public static final void saveSession(Session session, Bundle bundle) {
"""
Save the Session object into the supplied Bundle. This method is intended to be called from an
Activity or Fragment's onSaveInstanceState method in order to preserve Sessions across Activity lifecycle events.
@param session the Session ... | java | public static final void saveSession(Session session, Bundle bundle) {
if (bundle != null && session != null && !bundle.containsKey(SESSION_BUNDLE_SAVE_KEY)) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
new ObjectOutputStream(outputStream).wri... | [
"public",
"static",
"final",
"void",
"saveSession",
"(",
"Session",
"session",
",",
"Bundle",
"bundle",
")",
"{",
"if",
"(",
"bundle",
"!=",
"null",
"&&",
"session",
"!=",
"null",
"&&",
"!",
"bundle",
".",
"containsKey",
"(",
"SESSION_BUNDLE_SAVE_KEY",
")",
... | Save the Session object into the supplied Bundle. This method is intended to be called from an
Activity or Fragment's onSaveInstanceState method in order to preserve Sessions across Activity lifecycle events.
@param session the Session to save
@param bundle the Bundle to save the Session to | [
"Save",
"the",
"Session",
"object",
"into",
"the",
"supplied",
"Bundle",
".",
"This",
"method",
"is",
"intended",
"to",
"be",
"called",
"from",
"an",
"Activity",
"or",
"Fragment",
"s",
"onSaveInstanceState",
"method",
"in",
"order",
"to",
"preserve",
"Sessions... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L877-L888 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeVTypeHashMap.java | KTypeVTypeHashMap.allocateThenInsertThenRehash | protected void allocateThenInsertThenRehash(int slot, KType pendingKey, VType pendingValue) {
"""
This method is invoked when there is a new key/ value pair to be inserted into
the buffers but there is not enough empty slots to do so.
New buffers are allocated. If this succeeds, we know we can proceed
with re... | java | protected void allocateThenInsertThenRehash(int slot, KType pendingKey, VType pendingValue) {
assert assigned == resizeAt
&& Intrinsics.<KType> isEmpty(Intrinsics.<KType> cast(keys[slot]))
&& !Intrinsics.<KType> isEmpty(pendingKey);
// Try to allocate new buffers first. If we OOM, we leav... | [
"protected",
"void",
"allocateThenInsertThenRehash",
"(",
"int",
"slot",
",",
"KType",
"pendingKey",
",",
"VType",
"pendingValue",
")",
"{",
"assert",
"assigned",
"==",
"resizeAt",
"&&",
"Intrinsics",
".",
"<",
"KType",
">",
"isEmpty",
"(",
"Intrinsics",
".",
... | This method is invoked when there is a new key/ value pair to be inserted into
the buffers but there is not enough empty slots to do so.
New buffers are allocated. If this succeeds, we know we can proceed
with rehashing so we assign the pending element to the previous buffer
(possibly violating the invariant of having... | [
"This",
"method",
"is",
"invoked",
"when",
"there",
"is",
"a",
"new",
"key",
"/",
"value",
"pair",
"to",
"be",
"inserted",
"into",
"the",
"buffers",
"but",
"there",
"is",
"not",
"enough",
"empty",
"slots",
"to",
"do",
"so",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeVTypeHashMap.java#L1178-L1196 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java | DefaultUnifiedDiffDisplayer.maybeStartBlock | private <E, F> void maybeStartBlock(Delta<E> delta, State<E, F> state, int contextSize) {
"""
Starts a new {@link UnifiedDiffBlock} if the provided change is in a different context. The distance between two
changes inside the same block is less than 2 * context size.
@param delta the change
@param state the s... | java | private <E, F> void maybeStartBlock(Delta<E> delta, State<E, F> state, int contextSize)
{
if (state.getLastDelta() == null
|| state.getLastDelta().getPrevious().getLastIndex() < delta.getPrevious().getIndex() - contextSize * 2) {
maybeEndBlock(state, contextSize);
state.g... | [
"private",
"<",
"E",
",",
"F",
">",
"void",
"maybeStartBlock",
"(",
"Delta",
"<",
"E",
">",
"delta",
",",
"State",
"<",
"E",
",",
"F",
">",
"state",
",",
"int",
"contextSize",
")",
"{",
"if",
"(",
"state",
".",
"getLastDelta",
"(",
")",
"==",
"nu... | Starts a new {@link UnifiedDiffBlock} if the provided change is in a different context. The distance between two
changes inside the same block is less than 2 * context size.
@param delta the change
@param state the state of the displayer
@param contextSize the number of unmodified elements to display before and after ... | [
"Starts",
"a",
"new",
"{",
"@link",
"UnifiedDiffBlock",
"}",
"if",
"the",
"provided",
"change",
"is",
"in",
"a",
"different",
"context",
".",
"The",
"distance",
"between",
"two",
"changes",
"inside",
"the",
"same",
"block",
"is",
"less",
"than",
"2",
"*",
... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java#L196-L210 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_timeCondition_serviceName_condition_id_DELETE | public void billingAccount_timeCondition_serviceName_condition_id_DELETE(String billingAccount, String serviceName, Long id) throws IOException {
"""
Delete the given screen list
REST: DELETE /telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}
@param billingAccount [required] The name of you... | java | public void billingAccount_timeCondition_serviceName_condition_id_DELETE(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
exec(qPath, "D... | [
"public",
"void",
"billingAccount_timeCondition_serviceName_condition_id_DELETE",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/timeCondition/{serviceNa... | Delete the given screen list
REST: DELETE /telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Delete",
"the",
"given",
"screen",
"list"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5855-L5859 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_delegation_target_GET | public OvhReverseDelegation ip_delegation_target_GET(String ip, String target) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/delegation/{target}
@param ip [required]
@param target [required] NS target for delegation
"""
String qPath = "/ip/{ip}/delegation/{target}";
StringBuil... | java | public OvhReverseDelegation ip_delegation_target_GET(String ip, String target) throws IOException {
String qPath = "/ip/{ip}/delegation/{target}";
StringBuilder sb = path(qPath, ip, target);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhReverseDelegation.class);
} | [
"public",
"OvhReverseDelegation",
"ip_delegation_target_GET",
"(",
"String",
"ip",
",",
"String",
"target",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/delegation/{target}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip... | Get this object properties
REST: GET /ip/{ip}/delegation/{target}
@param ip [required]
@param target [required] NS target for delegation | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L112-L117 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/voice.java | voice.getSpeechRecognitionFirstResult | public static String getSpeechRecognitionFirstResult(int requestCode, int resultCode, Intent data) {
"""
Get first result from the Google Speech Recognition activity (DO NOT FORGET call this function on
onActivityResult())
@param requestCode
- onActivityResult request code
@param resultCode
- onActivityResu... | java | public static String getSpeechRecognitionFirstResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 0 && resultCode == -1) {
List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
if (results != null && results.size() > 0) {
return results.get(0);
}
... | [
"public",
"static",
"String",
"getSpeechRecognitionFirstResult",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
",",
"Intent",
"data",
")",
"{",
"if",
"(",
"requestCode",
"==",
"0",
"&&",
"resultCode",
"==",
"-",
"1",
")",
"{",
"List",
"<",
"String",
... | Get first result from the Google Speech Recognition activity (DO NOT FORGET call this function on
onActivityResult())
@param requestCode
- onActivityResult request code
@param resultCode
- onActivityResult result code
@param data
- onActivityResult Intent data
@return string containing the first result of what was rec... | [
"Get",
"first",
"result",
"from",
"the",
"Google",
"Speech",
"Recognition",
"activity",
"(",
"DO",
"NOT",
"FORGET",
"call",
"this",
"function",
"on",
"onActivityResult",
"()",
")"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/voice.java#L106-L114 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java | Attributes2Impl.setSpecified | public void setSpecified (int index, boolean value) {
"""
Assign a value to the "specified" flag of a specific attribute.
This is the only way this flag can be cleared, except clearing
by initialization with the copy constructor.
@param index The index of the attribute (zero-based).
@param value The desired ... | java | public void setSpecified (int index, boolean value)
{
if (index < 0 || index >= getLength ())
throw new ArrayIndexOutOfBoundsException (
"No attribute at index: " + index);
specified [index] = value;
} | [
"public",
"void",
"setSpecified",
"(",
"int",
"index",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"getLength",
"(",
")",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"No attribute at index: \"",
"+",
... | Assign a value to the "specified" flag of a specific attribute.
This is the only way this flag can be cleared, except clearing
by initialization with the copy constructor.
@param index The index of the attribute (zero-based).
@param value The desired flag value.
@exception java.lang.ArrayIndexOutOfBoundsException When... | [
"Assign",
"a",
"value",
"to",
"the",
"specified",
"flag",
"of",
"a",
"specific",
"attribute",
".",
"This",
"is",
"the",
"only",
"way",
"this",
"flag",
"can",
"be",
"cleared",
"except",
"clearing",
"by",
"initialization",
"with",
"the",
"copy",
"constructor",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java#L307-L313 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java | WriteFileExtensions.storeByteArrayToFile | public static void storeByteArrayToFile(final byte[] data, final File file) throws IOException {
"""
Saves a byte array to the given file.
@param data
The byte array to be saved.
@param file
The file to save the byte array.
@throws IOException
Signals that an I/O exception has occurred.
"""
try (File... | java | public static void storeByteArrayToFile(final byte[] data, final File file) throws IOException
{
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);)
{
bos.write(data);
bos.flush();
}
} | [
"public",
"static",
"void",
"storeByteArrayToFile",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"Buffer... | Saves a byte array to the given file.
@param data
The byte array to be saved.
@param file
The file to save the byte array.
@throws IOException
Signals that an I/O exception has occurred. | [
"Saves",
"a",
"byte",
"array",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java#L369-L377 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsSearchWidgetDialog.java | CmsSearchWidgetDialog.initUserObject | @SuppressWarnings("rawtypes")
@Override
protected void initUserObject() {
"""
Overridden to additionally get a hold on the widget object of type
<code>{@link CmsSearchParameters}</code>.<p>
@see org.opencms.workplace.tools.searchindex.A_CmsEditSearchIndexDialog#initUserObject()
"""
super.i... | java | @SuppressWarnings("rawtypes")
@Override
protected void initUserObject() {
super.initUserObject();
Object o = getDialogObject();
if (o == null) {
m_searchParams = new CmsSearchParameters();
// implant a hook upon modifications of the list
// this will ... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"protected",
"void",
"initUserObject",
"(",
")",
"{",
"super",
".",
"initUserObject",
"(",
")",
";",
"Object",
"o",
"=",
"getDialogObject",
"(",
")",
";",
"if",
"(",
"o",
"==",
"null",
"... | Overridden to additionally get a hold on the widget object of type
<code>{@link CmsSearchParameters}</code>.<p>
@see org.opencms.workplace.tools.searchindex.A_CmsEditSearchIndexDialog#initUserObject() | [
"Overridden",
"to",
"additionally",
"get",
"a",
"hold",
"on",
"the",
"widget",
"object",
"of",
"type",
"<code",
">",
"{",
"@link",
"CmsSearchParameters",
"}",
"<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsSearchWidgetDialog.java#L484-L508 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/mapper/JsonMapper.java | JsonMapper.fromJson | public <T> T fromJson(@Nullable String jsonString, Class<T> clazz) {
"""
反序列化POJO或简单Collection如List<String>.
如果JSON字符串为Null或"null"字符串, 返回Null. 如果JSON字符串为"[]", 返回空集合.
如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String, JavaType)
@see #fromJson(String, JavaType)
"""
if (StringUtils.isEmpty(jsonString... | java | public <T> T fromJson(@Nullable String jsonString, Class<T> clazz) {
if (StringUtils.isEmpty(jsonString)) {
return null;
}
try {
return mapper.readValue(jsonString, clazz);
} catch (IOException e) {
logger.warn("parse json string error:" + jsonString, e);
return null;
}
} | [
"public",
"<",
"T",
">",
"T",
"fromJson",
"(",
"@",
"Nullable",
"String",
"jsonString",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"jsonString",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"... | 反序列化POJO或简单Collection如List<String>.
如果JSON字符串为Null或"null"字符串, 返回Null. 如果JSON字符串为"[]", 返回空集合.
如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String, JavaType)
@see #fromJson(String, JavaType) | [
"反序列化POJO或简单Collection如List<String",
">",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/mapper/JsonMapper.java#L98-L109 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java | PluralRules.forLocale | public static PluralRules forLocale(ULocale locale, PluralType type) {
"""
Provides access to the predefined <code>PluralRules</code> for a given
locale and the plural type.
<p>ICU defines plural rules for many locales based on CLDR <i>Language Plural Rules</i>.
For these predefined rules, see CLDR page at
h... | java | public static PluralRules forLocale(ULocale locale, PluralType type) {
return Factory.getDefaultFactory().forLocale(locale, type);
} | [
"public",
"static",
"PluralRules",
"forLocale",
"(",
"ULocale",
"locale",
",",
"PluralType",
"type",
")",
"{",
"return",
"Factory",
".",
"getDefaultFactory",
"(",
")",
".",
"forLocale",
"(",
"locale",
",",
"type",
")",
";",
"}"
] | Provides access to the predefined <code>PluralRules</code> for a given
locale and the plural type.
<p>ICU defines plural rules for many locales based on CLDR <i>Language Plural Rules</i>.
For these predefined rules, see CLDR page at
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
... | [
"Provides",
"access",
"to",
"the",
"predefined",
"<code",
">",
"PluralRules<",
"/",
"code",
">",
"for",
"a",
"given",
"locale",
"and",
"the",
"plural",
"type",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java#L1926-L1928 |
oboehm/jfachwert | src/main/java/de/jfachwert/bank/Geldbetrag.java | Geldbetrag.stripTrailingZeros | @Override
public Geldbetrag stripTrailingZeros() {
"""
Liefert einen {@code Geldbetrag}, der numerisch dem gleichen Wert
entspricht, aber ohne Nullen in den Nachkommastellen.
@return im Priip der gleiche {@code Geldbetrag}, nur wird die Zahl
intern anders repraesentiert.
"""
if (isZero()) {
... | java | @Override
public Geldbetrag stripTrailingZeros() {
if (isZero()) {
return valueOf(BigDecimal.ZERO, getCurrency());
}
return valueOf(betrag.stripTrailingZeros(), getCurrency(), context);
} | [
"@",
"Override",
"public",
"Geldbetrag",
"stripTrailingZeros",
"(",
")",
"{",
"if",
"(",
"isZero",
"(",
")",
")",
"{",
"return",
"valueOf",
"(",
"BigDecimal",
".",
"ZERO",
",",
"getCurrency",
"(",
")",
")",
";",
"}",
"return",
"valueOf",
"(",
"betrag",
... | Liefert einen {@code Geldbetrag}, der numerisch dem gleichen Wert
entspricht, aber ohne Nullen in den Nachkommastellen.
@return im Priip der gleiche {@code Geldbetrag}, nur wird die Zahl
intern anders repraesentiert. | [
"Liefert",
"einen",
"{",
"@code",
"Geldbetrag",
"}",
"der",
"numerisch",
"dem",
"gleichen",
"Wert",
"entspricht",
"aber",
"ohne",
"Nullen",
"in",
"den",
"Nachkommastellen",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/bank/Geldbetrag.java#L1119-L1125 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/ui/LogFileWriter.java | LogFileWriter.readStatic | public StaticInfo readStatic() throws IOException {
"""
Read all static information at the start of the file
@return
@throws IOException
"""
List<Pair<UIStaticInfoRecord, Table>> out = new ArrayList<>();
boolean allStaticRead = false;
try (RandomAccessFile f = new RandomAccessFile(... | java | public StaticInfo readStatic() throws IOException {
List<Pair<UIStaticInfoRecord, Table>> out = new ArrayList<>();
boolean allStaticRead = false;
try (RandomAccessFile f = new RandomAccessFile(file, "r"); FileChannel fc = f.getChannel()) {
f.seek(0);
while (!allStaticRea... | [
"public",
"StaticInfo",
"readStatic",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Pair",
"<",
"UIStaticInfoRecord",
",",
"Table",
">",
">",
"out",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"boolean",
"allStaticRead",
"=",
"false",
";",
"try",... | Read all static information at the start of the file
@return
@throws IOException | [
"Read",
"all",
"static",
"information",
"at",
"the",
"start",
"of",
"the",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/graph/ui/LogFileWriter.java#L117-L171 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/io/StreamUtil.java | StreamUtil.routeStreamThroughProcess | public static InputStream routeStreamThroughProcess(final Process p, final InputStream origin, final boolean closeInput) {
"""
Given a Process, this function will route the flow of data through it & out again
@param p
@param origin
@param closeInput
@return
"""
InputStream processSTDOUT = p.getInputS... | java | public static InputStream routeStreamThroughProcess(final Process p, final InputStream origin, final boolean closeInput)
{
InputStream processSTDOUT = p.getInputStream();
OutputStream processSTDIN = p.getOutputStream();
// Kick off a background copy to the process
StreamUtil.doBackgroundCopy(origin, processST... | [
"public",
"static",
"InputStream",
"routeStreamThroughProcess",
"(",
"final",
"Process",
"p",
",",
"final",
"InputStream",
"origin",
",",
"final",
"boolean",
"closeInput",
")",
"{",
"InputStream",
"processSTDOUT",
"=",
"p",
".",
"getInputStream",
"(",
")",
";",
... | Given a Process, this function will route the flow of data through it & out again
@param p
@param origin
@param closeInput
@return | [
"Given",
"a",
"Process",
"this",
"function",
"will",
"route",
"the",
"flow",
"of",
"data",
"through",
"it",
"&",
"out",
"again"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/io/StreamUtil.java#L105-L114 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.unlockSourceAndCopy | private void unlockSourceAndCopy(File sourceFile, File copyFile) {
"""
Unlocks source and copy files after copying content. Also closes the source file so its content
can be deleted if it was deleted.
"""
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.r... | java | private void unlockSourceAndCopy(File sourceFile, File copyFile) {
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.readLock().unlock();
}
ReadWriteLock copyLock = copyFile.contentLock();
if (copyLock != null) {
copyLock.writeLock().unlock();
... | [
"private",
"void",
"unlockSourceAndCopy",
"(",
"File",
"sourceFile",
",",
"File",
"copyFile",
")",
"{",
"ReadWriteLock",
"sourceLock",
"=",
"sourceFile",
".",
"contentLock",
"(",
")",
";",
"if",
"(",
"sourceLock",
"!=",
"null",
")",
"{",
"sourceLock",
".",
"... | Unlocks source and copy files after copying content. Also closes the source file so its content
can be deleted if it was deleted. | [
"Unlocks",
"source",
"and",
"copy",
"files",
"after",
"copying",
"content",
".",
"Also",
"closes",
"the",
"source",
"file",
"so",
"its",
"content",
"can",
"be",
"deleted",
"if",
"it",
"was",
"deleted",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L682-L692 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.listAsync | public Observable<List<Person>> listAsync(String personGroupId, ListPersonGroupPersonsOptionalParameter listOptionalParameter) {
"""
List all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).
@param personGroup... | java | public Observable<List<Person>> listAsync(String personGroupId, ListPersonGroupPersonsOptionalParameter listOptionalParameter) {
return listWithServiceResponseAsync(personGroupId, listOptionalParameter).map(new Func1<ServiceResponse<List<Person>>, List<Person>>() {
@Override
public List<... | [
"public",
"Observable",
"<",
"List",
"<",
"Person",
">",
">",
"listAsync",
"(",
"String",
"personGroupId",
",",
"ListPersonGroupPersonsOptionalParameter",
"listOptionalParameter",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"personGroupId",
",",
"listOptional... | List all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).
@param personGroupId Id referencing a particular person group.
@param listOptionalParameter the object representing the optional parameters to be set before c... | [
"List",
"all",
"persons",
"in",
"a",
"person",
"group",
"and",
"retrieve",
"person",
"information",
"(",
"including",
"personId",
"name",
"userData",
"and",
"persistedFaceIds",
"of",
"registered",
"faces",
"of",
"the",
"person",
")",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L318-L325 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.printTo | public void printTo(StringBuilder buf, long instant) {
"""
Prints an instant from milliseconds since 1970-01-01T00:00:00Z,
using ISO chronology in the default DateTimeZone.
@param buf the destination to format to, not null
@param instant millis since 1970-01-01T00:00:00Z
"""
try {
pr... | java | public void printTo(StringBuilder buf, long instant) {
try {
printTo((Appendable) buf, instant);
} catch (IOException ex) {
// StringBuilder does not throw IOException
}
} | [
"public",
"void",
"printTo",
"(",
"StringBuilder",
"buf",
",",
"long",
"instant",
")",
"{",
"try",
"{",
"printTo",
"(",
"(",
"Appendable",
")",
"buf",
",",
"instant",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"// StringBuilder does not th... | Prints an instant from milliseconds since 1970-01-01T00:00:00Z,
using ISO chronology in the default DateTimeZone.
@param buf the destination to format to, not null
@param instant millis since 1970-01-01T00:00:00Z | [
"Prints",
"an",
"instant",
"from",
"milliseconds",
"since",
"1970",
"-",
"01",
"-",
"01T00",
":",
"00",
":",
"00Z",
"using",
"ISO",
"chronology",
"in",
"the",
"default",
"DateTimeZone",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L561-L567 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/WorkspacesApi.java | WorkspacesApi.getWorkspaceFile | public void getWorkspaceFile(String accountId, String workspaceId, String folderId, String fileId, WorkspacesApi.GetWorkspaceFileOptions options) throws ApiException {
"""
Get Workspace File
Retrieves a workspace file (the binary).
@param accountId The external account number (int) or account ID Guid. (required)... | java | public void getWorkspaceFile(String accountId, String workspaceId, String folderId, String fileId, WorkspacesApi.GetWorkspaceFileOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiExc... | [
"public",
"void",
"getWorkspaceFile",
"(",
"String",
"accountId",
",",
"String",
"workspaceId",
",",
"String",
"folderId",
",",
"String",
"fileId",
",",
"WorkspacesApi",
".",
"GetWorkspaceFileOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localV... | Get Workspace File
Retrieves a workspace file (the binary).
@param accountId The external account number (int) or account ID Guid. (required)
@param workspaceId Specifies the workspace ID GUID. (required)
@param folderId The ID of the folder being accessed. (required)
@param fileId Specifies the room file ID GUID. (req... | [
"Get",
"Workspace",
"File",
"Retrieves",
"a",
"workspace",
"file",
"(",
"the",
"binary",
")",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/WorkspacesApi.java#L350-L405 |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetBaseGenerator.java | RRBudgetBaseGenerator.hasPersonnelBudget | protected Boolean hasPersonnelBudget(KeyPersonDto keyPerson,int period) {
"""
This method check whether the key person has a personnel budget
@param keyPerson
(KeyPersonInfo) key person entry.
@param period
budget period
@return true if key person has personnel budget else false.
"""
List<? exten... | java | protected Boolean hasPersonnelBudget(KeyPersonDto keyPerson,int period){
List<? extends BudgetLineItemContract> budgetLineItemList = new ArrayList<>();
ProposalDevelopmentBudgetExtContract budget = s2SCommonBudgetService.getBudget(pdDoc.getDevelopmentProposal());
budgetLineItemList = budget.getB... | [
"protected",
"Boolean",
"hasPersonnelBudget",
"(",
"KeyPersonDto",
"keyPerson",
",",
"int",
"period",
")",
"{",
"List",
"<",
"?",
"extends",
"BudgetLineItemContract",
">",
"budgetLineItemList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ProposalDevelopmentBudget... | This method check whether the key person has a personnel budget
@param keyPerson
(KeyPersonInfo) key person entry.
@param period
budget period
@return true if key person has personnel budget else false. | [
"This",
"method",
"check",
"whether",
"the",
"key",
"person",
"has",
"a",
"personnel",
"budget"
] | train | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetBaseGenerator.java#L278-L295 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java | FastAdapterDiffUtil.set | public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> A set(final A adapter, DiffUtil.DiffResult result) {
"""
Dispatches a {@link androidx.recyclerview.widget.DiffUtil.DiffResult} to the given Adapter.
@param adapter the adapter to dispatch the updates to
@param result the computed {... | java | public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> A set(final A adapter, DiffUtil.DiffResult result) {
result.dispatchUpdatesTo(new FastAdapterListUpdateCallback<>(adapter));
return adapter;
} | [
"public",
"static",
"<",
"A",
"extends",
"ModelAdapter",
"<",
"Model",
",",
"Item",
">",
",",
"Model",
",",
"Item",
"extends",
"IItem",
">",
"A",
"set",
"(",
"final",
"A",
"adapter",
",",
"DiffUtil",
".",
"DiffResult",
"result",
")",
"{",
"result",
"."... | Dispatches a {@link androidx.recyclerview.widget.DiffUtil.DiffResult} to the given Adapter.
@param adapter the adapter to dispatch the updates to
@param result the computed {@link androidx.recyclerview.widget.DiffUtil.DiffResult}
@return the adapter to allow chaining | [
"Dispatches",
"a",
"{",
"@link",
"androidx",
".",
"recyclerview",
".",
"widget",
".",
"DiffUtil",
".",
"DiffResult",
"}",
"to",
"the",
"given",
"Adapter",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java#L107-L110 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.readField | public static Object readField(final Object target, final String fieldName, final boolean forceAccess) throws IllegalAccessException {
"""
Reads the named {@link Field}. Superclasses will be considered.
@param target
the object to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@... | java | public static Object readField(final Object target, final String fieldName, final boolean forceAccess) throws IllegalAccessException {
Validate.isTrue(target != null, "target object must not be null");
final Class<?> cls = target.getClass();
final Field field = getField(cls, fieldName, forceAcce... | [
"public",
"static",
"Object",
"readField",
"(",
"final",
"Object",
"target",
",",
"final",
"String",
"fieldName",
",",
"final",
"boolean",
"forceAccess",
")",
"throws",
"IllegalAccessException",
"{",
"Validate",
".",
"isTrue",
"(",
"target",
"!=",
"null",
",",
... | Reads the named {@link Field}. Superclasses will be considered.
@param target
the object to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@param forceAccess
whether to break scope restrictions using the
{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. {@code false... | [
"Reads",
"the",
"named",
"{",
"@link",
"Field",
"}",
".",
"Superclasses",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L466-L473 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getInput | public InputStream getInput(String pathname) throws FileNotFoundException {
"""
Opens an InputStream for reading from the file denoted by pathname.
@param pathname the full path of the file to read from
@return an InputStream for reading from the file
@throws FileNotFoundException if the file does not exist or ... | java | public InputStream getInput(String pathname) throws FileNotFoundException {
GridFile file = (GridFile) getFile(pathname);
checkFileIsReadable(file);
return new GridInputStream(file, data);
} | [
"public",
"InputStream",
"getInput",
"(",
"String",
"pathname",
")",
"throws",
"FileNotFoundException",
"{",
"GridFile",
"file",
"=",
"(",
"GridFile",
")",
"getFile",
"(",
"pathname",
")",
";",
"checkFileIsReadable",
"(",
"file",
")",
";",
"return",
"new",
"Gr... | Opens an InputStream for reading from the file denoted by pathname.
@param pathname the full path of the file to read from
@return an InputStream for reading from the file
@throws FileNotFoundException if the file does not exist or is a directory | [
"Opens",
"an",
"InputStream",
"for",
"reading",
"from",
"the",
"file",
"denoted",
"by",
"pathname",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L155-L159 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getDocLink | public Content getDocLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element element,
CharSequence label, boolean strong, boolean isProperty) {
"""
Return the link for the given member.
@param context the id of the context where the link will be printed.
@param typeElement the typeElement ... | java | public Content getDocLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element element,
CharSequence label, boolean strong, boolean isProperty) {
return getDocLink(context, typeElement, element, new StringContent(check(label)), strong, isProperty);
} | [
"public",
"Content",
"getDocLink",
"(",
"LinkInfoImpl",
".",
"Kind",
"context",
",",
"TypeElement",
"typeElement",
",",
"Element",
"element",
",",
"CharSequence",
"label",
",",
"boolean",
"strong",
",",
"boolean",
"isProperty",
")",
"{",
"return",
"getDocLink",
... | Return the link for the given member.
@param context the id of the context where the link will be printed.
@param typeElement the typeElement that we should link to. This is not
necessarily equal to element.containingClass(). We may be
inheriting comments.
@param element the member being linked to.
@param label the ... | [
"Return",
"the",
"link",
"for",
"the",
"given",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1405-L1408 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java | AnimationInteractivityManager.BuildInteractiveObjectFromAnchor | public void BuildInteractiveObjectFromAnchor(Sensor anchorSensor, String anchorDestination) {
"""
BuildInteractiveObjectFromAnchor is a special type of interactive object in that it does not get
built using ROUTE's.
@param anchorSensor is the Sensor that describes the sensor set to an Anchor
@param anchorDest... | java | public void BuildInteractiveObjectFromAnchor(Sensor anchorSensor, String anchorDestination) {
InteractiveObject interactiveObject = new InteractiveObject();
interactiveObject.setSensor(anchorSensor, anchorDestination);
interactiveObjects.add(interactiveObject);
} | [
"public",
"void",
"BuildInteractiveObjectFromAnchor",
"(",
"Sensor",
"anchorSensor",
",",
"String",
"anchorDestination",
")",
"{",
"InteractiveObject",
"interactiveObject",
"=",
"new",
"InteractiveObject",
"(",
")",
";",
"interactiveObject",
".",
"setSensor",
"(",
"anch... | BuildInteractiveObjectFromAnchor is a special type of interactive object in that it does not get
built using ROUTE's.
@param anchorSensor is the Sensor that describes the sensor set to an Anchor
@param anchorDestination is either another Viewpoint, url to a web site or another x3d scene | [
"BuildInteractiveObjectFromAnchor",
"is",
"a",
"special",
"type",
"of",
"interactive",
"object",
"in",
"that",
"it",
"does",
"not",
"get",
"built",
"using",
"ROUTE",
"s",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java#L502-L506 |
google/auto | common/src/main/java/com/google/auto/common/MoreElements.java | MoreElements.getLocalAndInheritedMethods | @Deprecated
public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
TypeElement type, Elements elementUtils) {
"""
Returns the set of all non-private methods from {@code type}, including methods that it
inherits from its ancestors. Inherited methods that are overridden are not included ... | java | @Deprecated
public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
TypeElement type, Elements elementUtils) {
Overrides overrides = new Overrides.NativeOverrides(elementUtils);
return getLocalAndInheritedMethods(type, overrides);
} | [
"@",
"Deprecated",
"public",
"static",
"ImmutableSet",
"<",
"ExecutableElement",
">",
"getLocalAndInheritedMethods",
"(",
"TypeElement",
"type",
",",
"Elements",
"elementUtils",
")",
"{",
"Overrides",
"overrides",
"=",
"new",
"Overrides",
".",
"NativeOverrides",
"(",
... | Returns the set of all non-private methods from {@code type}, including methods that it
inherits from its ancestors. Inherited methods that are overridden are not included in the
result. So if {@code type} defines {@code public String toString()}, the returned set will
contain that method, but not the {@code toString()... | [
"Returns",
"the",
"set",
"of",
"all",
"non",
"-",
"private",
"methods",
"from",
"{",
"@code",
"type",
"}",
"including",
"methods",
"that",
"it",
"inherits",
"from",
"its",
"ancestors",
".",
"Inherited",
"methods",
"that",
"are",
"overridden",
"are",
"not",
... | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/MoreElements.java#L300-L305 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecValidator.java | ContentSpecValidator.preValidateTopic | public boolean preValidateTopic(final SpecTopic specTopic, final Map<String, SpecTopic> specTopics,
final Set<String> processedFixedUrls, final BookType bookType, final ContentSpec contentSpec) {
"""
Validates a topic against the database and for formatting issues.
@param specTopic The topic to ... | java | public boolean preValidateTopic(final SpecTopic specTopic, final Map<String, SpecTopic> specTopics,
final Set<String> processedFixedUrls, final BookType bookType, final ContentSpec contentSpec) {
return preValidateTopic(specTopic, specTopics, processedFixedUrls, bookType, true, contentSpec);
} | [
"public",
"boolean",
"preValidateTopic",
"(",
"final",
"SpecTopic",
"specTopic",
",",
"final",
"Map",
"<",
"String",
",",
"SpecTopic",
">",
"specTopics",
",",
"final",
"Set",
"<",
"String",
">",
"processedFixedUrls",
",",
"final",
"BookType",
"bookType",
",",
... | Validates a topic against the database and for formatting issues.
@param specTopic The topic to be validated.
@param specTopics The list of topics that exist within the content specification.
@param processedFixedUrls
@param bookType The type of book the topic is to be validated against.
@param contentSpec The ... | [
"Validates",
"a",
"topic",
"against",
"the",
"database",
"and",
"for",
"formatting",
"issues",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecValidator.java#L1371-L1374 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/CallableUtils.java | CallableUtils.updateTypes | public static QueryParameters updateTypes(QueryParameters original, QueryParameters source) {
"""
Clones @original and updates it's types - taken from @source.
@param original QueryParameters which would be updated
@param source QueryParameters types of which would be read
@return updated clone on @original... | java | public static QueryParameters updateTypes(QueryParameters original, QueryParameters source) {
QueryParameters updatedParams = new QueryParameters(original);
Integer position = null;
String originalKey = null;
if (source != null) {
for (String sourceKey : source.keySet(... | [
"public",
"static",
"QueryParameters",
"updateTypes",
"(",
"QueryParameters",
"original",
",",
"QueryParameters",
"source",
")",
"{",
"QueryParameters",
"updatedParams",
"=",
"new",
"QueryParameters",
"(",
"original",
")",
";",
"Integer",
"position",
"=",
"null",
";... | Clones @original and updates it's types - taken from @source.
@param original QueryParameters which would be updated
@param source QueryParameters types of which would be read
@return updated clone on @original with updated types | [
"Clones",
"@original",
"and",
"updates",
"it",
"s",
"types",
"-",
"taken",
"from",
"@source",
"."
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/CallableUtils.java#L140-L159 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/common/Utils.java | Utils.findConstructor | public static Constructor findConstructor(Class<?> type, Object[] args) {
"""
Finds the constructor of the given class that is compatible with the given arguments.
@param type the class to find the constructor of
@param args the arguments
@return the constructor
"""
outer:
for (Constructor... | java | public static Constructor findConstructor(Class<?> type, Object[] args) {
outer:
for (Constructor constructor : type.getConstructors()) {
Class<?>[] paramTypes = constructor.getParameterTypes();
if (paramTypes.length != args.length) continue;
for (int i = 0; i < args.... | [
"public",
"static",
"Constructor",
"findConstructor",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"outer",
":",
"for",
"(",
"Constructor",
"constructor",
":",
"type",
".",
"getConstructors",
"(",
")",
")",
"{",
"Class"... | Finds the constructor of the given class that is compatible with the given arguments.
@param type the class to find the constructor of
@param args the arguments
@return the constructor | [
"Finds",
"the",
"constructor",
"of",
"the",
"given",
"class",
"that",
"is",
"compatible",
"with",
"the",
"given",
"arguments",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/common/Utils.java#L301-L314 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.convertTo | public <S, T> T convertTo(Class<S> input, Class<T> output, Object object) {
"""
Convert an object which is an instance of source class to the given target class
@param input The class of the object to be converted
@param output The target class to convert the object to
@param object The object to be converted
... | java | public <S, T> T convertTo(Class<S> input, Class<T> output, Object object) {
return convertTo(new ConverterKey<S,T>(input, output, DefaultBinding.class), object);
} | [
"public",
"<",
"S",
",",
"T",
">",
"T",
"convertTo",
"(",
"Class",
"<",
"S",
">",
"input",
",",
"Class",
"<",
"T",
">",
"output",
",",
"Object",
"object",
")",
"{",
"return",
"convertTo",
"(",
"new",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"(",
... | Convert an object which is an instance of source class to the given target class
@param input The class of the object to be converted
@param output The target class to convert the object to
@param object The object to be converted | [
"Convert",
"an",
"object",
"which",
"is",
"an",
"instance",
"of",
"source",
"class",
"to",
"the",
"given",
"target",
"class"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L794-L796 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CProductLocalServiceBaseImpl.java | CProductLocalServiceBaseImpl.getCProductByUuidAndGroupId | @Override
public CProduct getCProductByUuidAndGroupId(String uuid, long groupId)
throws PortalException {
"""
Returns the c product matching the UUID and group.
@param uuid the c product's UUID
@param groupId the primary key of the group
@return the matching c product
@throws PortalException if a matching... | java | @Override
public CProduct getCProductByUuidAndGroupId(String uuid, long groupId)
throws PortalException {
return cProductPersistence.findByUUID_G(uuid, groupId);
} | [
"@",
"Override",
"public",
"CProduct",
"getCProductByUuidAndGroupId",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"PortalException",
"{",
"return",
"cProductPersistence",
".",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"}"
] | Returns the c product matching the UUID and group.
@param uuid the c product's UUID
@param groupId the primary key of the group
@return the matching c product
@throws PortalException if a matching c product could not be found | [
"Returns",
"the",
"c",
"product",
"matching",
"the",
"UUID",
"and",
"group",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CProductLocalServiceBaseImpl.java#L407-L411 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/sa/StandardServiceAgentServer.java | StandardServiceAgentServer.handleTCPSrvDeReg | protected void handleTCPSrvDeReg(SrvDeReg srvDeReg, Socket socket) {
"""
Handles a unicast TCP SrvDeReg message arrived to this service agent.
<br />
This service agent will reply with an acknowledge containing the result of the deregistration.
@param srvDeReg the SrvDeReg message to handle
@param socket t... | java | protected void handleTCPSrvDeReg(SrvDeReg srvDeReg, Socket socket)
{
try
{
boolean update = srvDeReg.isUpdating();
ServiceInfo givenService = ServiceInfo.from(srvDeReg);
ServiceInfoCache.Result<ServiceInfo> result = uncacheService(givenService, update);
... | [
"protected",
"void",
"handleTCPSrvDeReg",
"(",
"SrvDeReg",
"srvDeReg",
",",
"Socket",
"socket",
")",
"{",
"try",
"{",
"boolean",
"update",
"=",
"srvDeReg",
".",
"isUpdating",
"(",
")",
";",
"ServiceInfo",
"givenService",
"=",
"ServiceInfo",
".",
"from",
"(",
... | Handles a unicast TCP SrvDeReg message arrived to this service agent.
<br />
This service agent will reply with an acknowledge containing the result of the deregistration.
@param srvDeReg the SrvDeReg message to handle
@param socket the socket connected to the client where to write the reply | [
"Handles",
"a",
"unicast",
"TCP",
"SrvDeReg",
"message",
"arrived",
"to",
"this",
"service",
"agent",
".",
"<br",
"/",
">",
"This",
"service",
"agent",
"will",
"reply",
"with",
"an",
"acknowledge",
"containing",
"the",
"result",
"of",
"the",
"deregistration",
... | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/sa/StandardServiceAgentServer.java#L192-L206 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetrics.java | GobblinMetrics.getTimer | public Timer getTimer(String prefix, String... suffixes) {
"""
Get a {@link Timer} with the given name prefix and suffixes.
@param prefix the given name prefix
@param suffixes the given name suffixes
@return a {@link Timer} with the given name prefix and suffixes
"""
return this.metricContext.timer(Me... | java | public Timer getTimer(String prefix, String... suffixes) {
return this.metricContext.timer(MetricRegistry.name(prefix, suffixes));
} | [
"public",
"Timer",
"getTimer",
"(",
"String",
"prefix",
",",
"String",
"...",
"suffixes",
")",
"{",
"return",
"this",
".",
"metricContext",
".",
"timer",
"(",
"MetricRegistry",
".",
"name",
"(",
"prefix",
",",
"suffixes",
")",
")",
";",
"}"
] | Get a {@link Timer} with the given name prefix and suffixes.
@param prefix the given name prefix
@param suffixes the given name suffixes
@return a {@link Timer} with the given name prefix and suffixes | [
"Get",
"a",
"{",
"@link",
"Timer",
"}",
"with",
"the",
"given",
"name",
"prefix",
"and",
"suffixes",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetrics.java#L345-L347 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.beginCreateImportOperation | public ImportExportResponseInner beginCreateImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequest parameters) {
"""
Creates an import operation that imports a bacpac into an existing database. The existing database must be empty.
@param resourceGroupName The na... | java | public ImportExportResponseInner beginCreateImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequest parameters) {
return beginCreateImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body();
... | [
"public",
"ImportExportResponseInner",
"beginCreateImportOperation",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"ImportExtensionRequest",
"parameters",
")",
"{",
"return",
"beginCreateImportOperationWithServiceResponseAsyn... | Creates an import operation that imports a bacpac into an existing database. The existing database must be empty.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@p... | [
"Creates",
"an",
"import",
"operation",
"that",
"imports",
"a",
"bacpac",
"into",
"an",
"existing",
"database",
".",
"The",
"existing",
"database",
"must",
"be",
"empty",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1995-L1997 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/RuleConditions.java | RuleConditions.checkNode | public static void checkNode(Node node, Node.Type... validTypes) {
"""
Check a node for validity.
<p>
@param node the node
@param validTypes expected types
"""
for (Node.Type type : validTypes) {
if (node.getNodeType() == type) {
return;
}
}
StringJoiner sj = new StringJoiner(", ");
... | java | public static void checkNode(Node node, Node.Type... validTypes) {
for (Node.Type type : validTypes) {
if (node.getNodeType() == type) {
return;
}
}
StringJoiner sj = new StringJoiner(", ");
for (Node.Type type : validTypes) {
sj.add(type.toString());
}
String nodeName = node.getNodeType().name... | [
"public",
"static",
"void",
"checkNode",
"(",
"Node",
"node",
",",
"Node",
".",
"Type",
"...",
"validTypes",
")",
"{",
"for",
"(",
"Node",
".",
"Type",
"type",
":",
"validTypes",
")",
"{",
"if",
"(",
"node",
".",
"getNodeType",
"(",
")",
"==",
"type"... | Check a node for validity.
<p>
@param node the node
@param validTypes expected types | [
"Check",
"a",
"node",
"for",
"validity",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/RuleConditions.java#L77-L92 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java | SFSUtilities.getSRID | public static int getSRID(Connection connection, TableLocation table) throws SQLException {
"""
Return the SRID of the first geometry column of the input table
@param connection Active connection
@param table Table name
@return The SRID of the first geometry column
@throws SQLException
"""
Re... | java | public static int getSRID(Connection connection, TableLocation table) throws SQLException {
ResultSet geomResultSet = getGeometryColumnsView(connection, table.getCatalog(), table.getSchema(),
table.getTable());
int srid = 0;
while (geomResultSet.next()) {
srid = geomR... | [
"public",
"static",
"int",
"getSRID",
"(",
"Connection",
"connection",
",",
"TableLocation",
"table",
")",
"throws",
"SQLException",
"{",
"ResultSet",
"geomResultSet",
"=",
"getGeometryColumnsView",
"(",
"connection",
",",
"table",
".",
"getCatalog",
"(",
")",
","... | Return the SRID of the first geometry column of the input table
@param connection Active connection
@param table Table name
@return The SRID of the first geometry column
@throws SQLException | [
"Return",
"the",
"SRID",
"of",
"the",
"first",
"geometry",
"column",
"of",
"the",
"input",
"table"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/SFSUtilities.java#L491-L501 |
revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.getOptionsFromConfigFile | private Map<String, String> getOptionsFromConfigFile(String newConfigFile) throws MojoExecutionException {
"""
Read config file and return the config as {@link Map}.
@return the options from config file
@throws MojoExecutionException
the mojo execution exception
"""
this.getLog().debug("Using sea... | java | private Map<String, String> getOptionsFromConfigFile(String newConfigFile) throws MojoExecutionException {
this.getLog().debug("Using search path at: " + this.basedir.getAbsolutePath());
this.resourceManager.addSearchPath(FileResourceLoader.ID, this.basedir.getAbsolutePath());
try (InputStream... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"getOptionsFromConfigFile",
"(",
"String",
"newConfigFile",
")",
"throws",
"MojoExecutionException",
"{",
"this",
".",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"Using search path at: \"",
"+",
"this",
".",
"ba... | Read config file and return the config as {@link Map}.
@return the options from config file
@throws MojoExecutionException
the mojo execution exception | [
"Read",
"config",
"file",
"and",
"return",
"the",
"config",
"as",
"{",
"@link",
"Map",
"}",
"."
] | train | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L698-L714 |
i-net-software/jlessc | src/com/inet/lib/less/Rule.java | Rule.ruleset | private void ruleset( String[] sel, CssFormatter formatter ) {
"""
Directives like @media in the root.
@param sel the selectors
@param formatter current formatter
"""
formatter = formatter.startBlock( sel );
appendPropertiesTo( formatter );
for( Formattable prop : properties ) {
... | java | private void ruleset( String[] sel, CssFormatter formatter ) {
formatter = formatter.startBlock( sel );
appendPropertiesTo( formatter );
for( Formattable prop : properties ) {
if( prop instanceof Mixin ) {
((Mixin)prop).appendSubRules( null, formatter );
... | [
"private",
"void",
"ruleset",
"(",
"String",
"[",
"]",
"sel",
",",
"CssFormatter",
"formatter",
")",
"{",
"formatter",
"=",
"formatter",
".",
"startBlock",
"(",
"sel",
")",
";",
"appendPropertiesTo",
"(",
"formatter",
")",
";",
"for",
"(",
"Formattable",
"... | Directives like @media in the root.
@param sel the selectors
@param formatter current formatter | [
"Directives",
"like",
"@media",
"in",
"the",
"root",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/Rule.java#L276-L290 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java | AssetRendition.getDimensionFromRenditionMetadata | private static @Nullable Dimension getDimensionFromRenditionMetadata(@NotNull Rendition rendition) {
"""
Read dimension for non-original rendition from renditions metadata generated by "DamRenditionMetadataService".
@param rendition Rendition
@return Dimension or null
"""
Asset asset = rendition.getAsset... | java | private static @Nullable Dimension getDimensionFromRenditionMetadata(@NotNull Rendition rendition) {
Asset asset = rendition.getAsset();
String metadataPath = JCR_CONTENT + "/" + NN_RENDITIONS_METADATA + "/" + rendition.getName();
Resource metadataResource = AdaptTo.notNull(asset, Resource.class).getChild(m... | [
"private",
"static",
"@",
"Nullable",
"Dimension",
"getDimensionFromRenditionMetadata",
"(",
"@",
"NotNull",
"Rendition",
"rendition",
")",
"{",
"Asset",
"asset",
"=",
"rendition",
".",
"getAsset",
"(",
")",
";",
"String",
"metadataPath",
"=",
"JCR_CONTENT",
"+",
... | Read dimension for non-original rendition from renditions metadata generated by "DamRenditionMetadataService".
@param rendition Rendition
@return Dimension or null | [
"Read",
"dimension",
"for",
"non",
"-",
"original",
"rendition",
"from",
"renditions",
"metadata",
"generated",
"by",
"DamRenditionMetadataService",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java#L158-L169 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/logging/LogTemplates.java | LogTemplates.everyNSeconds | public static <C> LogTemplate<C> everyNSeconds(LogTemplate<C> delegateLogger, long period) {
"""
Produces a log template which logs something at most every N secoonds.
@param delegateLogger Concrete log template
@param period N value in seconds, maximum period
@return Logger
"""
return everyNMillisecon... | java | public static <C> LogTemplate<C> everyNSeconds(LogTemplate<C> delegateLogger, long period) {
return everyNMilliseconds(delegateLogger, period * SimonClock.MILLIS_IN_SECOND);
} | [
"public",
"static",
"<",
"C",
">",
"LogTemplate",
"<",
"C",
">",
"everyNSeconds",
"(",
"LogTemplate",
"<",
"C",
">",
"delegateLogger",
",",
"long",
"period",
")",
"{",
"return",
"everyNMilliseconds",
"(",
"delegateLogger",
",",
"period",
"*",
"SimonClock",
"... | Produces a log template which logs something at most every N secoonds.
@param delegateLogger Concrete log template
@param period N value in seconds, maximum period
@return Logger | [
"Produces",
"a",
"log",
"template",
"which",
"logs",
"something",
"at",
"most",
"every",
"N",
"secoonds",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/logging/LogTemplates.java#L61-L63 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java | SeaGlassTextFieldUI.paintBackground | void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
"""
DOCUMENT ME!
@param context DOCUMENT ME!
@param g DOCUMENT ME!
@param c DOCUMENT ME!
"""
context.getPainter().paintTextFieldBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
// If necessary, ... | java | void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
context.getPainter().paintTextFieldBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
// If necessary, paint the placeholder text.
if (placeholderText != null && ((JTextComponent) c).getText().length() == 0 && !c.h... | [
"void",
"paintBackground",
"(",
"SeaGlassContext",
"context",
",",
"Graphics",
"g",
",",
"JComponent",
"c",
")",
"{",
"context",
".",
"getPainter",
"(",
")",
".",
"paintTextFieldBackground",
"(",
"context",
",",
"g",
",",
"0",
",",
"0",
",",
"c",
".",
"g... | DOCUMENT ME!
@param context DOCUMENT ME!
@param g DOCUMENT ME!
@param c DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java#L458-L464 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java | RedisClusterStorage.removeCalendar | @Override
public boolean removeCalendar(String calendarName, JedisCluster jedis) throws JobPersistenceException {
"""
Remove (delete) the <code>{@link Calendar}</code> with the given name.
@param calendarName the name of the calendar to be removed
@param jedis a thread-safe Redis connection
@return... | java | @Override
public boolean removeCalendar(String calendarName, JedisCluster jedis) throws JobPersistenceException {
final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);
if (jedis.scard(calendarTriggersSetKey) > 0) {
throw new JobPersistenceException(Stri... | [
"@",
"Override",
"public",
"boolean",
"removeCalendar",
"(",
"String",
"calendarName",
",",
"JedisCluster",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"calendarTriggersSetKey",
"=",
"redisSchema",
".",
"calendarTriggersSetKey",
"(",
"cale... | Remove (delete) the <code>{@link Calendar}</code> with the given name.
@param calendarName the name of the calendar to be removed
@param jedis a thread-safe Redis connection
@return true if a calendar with the given name was found and removed | [
"Remove",
"(",
"delete",
")",
"the",
"<code",
">",
"{",
"@link",
"Calendar",
"}",
"<",
"/",
"code",
">",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L306-L318 |
morfologik/morfologik-stemming | morfologik-fsa/src/main/java/morfologik/fsa/FSA5.java | FSA5.decodeFromBytes | static final int decodeFromBytes(final byte[] arcs, final int start, final int n) {
"""
Returns an n-byte integer encoded in byte-packed representation.
"""
int r = 0;
for (int i = n; --i >= 0;) {
r = r << 8 | (arcs[start + i] & 0xff);
}
return r;
} | java | static final int decodeFromBytes(final byte[] arcs, final int start, final int n) {
int r = 0;
for (int i = n; --i >= 0;) {
r = r << 8 | (arcs[start + i] & 0xff);
}
return r;
} | [
"static",
"final",
"int",
"decodeFromBytes",
"(",
"final",
"byte",
"[",
"]",
"arcs",
",",
"final",
"int",
"start",
",",
"final",
"int",
"n",
")",
"{",
"int",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"n",
";",
"--",
"i",
">=",
"0",
";",
... | Returns an n-byte integer encoded in byte-packed representation. | [
"Returns",
"an",
"n",
"-",
"byte",
"integer",
"encoded",
"in",
"byte",
"-",
"packed",
"representation",
"."
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa/src/main/java/morfologik/fsa/FSA5.java#L289-L295 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/proxy/InvocationException.java | InvocationException.newInstance | public static InvocationException newInstance(InvocationContext context, Throwable rootCause) {
"""
<p>Creates a new instance of {@link InvocationException} for a failed request <b>execution</b>
with the {@link InvocationContext} which was used to construct the request. If the given root
cause is already a {@lin... | java | public static InvocationException newInstance(InvocationContext context, Throwable rootCause) {
if(rootCause instanceof InvocationException) {
return (InvocationException)rootCause;
}
return new InvocationException(context, rootCause);
} | [
"public",
"static",
"InvocationException",
"newInstance",
"(",
"InvocationContext",
"context",
",",
"Throwable",
"rootCause",
")",
"{",
"if",
"(",
"rootCause",
"instanceof",
"InvocationException",
")",
"{",
"return",
"(",
"InvocationException",
")",
"rootCause",
";",
... | <p>Creates a new instance of {@link InvocationException} for a failed request <b>execution</b>
with the {@link InvocationContext} which was used to construct the request. If the given root
cause is already a {@link InvocationException}, it's returned as it is.<p>
@param context
the {@link InvocationContext} which init... | [
"<p",
">",
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"InvocationException",
"}",
"for",
"a",
"failed",
"request",
"<b",
">",
"execution<",
"/",
"b",
">",
"with",
"the",
"{",
"@link",
"InvocationContext",
"}",
"which",
"was",
"used",
"to",
"c... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/proxy/InvocationException.java#L110-L118 |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoDs/Util.java | Util.registerDeviceForJacorb | void registerDeviceForJacorb(final String name) {
"""
WARNING: The following code is JacORB specific. The jacorb.jar must have
been modified by adding org.jacorb.orb.ORB.putObjectKeyMap method. public
void putObjectKeyMap(String s, String t) { objectKeyMap.put(s, t); }
Add device name in HashTable used for Ja... | java | void registerDeviceForJacorb(final String name) {
// Get the 3 fields of device name
final StringTokenizer st = new StringTokenizer(name, "/");
final String[] field = new String[3];
for (int i = 0; i < 3 && st.countTokens() > 0; i++) {
field[i] = st.nextToken();
}
... | [
"void",
"registerDeviceForJacorb",
"(",
"final",
"String",
"name",
")",
"{",
"// Get the 3 fields of device name",
"final",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"name",
",",
"\"/\"",
")",
";",
"final",
"String",
"[",
"]",
"field",
"=",
"n... | WARNING: The following code is JacORB specific. The jacorb.jar must have
been modified by adding org.jacorb.orb.ORB.putObjectKeyMap method. public
void putObjectKeyMap(String s, String t) { objectKeyMap.put(s, t); }
Add device name in HashTable used for JacORB objectKeyMap if
_UseDb==false.
@param name
The device's n... | [
"WARNING",
":",
"The",
"following",
"code",
"is",
"JacORB",
"specific",
".",
"The",
"jacorb",
".",
"jar",
"must",
"have",
"been",
"modified",
"by",
"adding",
"org",
".",
"jacorb",
".",
"orb",
".",
"ORB",
".",
"putObjectKeyMap",
"method",
".",
"public",
"... | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Util.java#L1484-L1503 |
DV8FromTheWorld/JDA | src/main/java/com/iwebpp/crypto/TweetNaclFast.java | Box.open | public byte [] open(byte [] box) {
"""
/*
@description
Authenticates and decrypts the given box with peer's public key,
our secret key, and the given nonce.
Returns the original message, or null if authentication fails.
"""
if (box==null) return null;
// prepare shared key
... | java | public byte [] open(byte [] box) {
if (box==null) return null;
// prepare shared key
if (this.sharedKey == null) before();
return open_after(box, 0, box.length);
} | [
"public",
"byte",
"[",
"]",
"open",
"(",
"byte",
"[",
"]",
"box",
")",
"{",
"if",
"(",
"box",
"==",
"null",
")",
"return",
"null",
";",
"// prepare shared key",
"if",
"(",
"this",
".",
"sharedKey",
"==",
"null",
")",
"before",
"(",
")",
";",
"retur... | /*
@description
Authenticates and decrypts the given box with peer's public key,
our secret key, and the given nonce.
Returns the original message, or null if authentication fails. | [
"/",
"*",
"@description",
"Authenticates",
"and",
"decrypts",
"the",
"given",
"box",
"with",
"peer",
"s",
"public",
"key",
"our",
"secret",
"key",
"and",
"the",
"given",
"nonce",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/com/iwebpp/crypto/TweetNaclFast.java#L146-L153 |
alkacon/opencms-core | src/org/opencms/importexport/CmsExport.java | CmsExport.exportGroups | protected void exportGroups(Element parent, CmsOrganizationalUnit orgunit)
throws CmsImportExportException, SAXException {
"""
Exports all groups of the given organizational unit.<p>
@param parent the parent node to add the groups to
@param orgunit the organizational unit to write the groups for
@throws... | java | protected void exportGroups(Element parent, CmsOrganizationalUnit orgunit)
throws CmsImportExportException, SAXException {
try {
I_CmsReport report = getReport();
List<CmsGroup> allGroups = OpenCms.getOrgUnitManager().getGroups(getCms(), orgunit.getName(), false);
for (i... | [
"protected",
"void",
"exportGroups",
"(",
"Element",
"parent",
",",
"CmsOrganizationalUnit",
"orgunit",
")",
"throws",
"CmsImportExportException",
",",
"SAXException",
"{",
"try",
"{",
"I_CmsReport",
"report",
"=",
"getReport",
"(",
")",
";",
"List",
"<",
"CmsGrou... | Exports all groups of the given organizational unit.<p>
@param parent the parent node to add the groups to
@param orgunit the organizational unit to write the groups for
@throws CmsImportExportException if something goes wrong
@throws SAXException if something goes wrong processing the manifest.xml | [
"Exports",
"all",
"groups",
"of",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsExport.java#L977-L1010 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLValid | public static void assertXMLValid(String xmlString, String systemId)
throws SAXException, ConfigurationException {
"""
Assert that a String containing XML contains valid XML: the String must
contain a DOCTYPE to be validated, but the validation will use the
systemId to obtain the DTD
@param xmlString
@... | java | public static void assertXMLValid(String xmlString, String systemId)
throws SAXException, ConfigurationException {
assertXMLValid(new Validator(xmlString, systemId));
} | [
"public",
"static",
"void",
"assertXMLValid",
"(",
"String",
"xmlString",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
",",
"ConfigurationException",
"{",
"assertXMLValid",
"(",
"new",
"Validator",
"(",
"xmlString",
",",
"systemId",
")",
")",
";",
"... | Assert that a String containing XML contains valid XML: the String must
contain a DOCTYPE to be validated, but the validation will use the
systemId to obtain the DTD
@param xmlString
@param systemId
@throws SAXException
@throws ConfigurationException if validation could not be turned on
@see Validator | [
"Assert",
"that",
"a",
"String",
"containing",
"XML",
"contains",
"valid",
"XML",
":",
"the",
"String",
"must",
"contain",
"a",
"DOCTYPE",
"to",
"be",
"validated",
"but",
"the",
"validation",
"will",
"use",
"the",
"systemId",
"to",
"obtain",
"the",
"DTD"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L1067-L1070 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java | Shutterbug.shootElement | public static ElementSnapshot shootElement(WebDriver driver, WebElement element) {
"""
To be used when need to screenshot particular element.
@param driver WebDriver instance
@param element WebElement instance to be screenshotted
@return ElementSnapshot instance
"""
return shootElement(driver,ele... | java | public static ElementSnapshot shootElement(WebDriver driver, WebElement element) {
return shootElement(driver,element,false);
} | [
"public",
"static",
"ElementSnapshot",
"shootElement",
"(",
"WebDriver",
"driver",
",",
"WebElement",
"element",
")",
"{",
"return",
"shootElement",
"(",
"driver",
",",
"element",
",",
"false",
")",
";",
"}"
] | To be used when need to screenshot particular element.
@param driver WebDriver instance
@param element WebElement instance to be screenshotted
@return ElementSnapshot instance | [
"To",
"be",
"used",
"when",
"need",
"to",
"screenshot",
"particular",
"element",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java#L123-L125 |
threerings/nenya | core/src/main/java/com/threerings/media/animation/ScaleAnimation.java | ScaleAnimation.getCorner | public static Point getCorner (Point center, Point size) {
"""
Computes the upper left corner where the image should be drawn, given the center and
dimensions to which the image should be scaled.
"""
return new Point(center.x - size.x/2, center.y - size.y/2);
} | java | public static Point getCorner (Point center, Point size)
{
return new Point(center.x - size.x/2, center.y - size.y/2);
} | [
"public",
"static",
"Point",
"getCorner",
"(",
"Point",
"center",
",",
"Point",
"size",
")",
"{",
"return",
"new",
"Point",
"(",
"center",
".",
"x",
"-",
"size",
".",
"x",
"/",
"2",
",",
"center",
".",
"y",
"-",
"size",
".",
"y",
"/",
"2",
")",
... | Computes the upper left corner where the image should be drawn, given the center and
dimensions to which the image should be scaled. | [
"Computes",
"the",
"upper",
"left",
"corner",
"where",
"the",
"image",
"should",
"be",
"drawn",
"given",
"the",
"center",
"and",
"dimensions",
"to",
"which",
"the",
"image",
"should",
"be",
"scaled",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/ScaleAnimation.java#L105-L108 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.sendTypingStopped | public ApiSuccessResponse sendTypingStopped(String id, AcceptData4 acceptData) throws ApiException {
"""
Send notification that the agent stopped typing
Send notification that the agent stopped typing to the other participants in the specified chat.
@param id The ID of the chat interaction. (required)
@param ac... | java | public ApiSuccessResponse sendTypingStopped(String id, AcceptData4 acceptData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = sendTypingStoppedWithHttpInfo(id, acceptData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"sendTypingStopped",
"(",
"String",
"id",
",",
"AcceptData4",
"acceptData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"sendTypingStoppedWithHttpInfo",
"(",
"id",
",",
"acceptData",
"... | Send notification that the agent stopped typing
Send notification that the agent stopped typing to the other participants in the specified chat.
@param id The ID of the chat interaction. (required)
@param acceptData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, ... | [
"Send",
"notification",
"that",
"the",
"agent",
"stopped",
"typing",
"Send",
"notification",
"that",
"the",
"agent",
"stopped",
"typing",
"to",
"the",
"other",
"participants",
"in",
"the",
"specified",
"chat",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L1953-L1956 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readGroup | public CmsGroup readGroup(CmsDbContext dbc, CmsProject project) {
"""
Reads the group of a project.<p>
@param dbc the current database context
@param project the project to read from
@return the group of a resource
"""
try {
return readGroup(dbc, project.getGroupId());
} cat... | java | public CmsGroup readGroup(CmsDbContext dbc, CmsProject project) {
try {
return readGroup(dbc, project.getGroupId());
} catch (CmsException exc) {
return new CmsGroup(
CmsUUID.getNullUUID(),
CmsUUID.getNullUUID(),
project.getGroupId... | [
"public",
"CmsGroup",
"readGroup",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"project",
")",
"{",
"try",
"{",
"return",
"readGroup",
"(",
"dbc",
",",
"project",
".",
"getGroupId",
"(",
")",
")",
";",
"}",
"catch",
"(",
"CmsException",
"exc",
")",
"{... | Reads the group of a project.<p>
@param dbc the current database context
@param project the project to read from
@return the group of a resource | [
"Reads",
"the",
"group",
"of",
"a",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L6881-L6893 |
sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.addAuthInfo | public void addAuthInfo(final String scheme, final byte[] auth) {
"""
Add authentication information to the connection. This will be used to identify the user and check access to
nodes protected by ACLs
@param scheme
@param auth
"""
retryUntilConnected(new Callable<Object>() {
@Overrid... | java | public void addAuthInfo(final String scheme, final byte[] auth) {
retryUntilConnected(new Callable<Object>() {
@Override
public Object call() throws Exception {
_connection.addAuthInfo(scheme, auth);
return null;
}
});
} | [
"public",
"void",
"addAuthInfo",
"(",
"final",
"String",
"scheme",
",",
"final",
"byte",
"[",
"]",
"auth",
")",
"{",
"retryUntilConnected",
"(",
"new",
"Callable",
"<",
"Object",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"call",
"(",
")",
... | Add authentication information to the connection. This will be used to identify the user and check access to
nodes protected by ACLs
@param scheme
@param auth | [
"Add",
"authentication",
"information",
"to",
"the",
"connection",
".",
"This",
"will",
"be",
"used",
"to",
"identify",
"the",
"user",
"and",
"check",
"access",
"to",
"nodes",
"protected",
"by",
"ACLs"
] | train | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L1199-L1207 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/SimpleFooterHeader.java | SimpleFooterHeader.appendXMLToMasterStyle | @Override
public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable) throws IOException {
"""
Used in file styles.xml, in <office:master-styles>,<style:master-page />.
@throws IOException If an I/O error occurs
"""
if (this.centerRegion != null && !this.centerRegion.isEm... | java | @Override
public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable) throws IOException {
if (this.centerRegion != null && !this.centerRegion.isEmpty())
this.centerRegion.appendXMLContent(util, appendable);
} | [
"@",
"Override",
"public",
"void",
"appendXMLToMasterStyle",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"centerRegion",
"!=",
"null",
"&&",
"!",
"this",
".",
"centerRegi... | Used in file styles.xml, in <office:master-styles>,<style:master-page />.
@throws IOException If an I/O error occurs | [
"Used",
"in",
"file",
"styles",
".",
"xml",
"in",
"<office",
":",
"master",
"-",
"styles",
">",
"<style",
":",
"master",
"-",
"page",
"/",
">",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/SimpleFooterHeader.java#L75-L79 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java | GJGeometryReader.parseCoordinate | private Coordinate parseCoordinate(JsonParser jp) throws IOException {
"""
Parses a GeoJSON coordinate array and returns a JTS coordinate. The first
token corresponds to the first X value. The last token correponds to the
end of the coordinate array "]".
Parsed syntax:
100.0, 0.0]
@param jp
@throws IOE... | java | private Coordinate parseCoordinate(JsonParser jp) throws IOException {
jp.nextToken();
double x = jp.getDoubleValue();// VALUE_NUMBER_FLOAT
jp.nextToken(); // second value
double y = jp.getDoubleValue();
Coordinate coord;
//We look for a z value
jp.nextToken();
... | [
"private",
"Coordinate",
"parseCoordinate",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"double",
"x",
"=",
"jp",
".",
"getDoubleValue",
"(",
")",
";",
"// VALUE_NUMBER_FLOAT",
"jp",
".",
"nextToken",
"(... | Parses a GeoJSON coordinate array and returns a JTS coordinate. The first
token corresponds to the first X value. The last token correponds to the
end of the coordinate array "]".
Parsed syntax:
100.0, 0.0]
@param jp
@throws IOException
@return Coordinate | [
"Parses",
"a",
"GeoJSON",
"coordinate",
"array",
"and",
"returns",
"a",
"JTS",
"coordinate",
".",
"The",
"first",
"token",
"corresponds",
"to",
"the",
"first",
"X",
"value",
".",
"The",
"last",
"token",
"correponds",
"to",
"the",
"end",
"of",
"the",
"coord... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java#L348-L365 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/tsdb/model/ValueFilter.java | ValueFilter.createValueFilter | public static ValueFilter createValueFilter(String operation, Double value) {
"""
Create value filter for Double type.
@param operation Operation for comparing which support =, !=, >, <, >= and <=.
@param value Value for comparing with.
@return ValueFilter
"""
checkArgument(LONG_DOUBLE... | java | public static ValueFilter createValueFilter(String operation, Double value) {
checkArgument(LONG_DOUBLE_SUPPORTED_OPERATION.contains(operation), "Double value only support operations in "
+ LONG_DOUBLE_SUPPORTED_OPERATION.toString());
ValueFilter valueFilter = new ValueFilter(operation, ... | [
"public",
"static",
"ValueFilter",
"createValueFilter",
"(",
"String",
"operation",
",",
"Double",
"value",
")",
"{",
"checkArgument",
"(",
"LONG_DOUBLE_SUPPORTED_OPERATION",
".",
"contains",
"(",
"operation",
")",
",",
"\"Double value only support operations in \"",
"+",... | Create value filter for Double type.
@param operation Operation for comparing which support =, !=, >, <, >= and <=.
@param value Value for comparing with.
@return ValueFilter | [
"Create",
"value",
"filter",
"for",
"Double",
"type",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/tsdb/model/ValueFilter.java#L93-L98 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.buildClickBoundingBox | public BoundingBox buildClickBoundingBox(LatLng latLng, BoundingBox mapBounds) {
"""
Build a bounding box using the location coordinate click location and map view bounds
@param latLng click location
@param mapBounds map bounds
@return bounding box
@since 1.2.7
"""
// Get the screen width and... | java | public BoundingBox buildClickBoundingBox(LatLng latLng, BoundingBox mapBounds) {
// Get the screen width and height a click occurs from a feature
double width = TileBoundingBoxMapUtils.getLongitudeDistance(mapBounds) * screenClickPercentage;
double height = TileBoundingBoxMapUtils.getLatitudeDi... | [
"public",
"BoundingBox",
"buildClickBoundingBox",
"(",
"LatLng",
"latLng",
",",
"BoundingBox",
"mapBounds",
")",
"{",
"// Get the screen width and height a click occurs from a feature",
"double",
"width",
"=",
"TileBoundingBoxMapUtils",
".",
"getLongitudeDistance",
"(",
"mapBou... | Build a bounding box using the location coordinate click location and map view bounds
@param latLng click location
@param mapBounds map bounds
@return bounding box
@since 1.2.7 | [
"Build",
"a",
"bounding",
"box",
"using",
"the",
"location",
"coordinate",
"click",
"location",
"and",
"map",
"view",
"bounds"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L265-L279 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java | PendingCheckpointStats.reportSubtaskStats | boolean reportSubtaskStats(JobVertexID jobVertexId, SubtaskStateStats subtask) {
"""
Reports statistics for a single subtask.
@param jobVertexId ID of the task/operator the subtask belongs to.
@param subtask The statistics for the subtask.
@return <code>true</code> if successfully reported or <code>false</cod... | java | boolean reportSubtaskStats(JobVertexID jobVertexId, SubtaskStateStats subtask) {
TaskStateStats taskStateStats = taskStats.get(jobVertexId);
if (taskStateStats != null && taskStateStats.reportSubtaskStats(subtask)) {
currentNumAcknowledgedSubtasks++;
latestAcknowledgedSubtask = subtask;
currentStateSize ... | [
"boolean",
"reportSubtaskStats",
"(",
"JobVertexID",
"jobVertexId",
",",
"SubtaskStateStats",
"subtask",
")",
"{",
"TaskStateStats",
"taskStateStats",
"=",
"taskStats",
".",
"get",
"(",
"jobVertexId",
")",
";",
"if",
"(",
"taskStateStats",
"!=",
"null",
"&&",
"tas... | Reports statistics for a single subtask.
@param jobVertexId ID of the task/operator the subtask belongs to.
@param subtask The statistics for the subtask.
@return <code>true</code> if successfully reported or <code>false</code> otherwise. | [
"Reports",
"statistics",
"for",
"a",
"single",
"subtask",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java#L120-L138 |
apache/incubator-heron | heron/uploaders/src/java/org/apache/heron/uploader/s3/S3Uploader.java | S3Uploader.generateS3Path | private String generateS3Path(String pathPrefixParent, String topologyName, String filename) {
"""
Generate the path to a file in s3 given a prefix, topologyName, and filename
@param pathPrefixParent designates any parent folders that should be prefixed to the resulting path
@param topologyName the name of the... | java | private String generateS3Path(String pathPrefixParent, String topologyName, String filename) {
List<String> pathParts = new ArrayList<>(Arrays.asList(pathPrefixParent.split("/")));
pathParts.add(topologyName);
pathParts.add(filename);
return String.join("/", pathParts);
} | [
"private",
"String",
"generateS3Path",
"(",
"String",
"pathPrefixParent",
",",
"String",
"topologyName",
",",
"String",
"filename",
")",
"{",
"List",
"<",
"String",
">",
"pathParts",
"=",
"new",
"ArrayList",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"pathPrefix... | Generate the path to a file in s3 given a prefix, topologyName, and filename
@param pathPrefixParent designates any parent folders that should be prefixed to the resulting path
@param topologyName the name of the topology that we are uploaded
@param filename the name of the resulting file that is going to be uploaded
... | [
"Generate",
"the",
"path",
"to",
"a",
"file",
"in",
"s3",
"given",
"a",
"prefix",
"topologyName",
"and",
"filename"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/uploaders/src/java/org/apache/heron/uploader/s3/S3Uploader.java#L217-L223 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getTroubleshootingResult | public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of th... | java | public TroubleshootingResultInner getTroubleshootingResult(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return getTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).toBlocking().last().body();
} | [
"public",
"TroubleshootingResultInner",
"getTroubleshootingResult",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"getTroubleshootingResultWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher resource.
@param targetResourceId The target resource ID to query the troubleshooting result.
@throws IllegalArgumentException thrown... | [
"Get",
"the",
"last",
"completed",
"troubleshooting",
"result",
"on",
"a",
"specified",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1632-L1634 |
stevespringett/Alpine | alpine/src/main/java/alpine/crypto/DataEncryption.java | DataEncryption.encryptAsString | public static String encryptAsString(final SecretKey secretKey, final String plainText) throws Exception {
"""
Encrypts the specified plainText using AES-256 and returns a Base64 encoded
representation of the encrypted bytes.
@param secretKey the secret key to use to encrypt with
@param plainText the text to en... | java | public static String encryptAsString(final SecretKey secretKey, final String plainText) throws Exception {
return Base64.getEncoder().encodeToString(encryptAsBytes(secretKey, plainText));
} | [
"public",
"static",
"String",
"encryptAsString",
"(",
"final",
"SecretKey",
"secretKey",
",",
"final",
"String",
"plainText",
")",
"throws",
"Exception",
"{",
"return",
"Base64",
".",
"getEncoder",
"(",
")",
".",
"encodeToString",
"(",
"encryptAsBytes",
"(",
"se... | Encrypts the specified plainText using AES-256 and returns a Base64 encoded
representation of the encrypted bytes.
@param secretKey the secret key to use to encrypt with
@param plainText the text to encrypt
@return a Base64 encoded representation of the encrypted bytes
@throws Exception a number of exceptions may be th... | [
"Encrypts",
"the",
"specified",
"plainText",
"using",
"AES",
"-",
"256",
"and",
"returns",
"a",
"Base64",
"encoded",
"representation",
"of",
"the",
"encrypted",
"bytes",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/crypto/DataEncryption.java#L95-L97 |
RestComm/jain-slee.xcap | resources/xcap-client/ra/src/main/java/org/restcomm/slee/resource/xcapclient/XCAPClientResourceAdaptor.java | XCAPClientResourceAdaptor.processResponseEvent | public void processResponseEvent(FireableEventType eventType, ResponseEvent event, XCAPResourceAdaptorActivityHandle handle) {
"""
Receives an Event and sends it to the SLEE
@param event
@param handle
"""
if (tracer.isFineEnabled()) {
tracer.fine("NEW RESPONSE EVENT... | java | public void processResponseEvent(FireableEventType eventType, ResponseEvent event, XCAPResourceAdaptorActivityHandle handle){
if (tracer.isFineEnabled()) {
tracer.fine("NEW RESPONSE EVENT");
}
try {
... | [
"public",
"void",
"processResponseEvent",
"(",
"FireableEventType",
"eventType",
",",
"ResponseEvent",
"event",
",",
"XCAPResourceAdaptorActivityHandle",
"handle",
")",
"{",
"if",
"(",
"tracer",
".",
"isFineEnabled",
"(",
")",
")",
"{",
"tracer",
".",
"fine",
"(",... | Receives an Event and sends it to the SLEE
@param event
@param handle | [
"Receives",
"an",
"Event",
"and",
"sends",
"it",
"to",
"the",
"SLEE"
] | train | https://github.com/RestComm/jain-slee.xcap/blob/0caa9ab481a545e52c31401f19e99bdfbbfb7bf0/resources/xcap-client/ra/src/main/java/org/restcomm/slee/resource/xcapclient/XCAPClientResourceAdaptor.java#L184-L195 |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/NetworkServiceLocator.java | NetworkServiceLocator.getPort | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
"""
For the given interface, get the stub implementation.
If this service has no port for the given interface,
then ServiceException is thrown.
"""
if (portName =... | java | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
if (portName == null) {
return getPort(serviceEndpointInterface);
}
java.lang.String inputPortName = portName.getLocalPart();
if ("Networ... | [
"public",
"java",
".",
"rmi",
".",
"Remote",
"getPort",
"(",
"javax",
".",
"xml",
".",
"namespace",
".",
"QName",
"portName",
",",
"Class",
"serviceEndpointInterface",
")",
"throws",
"javax",
".",
"xml",
".",
"rpc",
".",
"ServiceException",
"{",
"if",
"(",... | For the given interface, get the stub implementation.
If this service has no port for the given interface,
then ServiceException is thrown. | [
"For",
"the",
"given",
"interface",
"get",
"the",
"stub",
"implementation",
".",
"If",
"this",
"service",
"has",
"no",
"port",
"for",
"the",
"given",
"interface",
"then",
"ServiceException",
"is",
"thrown",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201805/NetworkServiceLocator.java#L106-L119 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.createNewFile | public void createNewFile() throws SmbException {
"""
Create a new file but fail if it already exists. The check for
existance of the file and it's creation are an atomic operation with
respect to other filesystem activities.
"""
if( getUncPath0().length() == 1 ) {
throw new SmbException(... | java | public void createNewFile() throws SmbException {
if( getUncPath0().length() == 1 ) {
throw new SmbException( "Invalid operation for workgroups, servers, or shares" );
}
close( open0( O_RDWR | O_CREAT | O_EXCL, 0, ATTR_NORMAL, 0 ), 0L );
} | [
"public",
"void",
"createNewFile",
"(",
")",
"throws",
"SmbException",
"{",
"if",
"(",
"getUncPath0",
"(",
")",
".",
"length",
"(",
")",
"==",
"1",
")",
"{",
"throw",
"new",
"SmbException",
"(",
"\"Invalid operation for workgroups, servers, or shares\"",
")",
";... | Create a new file but fail if it already exists. The check for
existance of the file and it's creation are an atomic operation with
respect to other filesystem activities. | [
"Create",
"a",
"new",
"file",
"but",
"fail",
"if",
"it",
"already",
"exists",
".",
"The",
"check",
"for",
"existance",
"of",
"the",
"file",
"and",
"it",
"s",
"creation",
"are",
"an",
"atomic",
"operation",
"with",
"respect",
"to",
"other",
"filesystem",
... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L2567-L2572 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.longForQuery | public static long longForQuery(SQLiteStatement prog, String[] selectionArgs) {
"""
Utility method to run the pre-compiled query and return the value in the
first column of the first row.
"""
prog.bindAllArgsAsStrings(selectionArgs);
return prog.simpleQueryForLong();
} | java | public static long longForQuery(SQLiteStatement prog, String[] selectionArgs) {
prog.bindAllArgsAsStrings(selectionArgs);
return prog.simpleQueryForLong();
} | [
"public",
"static",
"long",
"longForQuery",
"(",
"SQLiteStatement",
"prog",
",",
"String",
"[",
"]",
"selectionArgs",
")",
"{",
"prog",
".",
"bindAllArgsAsStrings",
"(",
"selectionArgs",
")",
";",
"return",
"prog",
".",
"simpleQueryForLong",
"(",
")",
";",
"}"... | Utility method to run the pre-compiled query and return the value in the
first column of the first row. | [
"Utility",
"method",
"to",
"run",
"the",
"pre",
"-",
"compiled",
"query",
"and",
"return",
"the",
"value",
"in",
"the",
"first",
"column",
"of",
"the",
"first",
"row",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L845-L848 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.open | public static Anima open(String url, Quirks quirks) {
"""
Create anima with url, like Sqlite or h2
@param url jdbc url
@return Anima
"""
return open(url, null, null, quirks);
} | java | public static Anima open(String url, Quirks quirks) {
return open(url, null, null, quirks);
} | [
"public",
"static",
"Anima",
"open",
"(",
"String",
"url",
",",
"Quirks",
"quirks",
")",
"{",
"return",
"open",
"(",
"url",
",",
"null",
",",
"null",
",",
"quirks",
")",
";",
"}"
] | Create anima with url, like Sqlite or h2
@param url jdbc url
@return Anima | [
"Create",
"anima",
"with",
"url",
"like",
"Sqlite",
"or",
"h2"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L167-L169 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderColumn_ZDRM.java | QRDecompositionHouseholderColumn_ZDRM.getR | @Override
public ZMatrixRMaj getR(ZMatrixRMaj R, boolean compact) {
"""
Returns an upper triangular matrix which is the R in the QR decomposition. If compact then the input
expected to be size = [min(rows,cols) , numCols] otherwise size = [numRows,numCols].
@param R Storage for upper triangular matrix.
@... | java | @Override
public ZMatrixRMaj getR(ZMatrixRMaj R, boolean compact) {
if( compact )
R = UtilDecompositons_ZDRM.checkZerosLT(R,minLength,numCols);
else
R = UtilDecompositons_ZDRM.checkZerosLT(R,numRows,numCols);
for( int j = 0; j < numCols; j++ ) {
double co... | [
"@",
"Override",
"public",
"ZMatrixRMaj",
"getR",
"(",
"ZMatrixRMaj",
"R",
",",
"boolean",
"compact",
")",
"{",
"if",
"(",
"compact",
")",
"R",
"=",
"UtilDecompositons_ZDRM",
".",
"checkZerosLT",
"(",
"R",
",",
"minLength",
",",
"numCols",
")",
";",
"else"... | Returns an upper triangular matrix which is the R in the QR decomposition. If compact then the input
expected to be size = [min(rows,cols) , numCols] otherwise size = [numRows,numCols].
@param R Storage for upper triangular matrix.
@param compact If true then a compact matrix is expected. | [
"Returns",
"an",
"upper",
"triangular",
"matrix",
"which",
"is",
"the",
"R",
"in",
"the",
"QR",
"decomposition",
".",
"If",
"compact",
"then",
"the",
"input",
"expected",
"to",
"be",
"size",
"=",
"[",
"min",
"(",
"rows",
"cols",
")",
"numCols",
"]",
"o... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderColumn_ZDRM.java#L132-L148 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/lib/LibLoader.java | LibLoader.loadLibrary | public void loadLibrary(Class<?> clazz, String name) {
"""
Loads a native library. Uses {@link LoadPolicy#PREFER_SHIPPED} as the default loading policy.
@param clazz
The class whose classloader should be used to resolve shipped libraries
@param name
The name of the class.
"""
loadLibrary(clazz, n... | java | public void loadLibrary(Class<?> clazz, String name) {
loadLibrary(clazz, name, LoadPolicy.PREFER_SHIPPED);
} | [
"public",
"void",
"loadLibrary",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"loadLibrary",
"(",
"clazz",
",",
"name",
",",
"LoadPolicy",
".",
"PREFER_SHIPPED",
")",
";",
"}"
] | Loads a native library. Uses {@link LoadPolicy#PREFER_SHIPPED} as the default loading policy.
@param clazz
The class whose classloader should be used to resolve shipped libraries
@param name
The name of the class. | [
"Loads",
"a",
"native",
"library",
".",
"Uses",
"{",
"@link",
"LoadPolicy#PREFER_SHIPPED",
"}",
"as",
"the",
"default",
"loading",
"policy",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/lib/LibLoader.java#L91-L93 |
sualeh/magnetictrackparser | src/main/java/us/fatehi/magnetictrack/bankcard/Track2.java | Track2.from | public static Track2 from(final String rawTrackData) {
"""
Parses magnetic track 2 data into a Track2 object.
@param rawTrackData
Raw track data as a string. Can include newlines, and other
tracks as well.
@return A Track2 instance, corresponding to the parsed data.
"""
final Matcher matcher = track2... | java | public static Track2 from(final String rawTrackData)
{
final Matcher matcher = track2Pattern.matcher(trimToEmpty(rawTrackData));
final String rawTrack2Data;
final AccountNumber pan;
final ExpirationDate expirationDate;
final ServiceCode serviceCode;
final String discretionaryData;
if (ma... | [
"public",
"static",
"Track2",
"from",
"(",
"final",
"String",
"rawTrackData",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"track2Pattern",
".",
"matcher",
"(",
"trimToEmpty",
"(",
"rawTrackData",
")",
")",
";",
"final",
"String",
"rawTrack2Data",
";",
"final... | Parses magnetic track 2 data into a Track2 object.
@param rawTrackData
Raw track data as a string. Can include newlines, and other
tracks as well.
@return A Track2 instance, corresponding to the parsed data. | [
"Parses",
"magnetic",
"track",
"2",
"data",
"into",
"a",
"Track2",
"object",
"."
] | train | https://github.com/sualeh/magnetictrackparser/blob/1da8ff20ac6269b1d523875157278978ba71d260/src/main/java/us/fatehi/magnetictrack/bankcard/Track2.java#L72-L104 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/BloomFilterSerializer.java | BloomFilterSerializer.serializedSize | public long serializedSize(BloomFilter bf, TypeSizes typeSizes) {
"""
Calculates a serialized size of the given Bloom Filter
@see org.apache.cassandra.io.ISerializer#serialize(Object, org.apache.cassandra.io.util.DataOutputPlus)
@param bf Bloom filter to calculate serialized size
@return serialized size of ... | java | public long serializedSize(BloomFilter bf, TypeSizes typeSizes)
{
int size = typeSizes.sizeof(bf.hashCount); // hash count
size += bf.bitset.serializedSize(typeSizes);
return size;
} | [
"public",
"long",
"serializedSize",
"(",
"BloomFilter",
"bf",
",",
"TypeSizes",
"typeSizes",
")",
"{",
"int",
"size",
"=",
"typeSizes",
".",
"sizeof",
"(",
"bf",
".",
"hashCount",
")",
";",
"// hash count",
"size",
"+=",
"bf",
".",
"bitset",
".",
"serializ... | Calculates a serialized size of the given Bloom Filter
@see org.apache.cassandra.io.ISerializer#serialize(Object, org.apache.cassandra.io.util.DataOutputPlus)
@param bf Bloom filter to calculate serialized size
@return serialized size of the given bloom filter | [
"Calculates",
"a",
"serialized",
"size",
"of",
"the",
"given",
"Bloom",
"Filter",
"@see",
"org",
".",
"apache",
".",
"cassandra",
".",
"io",
".",
"ISerializer#serialize",
"(",
"Object",
"org",
".",
"apache",
".",
"cassandra",
".",
"io",
".",
"util",
".",
... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/BloomFilterSerializer.java#L60-L65 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java | EndpointActivationService.processAuthData | private void processAuthData(String id, Map<String, Object> activationProps) throws UnavailableException {
"""
Update the activation config properties with the userName/password of the authAlias.
@param id unique identifier for an authData config element.
@param activationProps activation config properties.
@... | java | private void processAuthData(String id, Map<String, Object> activationProps) throws UnavailableException {
final String filter = FilterUtils.createPropertyFilter(ID, id);
ServiceReference<?> authDataRef;
try {
ServiceReference<?>[] authDataRefs = ConnectionFactoryService.priv.getServ... | [
"private",
"void",
"processAuthData",
"(",
"String",
"id",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"activationProps",
")",
"throws",
"UnavailableException",
"{",
"final",
"String",
"filter",
"=",
"FilterUtils",
".",
"createPropertyFilter",
"(",
"ID",
",",... | Update the activation config properties with the userName/password of the authAlias.
@param id unique identifier for an authData config element.
@param activationProps activation config properties.
@throws UnavailableException if the authData element is not available. | [
"Update",
"the",
"activation",
"config",
"properties",
"with",
"the",
"userName",
"/",
"password",
"of",
"the",
"authAlias",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java#L436-L449 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java | Sources.asCharSource | public static CharSource asCharSource(final Class<?> contextClass, final String resourceName, final Charset charset) {
"""
Returns the given source as a {@link CharSource} with given charset
@param contextClass
@param resourceName
@param charset
@return
"""
return new CharSource() {
@Override public... | java | public static CharSource asCharSource(final Class<?> contextClass, final String resourceName, final Charset charset) {
return new CharSource() {
@Override public Reader openStream() throws IOException {
return asReader(checkNotNull(contextClass).getResourceAsStream(checkNotEmpty(resourceName)), checkNotNull(ch... | [
"public",
"static",
"CharSource",
"asCharSource",
"(",
"final",
"Class",
"<",
"?",
">",
"contextClass",
",",
"final",
"String",
"resourceName",
",",
"final",
"Charset",
"charset",
")",
"{",
"return",
"new",
"CharSource",
"(",
")",
"{",
"@",
"Override",
"publ... | Returns the given source as a {@link CharSource} with given charset
@param contextClass
@param resourceName
@param charset
@return | [
"Returns",
"the",
"given",
"source",
"as",
"a",
"{",
"@link",
"CharSource",
"}",
"with",
"given",
"charset"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java#L204-L210 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLog.java | FileLog.createFileLogHolder | public static FileLog createFileLogHolder(FileLog oldLog,
File logDirectory,
String newFileName,
int maxFiles,
long maxSizeBytes) {
... | java | public static FileLog createFileLogHolder(FileLog oldLog,
File logDirectory,
String newFileName,
int maxFiles,
long maxSizeBytes) {
... | [
"public",
"static",
"FileLog",
"createFileLogHolder",
"(",
"FileLog",
"oldLog",
",",
"File",
"logDirectory",
",",
"String",
"newFileName",
",",
"int",
"maxFiles",
",",
"long",
"maxSizeBytes",
")",
"{",
"final",
"FileLog",
"logHolder",
";",
"// We're only supporting ... | This method will check to see if the supplied parameters match the settings on the <code>oldLog</code>,
if they do then the <code>oldLog</code> is returned, otherwise a new FileLogHolder will be created.
@param oldLog The previous FileLogHolder that may or may not be replaced by a new one, may
be <code>null</code> (wi... | [
"This",
"method",
"will",
"check",
"to",
"see",
"if",
"the",
"supplied",
"parameters",
"match",
"the",
"settings",
"on",
"the",
"<code",
">",
"oldLog<",
"/",
"code",
">",
"if",
"they",
"do",
"then",
"the",
"<code",
">",
"oldLog<",
"/",
"code",
">",
"is... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.audit.file/src/com/ibm/ws/security/audit/logutils/FileLog.java#L103-L149 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/PreorderVisitor.java | PreorderVisitor.hasInterestingMethod | public static boolean hasInterestingMethod(ConstantPool cp, Collection<MethodDescriptor> methods) {
"""
Returns true if given constant pool probably has a reference to any of supplied methods
Useful to exclude from analysis uninteresting classes
@param cp constant pool
@param methods methods collection
@return... | java | public static boolean hasInterestingMethod(ConstantPool cp, Collection<MethodDescriptor> methods) {
for(Constant c : cp.getConstantPool()) {
if(c instanceof ConstantMethodref || c instanceof ConstantInterfaceMethodref) {
ConstantCP desc = (ConstantCP)c;
ConstantNameAn... | [
"public",
"static",
"boolean",
"hasInterestingMethod",
"(",
"ConstantPool",
"cp",
",",
"Collection",
"<",
"MethodDescriptor",
">",
"methods",
")",
"{",
"for",
"(",
"Constant",
"c",
":",
"cp",
".",
"getConstantPool",
"(",
")",
")",
"{",
"if",
"(",
"c",
"ins... | Returns true if given constant pool probably has a reference to any of supplied methods
Useful to exclude from analysis uninteresting classes
@param cp constant pool
@param methods methods collection
@return true if method is found | [
"Returns",
"true",
"if",
"given",
"constant",
"pool",
"probably",
"has",
"a",
"reference",
"to",
"any",
"of",
"supplied",
"methods",
"Useful",
"to",
"exclude",
"from",
"analysis",
"uninteresting",
"classes"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/PreorderVisitor.java#L635-L655 |
JodaOrg/joda-time | src/main/java/org/joda/time/Days.java | Days.daysBetween | public static Days daysBetween(ReadablePartial start, ReadablePartial end) {
"""
Creates a <code>Days</code> representing the number of whole days
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalDate</code> objects.
@... | java | public static Days daysBetween(ReadablePartial start, ReadablePartial end) {
if (start instanceof LocalDate && end instanceof LocalDate) {
Chronology chrono = DateTimeUtils.getChronology(start.getChronology());
int days = chrono.days().getDifference(
((LocalDate) en... | [
"public",
"static",
"Days",
"daysBetween",
"(",
"ReadablePartial",
"start",
",",
"ReadablePartial",
"end",
")",
"{",
"if",
"(",
"start",
"instanceof",
"LocalDate",
"&&",
"end",
"instanceof",
"LocalDate",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".... | Creates a <code>Days</code> representing the number of whole days
between the two specified partial datetimes.
<p>
The two partials must contain the same fields, for example you can specify
two <code>LocalDate</code> objects.
@param start the start partial date, must not be null
@param end the end partial date, must... | [
"Creates",
"a",
"<code",
">",
"Days<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"days",
"between",
"the",
"two",
"specified",
"partial",
"datetimes",
".",
"<p",
">",
"The",
"two",
"partials",
"must",
"contain",
"the",
"same",
"fiel... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Days.java#L134-L143 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java | GVRPose.getWorldRotation | public void getWorldRotation(int boneindex, Quaternionf q) {
"""
Gets the world location of a bone (relative to hierarchy root).
<p>
@param boneindex zero based index of bone whose rotation is wanted.
@return world rotation for the designated bone as a quaternion.
@see #setWorldRotation
@see #setWorldRotati... | java | public void getWorldRotation(int boneindex, Quaternionf q)
{
Bone bone = mBones[boneindex];
if ((bone.Changed & LOCAL_ROT) == LOCAL_ROT)
{
calcWorld(bone, mSkeleton.getParentBoneIndex(boneindex));
}
bone.WorldMatrix.getUnnormalizedRotation(q);
q.normalize... | [
"public",
"void",
"getWorldRotation",
"(",
"int",
"boneindex",
",",
"Quaternionf",
"q",
")",
"{",
"Bone",
"bone",
"=",
"mBones",
"[",
"boneindex",
"]",
";",
"if",
"(",
"(",
"bone",
".",
"Changed",
"&",
"LOCAL_ROT",
")",
"==",
"LOCAL_ROT",
")",
"{",
"ca... | Gets the world location of a bone (relative to hierarchy root).
<p>
@param boneindex zero based index of bone whose rotation is wanted.
@return world rotation for the designated bone as a quaternion.
@see #setWorldRotation
@see #setWorldRotations
@see #setWorldMatrix
@see GVRSkeleton#setBoneAxis | [
"Gets",
"the",
"world",
"location",
"of",
"a",
"bone",
"(",
"relative",
"to",
"hierarchy",
"root",
")",
".",
"<p",
">",
"@param",
"boneindex",
"zero",
"based",
"index",
"of",
"bone",
"whose",
"rotation",
"is",
"wanted",
".",
"@return",
"world",
"rotation",... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L430-L440 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java | AbstractServiceValidateController.validateAssertion | private boolean validateAssertion(final HttpServletRequest request, final String serviceTicketId, final Assertion assertion, final Service service) {
"""
Validate assertion.
@param request the request
@param serviceTicketId the service ticket id
@param assertion the assertion
@param service ... | java | private boolean validateAssertion(final HttpServletRequest request, final String serviceTicketId, final Assertion assertion, final Service service) {
for (val spec : serviceValidateConfigurationContext.getValidationSpecifications()) {
spec.reset();
val binder = new ServletRequestDataBind... | [
"private",
"boolean",
"validateAssertion",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"String",
"serviceTicketId",
",",
"final",
"Assertion",
"assertion",
",",
"final",
"Service",
"service",
")",
"{",
"for",
"(",
"val",
"spec",
":",
"serviceValid... | Validate assertion.
@param request the request
@param serviceTicketId the service ticket id
@param assertion the assertion
@param service the service
@return true/false | [
"Validate",
"assertion",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L242-L255 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/comm/RXTXCommPortAdapter.java | RXTXCommPortAdapter.getInputStream | public InputStream getInputStream() {
"""
This function returns the input stream to the COMM port.
@return The input stream
"""
InputStream stream=null;
try
{
stream=this.commPort.getInputStream();
}
catch(IOException exception)
{
thro... | java | public InputStream getInputStream()
{
InputStream stream=null;
try
{
stream=this.commPort.getInputStream();
}
catch(IOException exception)
{
throw new FaxException("Unable to extract input stream.",exception);
}
return ... | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"{",
"InputStream",
"stream",
"=",
"null",
";",
"try",
"{",
"stream",
"=",
"this",
".",
"commPort",
".",
"getInputStream",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"exception",
")",
"{",
"throw",... | This function returns the input stream to the COMM port.
@return The input stream | [
"This",
"function",
"returns",
"the",
"input",
"stream",
"to",
"the",
"COMM",
"port",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/RXTXCommPortAdapter.java#L61-L74 |
upwork/java-upwork | src/com/Upwork/api/Routers/Messages.java | Messages.getRoomByApplication | public JSONObject getRoomByApplication(String company, String applicationId, HashMap<String, String> params) throws JSONException {
"""
Get a specific room by application ID
@param company Company ID
@param applicationId Application ID
@param params Parameters
@throws JSONException If error occurred
@... | java | public JSONObject getRoomByApplication(String company, String applicationId, HashMap<String, String> params) throws JSONException {
return oClient.get("/messages/v3/" + company + "/rooms/appications/" + applicationId, params);
} | [
"public",
"JSONObject",
"getRoomByApplication",
"(",
"String",
"company",
",",
"String",
"applicationId",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
"\"/messages/v3/\"",
... | Get a specific room by application ID
@param company Company ID
@param applicationId Application ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Get",
"a",
"specific",
"room",
"by",
"application",
"ID"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Messages.java#L88-L90 |
opendigitaleducation/web-utils | src/main/java/org/vertx/java/core/http/RouteMatcher.java | RouteMatcher.deleteWithRegEx | public RouteMatcher deleteWithRegEx(String regex, Handler<HttpServerRequest> handler) {
"""
Specify a handler that will be called for a matching HTTP DELETE
@param regex A regular expression
@param handler The handler to call
"""
addRegEx(regex, handler, deleteBindings);
return this;
} | java | public RouteMatcher deleteWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, deleteBindings);
return this;
} | [
"public",
"RouteMatcher",
"deleteWithRegEx",
"(",
"String",
"regex",
",",
"Handler",
"<",
"HttpServerRequest",
">",
"handler",
")",
"{",
"addRegEx",
"(",
"regex",
",",
"handler",
",",
"deleteBindings",
")",
";",
"return",
"this",
";",
"}"
] | Specify a handler that will be called for a matching HTTP DELETE
@param regex A regular expression
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"a",
"matching",
"HTTP",
"DELETE"
] | train | https://github.com/opendigitaleducation/web-utils/blob/5c12f7e8781a9a0fbbe7b8d9fb741627aa97a1e3/src/main/java/org/vertx/java/core/http/RouteMatcher.java#L239-L242 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_transpose.java | Scs_transpose.cs_transpose | public static Scs cs_transpose(Scs A, boolean values) {
"""
Computes the transpose of a sparse matrix, C =A';
@param A
column-compressed matrix
@param values
pattern only if false, both pattern and values otherwise
@return C=A', null on error
"""
int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
... | java | public static Scs cs_transpose(Scs A, boolean values) {
int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
float Cx[], Ax[];
Scs C;
if (!Scs_util.CS_CSC(A))
return (null); /* check inputs */
m = A.m;
n = A.n;
Ap = A.p;
Ai = A.i;
... | [
"public",
"static",
"Scs",
"cs_transpose",
"(",
"Scs",
"A",
",",
"boolean",
"values",
")",
"{",
"int",
"p",
",",
"q",
",",
"j",
",",
"Cp",
"[",
"]",
",",
"Ci",
"[",
"]",
",",
"n",
",",
"m",
",",
"Ap",
"[",
"]",
",",
"Ai",
"[",
"]",
",",
"... | Computes the transpose of a sparse matrix, C =A';
@param A
column-compressed matrix
@param values
pattern only if false, both pattern and values otherwise
@return C=A', null on error | [
"Computes",
"the",
"transpose",
"of",
"a",
"sparse",
"matrix",
"C",
"=",
"A",
";"
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_transpose.java#L46-L73 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/event/AbstractFilteringStrategy.java | AbstractFilteringStrategy.processEntryEventFilter | protected boolean processEntryEventFilter(EventFilter filter, Data dataKey) {
"""
Evaluates filters of {@link EntryEventFilter} type.
@param filter the filter which must be a {@link EntryEventFilter}
@param dataKey the event entry key
@return {@code true} if the filter matches
"""
EntryEventFilte... | java | protected boolean processEntryEventFilter(EventFilter filter, Data dataKey) {
EntryEventFilter eventFilter = (EntryEventFilter) filter;
return eventFilter.eval(dataKey);
} | [
"protected",
"boolean",
"processEntryEventFilter",
"(",
"EventFilter",
"filter",
",",
"Data",
"dataKey",
")",
"{",
"EntryEventFilter",
"eventFilter",
"=",
"(",
"EntryEventFilter",
")",
"filter",
";",
"return",
"eventFilter",
".",
"eval",
"(",
"dataKey",
")",
";",
... | Evaluates filters of {@link EntryEventFilter} type.
@param filter the filter which must be a {@link EntryEventFilter}
@param dataKey the event entry key
@return {@code true} if the filter matches | [
"Evaluates",
"filters",
"of",
"{",
"@link",
"EntryEventFilter",
"}",
"type",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/event/AbstractFilteringStrategy.java#L57-L60 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.putBoolean | public void putBoolean(String key, boolean value) {
"""
put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putBoolean(String, boolean)
"""
sharedPreferences.edit().putBo... | java | public void putBoolean(String key, boolean value) {
sharedPreferences.edit().putBoolean(key, value).commit();
} | [
"public",
"void",
"putBoolean",
"(",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"sharedPreferences",
".",
"edit",
"(",
")",
".",
"putBoolean",
"(",
"key",
",",
"value",
")",
".",
"commit",
"(",
")",
";",
"}"
] | put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putBoolean(String, boolean) | [
"put",
"the",
"int",
"value",
"to",
"shared",
"preference"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L490-L492 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java | SparkUtils.listPaths | public static JavaRDD<String> listPaths(JavaSparkContext sc, String path, boolean recursive, Set<String> allowedExtensions) throws IOException {
"""
List of the files in the given directory (path), as a {@code JavaRDD<String>}
@param sc Spark context
@param path Path to list files i... | java | public static JavaRDD<String> listPaths(JavaSparkContext sc, String path, boolean recursive, Set<String> allowedExtensions) throws IOException {
return listPaths(sc, path, recursive, allowedExtensions, sc.hadoopConfiguration());
} | [
"public",
"static",
"JavaRDD",
"<",
"String",
">",
"listPaths",
"(",
"JavaSparkContext",
"sc",
",",
"String",
"path",
",",
"boolean",
"recursive",
",",
"Set",
"<",
"String",
">",
"allowedExtensions",
")",
"throws",
"IOException",
"{",
"return",
"listPaths",
"(... | List of the files in the given directory (path), as a {@code JavaRDD<String>}
@param sc Spark context
@param path Path to list files in
@param recursive Whether to walk the directory tree recursively (i.e., include subdirectories)
@param allowedExtensions If null: all files will be ... | [
"List",
"of",
"the",
"files",
"in",
"the",
"given",
"directory",
"(",
"path",
")",
"as",
"a",
"{",
"@code",
"JavaRDD<String",
">",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java#L571-L573 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/AndXServerMessageBlock.java | AndXServerMessageBlock.encode | int encode( byte[] dst, int dstIndex ) {
"""
/*
We overload this method from ServerMessageBlock because
we want writeAndXWireFormat to write the parameterWords
and bytes. This is so we can write batched smbs because
all but the first smb of the chaain do not have a header
and therefore we do not want to write... | java | int encode( byte[] dst, int dstIndex ) {
int start = headerStart = dstIndex;
dstIndex += writeHeaderWireFormat( dst, dstIndex );
dstIndex += writeAndXWireFormat( dst, dstIndex );
length = dstIndex - start;
if( digest != null ) {
digest.sign( dst, headerStart, length... | [
"int",
"encode",
"(",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstIndex",
")",
"{",
"int",
"start",
"=",
"headerStart",
"=",
"dstIndex",
";",
"dstIndex",
"+=",
"writeHeaderWireFormat",
"(",
"dst",
",",
"dstIndex",
")",
";",
"dstIndex",
"+=",
"writeAndXWireFor... | /*
We overload this method from ServerMessageBlock because
we want writeAndXWireFormat to write the parameterWords
and bytes. This is so we can write batched smbs because
all but the first smb of the chaain do not have a header
and therefore we do not want to writeHeaderWireFormat. We
just recursivly call writeAndXWire... | [
"/",
"*",
"We",
"overload",
"this",
"method",
"from",
"ServerMessageBlock",
"because",
"we",
"want",
"writeAndXWireFormat",
"to",
"write",
"the",
"parameterWords",
"and",
"bytes",
".",
"This",
"is",
"so",
"we",
"can",
"write",
"batched",
"smbs",
"because",
"al... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/AndXServerMessageBlock.java#L63-L75 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java | LocalTime.withSecond | public LocalTime withSecond(int second) {
"""
Returns a copy of this {@code LocalTime} with the second-of-minute altered.
<p>
This instance is immutable and unaffected by this method call.
@param second the second-of-minute to set in the result, from 0 to 59
@return a {@code LocalTime} based on this time wi... | java | public LocalTime withSecond(int second) {
if (this.second == second) {
return this;
}
SECOND_OF_MINUTE.checkValidValue(second);
return create(hour, minute, second, nano);
} | [
"public",
"LocalTime",
"withSecond",
"(",
"int",
"second",
")",
"{",
"if",
"(",
"this",
".",
"second",
"==",
"second",
")",
"{",
"return",
"this",
";",
"}",
"SECOND_OF_MINUTE",
".",
"checkValidValue",
"(",
"second",
")",
";",
"return",
"create",
"(",
"ho... | Returns a copy of this {@code LocalTime} with the second-of-minute altered.
<p>
This instance is immutable and unaffected by this method call.
@param second the second-of-minute to set in the result, from 0 to 59
@return a {@code LocalTime} based on this time with the requested second, not null
@throws DateTimeExcept... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalTime",
"}",
"with",
"the",
"second",
"-",
"of",
"-",
"minute",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L897-L903 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.setProperty | public static void setProperty(String name, String value) {
"""
Set the system property. This function is an helper for setting a system property usually accessible with {@link System}.
<p>This function must be called before launching the Janus platform.
@param name the name of the property.
@param value th... | java | public static void setProperty(String name, String value) {
if (name != null && !name.isEmpty()) {
if (value == null || value.isEmpty()) {
System.getProperties().remove(name);
} else {
System.setProperty(name, value);
}
}
} | [
"public",
"static",
"void",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"!",
"name",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"isEmp... | Set the system property. This function is an helper for setting a system property usually accessible with {@link System}.
<p>This function must be called before launching the Janus platform.
@param name the name of the property.
@param value the value of the property. If the value is <code>null</code> or empty, the p... | [
"Set",
"the",
"system",
"property",
".",
"This",
"function",
"is",
"an",
"helper",
"for",
"setting",
"a",
"system",
"property",
"usually",
"accessible",
"with",
"{",
"@link",
"System",
"}",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L837-L845 |
qzagarese/hyaline-dto | hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java | Hyaline.dtoFromClass | public static <T> T dtoFromClass(T entity, DTO dtoTemplate) throws HyalineException {
"""
It lets you create a new DTO starting from the annotation-based
configuration of your entity. This means that any annotation-based
configuration for JAXB, Jackson or whatever serialization framework you
are using on your e... | java | public static <T> T dtoFromClass(T entity, DTO dtoTemplate) throws HyalineException {
return dtoFromClass(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"dtoFromClass",
"(",
"T",
"entity",
",",
"DTO",
"dtoTemplate",
")",
"throws",
"HyalineException",
"{",
"return",
"dtoFromClass",
"(",
"entity",
",",
"dtoTemplate",
",",
"\"Hyaline$Proxy$\"",
"+",
"System",
".",
"currentT... | It lets you create a new DTO starting from the annotation-based
configuration of your entity. This means that any annotation-based
configuration for JAXB, Jackson or whatever serialization framework you
are using on your entity T will be kept. However, if you insert an
annotation on a field that exists also in your cla... | [
"It",
"lets",
"you",
"create",
"a",
"new",
"DTO",
"starting",
"from",
"the",
"annotation",
"-",
"based",
"configuration",
"of",
"your",
"entity",
".",
"This",
"means",
"that",
"any",
"annotation",
"-",
"based",
"configuration",
"for",
"JAXB",
"Jackson",
"or"... | train | https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L138-L140 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxWebAuth.java | DbxWebAuth.finishFromCode | public DbxAuthFinish finishFromCode(String code, String redirectUri) throws DbxException {
"""
Call this after the user has visited the authorizaton URL with a redirectUrl and copy/pasted
the authorization code that Dropbox gave them.
@param code The authorization code shown to the user when they clicked "Allo... | java | public DbxAuthFinish finishFromCode(String code, String redirectUri) throws DbxException {
return finish(code, redirectUri, null);
} | [
"public",
"DbxAuthFinish",
"finishFromCode",
"(",
"String",
"code",
",",
"String",
"redirectUri",
")",
"throws",
"DbxException",
"{",
"return",
"finish",
"(",
"code",
",",
"redirectUri",
",",
"null",
")",
";",
"}"
] | Call this after the user has visited the authorizaton URL with a redirectUrl and copy/pasted
the authorization code that Dropbox gave them.
@param code The authorization code shown to the user when they clicked "Allow" on the
authorization, page on the Dropbox website, never {@code null}.
@param redirectUri The origin... | [
"Call",
"this",
"after",
"the",
"user",
"has",
"visited",
"the",
"authorizaton",
"URL",
"with",
"a",
"redirectUrl",
"and",
"copy",
"/",
"pasted",
"the",
"authorization",
"code",
"that",
"Dropbox",
"gave",
"them",
"."
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxWebAuth.java#L325-L327 |
landawn/AbacusUtil | src/com/landawn/abacus/util/URLEncodedUtil.java | URLEncodedUtil.decodeFormFields | private static String decodeFormFields(final String content, final Charset charset) {
"""
Decode/unescape www-url-form-encoded content.
@param content
the content to decode, will decode '+' as space
@param charset
the charset to use
@return encoded string
"""
if (content == null) {
... | java | private static String decodeFormFields(final String content, final Charset charset) {
if (content == null) {
return null;
}
return urlDecode(content, (charset != null) ? charset : Charsets.UTF_8, true);
} | [
"private",
"static",
"String",
"decodeFormFields",
"(",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"urlDecode",
"(",
"content",
",",
"(",
... | Decode/unescape www-url-form-encoded content.
@param content
the content to decode, will decode '+' as space
@param charset
the charset to use
@return encoded string | [
"Decode",
"/",
"unescape",
"www",
"-",
"url",
"-",
"form",
"-",
"encoded",
"content",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/URLEncodedUtil.java#L404-L410 |
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/xtext/AbstractProjectAwareResourceDescriptionsProvider.java | AbstractProjectAwareResourceDescriptionsProvider.getResourceDescriptions | @Override
public IResourceDescriptions getResourceDescriptions(ResourceSet resourceSet) {
"""
And if we are in the indexing phase, we don't want to see the local resources.
"""
IResourceDescriptions result = super.getResourceDescriptions(resourceSet);
if (compilerPhases.isIndexing(resourceSet)) {
// d... | java | @Override
public IResourceDescriptions getResourceDescriptions(ResourceSet resourceSet) {
IResourceDescriptions result = super.getResourceDescriptions(resourceSet);
if (compilerPhases.isIndexing(resourceSet)) {
// during indexing we don't want to see any local files
String projectName = getProjectName(resou... | [
"@",
"Override",
"public",
"IResourceDescriptions",
"getResourceDescriptions",
"(",
"ResourceSet",
"resourceSet",
")",
"{",
"IResourceDescriptions",
"result",
"=",
"super",
".",
"getResourceDescriptions",
"(",
"resourceSet",
")",
";",
"if",
"(",
"compilerPhases",
".",
... | And if we are in the indexing phase, we don't want to see the local resources. | [
"And",
"if",
"we",
"are",
"in",
"the",
"indexing",
"phase",
"we",
"don",
"t",
"want",
"to",
"see",
"the",
"local",
"resources",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/xtext/AbstractProjectAwareResourceDescriptionsProvider.java#L43-L66 |
clanie/clanie-core | src/main/java/dk/clanie/io/IOUtil.java | IOUtil.addFilesRecursively | public static void addFilesRecursively(File dir, Collection<File> fileCollection) {
"""
Adds all files in a directory and it's subdirectories to the supplied Collection.
@param dir
the directory to scan.
@param fileCollection
the Collection to update.
"""
log.debug("Adding files from {}", dir.getPath()... | java | public static void addFilesRecursively(File dir, Collection<File> fileCollection) {
log.debug("Adding files from {}", dir.getPath());
File[] files = dir.listFiles();
for (File file : files) {
if (file.isDirectory())
addFilesRecursively(file, fileCollection);
else {
fileCollection.add(file);
}
}... | [
"public",
"static",
"void",
"addFilesRecursively",
"(",
"File",
"dir",
",",
"Collection",
"<",
"File",
">",
"fileCollection",
")",
"{",
"log",
".",
"debug",
"(",
"\"Adding files from {}\"",
",",
"dir",
".",
"getPath",
"(",
")",
")",
";",
"File",
"[",
"]",
... | Adds all files in a directory and it's subdirectories to the supplied Collection.
@param dir
the directory to scan.
@param fileCollection
the Collection to update. | [
"Adds",
"all",
"files",
"in",
"a",
"directory",
"and",
"it",
"s",
"subdirectories",
"to",
"the",
"supplied",
"Collection",
"."
] | train | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/io/IOUtil.java#L184-L194 |
threerings/nenya | core/src/main/java/com/threerings/util/DirectionUtil.java | DirectionUtil.getDirection | public static int getDirection (Point a, Point b) {
"""
Returns which of the eight compass directions that point <code>b</code> lies in from point
<code>a</code> as one of the {@link DirectionCodes} direction constants. <em>Note:</em>
that the coordinates supplied are assumed to be logical (screen) rather than c... | java | public static int getDirection (Point a, Point b)
{
return getDirection(a.getX(), a.getY(), b.getX(), b.getY());
} | [
"public",
"static",
"int",
"getDirection",
"(",
"Point",
"a",
",",
"Point",
"b",
")",
"{",
"return",
"getDirection",
"(",
"a",
".",
"getX",
"(",
")",
",",
"a",
".",
"getY",
"(",
")",
",",
"b",
".",
"getX",
"(",
")",
",",
"b",
".",
"getY",
"(",
... | Returns which of the eight compass directions that point <code>b</code> lies in from point
<code>a</code> as one of the {@link DirectionCodes} direction constants. <em>Note:</em>
that the coordinates supplied are assumed to be logical (screen) rather than cartesian
coordinates and <code>NORTH</code> is considered to po... | [
"Returns",
"which",
"of",
"the",
"eight",
"compass",
"directions",
"that",
"point",
"<code",
">",
"b<",
"/",
"code",
">",
"lies",
"in",
"from",
"point",
"<code",
">",
"a<",
"/",
"code",
">",
"as",
"one",
"of",
"the",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/DirectionUtil.java#L184-L187 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/io/csv/CsvReader.java | CsvReader.detectColumnTypes | protected ColumnType[] detectColumnTypes(Reader reader, CsvReadOptions options) {
"""
Estimates and returns the type for each column in the delimited text file {@code file}
<p>
The type is determined by checking a sample of the data in the file. Because only a sample of the data is
checked,
the types may be in... | java | protected ColumnType[] detectColumnTypes(Reader reader, CsvReadOptions options) {
boolean header = options.header();
int linesToSkip = header ? 1 : 0;
CsvParser parser = csvParser(options);
try {
return getTypes(reader, options, linesToSkip, parser);
} finally {
... | [
"protected",
"ColumnType",
"[",
"]",
"detectColumnTypes",
"(",
"Reader",
"reader",
",",
"CsvReadOptions",
"options",
")",
"{",
"boolean",
"header",
"=",
"options",
".",
"header",
"(",
")",
";",
"int",
"linesToSkip",
"=",
"header",
"?",
"1",
":",
"0",
";",
... | Estimates and returns the type for each column in the delimited text file {@code file}
<p>
The type is determined by checking a sample of the data in the file. Because only a sample of the data is
checked,
the types may be incorrect. If that is the case a Parse Exception will be thrown.
<p>
The method {@code printColum... | [
"Estimates",
"and",
"returns",
"the",
"type",
"for",
"each",
"column",
"in",
"the",
"delimited",
"text",
"file",
"{"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/io/csv/CsvReader.java#L145-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.