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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java | DateTimeParseContext.setParsedField | int setParsedField(TemporalField field, long value, int errorPos, int successPos) {
"""
Stores the parsed field.
<p>
This stores a field-value pair that has been parsed.
The value stored may be out of range for the field - no checks are performed.
@param field the field to set in the field-value map, not nu... | java | int setParsedField(TemporalField field, long value, int errorPos, int successPos) {
Objects.requireNonNull(field, "field");
Long old = currentParsed().fieldValues.put(field, value);
return (old != null && old.longValue() != value) ? ~errorPos : successPos;
} | [
"int",
"setParsedField",
"(",
"TemporalField",
"field",
",",
"long",
"value",
",",
"int",
"errorPos",
",",
"int",
"successPos",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"field",
",",
"\"field\"",
")",
";",
"Long",
"old",
"=",
"currentParsed",
"(",
... | Stores the parsed field.
<p>
This stores a field-value pair that has been parsed.
The value stored may be out of range for the field - no checks are performed.
@param field the field to set in the field-value map, not null
@param value the value to set in the field-value map
@param errorPos the position of the fiel... | [
"Stores",
"the",
"parsed",
"field",
".",
"<p",
">",
"This",
"stores",
"a",
"field",
"-",
"value",
"pair",
"that",
"has",
"been",
"parsed",
".",
"The",
"value",
"stored",
"may",
"be",
"out",
"of",
"range",
"for",
"the",
"field",
"-",
"no",
"checks",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java#L363-L367 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/core/IntHeapCache.java | IntHeapCache.createHashTable | @Override
public Hash2<Integer, V> createHashTable() {
"""
Modified hash table implementation. Rehash needs to calculate the correct hash code again.
"""
return new Hash2<Integer, V>(this) {
@Override
protected int modifiedHashCode(final int hc) {
return IntHeapCache.this.modifiedHash... | java | @Override
public Hash2<Integer, V> createHashTable() {
return new Hash2<Integer, V>(this) {
@Override
protected int modifiedHashCode(final int hc) {
return IntHeapCache.this.modifiedHash(hc);
}
@Override
protected boolean keyObjIsEqual(final Integer key, final Entry e) {
... | [
"@",
"Override",
"public",
"Hash2",
"<",
"Integer",
",",
"V",
">",
"createHashTable",
"(",
")",
"{",
"return",
"new",
"Hash2",
"<",
"Integer",
",",
"V",
">",
"(",
"this",
")",
"{",
"@",
"Override",
"protected",
"int",
"modifiedHashCode",
"(",
"final",
... | Modified hash table implementation. Rehash needs to calculate the correct hash code again. | [
"Modified",
"hash",
"table",
"implementation",
".",
"Rehash",
"needs",
"to",
"calculate",
"the",
"correct",
"hash",
"code",
"again",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/IntHeapCache.java#L58-L71 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.listCertificateIssuersAsync | public ServiceFuture<List<CertificateIssuerItem>> listCertificateIssuersAsync(final String vaultBaseUrl,
final ListOperationCallback<CertificateIssuerItem> serviceCallback) {
"""
List certificate issuers for the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.n... | java | public ServiceFuture<List<CertificateIssuerItem>> listCertificateIssuersAsync(final String vaultBaseUrl,
final ListOperationCallback<CertificateIssuerItem> serviceCallback) {
return getCertificateIssuersAsync(vaultBaseUrl, serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"CertificateIssuerItem",
">",
">",
"listCertificateIssuersAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"ListOperationCallback",
"<",
"CertificateIssuerItem",
">",
"serviceCallback",
")",
"{",
"return",
"getCe... | List certificate issuers for the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param serviceCallback
the async ServiceCallback to handle successful and failed
responses.
@return the {@link ServiceFuture} object | [
"List",
"certificate",
"issuers",
"for",
"the",
"specified",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1366-L1369 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/map/BindMapVisitor.java | BindMapVisitor.visitList | @SuppressWarnings("unchecked")
static VisitorStatusType visitList(String name, List<Object> list, BindMapListener listener, VisitorStatusType status) {
"""
Visit list.
@param name the name
@param list the list
@param listener the listener
@param status the status
@return the visitor status type
"""
i... | java | @SuppressWarnings("unchecked")
static VisitorStatusType visitList(String name, List<Object> list, BindMapListener listener, VisitorStatusType status) {
int i = 0;
for (Object item : list) {
if (item == null || item instanceof String) {
visit(name + "." + i, (String) item, listener, status);
} else if (it... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"VisitorStatusType",
"visitList",
"(",
"String",
"name",
",",
"List",
"<",
"Object",
">",
"list",
",",
"BindMapListener",
"listener",
",",
"VisitorStatusType",
"status",
")",
"{",
"int",
"i",
"=",
"... | Visit list.
@param name the name
@param list the list
@param listener the listener
@param status the status
@return the visitor status type | [
"Visit",
"list",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapVisitor.java#L82-L100 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Request.java | Request.generateStory | public Story generateStory(Map<String, Object> attributes) {
"""
Creates a Story from this Request.
@param attributes additional attributes for the Story.
@return A Story in the VersionOne system related to this Issue.
"""
Story result = getInstance().createNew(Story.class, this);
getInstan... | java | public Story generateStory(Map<String, Object> attributes) {
Story result = getInstance().createNew(Story.class, this);
getInstance().create().addAttributes(result, attributes);
result.save();
return result;
} | [
"public",
"Story",
"generateStory",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"Story",
"result",
"=",
"getInstance",
"(",
")",
".",
"createNew",
"(",
"Story",
".",
"class",
",",
"this",
")",
";",
"getInstance",
"(",
")",
".... | Creates a Story from this Request.
@param attributes additional attributes for the Story.
@return A Story in the VersionOne system related to this Issue. | [
"Creates",
"a",
"Story",
"from",
"this",
"Request",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Request.java#L217-L222 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/valuegeneration/StochasticValueGenerator.java | StochasticValueGenerator.addProbability | public boolean addProbability(E o, Double p) throws InconsistencyException, ParameterException {
"""
Adds a new element together with its occurrence probability.<br>
The method checks and sets the validity state of the chooser.
Once valid, no more probabilities are accepted.
@param o Element to add.
@param p O... | java | public boolean addProbability(E o, Double p) throws InconsistencyException, ParameterException {
if(isValid())
return false;
Validate.probability(p);
if(keys.isEmpty()){
keys.add(o);
limits.add(p);
} else {
if((getSum() + p) > 1.0+tolerance){
throw new InconsistencyException("Probabilities mus... | [
"public",
"boolean",
"addProbability",
"(",
"E",
"o",
",",
"Double",
"p",
")",
"throws",
"InconsistencyException",
",",
"ParameterException",
"{",
"if",
"(",
"isValid",
"(",
")",
")",
"return",
"false",
";",
"Validate",
".",
"probability",
"(",
"p",
")",
"... | Adds a new element together with its occurrence probability.<br>
The method checks and sets the validity state of the chooser.
Once valid, no more probabilities are accepted.
@param o Element to add.
@param p Occurrence probability of the given element.
@throws InconsistencyException Thrown if the sum of all maintained... | [
"Adds",
"a",
"new",
"element",
"together",
"with",
"its",
"occurrence",
"probability",
".",
"<br",
">",
"The",
"method",
"checks",
"and",
"sets",
"the",
"validity",
"state",
"of",
"the",
"chooser",
".",
"Once",
"valid",
"no",
"more",
"probabilities",
"are",
... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/valuegeneration/StochasticValueGenerator.java#L75-L94 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.setRowVar | public void setRowVar(final FacesContext context, final String rowKey) {
"""
Updates the row var for iterations over the list. The var value will be updated to the value for the specified rowKey.
@param context the FacesContext against which to the row var is set. Passed for performance
@param rowKey the rowKe... | java | public void setRowVar(final FacesContext context, final String rowKey) {
if (context == null) {
return;
}
if (rowKey == null) {
context.getExternalContext().getRequestMap().remove(getVar());
}
else {
final Object value = getRowMap().get(rowKe... | [
"public",
"void",
"setRowVar",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"String",
"rowKey",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"rowKey",
"==",
"null",
")",
"{",
"context",
".",
"getExter... | Updates the row var for iterations over the list. The var value will be updated to the value for the specified rowKey.
@param context the FacesContext against which to the row var is set. Passed for performance
@param rowKey the rowKey string | [
"Updates",
"the",
"row",
"var",
"for",
"iterations",
"over",
"the",
"list",
".",
"The",
"var",
"value",
"will",
"be",
"updated",
"to",
"the",
"value",
"for",
"the",
"specified",
"rowKey",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L312-L325 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.deletePhysicalNetworkFunctionDescriptor | @Help(
help =
"Delete the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id"
)
public void deletePhysicalNetworkFunctionDescriptor(final String idNsd, final String idPnf)
throws SDKException {
"""
Delete a specific PhysicalNetworkFunctionDescriptor which is cont... | java | @Help(
help =
"Delete the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id"
)
public void deletePhysicalNetworkFunctionDescriptor(final String idNsd, final String idPnf)
throws SDKException {
String url = idNsd + "/pnfdescriptors" + "/" + idPnf;
requestDelet... | [
"@",
"Help",
"(",
"help",
"=",
"\"Delete the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id\"",
")",
"public",
"void",
"deletePhysicalNetworkFunctionDescriptor",
"(",
"final",
"String",
"idNsd",
",",
"final",
"String",
"idPnf",
")",
"throws",
... | Delete a specific PhysicalNetworkFunctionDescriptor which is contained in a particular
NetworkServiceDescriptor.
@param idNsd the NetworkServiceDescriptor's ID
@param idPnf :the PhysicalNetworkFunctionDescriptor's ID
@throws SDKException if the request fails | [
"Delete",
"a",
"specific",
"PhysicalNetworkFunctionDescriptor",
"which",
"is",
"contained",
"in",
"a",
"particular",
"NetworkServiceDescriptor",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L339-L347 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.removeRight | public static String removeRight(final String value, final String suffix, final boolean caseSensitive) {
"""
Returns a new string with the 'suffix' removed, if present.
@param value The input String
@param suffix The suffix to remove
@param caseSensitive whether search should be case sensitive ... | java | public static String removeRight(final String value, final String suffix, final boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
validate(suffix, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return endsWith(value, suffix, caseSensitive) ? value
... | [
"public",
"static",
"String",
"removeRight",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"suffix",
",",
"final",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
... | Returns a new string with the 'suffix' removed, if present.
@param value The input String
@param suffix The suffix to remove
@param caseSensitive whether search should be case sensitive or not
@return The String without suffix! | [
"Returns",
"a",
"new",
"string",
"with",
"the",
"suffix",
"removed",
"if",
"present",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L776-L781 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.registerAlias | protected static void registerAlias(Class<?> parent, String alias, String cname) {
"""
Register a class alias with the registry.
@param parent Parent class
@param alias Alias name
@param cname Class name
"""
Entry e = data.get(parent);
assert (e != null);
e.addAlias(alias, cname);
} | java | protected static void registerAlias(Class<?> parent, String alias, String cname) {
Entry e = data.get(parent);
assert (e != null);
e.addAlias(alias, cname);
} | [
"protected",
"static",
"void",
"registerAlias",
"(",
"Class",
"<",
"?",
">",
"parent",
",",
"String",
"alias",
",",
"String",
"cname",
")",
"{",
"Entry",
"e",
"=",
"data",
".",
"get",
"(",
"parent",
")",
";",
"assert",
"(",
"e",
"!=",
"null",
")",
... | Register a class alias with the registry.
@param parent Parent class
@param alias Alias name
@param cname Class name | [
"Register",
"a",
"class",
"alias",
"with",
"the",
"registry",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L200-L204 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.toAttr | public static Attr toAttr(Document doc, Object o) throws PageException {
"""
casts a value to a XML Attribute Object
@param doc XML Document
@param o Object to cast
@return XML Comment Object
@throws PageException
"""
if (o instanceof Attr) return (Attr) o;
if (o instanceof Struct && ((Struct) o).size(... | java | public static Attr toAttr(Document doc, Object o) throws PageException {
if (o instanceof Attr) return (Attr) o;
if (o instanceof Struct && ((Struct) o).size() == 1) {
Struct sct = (Struct) o;
Entry<Key, Object> e = sct.entryIterator().next();
Attr attr = doc.createAttribute(e.getKey().getString());
... | [
"public",
"static",
"Attr",
"toAttr",
"(",
"Document",
"doc",
",",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Attr",
")",
"return",
"(",
"Attr",
")",
"o",
";",
"if",
"(",
"o",
"instanceof",
"Struct",
"&&",
"(",
... | casts a value to a XML Attribute Object
@param doc XML Document
@param o Object to cast
@return XML Comment Object
@throws PageException | [
"casts",
"a",
"value",
"to",
"a",
"XML",
"Attribute",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L148-L159 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.getFsImageName | public File getFsImageName(StorageLocationType type, long txid) {
"""
Return the name of the image file, preferring
"type" images. Otherwise, return any image.
@return The name of the image file.
"""
File lastCandidate = null;
for (Iterator<StorageDirectory> it =
dirIterator(NameNodeDirType.I... | java | public File getFsImageName(StorageLocationType type, long txid) {
File lastCandidate = null;
for (Iterator<StorageDirectory> it =
dirIterator(NameNodeDirType.IMAGE); it.hasNext();) {
StorageDirectory sd = it.next();
File fsImage = getStorageFile(sd, NameNodeFile.IMAGE, txid);
if(sd.getRo... | [
"public",
"File",
"getFsImageName",
"(",
"StorageLocationType",
"type",
",",
"long",
"txid",
")",
"{",
"File",
"lastCandidate",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"StorageDirectory",
">",
"it",
"=",
"dirIterator",
"(",
"NameNodeDirType",
".",
"IMAG... | Return the name of the image file, preferring
"type" images. Otherwise, return any image.
@return The name of the image file. | [
"Return",
"the",
"name",
"of",
"the",
"image",
"file",
"preferring",
"type",
"images",
".",
"Otherwise",
"return",
"any",
"image",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L557-L571 |
knightliao/disconf | disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java | ZookeeperMgr.read | public String read(String path, Watcher watcher, Stat stat) throws InterruptedException, KeeperException {
"""
@param path
@param watcher
@param stat
@return String
@throws InterruptedException
@throws KeeperException
@Description: 带状态信息的读取数据
@author liaoqiqi
@date 2013-6-17
"""
return sto... | java | public String read(String path, Watcher watcher, Stat stat) throws InterruptedException, KeeperException {
return store.read(path, watcher, stat);
} | [
"public",
"String",
"read",
"(",
"String",
"path",
",",
"Watcher",
"watcher",
",",
"Stat",
"stat",
")",
"throws",
"InterruptedException",
",",
"KeeperException",
"{",
"return",
"store",
".",
"read",
"(",
"path",
",",
"watcher",
",",
"stat",
")",
";",
"}"
] | @param path
@param watcher
@param stat
@return String
@throws InterruptedException
@throws KeeperException
@Description: 带状态信息的读取数据
@author liaoqiqi
@date 2013-6-17 | [
"@param",
"path",
"@param",
"watcher",
"@param",
"stat"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java#L217-L220 |
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java | JtsAdapter.ptsToGeomCmds | private static List<Integer> ptsToGeomCmds(final Geometry geom, final Vec2d cursor) {
"""
<p>Convert a {@link Point} or {@link MultiPoint} geometry to a list of MVT geometry drawing commands. See
<a href="https://github.com/mapbox/vector-tile-spec">vector-tile-spec</a>
for details.</p>
<p>WARNING: The value o... | java | private static List<Integer> ptsToGeomCmds(final Geometry geom, final Vec2d cursor) {
// Guard: empty geometry coordinates
final Coordinate[] geomCoords = geom.getCoordinates();
if(geomCoords.length <= 0) {
return Collections.emptyList();
}
/** Tile commands and par... | [
"private",
"static",
"List",
"<",
"Integer",
">",
"ptsToGeomCmds",
"(",
"final",
"Geometry",
"geom",
",",
"final",
"Vec2d",
"cursor",
")",
"{",
"// Guard: empty geometry coordinates",
"final",
"Coordinate",
"[",
"]",
"geomCoords",
"=",
"geom",
".",
"getCoordinates... | <p>Convert a {@link Point} or {@link MultiPoint} geometry to a list of MVT geometry drawing commands. See
<a href="https://github.com/mapbox/vector-tile-spec">vector-tile-spec</a>
for details.</p>
<p>WARNING: The value of the {@code cursor} parameter is modified as a result of calling this method.</p>
@param geom inp... | [
"<p",
">",
"Convert",
"a",
"{",
"@link",
"Point",
"}",
"or",
"{",
"@link",
"MultiPoint",
"}",
"geometry",
"to",
"a",
"list",
"of",
"MVT",
"geometry",
"drawing",
"commands",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",... | train | https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java#L430-L476 |
dbflute-session/mailflute | src/main/java/org/dbflute/mail/Postcard.java | Postcard.pushUlterior | public void pushUlterior(String key, Object value) {
"""
basically unused in mailflute, this is for extension by application
"""
assertArgumentNotNull("key", key);
assertArgumentNotNull("value", value);
if (pushedUlteriorMap == null) {
pushedUlteriorMap = new LinkedHashMap<S... | java | public void pushUlterior(String key, Object value) {
assertArgumentNotNull("key", key);
assertArgumentNotNull("value", value);
if (pushedUlteriorMap == null) {
pushedUlteriorMap = new LinkedHashMap<String, Object>(4);
}
pushedUlteriorMap.put(key, value);
} | [
"public",
"void",
"pushUlterior",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"assertArgumentNotNull",
"(",
"\"key\"",
",",
"key",
")",
";",
"assertArgumentNotNull",
"(",
"\"value\"",
",",
"value",
")",
";",
"if",
"(",
"pushedUlteriorMap",
"==",
... | basically unused in mailflute, this is for extension by application | [
"basically",
"unused",
"in",
"mailflute",
"this",
"is",
"for",
"extension",
"by",
"application"
] | train | https://github.com/dbflute-session/mailflute/blob/e41da4984131b09d55060e247fa4831682bc40a9/src/main/java/org/dbflute/mail/Postcard.java#L351-L358 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java | JsiiEngine.tryGetJsiiAnnotation | static Jsii tryGetJsiiAnnotation(final Class<?> type, final boolean inherited) {
"""
Attempts to find the @Jsii annotation from a type.
@param type The type.
@param inherited If 'true' will look for the annotation up the class hierarchy.
@return The annotation or null.
"""
Jsii[] ann;
if (i... | java | static Jsii tryGetJsiiAnnotation(final Class<?> type, final boolean inherited) {
Jsii[] ann;
if (inherited) {
ann = (Jsii[]) type.getAnnotationsByType(Jsii.class);
} else {
ann = (Jsii[]) type.getDeclaredAnnotationsByType(Jsii.class);
}
if (ann.length ==... | [
"static",
"Jsii",
"tryGetJsiiAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"boolean",
"inherited",
")",
"{",
"Jsii",
"[",
"]",
"ann",
";",
"if",
"(",
"inherited",
")",
"{",
"ann",
"=",
"(",
"Jsii",
"[",
"]",
")",
"type",
... | Attempts to find the @Jsii annotation from a type.
@param type The type.
@param inherited If 'true' will look for the annotation up the class hierarchy.
@return The annotation or null. | [
"Attempts",
"to",
"find",
"the"
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L532-L546 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java | LocalClientFactory.createClient | public JestClient createClient(Map<String, String> config, String defaultIndexName) {
"""
Creates a client from information in the config map.
@param config the configuration
@param defaultIndexName the default index to use if not specified in the config
@return the ES client
"""
JestClient client;
... | java | public JestClient createClient(Map<String, String> config, String defaultIndexName) {
JestClient client;
String indexName = config.get("client.index"); //$NON-NLS-1$
if (indexName == null) {
indexName = defaultIndexName;
}
client = createLocalClient(config, indexName,... | [
"public",
"JestClient",
"createClient",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
",",
"String",
"defaultIndexName",
")",
"{",
"JestClient",
"client",
";",
"String",
"indexName",
"=",
"config",
".",
"get",
"(",
"\"client.index\"",
")",
";",
"/... | Creates a client from information in the config map.
@param config the configuration
@param defaultIndexName the default index to use if not specified in the config
@return the ES client | [
"Creates",
"a",
"client",
"from",
"information",
"in",
"the",
"config",
"map",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java#L42-L50 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java | CalendarPanel.setSizeOfMonthYearPanel | private void setSizeOfMonthYearPanel() {
"""
setSizeOfMonthYearPanel, This sets the size of the panel at the top of the calendar that
holds the month and the year label. The size is calculated from the largest month name (in
pixels), that exists in locale and language that is being used by the date picker.
"... | java | private void setSizeOfMonthYearPanel() {
// Skip this function if the settings have not been applied.
if (settings == null) {
return;
}
// Get the font metrics object.
Font font = labelMonth.getFont();
Canvas canvas = new Canvas();
FontMetrics metrics ... | [
"private",
"void",
"setSizeOfMonthYearPanel",
"(",
")",
"{",
"// Skip this function if the settings have not been applied.",
"if",
"(",
"settings",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// Get the font metrics object.",
"Font",
"font",
"=",
"labelMonth",
".",
"ge... | setSizeOfMonthYearPanel, This sets the size of the panel at the top of the calendar that
holds the month and the year label. The size is calculated from the largest month name (in
pixels), that exists in locale and language that is being used by the date picker. | [
"setSizeOfMonthYearPanel",
"This",
"sets",
"the",
"size",
"of",
"the",
"panel",
"at",
"the",
"top",
"of",
"the",
"calendar",
"that",
"holds",
"the",
"month",
"and",
"the",
"year",
"label",
".",
"The",
"size",
"is",
"calculated",
"from",
"the",
"largest",
"... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L1199-L1234 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.checkSlip | public static File checkSlip(File parentFile, File file) throws IllegalArgumentException {
"""
检查父完整路径是否为自路径的前半部分,如果不是说明不是子路径,可能存在slip注入。
<p>
见http://blog.nsfocus.net/zip-slip-2/
@param parentFile 父文件或目录
@param file 子文件或目录
@return 子文件或目录
@throws IllegalArgumentException 检查创建的子文件不在父目录中抛出此异常
"""
if (n... | java | public static File checkSlip(File parentFile, File file) throws IllegalArgumentException {
if (null != parentFile && null != file) {
String parentCanonicalPath;
String canonicalPath;
try {
parentCanonicalPath = parentFile.getCanonicalPath();
canonicalPath = file.getCanonicalPath();
} catch ... | [
"public",
"static",
"File",
"checkSlip",
"(",
"File",
"parentFile",
",",
"File",
"file",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"null",
"!=",
"parentFile",
"&&",
"null",
"!=",
"file",
")",
"{",
"String",
"parentCanonicalPath",
";",
"String"... | 检查父完整路径是否为自路径的前半部分,如果不是说明不是子路径,可能存在slip注入。
<p>
见http://blog.nsfocus.net/zip-slip-2/
@param parentFile 父文件或目录
@param file 子文件或目录
@return 子文件或目录
@throws IllegalArgumentException 检查创建的子文件不在父目录中抛出此异常 | [
"检查父完整路径是否为自路径的前半部分,如果不是说明不是子路径,可能存在slip注入。",
"<p",
">",
"见http",
":",
"//",
"blog",
".",
"nsfocus",
".",
"net",
"/",
"zip",
"-",
"slip",
"-",
"2",
"/"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3384-L3399 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java | OrderItemUrl.addItemToQuoteUrl | public static MozuUrl addItemToQuoteUrl(String quoteId, String responseFields) {
"""
Get Resource Url for AddItemToQuote
@param quoteId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to re... | java | public static MozuUrl addItemToQuoteUrl(String quoteId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}/items?responseFields={responseFields}");
formatter.formatUrl("quoteId", quoteId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(... | [
"public",
"static",
"MozuUrl",
"addItemToQuoteUrl",
"(",
"String",
"quoteId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/quotes/{quoteId}/items?responseFields={responseFields}\"",
")",
";",
"form... | Get Resource Url for AddItemToQuote
@param quoteId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return S... | [
"Get",
"Resource",
"Url",
"for",
"AddItemToQuote"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java#L84-L90 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.createGraph | public static boolean createGraph(Connection connection,
String inputTable,
String spatialFieldName,
double tolerance,
boolean orientBySlope,
... | java | public static boolean createGraph(Connection connection,
String inputTable,
String spatialFieldName,
double tolerance,
boolean orientBySlope,
... | [
"public",
"static",
"boolean",
"createGraph",
"(",
"Connection",
"connection",
",",
"String",
"inputTable",
",",
"String",
"spatialFieldName",
",",
"double",
"tolerance",
",",
"boolean",
"orientBySlope",
",",
"boolean",
"deleteTables",
")",
"throws",
"SQLException",
... | Create the nodes and edges tables from the input table containing
LINESTRINGs in the given column and using the given
tolerance, and potentially orienting edges by slope.
<p/>
The tolerance value is used specify the side length of a square Envelope
around each node used to snap together other nodes within the same
Enve... | [
"Create",
"the",
"nodes",
"and",
"edges",
"tables",
"from",
"the",
"input",
"table",
"containing",
"LINESTRINGs",
"in",
"the",
"given",
"column",
"and",
"using",
"the",
"given",
"tolerance",
"and",
"potentially",
"orienting",
"edges",
"by",
"slope",
".",
"<p",... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L229-L287 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java | CacheListUtil.addFirst | public static Single<Boolean> addFirst(String cacheKey, Object value) {
"""
add element to the list's header
@param cacheKey the key for the cached list.
@param value the value to be added.
"""
return addFirst(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | java | public static Single<Boolean> addFirst(String cacheKey, Object value) {
return addFirst(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"addFirst",
"(",
"String",
"cacheKey",
",",
"Object",
"value",
")",
"{",
"return",
"addFirst",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"value",
")",
";",
"}"
] | add element to the list's header
@param cacheKey the key for the cached list.
@param value the value to be added. | [
"add",
"element",
"to",
"the",
"list",
"s",
"header"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java#L103-L105 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldRenderer.java | WFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WField.
@param component the WField to paint.
@param renderContext the RenderContext to paint to.
"""
WField field = (WField) component;
XmlStringBuilder xml = renderContext.getWr... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WField field = (WField) component;
XmlStringBuilder xml = renderContext.getWriter();
int inputWidth = field.getInputWidth();
xml.appendTagOpen("ui:field");
xml.appendAttribute("id", component.getId());
xm... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WField",
"field",
"=",
"(",
"WField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
... | Paints the given WField.
@param component the WField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WField",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldRenderer.java#L23-L61 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.createThumbnailJob | public CreateThumbnailJobResponse createThumbnailJob(String pipelineName, String sourceKey) {
"""
Creates a thumbnail job and return job ID.
@param pipelineName The name of a pipeline.
@param sourceKey The key of source object.
@return the unique ID of the new thumbnail job.
"""
ThumbnailSource ... | java | public CreateThumbnailJobResponse createThumbnailJob(String pipelineName, String sourceKey) {
ThumbnailSource source = new ThumbnailSource();
source.setKey(sourceKey);
CreateThumbnailJobRequest request =
new CreateThumbnailJobRequest().withPipelineName(pipelineName).with... | [
"public",
"CreateThumbnailJobResponse",
"createThumbnailJob",
"(",
"String",
"pipelineName",
",",
"String",
"sourceKey",
")",
"{",
"ThumbnailSource",
"source",
"=",
"new",
"ThumbnailSource",
"(",
")",
";",
"source",
".",
"setKey",
"(",
"sourceKey",
")",
";",
"Crea... | Creates a thumbnail job and return job ID.
@param pipelineName The name of a pipeline.
@param sourceKey The key of source object.
@return the unique ID of the new thumbnail job. | [
"Creates",
"a",
"thumbnail",
"job",
"and",
"return",
"job",
"ID",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L1238-L1246 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/jms/JmsSession.java | JmsSession.closeContext | public void closeContext()
throws EFapsException {
"""
Method that closes the opened Context {@link #openContext()}, by
committing or rollback it.
@throws EFapsException on error
@see #detach()
"""
if (isLogedIn()) {
try {
if (!Context.isTMNoTransaction()) {
... | java | public void closeContext()
throws EFapsException
{
if (isLogedIn()) {
try {
if (!Context.isTMNoTransaction()) {
if (Context.isTMActive()) {
Context.commit();
} else {
Context.rollback(... | [
"public",
"void",
"closeContext",
"(",
")",
"throws",
"EFapsException",
"{",
"if",
"(",
"isLogedIn",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"Context",
".",
"isTMNoTransaction",
"(",
")",
")",
"{",
"if",
"(",
"Context",
".",
"isTMActive",
"(",
... | Method that closes the opened Context {@link #openContext()}, by
committing or rollback it.
@throws EFapsException on error
@see #detach() | [
"Method",
"that",
"closes",
"the",
"opened",
"Context",
"{",
"@link",
"#openContext",
"()",
"}",
"by",
"committing",
"or",
"rollback",
"it",
".",
"@throws",
"EFapsException",
"on",
"error"
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/jms/JmsSession.java#L159-L177 |
jbundle/jbundle | thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JBlinkLabel.java | JBlinkLabel.getTableCellRendererComponent | public java.awt.Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
"""
If this control is in a JTable, this is how to render it.
@param table The table this component is in.
@param value The value of this cell.
@param isSelected True ... | java | public java.awt.Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
{
if (m_table == null)
{ // Cache this for later.
m_table = table;
// The following code is here because the column of this compone... | [
"public",
"java",
".",
"awt",
".",
"Component",
"getTableCellRendererComponent",
"(",
"JTable",
"table",
",",
"Object",
"value",
",",
"boolean",
"isSelected",
",",
"boolean",
"hasFocus",
",",
"int",
"row",
",",
"int",
"column",
")",
"{",
"if",
"(",
"m_table"... | If this control is in a JTable, this is how to render it.
@param table The table this component is in.
@param value The value of this cell.
@param isSelected True if selected.
@param hasFocus True if focused.
@param row The table row.
@param column The table column.
@return This component (after updating for blink). | [
"If",
"this",
"control",
"is",
"in",
"a",
"JTable",
"this",
"is",
"how",
"to",
"render",
"it",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JBlinkLabel.java#L128-L147 |
google/closure-templates | java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java | TranslateToPyExprVisitor.genPyExprUsingSoySyntax | private PyExpr genPyExprUsingSoySyntax(OperatorNode opNode) {
"""
Generates a Python expression for the given OperatorNode's subtree assuming that the Python
expression for the operator uses the same syntax format as the Soy operator.
@param opNode the OperatorNode whose subtree to generate a Python expression... | java | private PyExpr genPyExprUsingSoySyntax(OperatorNode opNode) {
List<PyExpr> operandPyExprs = visitChildren(opNode);
String newExpr = PyExprUtils.genExprWithNewToken(opNode.getOperator(), operandPyExprs, null);
return new PyExpr(newExpr, PyExprUtils.pyPrecedenceForOperator(opNode.getOperator()));
} | [
"private",
"PyExpr",
"genPyExprUsingSoySyntax",
"(",
"OperatorNode",
"opNode",
")",
"{",
"List",
"<",
"PyExpr",
">",
"operandPyExprs",
"=",
"visitChildren",
"(",
"opNode",
")",
";",
"String",
"newExpr",
"=",
"PyExprUtils",
".",
"genExprWithNewToken",
"(",
"opNode"... | Generates a Python expression for the given OperatorNode's subtree assuming that the Python
expression for the operator uses the same syntax format as the Soy operator.
@param opNode the OperatorNode whose subtree to generate a Python expression for
@return the generated Python expression | [
"Generates",
"a",
"Python",
"expression",
"for",
"the",
"given",
"OperatorNode",
"s",
"subtree",
"assuming",
"that",
"the",
"Python",
"expression",
"for",
"the",
"operator",
"uses",
"the",
"same",
"syntax",
"format",
"as",
"the",
"Soy",
"operator",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L641-L646 |
metamx/java-util | src/main/java/com/metamx/common/concurrent/ScheduledExecutors.java | ScheduledExecutors.scheduleAtFixedRate | public static void scheduleAtFixedRate(ScheduledExecutorService exec, Duration rate, Runnable runnable) {
"""
Run runnable once every period. Exceptions are caught and logged as errors.
"""
scheduleAtFixedRate(exec, rate, rate, runnable);
} | java | public static void scheduleAtFixedRate(ScheduledExecutorService exec, Duration rate, Runnable runnable)
{
scheduleAtFixedRate(exec, rate, rate, runnable);
} | [
"public",
"static",
"void",
"scheduleAtFixedRate",
"(",
"ScheduledExecutorService",
"exec",
",",
"Duration",
"rate",
",",
"Runnable",
"runnable",
")",
"{",
"scheduleAtFixedRate",
"(",
"exec",
",",
"rate",
",",
"rate",
",",
"runnable",
")",
";",
"}"
] | Run runnable once every period. Exceptions are caught and logged as errors. | [
"Run",
"runnable",
"once",
"every",
"period",
".",
"Exceptions",
"are",
"caught",
"and",
"logged",
"as",
"errors",
"."
] | train | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/common/concurrent/ScheduledExecutors.java#L119-L122 |
fuinorg/units4j | src/main/java/org/fuin/units4j/Units4JUtils.java | Units4JUtils.assertCauseMessage | public static void assertCauseMessage(final Throwable ex, final String expectedMessage) {
"""
Verifies that the cause of an exception contains an expected message.
@param ex
Exception with the cause to check,
@param expectedMessage
Message of the cause.
"""
assertThat(ex.getCause()).isNotNull();
... | java | public static void assertCauseMessage(final Throwable ex, final String expectedMessage) {
assertThat(ex.getCause()).isNotNull();
assertThat(ex.getCause().getMessage()).isEqualTo(expectedMessage);
} | [
"public",
"static",
"void",
"assertCauseMessage",
"(",
"final",
"Throwable",
"ex",
",",
"final",
"String",
"expectedMessage",
")",
"{",
"assertThat",
"(",
"ex",
".",
"getCause",
"(",
")",
")",
".",
"isNotNull",
"(",
")",
";",
"assertThat",
"(",
"ex",
".",
... | Verifies that the cause of an exception contains an expected message.
@param ex
Exception with the cause to check,
@param expectedMessage
Message of the cause. | [
"Verifies",
"that",
"the",
"cause",
"of",
"an",
"exception",
"contains",
"an",
"expected",
"message",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/Units4JUtils.java#L273-L276 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.setOutputProperty | public void setOutputProperty(String name, String value)
throws IllegalArgumentException {
"""
This method is used to set or override the value
of the effective xsl:output attribute values
specified in the stylesheet.
<p>
The recognized standard output properties are:
<ul>
<li>cdata-section-element... | java | public void setOutputProperty(String name, String value)
throws IllegalArgumentException
{
synchronized (m_reentryGuard)
{
// Get the output format that was set by the user, otherwise get the
// output format from the stylesheet.
if (null == m_outputFormat)
{
m_out... | [
"public",
"void",
"setOutputProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"synchronized",
"(",
"m_reentryGuard",
")",
"{",
"// Get the output format that was set by the user, otherwise get the ",
"// output format from... | This method is used to set or override the value
of the effective xsl:output attribute values
specified in the stylesheet.
<p>
The recognized standard output properties are:
<ul>
<li>cdata-section-elements
<li>doctype-system
<li>doctype-public
<li>indent
<li>media-type
<li>method
<li>omit-xml-declaration
<li>standalone... | [
"This",
"method",
"is",
"used",
"to",
"set",
"or",
"override",
"the",
"value",
"of",
"the",
"effective",
"xsl",
":",
"output",
"attribute",
"values",
"specified",
"in",
"the",
"stylesheet",
".",
"<p",
">",
"The",
"recognized",
"standard",
"output",
"properti... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L829-L850 |
jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.readFileColumn | public static double[] readFileColumn(String filename, int columnIdx, int sizeLimit)
throws IOException, SAXException {
"""
Reads timeseries from a file. Assumes that file has a single double value on every line.
Assigned timestamps are the line numbers.
@param filename The file to read from.
@param co... | java | public static double[] readFileColumn(String filename, int columnIdx, int sizeLimit)
throws IOException, SAXException {
// make sure the path exists
Path path = Paths.get(filename);
if (!(Files.exists(path))) {
throw new SAXException("unable to load data - data source not found.");
}... | [
"public",
"static",
"double",
"[",
"]",
"readFileColumn",
"(",
"String",
"filename",
",",
"int",
"columnIdx",
",",
"int",
"sizeLimit",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"// make sure the path exists\r",
"Path",
"path",
"=",
"Paths",
".",
"g... | Reads timeseries from a file. Assumes that file has a single double value on every line.
Assigned timestamps are the line numbers.
@param filename The file to read from.
@param columnIdx The column index.
@param sizeLimit The number of lines to read, 0 == all.
@return data.
@throws IOException if error occurs.
@throws... | [
"Reads",
"timeseries",
"from",
"a",
"file",
".",
"Assumes",
"that",
"file",
"has",
"a",
"single",
"double",
"value",
"on",
"every",
"line",
".",
"Assigned",
"timestamps",
"are",
"the",
"line",
"numbers",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L54-L67 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java | LoadBalancersInner.beginDelete | public void beginDelete(String resourceGroupName, String loadBalancerName) {
"""
Deletes the specified load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentException thrown if parameters fail the validation
@thro... | java | public void beginDelete(String resourceGroupName, String loadBalancerName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBalancerName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
"."... | Deletes the specified load balancer.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all ... | [
"Deletes",
"the",
"specified",
"load",
"balancer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java#L191-L193 |
GumTreeDiff/gumtree | core/src/main/java/com/github/gumtreediff/tree/TreeContext.java | TreeContext.getMetadata | public Object getMetadata(ITree node, String key) {
"""
Get a local metadata, if available. Otherwise get a global metadata.
There is no way to know if the metadata is really null or does not exists.
@param key of metadata
@return the metadata or null if not found
"""
Object metadata;
if (... | java | public Object getMetadata(ITree node, String key) {
Object metadata;
if (node == null || (metadata = node.getMetadata(key)) == null)
return getMetadata(key);
return metadata;
} | [
"public",
"Object",
"getMetadata",
"(",
"ITree",
"node",
",",
"String",
"key",
")",
"{",
"Object",
"metadata",
";",
"if",
"(",
"node",
"==",
"null",
"||",
"(",
"metadata",
"=",
"node",
".",
"getMetadata",
"(",
"key",
")",
")",
"==",
"null",
")",
"ret... | Get a local metadata, if available. Otherwise get a global metadata.
There is no way to know if the metadata is really null or does not exists.
@param key of metadata
@return the metadata or null if not found | [
"Get",
"a",
"local",
"metadata",
"if",
"available",
".",
"Otherwise",
"get",
"a",
"global",
"metadata",
".",
"There",
"is",
"no",
"way",
"to",
"know",
"if",
"the",
"metadata",
"is",
"really",
"null",
"or",
"does",
"not",
"exists",
"."
] | train | https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/tree/TreeContext.java#L83-L88 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UISelectMany.java | UISelectMany.countElementOccurrence | private static int countElementOccurrence(Object element, Object[] array) {
"""
<p>Return the number of occurrances of a particular element in the
array.</p>
@param element object whose occurrance is to be counted in the array.
@param array object representing the old value of this component.
"""
... | java | private static int countElementOccurrence(Object element, Object[] array) {
int count = 0;
for ( int i= 0; i < array.length; ++i ) {
Object arrayElement = array[i];
if (arrayElement != null && element != null) {
if (arrayElement.equals(element)) {
... | [
"private",
"static",
"int",
"countElementOccurrence",
"(",
"Object",
"element",
",",
"Object",
"[",
"]",
"array",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"++",
"i",
")",... | <p>Return the number of occurrances of a particular element in the
array.</p>
@param element object whose occurrance is to be counted in the array.
@param array object representing the old value of this component. | [
"<p",
">",
"Return",
"the",
"number",
"of",
"occurrances",
"of",
"a",
"particular",
"element",
"in",
"the",
"array",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UISelectMany.java#L495-L508 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/XMLFilterBase.java | XMLFilterBase.startElement | public void startElement (String uri, String localName)
throws SAXException {
"""
Start a new element without a qname or attributes.
<p>This method will provide a default empty attribute
list and an empty string for the qualified name. It invokes
{@link #startElement(String, String, String, Attributes)}
... | java | public void startElement (String uri, String localName)
throws SAXException
{
startElement(uri, localName, "", EMPTY_ATTS);
} | [
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"throws",
"SAXException",
"{",
"startElement",
"(",
"uri",
",",
"localName",
",",
"\"\"",
",",
"EMPTY_ATTS",
")",
";",
"}"
] | Start a new element without a qname or attributes.
<p>This method will provide a default empty attribute
list and an empty string for the qualified name. It invokes
{@link #startElement(String, String, String, Attributes)}
directly.</p>
@param uri The element's Namespace URI.
@param localName The element's local name... | [
"Start",
"a",
"new",
"element",
"without",
"a",
"qname",
"or",
"attributes",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/XMLFilterBase.java#L168-L172 |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/laconic/LaconicExplanationGeneratorBasedOnOPlus.java | LaconicExplanationGeneratorBasedOnOPlus.getExplanations | public Set<Explanation<OWLAxiom>> getExplanations(OWLAxiom entailment) throws ExplanationException {
"""
Gets explanations for an entailment. All explanations for the entailment will be returned.
@param entailment The entailment for which explanations will be generated.
@return A set containing all of the expla... | java | public Set<Explanation<OWLAxiom>> getExplanations(OWLAxiom entailment) throws ExplanationException {
return getExplanations(entailment, Integer.MAX_VALUE);
} | [
"public",
"Set",
"<",
"Explanation",
"<",
"OWLAxiom",
">",
">",
"getExplanations",
"(",
"OWLAxiom",
"entailment",
")",
"throws",
"ExplanationException",
"{",
"return",
"getExplanations",
"(",
"entailment",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}"
] | Gets explanations for an entailment. All explanations for the entailment will be returned.
@param entailment The entailment for which explanations will be generated.
@return A set containing all of the explanations. The set will be empty if the entailment does not hold.
@throws org.semanticweb.owl.explanation.api.Exp... | [
"Gets",
"explanations",
"for",
"an",
"entailment",
".",
"All",
"explanations",
"for",
"the",
"entailment",
"will",
"be",
"returned",
"."
] | train | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/laconic/LaconicExplanationGeneratorBasedOnOPlus.java#L47-L49 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java | RouteProcessorThreadListener.onMilestoneTrigger | @Override
public void onMilestoneTrigger(List<Milestone> triggeredMilestones, RouteProgress routeProgress) {
"""
With each valid and successful rawLocation update, this will get called once the work on the
navigation engine thread has finished. Depending on whether or not a milestone gets triggered
or not, the... | java | @Override
public void onMilestoneTrigger(List<Milestone> triggeredMilestones, RouteProgress routeProgress) {
for (Milestone milestone : triggeredMilestones) {
String instruction = buildInstructionString(routeProgress, milestone);
eventDispatcher.onMilestoneEvent(routeProgress, instruction, milestone);... | [
"@",
"Override",
"public",
"void",
"onMilestoneTrigger",
"(",
"List",
"<",
"Milestone",
">",
"triggeredMilestones",
",",
"RouteProgress",
"routeProgress",
")",
"{",
"for",
"(",
"Milestone",
"milestone",
":",
"triggeredMilestones",
")",
"{",
"String",
"instruction",
... | With each valid and successful rawLocation update, this will get called once the work on the
navigation engine thread has finished. Depending on whether or not a milestone gets triggered
or not, the navigation event dispatcher will be called to notify the developer. | [
"With",
"each",
"valid",
"and",
"successful",
"rawLocation",
"update",
"this",
"will",
"get",
"called",
"once",
"the",
"work",
"on",
"the",
"navigation",
"engine",
"thread",
"has",
"finished",
".",
"Depending",
"on",
"whether",
"or",
"not",
"a",
"milestone",
... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java#L42-L48 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONObject.java | JSONObject.getDouble | public double getDouble(String key, double def) {
"""
get double value.
@param key key.
@param def default value.
@return value or default value.
"""
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.doubleValue() : def;
} | java | public double getDouble(String key, double def) {
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.doubleValue() : def;
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"def",
")",
"{",
"Object",
"tmp",
"=",
"objectMap",
".",
"get",
"(",
"key",
")",
";",
"return",
"tmp",
"!=",
"null",
"&&",
"tmp",
"instanceof",
"Number",
"?",
"(",
"(",
"Number",
"... | get double value.
@param key key.
@param def default value.
@return value or default value. | [
"get",
"double",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONObject.java#L102-L106 |
spockframework/spock | spock-core/src/main/java/org/spockframework/gentyref/GenericTypeReflector.java | GenericTypeReflector.getTypeParameter | public static Type getTypeParameter(Type type, TypeVariable<? extends Class<?>> variable) {
"""
Gets the type parameter for a given type that is the value for a given type variable.
For example, with <tt>class StringList implements List<String></tt>,
<tt>getTypeParameter(StringList.class, Collection.class.... | java | public static Type getTypeParameter(Type type, TypeVariable<? extends Class<?>> variable) {
Class<?> clazz = variable.getGenericDeclaration();
Type superType = getExactSuperType(type, clazz);
if (superType instanceof ParameterizedType) {
int index = Arrays.asList(clazz.getTypeParameters()).indexOf(variable);
... | [
"public",
"static",
"Type",
"getTypeParameter",
"(",
"Type",
"type",
",",
"TypeVariable",
"<",
"?",
"extends",
"Class",
"<",
"?",
">",
">",
"variable",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"variable",
".",
"getGenericDeclaration",
"(",
")",
";... | Gets the type parameter for a given type that is the value for a given type variable.
For example, with <tt>class StringList implements List<String></tt>,
<tt>getTypeParameter(StringList.class, Collection.class.getTypeParameters()[0])</tt>
returns <tt>String</tt>.
@param type The type to inspect.
@param variable... | [
"Gets",
"the",
"type",
"parameter",
"for",
"a",
"given",
"type",
"that",
"is",
"the",
"value",
"for",
"a",
"given",
"type",
"variable",
".",
"For",
"example",
"with",
"<tt",
">",
"class",
"StringList",
"implements",
"List<",
";",
"String>",
";",
"<",
... | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/gentyref/GenericTypeReflector.java#L143-L152 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_accessPoint_accessPointId_customerNetwork_POST | public ArrayList<OvhTask> serviceName_accessPoint_accessPointId_customerNetwork_POST(String serviceName, Long accessPointId, String network) throws IOException {
"""
Add a new network
REST: POST /horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork
@param network [required] The private network... | java | public ArrayList<OvhTask> serviceName_accessPoint_accessPointId_customerNetwork_POST(String serviceName, Long accessPointId, String network) throws IOException {
String qPath = "/horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork";
StringBuilder sb = path(qPath, serviceName, accessPointId);
Has... | [
"public",
"ArrayList",
"<",
"OvhTask",
">",
"serviceName_accessPoint_accessPointId_customerNetwork_POST",
"(",
"String",
"serviceName",
",",
"Long",
"accessPointId",
",",
"String",
"network",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/horizonView/{serv... | Add a new network
REST: POST /horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork
@param network [required] The private network you want to reach.
@param serviceName [required] Domain of the service
@param accessPointId [required] Pool id | [
"Add",
"a",
"new",
"network"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L104-L111 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java | MarginalLogLikelihood.getFgLat | public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
"""
Get a copy of the factor graph where the predicted variables are clamped.
@param fgLatPred The original factor graph.
@param goldConfig The assignment to the predicted variables.
@return The clamped factor graph.
"""
... | java | public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
// TODO: instead, have this just look at whether or not the var is in the gold config
List<Var> predictedVars = VarSet.getVarsOfType(fgLatPred.getVars(), VarType.PREDICTED);
VarConfig predConfig = goldConfig.getInt... | [
"public",
"static",
"FactorGraph",
"getFgLat",
"(",
"FactorGraph",
"fgLatPred",
",",
"VarConfig",
"goldConfig",
")",
"{",
"// TODO: instead, have this just look at whether or not the var is in the gold config",
"List",
"<",
"Var",
">",
"predictedVars",
"=",
"VarSet",
".",
"... | Get a copy of the factor graph where the predicted variables are clamped.
@param fgLatPred The original factor graph.
@param goldConfig The assignment to the predicted variables.
@return The clamped factor graph. | [
"Get",
"a",
"copy",
"of",
"the",
"factor",
"graph",
"where",
"the",
"predicted",
"variables",
"are",
"clamped",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java#L175-L182 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/engine/TemplateSourceImpl.java | TemplateSourceImpl.sourceSignatureChanged | protected boolean sourceSignatureChanged(String tName, Compiler compiler)
throws IOException {
"""
parses the tea source file and compares the signature to the signature of the current class file
in the TemplateRepository
@return true if tea source signature is different than the class file signature o... | java | protected boolean sourceSignatureChanged(String tName, Compiler compiler)
throws IOException {
TemplateRepository tRepo = TemplateRepository.getInstance();
TemplateInfo templateInfo = tRepo.getTemplateInfo(tName);
if(null == templateInfo) {
return false;
}
C... | [
"protected",
"boolean",
"sourceSignatureChanged",
"(",
"String",
"tName",
",",
"Compiler",
"compiler",
")",
"throws",
"IOException",
"{",
"TemplateRepository",
"tRepo",
"=",
"TemplateRepository",
".",
"getInstance",
"(",
")",
";",
"TemplateInfo",
"templateInfo",
"=",
... | parses the tea source file and compares the signature to the signature of the current class file
in the TemplateRepository
@return true if tea source signature is different than the class file signature or class file does not exist | [
"parses",
"the",
"tea",
"source",
"file",
"and",
"compares",
"the",
"signature",
"to",
"the",
"signature",
"of",
"the",
"current",
"class",
"file",
"in",
"the",
"TemplateRepository"
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/engine/TemplateSourceImpl.java#L853-L868 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/hc/special/HCSpecialNodeHandler.java | HCSpecialNodeHandler.recursiveExtractAndRemoveOutOfBandNodes | public static void recursiveExtractAndRemoveOutOfBandNodes (@Nonnull final IHCNode aParentElement,
@Nonnull final List <IHCNode> aTargetList) {
"""
Extract all out-of-band child nodes for the passed element. Must be called
after the element is finished... | java | public static void recursiveExtractAndRemoveOutOfBandNodes (@Nonnull final IHCNode aParentElement,
@Nonnull final List <IHCNode> aTargetList)
{
ValueEnforcer.notNull (aParentElement, "ParentElement");
ValueEnforcer.notNull (aTargetList, "TargetList... | [
"public",
"static",
"void",
"recursiveExtractAndRemoveOutOfBandNodes",
"(",
"@",
"Nonnull",
"final",
"IHCNode",
"aParentElement",
",",
"@",
"Nonnull",
"final",
"List",
"<",
"IHCNode",
">",
"aTargetList",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aParentElemen... | Extract all out-of-band child nodes for the passed element. Must be called
after the element is finished! All out-of-band nodes are detached from
their parent so that the original node can be reused. Wrapped nodes where
the inner node is an out of band node are also considered and removed.
@param aParentElement
The pa... | [
"Extract",
"all",
"out",
"-",
"of",
"-",
"band",
"child",
"nodes",
"for",
"the",
"passed",
"element",
".",
"Must",
"be",
"called",
"after",
"the",
"element",
"is",
"finished!",
"All",
"out",
"-",
"of",
"-",
"band",
"nodes",
"are",
"detached",
"from",
"... | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/special/HCSpecialNodeHandler.java#L158-L166 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DecimalStyle.java | DecimalStyle.withDecimalSeparator | public DecimalStyle withDecimalSeparator(char decimalSeparator) {
"""
Returns a copy of the info with a new character that represents the decimal point.
<p>
The character used to represent a decimal point may vary by culture.
This method specifies the character to use.
@param decimalSeparator the character ... | java | public DecimalStyle withDecimalSeparator(char decimalSeparator) {
if (decimalSeparator == this.decimalSeparator) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} | [
"public",
"DecimalStyle",
"withDecimalSeparator",
"(",
"char",
"decimalSeparator",
")",
"{",
"if",
"(",
"decimalSeparator",
"==",
"this",
".",
"decimalSeparator",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"DecimalStyle",
"(",
"zeroDigit",
",",
"posi... | Returns a copy of the info with a new character that represents the decimal point.
<p>
The character used to represent a decimal point may vary by culture.
This method specifies the character to use.
@param decimalSeparator the character for the decimal point
@return a copy with a new character that represents the d... | [
"Returns",
"a",
"copy",
"of",
"the",
"info",
"with",
"a",
"new",
"character",
"that",
"represents",
"the",
"decimal",
"point",
".",
"<p",
">",
"The",
"character",
"used",
"to",
"represent",
"a",
"decimal",
"point",
"may",
"vary",
"by",
"culture",
".",
"T... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DecimalStyle.java#L303-L308 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotateAround | public Matrix4x3d rotateAround(Quaterniondc quat, double ox, double oy, double oz) {
"""
Apply the rotation transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will... | java | public Matrix4x3d rotateAround(Quaterniondc quat, double ox, double oy, double oz) {
return rotateAround(quat, ox, oy, oz, this);
} | [
"public",
"Matrix4x3d",
"rotateAround",
"(",
"Quaterniondc",
"quat",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
")",
"{",
"return",
"rotateAround",
"(",
"quat",
",",
"ox",
",",
"oy",
",",
"oz",
",",
"this",
")",
";",
"}"
] | Apply the rotation transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the negative axi... | [
"Apply",
"the",
"rotation",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaterniondc",
"}",
"to",
"this",
"matrix",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",
">",
"as",
"the",
"rotation",
"origin",
".",
"<... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L3348-L3350 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.registerLibertyProcessService | private void registerLibertyProcessService(BundleContext systemBundleCtx, BootstrapConfig config) {
"""
Register the command line service with the OSGi framework service
registry. This gives service consumers access to the command line used to
launch the platform/runtime.
@param systemBundleCtx
The framework... | java | private void registerLibertyProcessService(BundleContext systemBundleCtx, BootstrapConfig config) {
List<String> cmds = config.getCmdArgs();
if (cmds == null)
cmds = new ArrayList<String>();
LibertyProcessImpl processImpl = new LibertyProcessImpl(cmds, this);
systemBundleCtx... | [
"private",
"void",
"registerLibertyProcessService",
"(",
"BundleContext",
"systemBundleCtx",
",",
"BootstrapConfig",
"config",
")",
"{",
"List",
"<",
"String",
">",
"cmds",
"=",
"config",
".",
"getCmdArgs",
"(",
")",
";",
"if",
"(",
"cmds",
"==",
"null",
")",
... | Register the command line service with the OSGi framework service
registry. This gives service consumers access to the command line used to
launch the platform/runtime.
@param systemBundleCtx
The framework system bundle context
@param config
The active bootstrap config | [
"Register",
"the",
"command",
"line",
"service",
"with",
"the",
"OSGi",
"framework",
"service",
"registry",
".",
"This",
"gives",
"service",
"consumers",
"access",
"to",
"the",
"command",
"line",
"used",
"to",
"launch",
"the",
"platform",
"/",
"runtime",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L472-L479 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.addDataSerieToScatterPlot | public void addDataSerieToScatterPlot(String scatterID, double[][] dataSerie) {
"""
Sets the data for the scatterPlot.
Should be used only the first time. Use
updateDataSerieOnScaterPlot to change the data
@param scatterID
@param dataSerie the data. The first dimension MUST BE 2 (double[2][whatever_int])
... | java | public void addDataSerieToScatterPlot(String scatterID, double[][] dataSerie){
if (this.scatterPlots.containsKey(scatterID)) {
this.scatterPlotsData.put(scatterID, dataSerie);
this.scatterPlots.get(scatterID).addSeries((double[][])this.scatterPlotsData.get(scatterID), scatterID, null)... | [
"public",
"void",
"addDataSerieToScatterPlot",
"(",
"String",
"scatterID",
",",
"double",
"[",
"]",
"[",
"]",
"dataSerie",
")",
"{",
"if",
"(",
"this",
".",
"scatterPlots",
".",
"containsKey",
"(",
"scatterID",
")",
")",
"{",
"this",
".",
"scatterPlotsData",... | Sets the data for the scatterPlot.
Should be used only the first time. Use
updateDataSerieOnScaterPlot to change the data
@param scatterID
@param dataSerie the data. The first dimension MUST BE 2 (double[2][whatever_int]) | [
"Sets",
"the",
"data",
"for",
"the",
"scatterPlot",
".",
"Should",
"be",
"used",
"only",
"the",
"first",
"time",
".",
"Use",
"updateDataSerieOnScaterPlot",
"to",
"change",
"the",
"data"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L308-L313 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/StringUtils.java | StringUtils.join | @SuppressWarnings( {
"""
Assemble all elements in map to a string.
@param value map to serializer
@param delim entry delimiter
@return concatenated map
""" "rawtypes", "unchecked" })
public static String join(final Map value, final String delim) {
if (value == null || value.isEmpty()) {
... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static String join(final Map value, final String delim) {
if (value == null || value.isEmpty()) {
return "";
}
final StringBuilder buf = new StringBuilder();
for (final Iterator<Map.Entry<String, String>> i = value.ent... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"String",
"join",
"(",
"final",
"Map",
"value",
",",
"final",
"String",
"delim",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"isEmp... | Assemble all elements in map to a string.
@param value map to serializer
@param delim entry delimiter
@return concatenated map | [
"Assemble",
"all",
"elements",
"in",
"map",
"to",
"a",
"string",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L70-L84 |
line/line-bot-sdk-java | line-bot-servlet/src/main/java/com/linecorp/bot/servlet/LineBotCallbackRequestParser.java | LineBotCallbackRequestParser.handle | public CallbackRequest handle(HttpServletRequest req) throws LineBotCallbackException, IOException {
"""
Parse request.
@param req HTTP servlet request.
@return Parsed result. If there's an error, this method sends response.
@throws LineBotCallbackException There's an error around signature.
"""
... | java | public CallbackRequest handle(HttpServletRequest req) throws LineBotCallbackException, IOException {
// validate signature
String signature = req.getHeader("X-Line-Signature");
final byte[] json = ByteStreams.toByteArray(req.getInputStream());
return handle(signature, new String(json, St... | [
"public",
"CallbackRequest",
"handle",
"(",
"HttpServletRequest",
"req",
")",
"throws",
"LineBotCallbackException",
",",
"IOException",
"{",
"// validate signature",
"String",
"signature",
"=",
"req",
".",
"getHeader",
"(",
"\"X-Line-Signature\"",
")",
";",
"final",
"... | Parse request.
@param req HTTP servlet request.
@return Parsed result. If there's an error, this method sends response.
@throws LineBotCallbackException There's an error around signature. | [
"Parse",
"request",
"."
] | train | https://github.com/line/line-bot-sdk-java/blob/d6d30b19d5b90c2d3269eb9d6f88fe76fb6fcb55/line-bot-servlet/src/main/java/com/linecorp/bot/servlet/LineBotCallbackRequestParser.java#L58-L63 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java | GenericQueryRequest.jsonQuery | public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String username, String password, InetAddress targetNode, String contextId, String statement) {
"""
Create a {@link GenericQueryRequest} and mark it as containing a full N1QL query in Json form
(including additional query parameters like... | java | public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String username, String password, InetAddress targetNode, String contextId, String statement) {
return new GenericQueryRequest(jsonQuery, true, bucket, username, password, targetNode, contextId,
statement);
} | [
"public",
"static",
"GenericQueryRequest",
"jsonQuery",
"(",
"String",
"jsonQuery",
",",
"String",
"bucket",
",",
"String",
"username",
",",
"String",
"password",
",",
"InetAddress",
"targetNode",
",",
"String",
"contextId",
",",
"String",
"statement",
")",
"{",
... | Create a {@link GenericQueryRequest} and mark it as containing a full N1QL query in Json form
(including additional query parameters like named arguments, etc...).
The simplest form of such a query is a single statement encapsulated in a json query object:
<pre>{"statement":"SELECT * FROM default"}</pre>.
@param json... | [
"Create",
"a",
"{",
"@link",
"GenericQueryRequest",
"}",
"and",
"mark",
"it",
"as",
"containing",
"a",
"full",
"N1QL",
"query",
"in",
"Json",
"form",
"(",
"including",
"additional",
"query",
"parameters",
"like",
"named",
"arguments",
"etc",
"...",
")",
"."
... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java#L184-L187 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.lookAtLH | public Matrix4x3f lookAtLH(float eyeX, float eyeY, float eyeZ,
float centerX, float centerY, float centerZ,
float upX, float upY, float upZ, Matrix4x3f dest) {
"""
Apply a "lookat" transformation to this matrix for a left-handed coordinate system,
that... | java | public Matrix4x3f lookAtLH(float eyeX, float eyeY, float eyeZ,
float centerX, float centerY, float centerZ,
float upX, float upY, float upZ, Matrix4x3f dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setLookAtLH(eyeX, eyeY,... | [
"public",
"Matrix4x3f",
"lookAtLH",
"(",
"float",
"eyeX",
",",
"float",
"eyeY",
",",
"float",
"eyeZ",
",",
"float",
"centerX",
",",
"float",
"centerY",
",",
"float",
"centerZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
",",
"Matrix4x... | Apply a "lookat" transformation to this matrix for a left-handed coordinate system,
that aligns <code>+z</code> with <code>center - eye</code> and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix,
then the new matrix will be <code>M * L</code>... | [
"Apply",
"a",
"lookat",
"transformation",
"to",
"this",
"matrix",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"<code",
">",
"+",
"z<",
"/",
"code",
">",
"with",
"<code",
">",
"center",
"-",
"eye<",
"/",
"code",
">",
"an... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L6688-L6694 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBUpdate.java | DBUpdate.pullAll | public static Builder pullAll(String field, Object... values) {
"""
Remove all occurances of the values from the array at field
@param field The field to remove the values from
@param values The values to remove
@return this object
"""
return new Builder().pullAll(field, values);
} | java | public static Builder pullAll(String field, Object... values) {
return new Builder().pullAll(field, values);
} | [
"public",
"static",
"Builder",
"pullAll",
"(",
"String",
"field",
",",
"Object",
"...",
"values",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"pullAll",
"(",
"field",
",",
"values",
")",
";",
"}"
] | Remove all occurances of the values from the array at field
@param field The field to remove the values from
@param values The values to remove
@return this object | [
"Remove",
"all",
"occurances",
"of",
"the",
"values",
"from",
"the",
"array",
"at",
"field"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBUpdate.java#L187-L189 |
google/closure-compiler | src/com/google/javascript/jscomp/RemoveUnusedCode.java | RemoveUnusedCode.traverseFunction | private void traverseFunction(Node function, Scope parentScope) {
"""
Traverses a function
ES6 scopes of a function include the parameter scope and the body scope
of the function.
Note that CATCH blocks also create a new scope, but only for the
catch variable. Declarations within the block actually belong ... | java | private void traverseFunction(Node function, Scope parentScope) {
checkState(function.getChildCount() == 3, function);
checkState(function.isFunction(), function);
final Node paramlist = NodeUtil.getFunctionParameters(function);
final Node body = function.getLastChild();
checkState(body.getNext() =... | [
"private",
"void",
"traverseFunction",
"(",
"Node",
"function",
",",
"Scope",
"parentScope",
")",
"{",
"checkState",
"(",
"function",
".",
"getChildCount",
"(",
")",
"==",
"3",
",",
"function",
")",
";",
"checkState",
"(",
"function",
".",
"isFunction",
"(",... | Traverses a function
ES6 scopes of a function include the parameter scope and the body scope
of the function.
Note that CATCH blocks also create a new scope, but only for the
catch variable. Declarations within the block actually belong to the
enclosing scope. Because we don't remove catch variables, there's
no need ... | [
"Traverses",
"a",
"function"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RemoveUnusedCode.java#L1295-L1325 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/FileUtils.java | FileUtils.isSubPath | public static boolean isSubPath(File parent, File child) throws IOException {
"""
*
Check if child path is child of parent path.
@param parent Expected parent path.
@param child Expected child path.
@return If child path is child of parent path.
@throws IOException
"""
String childStr = child.getCanon... | java | public static boolean isSubPath(File parent, File child) throws IOException {
String childStr = child.getCanonicalPath();
String parentStr = parent.getCanonicalPath();
return childStr.startsWith(parentStr);
} | [
"public",
"static",
"boolean",
"isSubPath",
"(",
"File",
"parent",
",",
"File",
"child",
")",
"throws",
"IOException",
"{",
"String",
"childStr",
"=",
"child",
".",
"getCanonicalPath",
"(",
")",
";",
"String",
"parentStr",
"=",
"parent",
".",
"getCanonicalPath... | *
Check if child path is child of parent path.
@param parent Expected parent path.
@param child Expected child path.
@return If child path is child of parent path.
@throws IOException | [
"*",
"Check",
"if",
"child",
"path",
"is",
"child",
"of",
"parent",
"path",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/FileUtils.java#L45-L50 |
lets-blade/blade | src/main/java/com/blade/kit/EncryptKit.java | EncryptKit.hmacSHA512 | public static String hmacSHA512(String data, String key) {
"""
HmacSHA512加密
@param data 明文字符串
@param key 秘钥
@return 16进制密文
"""
return hmacSHA512(data.getBytes(), key.getBytes());
} | java | public static String hmacSHA512(String data, String key) {
return hmacSHA512(data.getBytes(), key.getBytes());
} | [
"public",
"static",
"String",
"hmacSHA512",
"(",
"String",
"data",
",",
"String",
"key",
")",
"{",
"return",
"hmacSHA512",
"(",
"data",
".",
"getBytes",
"(",
")",
",",
"key",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | HmacSHA512加密
@param data 明文字符串
@param key 秘钥
@return 16进制密文 | [
"HmacSHA512加密"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/EncryptKit.java#L393-L395 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java | IPAddress.toNormalizedString | public static void toNormalizedString(IPAddressValueProvider provider, StringBuilder builder) {
"""
Allows for the creation of a normalized string without creating a full IP address object first.
Instead you can implement the {@link IPAddressValueProvider} interface in whatever way is most efficient.
The string ... | java | public static void toNormalizedString(IPAddressValueProvider provider, StringBuilder builder) {
IPVersion version = provider.getIPVersion();
if(version.isIPv4()) {
toNormalizedString(IPv4Address.defaultIpv4Network().getPrefixConfiguration(), provider.getValues(), provider.getUpperValues(), provider.getPrefixLeng... | [
"public",
"static",
"void",
"toNormalizedString",
"(",
"IPAddressValueProvider",
"provider",
",",
"StringBuilder",
"builder",
")",
"{",
"IPVersion",
"version",
"=",
"provider",
".",
"getIPVersion",
"(",
")",
";",
"if",
"(",
"version",
".",
"isIPv4",
"(",
")",
... | Allows for the creation of a normalized string without creating a full IP address object first.
Instead you can implement the {@link IPAddressValueProvider} interface in whatever way is most efficient.
The string is appended to the provided {@link StringBuilder} instance.
@param provider
@param builder | [
"Allows",
"for",
"the",
"creation",
"of",
"a",
"normalized",
"string",
"without",
"creating",
"a",
"full",
"IP",
"address",
"object",
"first",
".",
"Instead",
"you",
"can",
"implement",
"the",
"{",
"@link",
"IPAddressValueProvider",
"}",
"interface",
"in",
"wh... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java#L606-L615 |
jOOQ/jOOR | jOOR/src/main/java/org/joor/Reflect.java | Reflect.exactMethod | private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
"""
Searches a method with the exact same signature as desired.
<p>
If a public method is found in the class hierarchy, this method is returned.
Otherwise a private method with the exact same signature is returned.
If no e... | java | private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
Class<?> t = type();
// first priority: find a public method with exact signature match in class hierarchy
try {
return t.getMethod(name, types);
}
// second priority: find a pr... | [
"private",
"Method",
"exactMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"throws",
"NoSuchMethodException",
"{",
"Class",
"<",
"?",
">",
"t",
"=",
"type",
"(",
")",
";",
"// first priority: find a public method with exact... | Searches a method with the exact same signature as desired.
<p>
If a public method is found in the class hierarchy, this method is returned.
Otherwise a private method with the exact same signature is returned.
If no exact match could be found, we let the {@code NoSuchMethodException} pass through. | [
"Searches",
"a",
"method",
"with",
"the",
"exact",
"same",
"signature",
"as",
"desired",
".",
"<p",
">",
"If",
"a",
"public",
"method",
"is",
"found",
"in",
"the",
"class",
"hierarchy",
"this",
"method",
"is",
"returned",
".",
"Otherwise",
"a",
"private",
... | train | https://github.com/jOOQ/jOOR/blob/40b42be12ecc9939560ff86921bbc57c99a21b85/jOOR/src/main/java/org/joor/Reflect.java#L585-L607 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/OnSelectHandler.java | OnSelectHandler.init | public void init(Record record, RecordOwner recordOwner, Record recordToSync, boolean bUpdateOnSelect, int iEventToTrigger) {
"""
OnSelectHandler - Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param recordToSync The record to synchronize with this one.
@pa... | java | public void init(Record record, RecordOwner recordOwner, Record recordToSync, boolean bUpdateOnSelect, int iEventToTrigger)
{
super.init(record);
m_recordOwner = recordOwner;
m_recordToSync = recordToSync;
m_bUpdateOnSelect = bUpdateOnSelect;
m_iEventToTrigger = iEventToTrigg... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"RecordOwner",
"recordOwner",
",",
"Record",
"recordToSync",
",",
"boolean",
"bUpdateOnSelect",
",",
"int",
"iEventToTrigger",
")",
"{",
"super",
".",
"init",
"(",
"record",
")",
";",
"m_recordOwner",
"="... | OnSelectHandler - Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param recordToSync The record to synchronize with this one.
@param bUpdateOnSelect If true, update or add a record in progress before syncing this record. | [
"OnSelectHandler",
"-",
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/OnSelectHandler.java#L102-L109 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.createPatchElement | protected static PatchElement createPatchElement(final PatchEntry entry, String patchId, final List<ContentModification> modifications) {
"""
Copy a patch element
@param entry the patch entry
@param patchId the patch id for the element
@param modifications the element modifications
@return the ... | java | protected static PatchElement createPatchElement(final PatchEntry entry, String patchId, final List<ContentModification> modifications) {
final PatchElement patchElement = entry.element;
final PatchElementImpl element = new PatchElementImpl(patchId);
element.setProvider(patchElement.getProvider(... | [
"protected",
"static",
"PatchElement",
"createPatchElement",
"(",
"final",
"PatchEntry",
"entry",
",",
"String",
"patchId",
",",
"final",
"List",
"<",
"ContentModification",
">",
"modifications",
")",
"{",
"final",
"PatchElement",
"patchElement",
"=",
"entry",
".",
... | Copy a patch element
@param entry the patch entry
@param patchId the patch id for the element
@param modifications the element modifications
@return the new patch element | [
"Copy",
"a",
"patch",
"element"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L960-L968 |
threerings/nenya | core/src/main/java/com/threerings/media/animation/AnimationSequencer.java | AnimationSequencer.addAnimation | public void addAnimation (Animation anim, long delta, Runnable completionAction) {
"""
Adds the supplied animation to the sequence with the given parameters. Note that care
should be taken if this is called after the animation sequence has begun firing animations.
Do not add new animations after the final animat... | java | public void addAnimation (Animation anim, long delta, Runnable completionAction)
{
// sanity check
if (_finished) {
throw new IllegalStateException("Animation added to finished sequencer");
}
// if this guy is triggering on a previous animation, grab that
// good... | [
"public",
"void",
"addAnimation",
"(",
"Animation",
"anim",
",",
"long",
"delta",
",",
"Runnable",
"completionAction",
")",
"{",
"// sanity check",
"if",
"(",
"_finished",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Animation added to finished sequencer... | Adds the supplied animation to the sequence with the given parameters. Note that care
should be taken if this is called after the animation sequence has begun firing animations.
Do not add new animations after the final animation in the sequence has been started or you
run the risk of attempting to add an animation to ... | [
"Adds",
"the",
"supplied",
"animation",
"to",
"the",
"sequence",
"with",
"the",
"given",
"parameters",
".",
"Note",
"that",
"care",
"should",
"be",
"taken",
"if",
"this",
"is",
"called",
"after",
"the",
"animation",
"sequence",
"has",
"begun",
"firing",
"ani... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/AnimationSequencer.java#L69-L95 |
lz4/lz4-java | src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java | LZ4DecompressorWithLength.getDecompressedLength | public static int getDecompressedLength(byte[] src, int srcOff) {
"""
Returns the decompressed length of compressed data in <code>src[srcOff:]</code>.
@param src the compressed data
@param srcOff the start offset in src
@return the decompressed length
"""
return (src[srcOff] & 0xFF) | (src[srcOff + 1]... | java | public static int getDecompressedLength(byte[] src, int srcOff) {
return (src[srcOff] & 0xFF) | (src[srcOff + 1] & 0xFF) << 8 | (src[srcOff + 2] & 0xFF) << 16 | src[srcOff + 3] << 24;
} | [
"public",
"static",
"int",
"getDecompressedLength",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOff",
")",
"{",
"return",
"(",
"src",
"[",
"srcOff",
"]",
"&",
"0xFF",
")",
"|",
"(",
"src",
"[",
"srcOff",
"+",
"1",
"]",
"&",
"0xFF",
")",
"<<",
"... | Returns the decompressed length of compressed data in <code>src[srcOff:]</code>.
@param src the compressed data
@param srcOff the start offset in src
@return the decompressed length | [
"Returns",
"the",
"decompressed",
"length",
"of",
"compressed",
"data",
"in",
"<code",
">",
"src",
"[",
"srcOff",
":",
"]",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/lz4/lz4-java/blob/c5ae694a3aa8b33ef87fd0486727a7d1e8f71367/src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java#L49-L51 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Expression.java | Expression.isNot | @NonNull
public Expression isNot(@NonNull Expression expression) {
"""
Create an IS NOT expression that evaluates whether or not the current expression is not
equal to the given expression.
@param expression the expression to compare with the current expression.
@return an IS NOT expression.
"""
... | java | @NonNull
public Expression isNot(@NonNull Expression expression) {
if (expression == null) {
throw new IllegalArgumentException("expression cannot be null.");
}
return new BinaryExpression(this, expression, BinaryExpression.OpType.IsNot);
} | [
"@",
"NonNull",
"public",
"Expression",
"isNot",
"(",
"@",
"NonNull",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expression cannot be null.\"",
")",
";",
"}",
"return... | Create an IS NOT expression that evaluates whether or not the current expression is not
equal to the given expression.
@param expression the expression to compare with the current expression.
@return an IS NOT expression. | [
"Create",
"an",
"IS",
"NOT",
"expression",
"that",
"evaluates",
"whether",
"or",
"not",
"the",
"current",
"expression",
"is",
"not",
"equal",
"to",
"the",
"given",
"expression",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Expression.java#L784-L790 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryBlockchainInfo | public BlockchainInfo queryBlockchainInfo(Collection<Peer> peers, User userContext) throws ProposalException, InvalidArgumentException {
"""
query for chain information
@param peers The peers to try send the request.
@param userContext the user context.
@return a {@link BlockchainInfo} object containing... | java | public BlockchainInfo queryBlockchainInfo(Collection<Peer> peers, User userContext) throws ProposalException, InvalidArgumentException {
checkChannelState();
checkPeers(peers);
User.userContextCheck(userContext);
try {
logger.debug("queryBlockchainInfo to peer " + " on chan... | [
"public",
"BlockchainInfo",
"queryBlockchainInfo",
"(",
"Collection",
"<",
"Peer",
">",
"peers",
",",
"User",
"userContext",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"checkChannelState",
"(",
")",
";",
"checkPeers",
"(",
"peers",
")"... | query for chain information
@param peers The peers to try send the request.
@param userContext the user context.
@return a {@link BlockchainInfo} object containing the chain info requested
@throws InvalidArgumentException
@throws ProposalException | [
"query",
"for",
"chain",
"information"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3130-L3149 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/Util.java | Util.setBlob | private static void setBlob(PreparedStatement ps, int i, Object o, Class<?> cls)
throws SQLException {
"""
Sets a blob parameter for the prepared statement.
@param ps
@param i
@param o
@param cls
@throws SQLException
"""
final InputStream is;
if (o instanceof byte[]) {
... | java | private static void setBlob(PreparedStatement ps, int i, Object o, Class<?> cls)
throws SQLException {
final InputStream is;
if (o instanceof byte[]) {
is = new ByteArrayInputStream((byte[]) o);
} | [
"private",
"static",
"void",
"setBlob",
"(",
"PreparedStatement",
"ps",
",",
"int",
"i",
",",
"Object",
"o",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"throws",
"SQLException",
"{",
"final",
"InputStream",
"is",
";",
"if",
"(",
"o",
"instanceof",
"byte",
... | Sets a blob parameter for the prepared statement.
@param ps
@param i
@param o
@param cls
@throws SQLException | [
"Sets",
"a",
"blob",
"parameter",
"for",
"the",
"prepared",
"statement",
"."
] | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/Util.java#L808-L813 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java | Node.modifySubscriptionsAsOwner | public PubSub modifySubscriptionsAsOwner(List<Subscription> changedSubs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Modify the subscriptions for this PubSub node as owner.
<p>
Note that the subscriptions are _not_ checked against the existing subscri... | java | public PubSub modifySubscriptionsAsOwner(List<Subscription> changedSubs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub pubSub = createPubsubPacket(Type.set,
new SubscriptionsExtension(SubscriptionsNamespace.owner, getId(), changedSubs))... | [
"public",
"PubSub",
"modifySubscriptionsAsOwner",
"(",
"List",
"<",
"Subscription",
">",
"changedSubs",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"PubSub",
"pubSub",
"=",
"createPubsubP... | Modify the subscriptions for this PubSub node as owner.
<p>
Note that the subscriptions are _not_ checked against the existing subscriptions
since these are not cached (and indeed could change asynchronously)
</p>
@param changedSubs subscriptions that have changed
@return <code>null</code> or a PubSub stanza with addi... | [
"Modify",
"the",
"subscriptions",
"for",
"this",
"PubSub",
"node",
"as",
"owner",
".",
"<p",
">",
"Note",
"that",
"the",
"subscriptions",
"are",
"_not_",
"checked",
"against",
"the",
"existing",
"subscriptions",
"since",
"these",
"are",
"not",
"cached",
"(",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L240-L246 |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java | SREutils.getSreSpecificData | @Pure
public static <S> S getSreSpecificData(SRESpecificDataContainer container, Class<S> type) {
"""
Replies the data associated to the container by the SRE.
@param <S> the type of the data.
@param type the type of the data.
@param container the container.
@return the SRE-specific data.
"""
assert co... | java | @Pure
public static <S> S getSreSpecificData(SRESpecificDataContainer container, Class<S> type) {
assert container != null;
return container.$getSreSpecificData(type);
} | [
"@",
"Pure",
"public",
"static",
"<",
"S",
">",
"S",
"getSreSpecificData",
"(",
"SRESpecificDataContainer",
"container",
",",
"Class",
"<",
"S",
">",
"type",
")",
"{",
"assert",
"container",
"!=",
"null",
";",
"return",
"container",
".",
"$",
"getSreSpecific... | Replies the data associated to the container by the SRE.
@param <S> the type of the data.
@param type the type of the data.
@param container the container.
@return the SRE-specific data. | [
"Replies",
"the",
"data",
"associated",
"to",
"the",
"container",
"by",
"the",
"SRE",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java#L69-L73 |
mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/Assertions.java | Assertions.notNull | public static <T> void notNull(final String name, final T value) {
"""
Throw IllegalArgumentException if the value is null.
@param name the parameter name.
@param value the value that should not be null.
@param <T> the value type.
@throws IllegalArgumentException if value is null.
"""
if (value ==... | java | public static <T> void notNull(final String name, final T value) {
if (value == null) {
throw new IllegalArgumentException(name + " can not be null");
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"notNull",
"(",
"final",
"String",
"name",
",",
"final",
"T",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"name",
"+",
"\" can not be null\"",
... | Throw IllegalArgumentException if the value is null.
@param name the parameter name.
@param value the value that should not be null.
@param <T> the value type.
@throws IllegalArgumentException if value is null. | [
"Throw",
"IllegalArgumentException",
"if",
"the",
"value",
"is",
"null",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/Assertions.java#L30-L34 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java | ClassUtils.isAssignableFrom | public static boolean isAssignableFrom(Class<?> interfaceClass, Class<?> implementClass) {
"""
The isAssignableFrom method which can cross multiple classloader.
@param interfaceClass 接口类
@param implementClass 实现类
@return 是否指定类型的实现类
@see Class#isAssignableFrom(Class)
"""
if (interfaceClass.isAssig... | java | public static boolean isAssignableFrom(Class<?> interfaceClass, Class<?> implementClass) {
if (interfaceClass.isAssignableFrom(implementClass)) {
return true;
}
// 跨ClassLoader的情况
String interfaceName = interfaceClass.getCanonicalName();
return implementClass.getCanon... | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"interfaceClass",
",",
"Class",
"<",
"?",
">",
"implementClass",
")",
"{",
"if",
"(",
"interfaceClass",
".",
"isAssignableFrom",
"(",
"implementClass",
")",
")",
"{",
"return",
"... | The isAssignableFrom method which can cross multiple classloader.
@param interfaceClass 接口类
@param implementClass 实现类
@return 是否指定类型的实现类
@see Class#isAssignableFrom(Class) | [
"The",
"isAssignableFrom",
"method",
"which",
"can",
"cross",
"multiple",
"classloader",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java#L319-L327 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java | MultiPolygon.fromPolygons | public static MultiPolygon fromPolygons(@NonNull List<Polygon> polygons,
@Nullable BoundingBox bbox) {
"""
Create a new instance of this class by defining a list of {@link Polygon} objects and passing
that list in as a parameter in this method. The Polygons should comply ... | java | public static MultiPolygon fromPolygons(@NonNull List<Polygon> polygons,
@Nullable BoundingBox bbox) {
List<List<List<Point>>> coordinates = new ArrayList<>(polygons.size());
for (Polygon polygon : polygons) {
coordinates.add(polygon.coordinates());
}
retu... | [
"public",
"static",
"MultiPolygon",
"fromPolygons",
"(",
"@",
"NonNull",
"List",
"<",
"Polygon",
">",
"polygons",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"List",
"<",
"List",
"<",
"Point",
">>>",
"coordinates",
"=",
"new",
"Arra... | Create a new instance of this class by defining a list of {@link Polygon} objects and passing
that list in as a parameter in this method. The Polygons should comply with the GeoJson
specifications described in the documentation. Optionally, pass in an instance of a
{@link BoundingBox} which better describes this MultiP... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"Polygon",
"}",
"objects",
"and",
"passing",
"that",
"list",
"in",
"as",
"a",
"parameter",
"in",
"this",
"method",
".",
"The",
"Polygons",
"should... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java#L129-L136 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendRequest | private void sendRequest(String header, byte[] body) throws IOException {
"""
Send the request represented by the given header and optional body.
"""
// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.
byte[] headerBytes = Utils.toBytes(header);
byte[] r... | java | private void sendRequest(String header, byte[] body) throws IOException {
// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.
byte[] headerBytes = Utils.toBytes(header);
byte[] requestBytes = headerBytes;
if (body != null && body.length > 0) {
... | [
"private",
"void",
"sendRequest",
"(",
"String",
"header",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.\r",
"byte",
"[",
"]",
"headerBytes",
"=",
"Utils",
".",
"toByt... | Send the request represented by the given header and optional body. | [
"Send",
"the",
"request",
"represented",
"by",
"the",
"given",
"header",
"and",
"optional",
"body",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L433-L446 |
samskivert/pythagoras | src/main/java/pythagoras/d/Quaternion.java | Quaternion.randomize | public Quaternion randomize (Random rand) {
"""
Sets this to a random rotation obtained from a completely uniform distribution.
"""
// pick angles according to the surface area distribution
return fromAngles(MathUtil.lerp(-Math.PI, +Math.PI, rand.nextFloat()),
Math.asi... | java | public Quaternion randomize (Random rand) {
// pick angles according to the surface area distribution
return fromAngles(MathUtil.lerp(-Math.PI, +Math.PI, rand.nextFloat()),
Math.asin(MathUtil.lerp(-1f, +1f, rand.nextFloat())),
MathUtil.lerp(-Math.PI, +... | [
"public",
"Quaternion",
"randomize",
"(",
"Random",
"rand",
")",
"{",
"// pick angles according to the surface area distribution",
"return",
"fromAngles",
"(",
"MathUtil",
".",
"lerp",
"(",
"-",
"Math",
".",
"PI",
",",
"+",
"Math",
".",
"PI",
",",
"rand",
".",
... | Sets this to a random rotation obtained from a completely uniform distribution. | [
"Sets",
"this",
"to",
"a",
"random",
"rotation",
"obtained",
"from",
"a",
"completely",
"uniform",
"distribution",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Quaternion.java#L173-L178 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/InetAddress.java | InetAddress.getAllByName | public static InetAddress[] getAllByName(String host)
throws UnknownHostException {
"""
Given the name of a host, returns an array of its IP addresses,
based on the configured name service on the system.
<p> The host name can either be a machine name, such as
"<code>java.sun.com</code>", or a textual ... | java | public static InetAddress[] getAllByName(String host)
throws UnknownHostException {
return impl.lookupAllHostAddr(host, NETID_UNSET).clone();
} | [
"public",
"static",
"InetAddress",
"[",
"]",
"getAllByName",
"(",
"String",
"host",
")",
"throws",
"UnknownHostException",
"{",
"return",
"impl",
".",
"lookupAllHostAddr",
"(",
"host",
",",
"NETID_UNSET",
")",
".",
"clone",
"(",
")",
";",
"}"
] | Given the name of a host, returns an array of its IP addresses,
based on the configured name service on the system.
<p> The host name can either be a machine name, such as
"<code>java.sun.com</code>", or a textual representation of its IP
address. If a literal IP address is supplied, only the
validity of the address f... | [
"Given",
"the",
"name",
"of",
"a",
"host",
"returns",
"an",
"array",
"of",
"its",
"IP",
"addresses",
"based",
"on",
"the",
"configured",
"name",
"service",
"on",
"the",
"system",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/InetAddress.java#L753-L756 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/context/FacesContext.java | FacesContext.getCurrentInstance | public static FacesContext getCurrentInstance() {
"""
<p class="changed_modified_2_0">Return the {@link FacesContext}
instance for the request that is being processed by the current
thread. If called during application initialization or shutdown,
any method documented as "valid to call this method during
appl... | java | public static FacesContext getCurrentInstance() {
FacesContext facesContext = instance.get();
if (null == facesContext) {
facesContext = (FacesContext)threadInitContext.get(Thread.currentThread());
}
// Bug 20458755: If not found in the threadInitContext, use
// a sp... | [
"public",
"static",
"FacesContext",
"getCurrentInstance",
"(",
")",
"{",
"FacesContext",
"facesContext",
"=",
"instance",
".",
"get",
"(",
")",
";",
"if",
"(",
"null",
"==",
"facesContext",
")",
"{",
"facesContext",
"=",
"(",
"FacesContext",
")",
"threadInitCo... | <p class="changed_modified_2_0">Return the {@link FacesContext}
instance for the request that is being processed by the current
thread. If called during application initialization or shutdown,
any method documented as "valid to call this method during
application startup or shutdown" must be supported during
applicati... | [
"<p",
"class",
"=",
"changed_modified_2_0",
">",
"Return",
"the",
"{"
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/context/FacesContext.java#L896-L918 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/Cycles.java | Cycles.markRingAtomsAndBonds | public static int markRingAtomsAndBonds(IAtomContainer mol) {
"""
Find and mark all cyclic atoms and bonds in the provided molecule.
@param mol molecule
@see IBond#isInRing()
@see IAtom#isInRing()
@return Number of rings found (circuit rank)
@see <a href="https://en.wikipedia.org/wiki/Circuit_rank">Circuit ... | java | public static int markRingAtomsAndBonds(IAtomContainer mol) {
EdgeToBondMap bonds = EdgeToBondMap.withSpaceFor(mol);
return markRingAtomsAndBonds(mol, GraphUtil.toAdjList(mol, bonds), bonds);
} | [
"public",
"static",
"int",
"markRingAtomsAndBonds",
"(",
"IAtomContainer",
"mol",
")",
"{",
"EdgeToBondMap",
"bonds",
"=",
"EdgeToBondMap",
".",
"withSpaceFor",
"(",
"mol",
")",
";",
"return",
"markRingAtomsAndBonds",
"(",
"mol",
",",
"GraphUtil",
".",
"toAdjList"... | Find and mark all cyclic atoms and bonds in the provided molecule.
@param mol molecule
@see IBond#isInRing()
@see IAtom#isInRing()
@return Number of rings found (circuit rank)
@see <a href="https://en.wikipedia.org/wiki/Circuit_rank">Circuit Rank</a> | [
"Find",
"and",
"mark",
"all",
"cyclic",
"atoms",
"and",
"bonds",
"in",
"the",
"provided",
"molecule",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/Cycles.java#L423-L426 |
xebia/Xebium | src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java | SeleniumDriverFixture.saveScreenshotAfterInFolder | public void saveScreenshotAfterInFolder(String policy, String baseDir) throws IOException {
"""
<p><code>
| save screenshot after | <i>failure</i> | in folder | <i>http://files/testResults/screenshots/${PAGE_NAME} |
| save screenshot after | <i>error</i> |
</code></p>
"""
screenCapture.setScreenshotBaseDi... | java | public void saveScreenshotAfterInFolder(String policy, String baseDir) throws IOException {
screenCapture.setScreenshotBaseDir(removeAnchorTag(baseDir));
saveScreenshotAfter(policy);
} | [
"public",
"void",
"saveScreenshotAfterInFolder",
"(",
"String",
"policy",
",",
"String",
"baseDir",
")",
"throws",
"IOException",
"{",
"screenCapture",
".",
"setScreenshotBaseDir",
"(",
"removeAnchorTag",
"(",
"baseDir",
")",
")",
";",
"saveScreenshotAfter",
"(",
"p... | <p><code>
| save screenshot after | <i>failure</i> | in folder | <i>http://files/testResults/screenshots/${PAGE_NAME} |
| save screenshot after | <i>error</i> |
</code></p> | [
"<p",
">",
"<code",
">",
"|",
"save",
"screenshot",
"after",
"|",
"<i",
">",
"failure<",
"/",
"i",
">",
"|",
"in",
"folder",
"|",
"<i",
">",
"http",
":",
"//",
"files",
"/",
"testResults",
"/",
"screenshots",
"/",
"$",
"{",
"PAGE_NAME",
"}",
"|",
... | train | https://github.com/xebia/Xebium/blob/594f6d9e65622acdbd03dba0700b17645981da1f/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java#L341-L344 |
roboconf/roboconf-platform | core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java | Ec2IaasHandler.parseProperties | static void parseProperties( Map<String, String> targetProperties ) throws TargetException {
"""
Parses the properties and saves them in a Java bean.
@param targetProperties the IaaS properties
@throws TargetException
"""
// Quick check
String[] properties = {
Ec2Constants.EC2_ENDPOINT,
Ec2Constan... | java | static void parseProperties( Map<String, String> targetProperties ) throws TargetException {
// Quick check
String[] properties = {
Ec2Constants.EC2_ENDPOINT,
Ec2Constants.EC2_ACCESS_KEY,
Ec2Constants.EC2_SECRET_KEY,
Ec2Constants.AMI_VM_NODE,
Ec2Constants.VM_INSTANCE_TYPE,
Ec2Constants.SSH_KEY_NA... | [
"static",
"void",
"parseProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"targetProperties",
")",
"throws",
"TargetException",
"{",
"// Quick check",
"String",
"[",
"]",
"properties",
"=",
"{",
"Ec2Constants",
".",
"EC2_ENDPOINT",
",",
"Ec2Constants",
... | Parses the properties and saves them in a Java bean.
@param targetProperties the IaaS properties
@throws TargetException | [
"Parses",
"the",
"properties",
"and",
"saves",
"them",
"in",
"a",
"Java",
"bean",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java#L242-L259 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/ProtempaUtil.java | ProtempaUtil.checkArrayForDuplicates | static void checkArrayForDuplicates(Object[] array, String arrayName) {
"""
Checks an array for duplicates as checked with the <code>equals</code>
method.
@param array an {@link Object[]}. Cannot be <code>null</code>.
@param arrayName the name {@link String} of the array to use in the
error message if a dupl... | java | static void checkArrayForDuplicates(Object[] array, String arrayName) {
if (array.length > 1) {
if (array.length == 2) {
if (array[0] == array[1] ||
(array[0] != null && array[0].equals(array[1]))) {
throw new IllegalArgumentException(arra... | [
"static",
"void",
"checkArrayForDuplicates",
"(",
"Object",
"[",
"]",
"array",
",",
"String",
"arrayName",
")",
"{",
"if",
"(",
"array",
".",
"length",
">",
"1",
")",
"{",
"if",
"(",
"array",
".",
"length",
"==",
"2",
")",
"{",
"if",
"(",
"array",
... | Checks an array for duplicates as checked with the <code>equals</code>
method.
@param array an {@link Object[]}. Cannot be <code>null</code>.
@param arrayName the name {@link String} of the array to use in the
error message if a duplicate is found.
@throws IllegalArgumentException if a duplicate is found. | [
"Checks",
"an",
"array",
"for",
"duplicates",
"as",
"checked",
"with",
"the",
"<code",
">",
"equals<",
"/",
"code",
">",
"method",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/ProtempaUtil.java#L154-L174 |
kubernetes-client/java | extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java | Pager.getNextCall | private Call getNextCall(Integer nextLimit, String continueToken) {
"""
returns next list call by setting continue variable and limit
"""
PagerParams params = new PagerParams((nextLimit != null) ? nextLimit : limit, continueToken);
return listFunc.apply(params);
} | java | private Call getNextCall(Integer nextLimit, String continueToken) {
PagerParams params = new PagerParams((nextLimit != null) ? nextLimit : limit, continueToken);
return listFunc.apply(params);
} | [
"private",
"Call",
"getNextCall",
"(",
"Integer",
"nextLimit",
",",
"String",
"continueToken",
")",
"{",
"PagerParams",
"params",
"=",
"new",
"PagerParams",
"(",
"(",
"nextLimit",
"!=",
"null",
")",
"?",
"nextLimit",
":",
"limit",
",",
"continueToken",
")",
... | returns next list call by setting continue variable and limit | [
"returns",
"next",
"list",
"call",
"by",
"setting",
"continue",
"variable",
"and",
"limit"
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java#L65-L68 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/jmx/service/MBeanMessageHelper.java | MBeanMessageHelper.getUnableToPerformOperationMessage | public static String getUnableToPerformOperationMessage(String libertyServerName, String hostName, String logsLocation, String requestId) {
"""
Provides a message for when the mbean is unable to perform an operation. Takes an Object[]
which should contain 4 strings:<br>
{0} server name<br>
{1} host name<br>
{2... | java | public static String getUnableToPerformOperationMessage(String libertyServerName, String hostName, String logsLocation, String requestId) {
Object[] inserts = { libertyServerName, hostName, logsLocation, requestId };
String msg = BootstrapConstants.messages.getString("error.mbean.operation.failure");
... | [
"public",
"static",
"String",
"getUnableToPerformOperationMessage",
"(",
"String",
"libertyServerName",
",",
"String",
"hostName",
",",
"String",
"logsLocation",
",",
"String",
"requestId",
")",
"{",
"Object",
"[",
"]",
"inserts",
"=",
"{",
"libertyServerName",
",",... | Provides a message for when the mbean is unable to perform an operation. Takes an Object[]
which should contain 4 strings:<br>
{0} server name<br>
{1} host name<br>
{2} logs location<br>
{3} unique request id<br>
@param inserts Substitution text for the message
@return Formated "mbean is unable to perform an operation... | [
"Provides",
"a",
"message",
"for",
"when",
"the",
"mbean",
"is",
"unable",
"to",
"perform",
"an",
"operation",
".",
"Takes",
"an",
"Object",
"[]",
"which",
"should",
"contain",
"4",
"strings",
":",
"<br",
">",
"{",
"0",
"}",
"server",
"name<br",
">",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/jmx/service/MBeanMessageHelper.java#L33-L38 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/memory/MemRepository.java | MemRepository.getDuringWalk | ITypedReferenceableInstance getDuringWalk(Id id, ObjectGraphWalker walker) throws RepositoryException {
"""
/*
- Id must be valid; Class must be valid.
- Ask ClassStore to createInstance.
- Ask ClassStore to load instance.
- load instance traits
- add to GraphWalker
"""
ClassStore cS = getClassSto... | java | ITypedReferenceableInstance getDuringWalk(Id id, ObjectGraphWalker walker) throws RepositoryException {
ClassStore cS = getClassStore(id.getTypeName());
if (cS == null) {
throw new RepositoryException(String.format("Unknown Class %s", id.getTypeName()));
}
cS.validate(this, i... | [
"ITypedReferenceableInstance",
"getDuringWalk",
"(",
"Id",
"id",
",",
"ObjectGraphWalker",
"walker",
")",
"throws",
"RepositoryException",
"{",
"ClassStore",
"cS",
"=",
"getClassStore",
"(",
"id",
".",
"getTypeName",
"(",
")",
")",
";",
"if",
"(",
"cS",
"==",
... | /*
- Id must be valid; Class must be valid.
- Ask ClassStore to createInstance.
- Ask ClassStore to load instance.
- load instance traits
- add to GraphWalker | [
"/",
"*",
"-",
"Id",
"must",
"be",
"valid",
";",
"Class",
"must",
"be",
"valid",
".",
"-",
"Ask",
"ClassStore",
"to",
"createInstance",
".",
"-",
"Ask",
"ClassStore",
"to",
"load",
"instance",
".",
"-",
"load",
"instance",
"traits",
"-",
"add",
"to",
... | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/memory/MemRepository.java#L242-L257 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.withBody | public HttpResponse withBody(String body, MediaType contentType) {
"""
Set response body to return a string response body with the specified encoding. <b>Note:</b> The character set of the
response will be forced to the specified charset, even if the Content-Type header specifies otherwise.
@param body ... | java | public HttpResponse withBody(String body, MediaType contentType) {
if (body != null) {
this.body = new StringBody(body, contentType);
}
return this;
} | [
"public",
"HttpResponse",
"withBody",
"(",
"String",
"body",
",",
"MediaType",
"contentType",
")",
"{",
"if",
"(",
"body",
"!=",
"null",
")",
"{",
"this",
".",
"body",
"=",
"new",
"StringBody",
"(",
"body",
",",
"contentType",
")",
";",
"}",
"return",
... | Set response body to return a string response body with the specified encoding. <b>Note:</b> The character set of the
response will be forced to the specified charset, even if the Content-Type header specifies otherwise.
@param body a string
@param contentType media type, if charset is included this will be use... | [
"Set",
"response",
"body",
"to",
"return",
"a",
"string",
"response",
"body",
"with",
"the",
"specified",
"encoding",
".",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"The",
"character",
"set",
"of",
"the",
"response",
"will",
"be",
"forced",
"to",
"th... | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L114-L119 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Triple.java | Triple.setLeftIf | public <E extends Exception> boolean setLeftIf(final L newLeft, Try.BiPredicate<? super Triple<L, M, R>, ? super L, E> predicate) throws E {
"""
Set to the specified <code>newLeft</code> and returns <code>true</code>
if <code>predicate</code> returns true. Otherwise returns
<code>false</code> without setting the... | java | public <E extends Exception> boolean setLeftIf(final L newLeft, Try.BiPredicate<? super Triple<L, M, R>, ? super L, E> predicate) throws E {
if (predicate.test(this, newLeft)) {
this.left = newLeft;
return true;
}
return false;
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"setLeftIf",
"(",
"final",
"L",
"newLeft",
",",
"Try",
".",
"BiPredicate",
"<",
"?",
"super",
"Triple",
"<",
"L",
",",
"M",
",",
"R",
">",
",",
"?",
"super",
"L",
",",
"E",
">",
"predicate... | Set to the specified <code>newLeft</code> and returns <code>true</code>
if <code>predicate</code> returns true. Otherwise returns
<code>false</code> without setting the value to new value.
@param newLeft
@param predicate - the first parameter is current pair, the second
parameter is the <code>newLeft</code>
@return | [
"Set",
"to",
"the",
"specified",
"<code",
">",
"newLeft<",
"/",
"code",
">",
"and",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"<code",
">",
"predicate<",
"/",
"code",
">",
"returns",
"true",
".",
"Otherwise",
"returns",
"<code",
">",
"f... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Triple.java#L137-L144 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java | ExportConfigurationsInner.listAsync | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> listAsync(String resourceGroupName, String resourceName) {
"""
Gets a list of Continuous Export configuration of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name... | java | public Observable<List<ApplicationInsightsComponentExportConfigurationInner>> listAsync(String resourceGroupName, String resourceName) {
return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<List<ApplicationInsightsComponentExportConfigurationInner>>, List<Applicatio... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentExportConfigurationInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Gets a list of Continuous Export configuration of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to ... | [
"Gets",
"a",
"list",
"of",
"Continuous",
"Export",
"configuration",
"of",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ExportConfigurationsInner.java#L118-L125 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationFileUtil.java | ValidationFileUtil.writeStringToFile | public static void writeStringToFile(File file, String content) throws IOException {
"""
Write string to file.
@param file the file
@param content the content
@throws IOException the io exception
"""
OutputStream outputStream = getOutputStream(file);
outputStream.write(content.getBytes(... | java | public static void writeStringToFile(File file, String content) throws IOException {
OutputStream outputStream = getOutputStream(file);
outputStream.write(content.getBytes());
} | [
"public",
"static",
"void",
"writeStringToFile",
"(",
"File",
"file",
",",
"String",
"content",
")",
"throws",
"IOException",
"{",
"OutputStream",
"outputStream",
"=",
"getOutputStream",
"(",
"file",
")",
";",
"outputStream",
".",
"write",
"(",
"content",
".",
... | Write string to file.
@param file the file
@param content the content
@throws IOException the io exception | [
"Write",
"string",
"to",
"file",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationFileUtil.java#L63-L66 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java | Utils.getLongWithCurrentDate | public static long getLongWithCurrentDate(String value, String timezone) {
"""
Helper method for getting a value containing CURRENTDAY-1 or CURRENTHOUR-1 in the form yyyyMMddHHmmss
@param value
@param timezone
@return
"""
if (Strings.isNullOrEmpty(value)) {
return 0;
}
DateTime time = get... | java | public static long getLongWithCurrentDate(String value, String timezone) {
if (Strings.isNullOrEmpty(value)) {
return 0;
}
DateTime time = getCurrentTime(timezone);
DateTimeFormatter dtFormatter = DateTimeFormat.forPattern(CURRENT_DATE_FORMAT).withZone(time.getZone());
if (value.toUpperCase()... | [
"public",
"static",
"long",
"getLongWithCurrentDate",
"(",
"String",
"value",
",",
"String",
"timezone",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",
"{",
"return",
"0",
";",
"}",
"DateTime",
"time",
"=",
"getCurrentTime",
... | Helper method for getting a value containing CURRENTDAY-1 or CURRENTHOUR-1 in the form yyyyMMddHHmmss
@param value
@param timezone
@return | [
"Helper",
"method",
"for",
"getting",
"a",
"value",
"containing",
"CURRENTDAY",
"-",
"1",
"or",
"CURRENTHOUR",
"-",
"1",
"in",
"the",
"form",
"yyyyMMddHHmmss"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L283-L299 |
restfb/restfb | src/main/java/com/restfb/util/ObjectUtil.java | ObjectUtil.requireNotEmpty | public static String requireNotEmpty(String obj, String errorText) {
"""
Ensures that {@code obj} isn't {@code null} or an empty string.
@param obj
The parameter to check.
@param errorText
The exception message.
@throws IllegalArgumentException
If {@code obj} is {@code null} or an empty string.
"""
... | java | public static String requireNotEmpty(String obj, String errorText) {
if (isBlank(obj)) {
throw new IllegalArgumentException(errorText);
}
return obj;
} | [
"public",
"static",
"String",
"requireNotEmpty",
"(",
"String",
"obj",
",",
"String",
"errorText",
")",
"{",
"if",
"(",
"isBlank",
"(",
"obj",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"errorText",
")",
";",
"}",
"return",
"obj",
";",... | Ensures that {@code obj} isn't {@code null} or an empty string.
@param obj
The parameter to check.
@param errorText
The exception message.
@throws IllegalArgumentException
If {@code obj} is {@code null} or an empty string. | [
"Ensures",
"that",
"{",
"@code",
"obj",
"}",
"isn",
"t",
"{",
"@code",
"null",
"}",
"or",
"an",
"empty",
"string",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/ObjectUtil.java#L45-L50 |
RestComm/sip-servlets | sip-servlets-examples/click-to-call-servlet3/src/main/java/org/mobicents/servlet/sip/example/StatusServlet.java | StatusServlet.init | @Override
public void init(final ServletConfig config) throws ServletException {
"""
/*
Start a new thread that using the LinkedBlockingQueue, every time there is a new element in the collection
will retrieve the last updated users HashMap and calls container and will use them to produce and dispatch a new reps... | java | @Override
public void init(final ServletConfig config) throws ServletException {
data = new StatusServletNotifier(queue, config);
data.eventsQueue = new LinkedBlockingQueue<String>();
if (data.eventsQueue == null) data.eventsQueue = new LinkedBlockingQueue<String>();
config.getServletContext().setAttribute("e... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"final",
"ServletConfig",
"config",
")",
"throws",
"ServletException",
"{",
"data",
"=",
"new",
"StatusServletNotifier",
"(",
"queue",
",",
"config",
")",
";",
"data",
".",
"eventsQueue",
"=",
"new",
"LinkedBlock... | /*
Start a new thread that using the LinkedBlockingQueue, every time there is a new element in the collection
will retrieve the last updated users HashMap and calls container and will use them to produce and dispatch a new repsonse
to the clients in the queue.
Important here is the fact that we never close the stream a... | [
"/",
"*",
"Start",
"a",
"new",
"thread",
"that",
"using",
"the",
"LinkedBlockingQueue",
"every",
"time",
"there",
"is",
"a",
"new",
"element",
"in",
"the",
"collection",
"will",
"retrieve",
"the",
"last",
"updated",
"users",
"HashMap",
"and",
"calls",
"conta... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/click-to-call-servlet3/src/main/java/org/mobicents/servlet/sip/example/StatusServlet.java#L39-L50 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/interfaces/NicMatchInterfaceCriteria.java | NicMatchInterfaceCriteria.isAcceptable | @Override
protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException {
"""
{@inheritDoc}
@return <code>address</code> if the {@link #getAcceptablePattern() acceptable pattern}
matches <code>networkInterface</code>'s {@link NetworkInterface#getName() na... | java | @Override
protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException {
if( pattern.matcher(networkInterface.getName()).matches() )
return address;
return null;
} | [
"@",
"Override",
"protected",
"InetAddress",
"isAcceptable",
"(",
"NetworkInterface",
"networkInterface",
",",
"InetAddress",
"address",
")",
"throws",
"SocketException",
"{",
"if",
"(",
"pattern",
".",
"matcher",
"(",
"networkInterface",
".",
"getName",
"(",
")",
... | {@inheritDoc}
@return <code>address</code> if the {@link #getAcceptablePattern() acceptable pattern}
matches <code>networkInterface</code>'s {@link NetworkInterface#getName() name}. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/interfaces/NicMatchInterfaceCriteria.java#L70-L76 |
gdx-libs/gdx-kiwi | src/com/github/czyzby/kiwi/util/gdx/scene2d/Tooltips.java | Tooltips.setDefaultTooltipManager | public static void setDefaultTooltipManager(final TooltipManager tooltipManager) {
"""
Since main tooltip manager instance cannot be changed globally with a regular setter, this method modifies it
using reflection.
@param tooltipManager will be returned on {@link TooltipManager#getInstance()} calls.
"""
... | java | public static void setDefaultTooltipManager(final TooltipManager tooltipManager) {
try {
// We have to set the app field, as it is validated by the static getter.
Reflection.setFieldValue(ClassReflection.getDeclaredField(TooltipManager.class, "app"), null, Gdx.app);
Reflectio... | [
"public",
"static",
"void",
"setDefaultTooltipManager",
"(",
"final",
"TooltipManager",
"tooltipManager",
")",
"{",
"try",
"{",
"// We have to set the app field, as it is validated by the static getter.",
"Reflection",
".",
"setFieldValue",
"(",
"ClassReflection",
".",
"getDecl... | Since main tooltip manager instance cannot be changed globally with a regular setter, this method modifies it
using reflection.
@param tooltipManager will be returned on {@link TooltipManager#getInstance()} calls. | [
"Since",
"main",
"tooltip",
"manager",
"instance",
"cannot",
"be",
"changed",
"globally",
"with",
"a",
"regular",
"setter",
"this",
"method",
"modifies",
"it",
"using",
"reflection",
"."
] | train | https://github.com/gdx-libs/gdx-kiwi/blob/0172ee7534162f33b939bcdc4de089bc9579dd62/src/com/github/czyzby/kiwi/util/gdx/scene2d/Tooltips.java#L21-L30 |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java | SymbolType.typeVariableOf | public static SymbolType typeVariableOf(TypeVariable<?> typeVariable) throws InvalidTypeException {
"""
Builds a symbol for a type variable from a TypeVariable.
@param typeVariable The loaded type variable by reflection
@return a SymbolType that represents a variable (for generics)
@throws InvalidTypeException ... | java | public static SymbolType typeVariableOf(TypeVariable<?> typeVariable) throws InvalidTypeException {
return valueOf(typeVariable, null).cloneAsTypeVariable(typeVariable.getName());
} | [
"public",
"static",
"SymbolType",
"typeVariableOf",
"(",
"TypeVariable",
"<",
"?",
">",
"typeVariable",
")",
"throws",
"InvalidTypeException",
"{",
"return",
"valueOf",
"(",
"typeVariable",
",",
"null",
")",
".",
"cloneAsTypeVariable",
"(",
"typeVariable",
".",
"g... | Builds a symbol for a type variable from a TypeVariable.
@param typeVariable The loaded type variable by reflection
@return a SymbolType that represents a variable (for generics)
@throws InvalidTypeException when the type cannot be loaded | [
"Builds",
"a",
"symbol",
"for",
"a",
"type",
"variable",
"from",
"a",
"TypeVariable",
"."
] | train | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java#L841-L843 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoRef.java | AccessibilityNodeInfoRef.owned | public static AccessibilityNodeInfoRef owned(
AccessibilityNodeInfoCompat node) {
"""
Creates a new instance of this class taking ownership of {@code node}.
"""
return node != null ? new AccessibilityNodeInfoRef(node, true) : null;
} | java | public static AccessibilityNodeInfoRef owned(
AccessibilityNodeInfoCompat node) {
return node != null ? new AccessibilityNodeInfoRef(node, true) : null;
} | [
"public",
"static",
"AccessibilityNodeInfoRef",
"owned",
"(",
"AccessibilityNodeInfoCompat",
"node",
")",
"{",
"return",
"node",
"!=",
"null",
"?",
"new",
"AccessibilityNodeInfoRef",
"(",
"node",
",",
"true",
")",
":",
"null",
";",
"}"
] | Creates a new instance of this class taking ownership of {@code node}. | [
"Creates",
"a",
"new",
"instance",
"of",
"this",
"class",
"taking",
"ownership",
"of",
"{"
] | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoRef.java#L108-L111 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.findIn | @Deprecated
public int findIn(CharSequence value, int fromIndex, boolean findNot) {
"""
Find the first index at or after fromIndex where the UnicodeSet matches at that index.
If findNot is true, then reverse the sense of the match: find the first place where the UnicodeSet doesn't match.
If there is no match... | java | @Deprecated
public int findIn(CharSequence value, int fromIndex, boolean findNot) {
//TODO add strings, optimize, using ICU4C algorithms
int cp;
for (; fromIndex < value.length(); fromIndex += UTF16.getCharCount(cp)) {
cp = UTF16.charAt(value, fromIndex);
if (contains... | [
"@",
"Deprecated",
"public",
"int",
"findIn",
"(",
"CharSequence",
"value",
",",
"int",
"fromIndex",
",",
"boolean",
"findNot",
")",
"{",
"//TODO add strings, optimize, using ICU4C algorithms",
"int",
"cp",
";",
"for",
"(",
";",
"fromIndex",
"<",
"value",
".",
"... | Find the first index at or after fromIndex where the UnicodeSet matches at that index.
If findNot is true, then reverse the sense of the match: find the first place where the UnicodeSet doesn't match.
If there is no match, length is returned.
@deprecated This API is ICU internal only. Use span instead.
@hide original d... | [
"Find",
"the",
"first",
"index",
"at",
"or",
"after",
"fromIndex",
"where",
"the",
"UnicodeSet",
"matches",
"at",
"that",
"index",
".",
"If",
"findNot",
"is",
"true",
"then",
"reverse",
"the",
"sense",
"of",
"the",
"match",
":",
"find",
"the",
"first",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L4599-L4610 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.completeMerge | void completeMerge(SegmentMetadata sourceMetadata) {
"""
Executes Step 2 of the 2-Step Merge Process.
The StreamSegments are physically merged in the Storage. The Source StreamSegment does not exist anymore.
The ReadIndex entries of the two Streams are actually joined together.
@param sourceMetadata The Segme... | java | void completeMerge(SegmentMetadata sourceMetadata) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "completeMerge", sourceMetadata.getId());
Exceptions.checkNotClosed(this.closed, this);
Exceptions.checkArgument(sourceMetadata.isDeleted(), "sourceSegmentStreamId",
... | [
"void",
"completeMerge",
"(",
"SegmentMetadata",
"sourceMetadata",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"completeMerge\"",
",",
"sourceMetadata",
".",
"getId",
"(",
"... | Executes Step 2 of the 2-Step Merge Process.
The StreamSegments are physically merged in the Storage. The Source StreamSegment does not exist anymore.
The ReadIndex entries of the two Streams are actually joined together.
@param sourceMetadata The SegmentMetadata of the Segment that was merged into this one. | [
"Executes",
"Step",
"2",
"of",
"the",
"2",
"-",
"Step",
"Merge",
"Process",
".",
"The",
"StreamSegments",
"are",
"physically",
"merged",
"in",
"the",
"Storage",
".",
"The",
"Source",
"StreamSegment",
"does",
"not",
"exist",
"anymore",
".",
"The",
"ReadIndex"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L423-L471 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.transferAgent | public ApiSuccessResponse transferAgent(String mediatype, String id, TransferData transferData) throws ApiException {
"""
Transfer an interaction
Transfer the interaction to the specified agent.
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param transferData ... | java | public ApiSuccessResponse transferAgent(String mediatype, String id, TransferData transferData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = transferAgentWithHttpInfo(mediatype, id, transferData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"transferAgent",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"TransferData",
"transferData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"transferAgentWithHttpInfo",
"(",
"me... | Transfer an interaction
Transfer the interaction to the specified agent.
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param transferData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the res... | [
"Transfer",
"an",
"interaction",
"Transfer",
"the",
"interaction",
"to",
"the",
"specified",
"agent",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L4341-L4344 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.safeDecodeAsString | @Nullable
public static String safeDecodeAsString (@Nullable final String sEncoded, @Nonnull final Charset aCharset) {
"""
Decode the string and convert it back to a string.
@param sEncoded
The encoded string.
@param aCharset
The character set to be used.
@return <code>null</code> if decoding failed.
... | java | @Nullable
public static String safeDecodeAsString (@Nullable final String sEncoded, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (aCharset, "Charset");
if (sEncoded != null)
try
{
final byte [] aDecoded = decode (sEncoded, DONT_GUNZIP);
return new String (aDecoded, aC... | [
"@",
"Nullable",
"public",
"static",
"String",
"safeDecodeAsString",
"(",
"@",
"Nullable",
"final",
"String",
"sEncoded",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aCharset",
",",
"\"Charset\"",
")",
... | Decode the string and convert it back to a string.
@param sEncoded
The encoded string.
@param aCharset
The character set to be used.
@return <code>null</code> if decoding failed. | [
"Decode",
"the",
"string",
"and",
"convert",
"it",
"back",
"to",
"a",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2664-L2679 |
treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.isVolumeIdExists | private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) {
"""
Check whether volumeId exists in list.
@param volumeIds List of volume Ids.
@param volumeId to check in the list.
@return true if volumeId is valid.
"""
if (volumeIds != null && volumeIds.size() > 0) {
... | java | private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) {
if (volumeIds != null && volumeIds.size() > 0) {
for (String volId : volumeIds) {
if (volId.equals(volumeId)) {
return true;
}
}
}
... | [
"private",
"boolean",
"isVolumeIdExists",
"(",
"final",
"List",
"<",
"String",
">",
"volumeIds",
",",
"final",
"String",
"volumeId",
")",
"{",
"if",
"(",
"volumeIds",
"!=",
"null",
"&&",
"volumeIds",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"for",
"(... | Check whether volumeId exists in list.
@param volumeIds List of volume Ids.
@param volumeId to check in the list.
@return true if volumeId is valid. | [
"Check",
"whether",
"volumeId",
"exists",
"in",
"list",
"."
] | train | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1730-L1740 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java | PortableUtils.validateFactoryAndClass | static void validateFactoryAndClass(FieldDefinition fd, int factoryId, int classId, String fullPath) {
"""
Validates if the given factoryId and classId match the ones from the fieldDefinition
@param fd given fieldDefinition to validate against
@param factoryId given factoryId to validate
@param classId... | java | static void validateFactoryAndClass(FieldDefinition fd, int factoryId, int classId, String fullPath) {
if (factoryId != fd.getFactoryId()) {
throw new IllegalArgumentException("Invalid factoryId! Expected: "
+ fd.getFactoryId() + ", Current: " + factoryId + " in path " + fullPath... | [
"static",
"void",
"validateFactoryAndClass",
"(",
"FieldDefinition",
"fd",
",",
"int",
"factoryId",
",",
"int",
"classId",
",",
"String",
"fullPath",
")",
"{",
"if",
"(",
"factoryId",
"!=",
"fd",
".",
"getFactoryId",
"(",
")",
")",
"{",
"throw",
"new",
"Il... | Validates if the given factoryId and classId match the ones from the fieldDefinition
@param fd given fieldDefinition to validate against
@param factoryId given factoryId to validate
@param classId given factoryId to validate
@param fullPath full path - just for output | [
"Validates",
"if",
"the",
"given",
"factoryId",
"and",
"classId",
"match",
"the",
"ones",
"from",
"the",
"fieldDefinition"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java#L168-L177 |
JohnPersano/SuperToasts | library/src/main/java/com/github/johnpersano/supertoasts/library/SuperActivityToast.java | SuperActivityToast.onRestoreState | public static void onRestoreState(Context context, Bundle bundle) {
"""
Restores the state of all SuperToasts that were showing and/or pending.
This should be called in the {@link android.app.Activity#onCreate(android.os.Bundle)}
method of your Activity.
@param context The Activity Context
@param bundle Th... | java | public static void onRestoreState(Context context, Bundle bundle) {
// The Bundle will be null sometimes
if (bundle == null) return;
// Get the List created in onSaveState()
final ArrayList<Style> styleList = bundle.getParcelableArrayList(BUNDLE_KEY);
if (styleList == n... | [
"public",
"static",
"void",
"onRestoreState",
"(",
"Context",
"context",
",",
"Bundle",
"bundle",
")",
"{",
"// The Bundle will be null sometimes\r",
"if",
"(",
"bundle",
"==",
"null",
")",
"return",
";",
"// Get the List created in onSaveState()\r",
"final",
"ArrayList... | Restores the state of all SuperToasts that were showing and/or pending.
This should be called in the {@link android.app.Activity#onCreate(android.os.Bundle)}
method of your Activity.
@param context The Activity Context
@param bundle The Bundle provided in onCreate() | [
"Restores",
"the",
"state",
"of",
"all",
"SuperToasts",
"that",
"were",
"showing",
"and",
"/",
"or",
"pending",
"."
] | train | https://github.com/JohnPersano/SuperToasts/blob/5394db6a2f5c38410586d5d001d61f731da1132a/library/src/main/java/com/github/johnpersano/supertoasts/library/SuperActivityToast.java#L833-L858 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java | Force.addDirection | public void addDirection(double extrp, Direction direction) {
"""
Increase direction with input value.
@param extrp The extrapolation value.
@param direction The direction to add.
"""
addDirection(extrp, direction.getDirectionHorizontal(), direction.getDirectionVertical());
} | java | public void addDirection(double extrp, Direction direction)
{
addDirection(extrp, direction.getDirectionHorizontal(), direction.getDirectionVertical());
} | [
"public",
"void",
"addDirection",
"(",
"double",
"extrp",
",",
"Direction",
"direction",
")",
"{",
"addDirection",
"(",
"extrp",
",",
"direction",
".",
"getDirectionHorizontal",
"(",
")",
",",
"direction",
".",
"getDirectionVertical",
"(",
")",
")",
";",
"}"
] | Increase direction with input value.
@param extrp The extrapolation value.
@param direction The direction to add. | [
"Increase",
"direction",
"with",
"input",
"value",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java#L194-L197 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java | VpnSitesInner.createOrUpdate | public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) {
"""
Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSite be... | java | public VpnSiteInner createOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().last().body();
} | [
"public",
"VpnSiteInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vpnSiteName",
",",
"VpnSiteInner",
"vpnSiteParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vpnSiteName",
",",
"vpnSiteP... | Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSite being created or updated.
@param vpnSiteParameters Parameters supplied to create or update VpnSite.
@throws IllegalArgumentExcept... | [
"Creates",
"a",
"VpnSite",
"resource",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"VpnSite",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java#L211-L213 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.