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 |
|---|---|---|---|---|---|---|---|---|---|---|
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/security/certgen/TLSCertificateKeyPair.java | TLSCertificateKeyPair.fromX509CertKeyPair | static TLSCertificateKeyPair fromX509CertKeyPair(X509Certificate x509Cert, KeyPair keyPair) throws IOException {
"""
*
Creates a TLSCertificateKeyPair out of the given {@link X509Certificate} and {@link KeyPair}
encoded in PEM and also in DER for the certificate
@param x509Cert the certificate to process
@para... | java | static TLSCertificateKeyPair fromX509CertKeyPair(X509Certificate x509Cert, KeyPair keyPair) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(baos);
JcaPEMWriter w = new JcaPEMWriter(writer);
w.writeObject(x509Cert);
... | [
"static",
"TLSCertificateKeyPair",
"fromX509CertKeyPair",
"(",
"X509Certificate",
"x509Cert",
",",
"KeyPair",
"keyPair",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"PrintWriter",
"writer",
"=",... | *
Creates a TLSCertificateKeyPair out of the given {@link X509Certificate} and {@link KeyPair}
encoded in PEM and also in DER for the certificate
@param x509Cert the certificate to process
@param keyPair the key pair to process
@return a TLSCertificateKeyPair
@throws IOException upon failure | [
"*",
"Creates",
"a",
"TLSCertificateKeyPair",
"out",
"of",
"the",
"given",
"{"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/security/certgen/TLSCertificateKeyPair.java#L53-L76 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.getAbsoluteParent | public static String getAbsoluteParent(String path, int level) {
"""
Returns the n<sup>th</sup> absolute parent of the path, where n=level.
<p>
Example:<br>
<code>
Text.getAbsoluteParent("/foo/bar/test", 1) == "/foo/bar"
</code>
@param path
the path of the page
@param level
the level of the parent
@ret... | java | public static String getAbsoluteParent(String path, int level)
{
int idx = 0;
int len = path.length();
while (level >= 0 && idx < len)
{
idx = path.indexOf('/', idx + 1);
if (idx < 0)
{
idx = len;
}
level--;
}
return level >... | [
"public",
"static",
"String",
"getAbsoluteParent",
"(",
"String",
"path",
",",
"int",
"level",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"int",
"len",
"=",
"path",
".",
"length",
"(",
")",
";",
"while",
"(",
"level",
">=",
"0",
"&&",
"idx",
"<",
"len"... | Returns the n<sup>th</sup> absolute parent of the path, where n=level.
<p>
Example:<br>
<code>
Text.getAbsoluteParent("/foo/bar/test", 1) == "/foo/bar"
</code>
@param path
the path of the page
@param level
the level of the parent
@return String absolute parent | [
"Returns",
"the",
"n<sup",
">",
"th<",
"/",
"sup",
">",
"absolute",
"parent",
"of",
"the",
"path",
"where",
"n",
"=",
"level",
".",
"<p",
">",
"Example",
":",
"<br",
">",
"<code",
">",
"Text",
".",
"getAbsoluteParent",
"(",
"/",
"foo",
"/",
"bar",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L811-L825 |
mozilla/rhino | src/org/mozilla/javascript/DToA.java | DToA.d2b | private static BigInteger d2b(double d, int[] e, int[] bits) {
"""
/* Convert d into the form b*2^e, where b is an odd integer. b is the returned
Bigint and e is the returned binary exponent. Return the number of significant
bits in b in bits. d must be finite and nonzero.
"""
byte dbl_bits[];
... | java | private static BigInteger d2b(double d, int[] e, int[] bits)
{
byte dbl_bits[];
int i, k, y, z, de;
long dBits = Double.doubleToLongBits(d);
int d0 = (int)(dBits >>> 32);
int d1 = (int)(dBits);
z = d0 & Frac_mask;
d0 &= 0x7fffffff; /* clear sign bit, which ... | [
"private",
"static",
"BigInteger",
"d2b",
"(",
"double",
"d",
",",
"int",
"[",
"]",
"e",
",",
"int",
"[",
"]",
"bits",
")",
"{",
"byte",
"dbl_bits",
"[",
"]",
";",
"int",
"i",
",",
"k",
",",
"y",
",",
"z",
",",
"de",
";",
"long",
"dBits",
"="... | /* Convert d into the form b*2^e, where b is an odd integer. b is the returned
Bigint and e is the returned binary exponent. Return the number of significant
bits in b in bits. d must be finite and nonzero. | [
"/",
"*",
"Convert",
"d",
"into",
"the",
"form",
"b",
"*",
"2^e",
"where",
"b",
"is",
"an",
"odd",
"integer",
".",
"b",
"is",
"the",
"returned",
"Bigint",
"and",
"e",
"is",
"the",
"returned",
"binary",
"exponent",
".",
"Return",
"the",
"number",
"of"... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/DToA.java#L159-L204 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseTableAuditingPoliciesInner.java | DatabaseTableAuditingPoliciesInner.listByDatabaseAsync | public Observable<DatabaseTableAuditingPolicyListResultInner> listByDatabaseAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Lists a database's table auditing policies. Table auditing is deprecated, use blob auditing instead.
@param resourceGroupName The name of the resource group t... | java | public Observable<DatabaseTableAuditingPolicyListResultInner> listByDatabaseAsync(String resourceGroupName, String serverName, String databaseName) {
return listByDatabaseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseTableAuditingPolicyListResultInne... | [
"public",
"Observable",
"<",
"DatabaseTableAuditingPolicyListResultInner",
">",
"listByDatabaseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listByDatabaseWithServiceResponseAsync",
"(",
"resourceG... | Lists a database's table auditing policies. Table auditing is deprecated, use blob auditing instead.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param database... | [
"Lists",
"a",
"database",
"s",
"table",
"auditing",
"policies",
".",
"Table",
"auditing",
"is",
"deprecated",
"use",
"blob",
"auditing",
"instead",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseTableAuditingPoliciesInner.java#L306-L313 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationImpl_CustomFieldSerializer.java | OWLAnnotationImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.cl... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLAnnotationImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationImpl_CustomFieldSerializer.java#L71-L74 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.createIntrinsic | public static CameraPinhole createIntrinsic(int width, int height, double hfov, double vfov) {
"""
Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics
@param width Image width
@param height Image height
@param hfov Horizontal FOV in degrees
@param vfov V... | java | public static CameraPinhole createIntrinsic(int width, int height, double hfov, double vfov) {
CameraPinhole intrinsic = new CameraPinhole();
intrinsic.width = width;
intrinsic.height = height;
intrinsic.cx = width / 2;
intrinsic.cy = height / 2;
intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadi... | [
"public",
"static",
"CameraPinhole",
"createIntrinsic",
"(",
"int",
"width",
",",
"int",
"height",
",",
"double",
"hfov",
",",
"double",
"vfov",
")",
"{",
"CameraPinhole",
"intrinsic",
"=",
"new",
"CameraPinhole",
"(",
")",
";",
"intrinsic",
".",
"width",
"=... | Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics
@param width Image width
@param height Image height
@param hfov Horizontal FOV in degrees
@param vfov Vertical FOV in degrees
@return guess camera parameters | [
"Creates",
"a",
"set",
"of",
"intrinsic",
"parameters",
"without",
"distortion",
"for",
"a",
"camera",
"with",
"the",
"specified",
"characteristics"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L97-L107 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withSparseParcelableArray | public Postcard withSparseParcelableArray(@Nullable String key, @Nullable SparseArray<? extends Parcelable> value) {
"""
Inserts a SparceArray of Parcelable values into the mapping of this
Bundle, replacing any existing value for the given key. Either key
or value may be null.
@param key a String, or null
... | java | public Postcard withSparseParcelableArray(@Nullable String key, @Nullable SparseArray<? extends Parcelable> value) {
mBundle.putSparseParcelableArray(key, value);
return this;
} | [
"public",
"Postcard",
"withSparseParcelableArray",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"SparseArray",
"<",
"?",
"extends",
"Parcelable",
">",
"value",
")",
"{",
"mBundle",
".",
"putSparseParcelableArray",
"(",
"key",
",",
"value",
")",
... | Inserts a SparceArray of Parcelable values into the mapping of this
Bundle, replacing any existing value for the given key. Either key
or value may be null.
@param key a String, or null
@param value a SparseArray of Parcelable objects, or null
@return current | [
"Inserts",
"a",
"SparceArray",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L416-L419 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.saveInternal | protected CmsSitemapChange saveInternal(String entryPoint, CmsSitemapChange change) throws CmsException {
"""
Internal method for saving a sitemap.<p>
@param entryPoint the URI of the sitemap to save
@param change the change to save
@return list of changed sitemap entries
@throws CmsException if somethin... | java | protected CmsSitemapChange saveInternal(String entryPoint, CmsSitemapChange change) throws CmsException {
ensureSession();
switch (change.getChangeType()) {
case clipboardOnly:
// do nothing
break;
case remove:
change = removeEntry... | [
"protected",
"CmsSitemapChange",
"saveInternal",
"(",
"String",
"entryPoint",
",",
"CmsSitemapChange",
"change",
")",
"throws",
"CmsException",
"{",
"ensureSession",
"(",
")",
";",
"switch",
"(",
"change",
".",
"getChangeType",
"(",
")",
")",
"{",
"case",
"clipb... | Internal method for saving a sitemap.<p>
@param entryPoint the URI of the sitemap to save
@param change the change to save
@return list of changed sitemap entries
@throws CmsException if something goes wrong | [
"Internal",
"method",
"for",
"saving",
"a",
"sitemap",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L1234-L1252 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java | Dater.of | public static Dater of(String date, String pattern) {
"""
Returns a new Dater instance with the given date and pattern
@param date
@return
"""
return new Dater(checkNotNull(date), checkNotNull(pattern));
} | java | public static Dater of(String date, String pattern) {
return new Dater(checkNotNull(date), checkNotNull(pattern));
} | [
"public",
"static",
"Dater",
"of",
"(",
"String",
"date",
",",
"String",
"pattern",
")",
"{",
"return",
"new",
"Dater",
"(",
"checkNotNull",
"(",
"date",
")",
",",
"checkNotNull",
"(",
"pattern",
")",
")",
";",
"}"
] | Returns a new Dater instance with the given date and pattern
@param date
@return | [
"Returns",
"a",
"new",
"Dater",
"instance",
"with",
"the",
"given",
"date",
"and",
"pattern"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java#L254-L256 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatter.java | DateTimeFormatter.withChronology | public DateTimeFormatter withChronology(Chronology chrono) {
"""
Returns a copy of this formatter with a new override chronology.
<p>
This returns a formatter with similar state to this formatter but
with the override chronology set.
By default, a formatter has no override chronology, returning null.
<p>
If ... | java | public DateTimeFormatter withChronology(Chronology chrono) {
if (Jdk8Methods.equals(this.chrono, chrono)) {
return this;
}
return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono, zone);
} | [
"public",
"DateTimeFormatter",
"withChronology",
"(",
"Chronology",
"chrono",
")",
"{",
"if",
"(",
"Jdk8Methods",
".",
"equals",
"(",
"this",
".",
"chrono",
",",
"chrono",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"DateTimeFormatter",
"(",
... | Returns a copy of this formatter with a new override chronology.
<p>
This returns a formatter with similar state to this formatter but
with the override chronology set.
By default, a formatter has no override chronology, returning null.
<p>
If an override is added, then any date that is printed or parsed will be affect... | [
"Returns",
"a",
"copy",
"of",
"this",
"formatter",
"with",
"a",
"new",
"override",
"chronology",
".",
"<p",
">",
"This",
"returns",
"a",
"formatter",
"with",
"similar",
"state",
"to",
"this",
"formatter",
"but",
"with",
"the",
"override",
"chronology",
"set"... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatter.java#L1135-L1140 |
graknlabs/grakn | server/src/server/exception/TransactionException.java | TransactionException.invalidLabelStart | public static TransactionException invalidLabelStart(Label label) {
"""
Thrown when creating a label which starts with a reserved character Schema.ImplicitType#RESERVED
"""
return create(String.format("Cannot create a label {%s} starting with character {%s} as it is a reserved starting character", labe... | java | public static TransactionException invalidLabelStart(Label label) {
return create(String.format("Cannot create a label {%s} starting with character {%s} as it is a reserved starting character", label, Schema.ImplicitType.RESERVED.getValue()));
} | [
"public",
"static",
"TransactionException",
"invalidLabelStart",
"(",
"Label",
"label",
")",
"{",
"return",
"create",
"(",
"String",
".",
"format",
"(",
"\"Cannot create a label {%s} starting with character {%s} as it is a reserved starting character\"",
",",
"label",
",",
"S... | Thrown when creating a label which starts with a reserved character Schema.ImplicitType#RESERVED | [
"Thrown",
"when",
"creating",
"a",
"label",
"which",
"starts",
"with",
"a",
"reserved",
"character",
"Schema",
".",
"ImplicitType#RESERVED"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L299-L301 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.executeUpdateSql | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity) {
"""
Executes an update SQL.
@param sql the update SQL to execute
@param propDescs the array of parameters
@param entity the entity object in insertion, otherwise null
@return the number of updated rows
@throws SQLRuntimeE... | java | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity){
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
printSql(sql);
... | [
"public",
"int",
"executeUpdateSql",
"(",
"String",
"sql",
",",
"PropertyDesc",
"[",
"]",
"propDescs",
",",
"Object",
"entity",
")",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{",
"Connection",
"conn",
... | Executes an update SQL.
@param sql the update SQL to execute
@param propDescs the array of parameters
@param entity the entity object in insertion, otherwise null
@return the number of updated rows
@throws SQLRuntimeException if a database access error occurs | [
"Executes",
"an",
"update",
"SQL",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L274-L309 |
cojen/Cojen | src/main/java/org/cojen/classfile/MethodInfo.java | MethodInfo.addInnerClass | public ClassFile addInnerClass(String innerClassName, Class superClass) {
"""
Add an inner class to this method.
@param innerClassName Optional short inner class name.
@param superClass Super class.
"""
return addInnerClass(innerClassName, superClass.getName());
} | java | public ClassFile addInnerClass(String innerClassName, Class superClass) {
return addInnerClass(innerClassName, superClass.getName());
} | [
"public",
"ClassFile",
"addInnerClass",
"(",
"String",
"innerClassName",
",",
"Class",
"superClass",
")",
"{",
"return",
"addInnerClass",
"(",
"innerClassName",
",",
"superClass",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Add an inner class to this method.
@param innerClassName Optional short inner class name.
@param superClass Super class. | [
"Add",
"an",
"inner",
"class",
"to",
"this",
"method",
"."
] | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/classfile/MethodInfo.java#L331-L333 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java | ClientCollection.createMediaEntry | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException {
"""
Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to persist the properties... | java | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title, s... | [
"public",
"ClientMediaEntry",
"createMediaEntry",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"slug",
",",
"final",
"String",
"contentType",
",",
"final",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"!",
"isWritab... | Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to persist the properties of the entry that is
returned.
@param title Title to used for uploaded file.
@param slug String to be used in file-name of stored file
@param contentType MIME c... | [
"Create",
"new",
"media",
"entry",
"assocaited",
"with",
"collection",
"but",
"do",
"not",
"save",
".",
"server",
".",
"Depending",
"on",
"the",
"Atom",
"server",
"you",
"may",
"or",
"may",
"not",
"be",
"able",
"to",
"persist",
"the",
"properties",
"of",
... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L158-L163 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java | JobStreamsInner.getAsync | public Observable<JobStreamInner> getAsync(String resourceGroupName, String automationAccountName, String jobId, String jobStreamId) {
"""
Retrieve the job stream identified by job stream id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation accou... | java | public Observable<JobStreamInner> getAsync(String resourceGroupName, String automationAccountName, String jobId, String jobStreamId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId, jobStreamId).map(new Func1<ServiceResponse<JobStreamInner>, JobStreamInner>() {
@... | [
"public",
"Observable",
"<",
"JobStreamInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"jobId",
",",
"String",
"jobStreamId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",... | Retrieve the job stream identified by job stream id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@param jobStreamId The job stream id.
@throws IllegalArgumentException thrown if parameters fail the validation
@retur... | [
"Retrieve",
"the",
"job",
"stream",
"identified",
"by",
"job",
"stream",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java#L115-L122 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/entities/InjectionOptions.java | InjectionOptions.getInjectionSetting | private String getInjectionSetting(final String input, final char startDelim) {
"""
Gets the Injection Setting for these options when using the String Constructor.
@param input The input to be parsed to get the setting.
@param startDelim The delimiter that specifies that start of options (ie '[')
@return... | java | private String getInjectionSetting(final String input, final char startDelim) {
return input == null || input.equals("") ? null : StringUtilities.split(input, startDelim)[0].trim();
} | [
"private",
"String",
"getInjectionSetting",
"(",
"final",
"String",
"input",
",",
"final",
"char",
"startDelim",
")",
"{",
"return",
"input",
"==",
"null",
"||",
"input",
".",
"equals",
"(",
"\"\"",
")",
"?",
"null",
":",
"StringUtilities",
".",
"split",
"... | Gets the Injection Setting for these options when using the String Constructor.
@param input The input to be parsed to get the setting.
@param startDelim The delimiter that specifies that start of options (ie '[')
@return The title as a String or null if the title is blank. | [
"Gets",
"the",
"Injection",
"Setting",
"for",
"these",
"options",
"when",
"using",
"the",
"String",
"Constructor",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/entities/InjectionOptions.java#L78-L80 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/Stripe.java | Stripe.retrieveSourceSynchronous | public Source retrieveSourceSynchronous(
@NonNull @Size(min = 1) String sourceId,
@NonNull @Size(min = 1) String clientSecret)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
APIException {
"""
Retrieve an exis... | java | public Source retrieveSourceSynchronous(
@NonNull @Size(min = 1) String sourceId,
@NonNull @Size(min = 1) String clientSecret)
throws AuthenticationException,
InvalidRequestException,
APIConnectionException,
APIException {
return retrieveSo... | [
"public",
"Source",
"retrieveSourceSynchronous",
"(",
"@",
"NonNull",
"@",
"Size",
"(",
"min",
"=",
"1",
")",
"String",
"sourceId",
",",
"@",
"NonNull",
"@",
"Size",
"(",
"min",
"=",
"1",
")",
"String",
"clientSecret",
")",
"throws",
"AuthenticationException... | Retrieve an existing {@link Source} from the Stripe API. Note that this is a
synchronous method, and cannot be called on the main thread. Doing so will cause your app
to crash. This method uses the default publishable key for this {@link Stripe} instance.
@param sourceId the {@link Source#mId} field of the desired Sou... | [
"Retrieve",
"an",
"existing",
"{",
"@link",
"Source",
"}",
"from",
"the",
"Stripe",
"API",
".",
"Note",
"that",
"this",
"is",
"a",
"synchronous",
"method",
"and",
"cannot",
"be",
"called",
"on",
"the",
"main",
"thread",
".",
"Doing",
"so",
"will",
"cause... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/Stripe.java#L784-L792 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/SecurityServletConfiguratorHelper.java | SecurityServletConfiguratorHelper.createFormLoginConfiguration | private FormLoginConfiguration createFormLoginConfiguration(LoginConfig loginConfig) {
"""
Creates a form login configuration object that represents a form-login-config element in web.xml and/or web-fragment.xml files.
@param loginConfig the login-config element
@return the security code's representation of a ... | java | private FormLoginConfiguration createFormLoginConfiguration(LoginConfig loginConfig) {
FormLoginConfiguration formLoginConfiguration = null;
FormLoginConfig formLoginConfig = loginConfig.getFormLoginConfig();
if (formLoginConfig != null) {
String loginPage = formLoginConfig.getFormLo... | [
"private",
"FormLoginConfiguration",
"createFormLoginConfiguration",
"(",
"LoginConfig",
"loginConfig",
")",
"{",
"FormLoginConfiguration",
"formLoginConfiguration",
"=",
"null",
";",
"FormLoginConfig",
"formLoginConfig",
"=",
"loginConfig",
".",
"getFormLoginConfig",
"(",
")... | Creates a form login configuration object that represents a form-login-config element in web.xml and/or web-fragment.xml files.
@param loginConfig the login-config element
@return the security code's representation of a login configuration | [
"Creates",
"a",
"form",
"login",
"configuration",
"object",
"that",
"represents",
"a",
"form",
"-",
"login",
"-",
"config",
"element",
"in",
"web",
".",
"xml",
"and",
"/",
"or",
"web",
"-",
"fragment",
".",
"xml",
"files",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/SecurityServletConfiguratorHelper.java#L646-L655 |
JOML-CI/JOML | src/org/joml/Vector4d.java | Vector4d.set | public Vector4d set(int index, ByteBuffer buffer) {
"""
Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buff... | java | public Vector4d set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4d",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4d.java#L502-L505 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java | FlowTriggerScheduler.getScheduledFlowTriggerJobs | public List<ScheduledFlowTrigger> getScheduledFlowTriggerJobs() {
"""
Retrieve the list of scheduled flow triggers from quartz database
"""
try {
final Scheduler quartzScheduler = this.scheduler.getScheduler();
final List<String> groupNames = quartzScheduler.getJobGroupNames();
final Lis... | java | public List<ScheduledFlowTrigger> getScheduledFlowTriggerJobs() {
try {
final Scheduler quartzScheduler = this.scheduler.getScheduler();
final List<String> groupNames = quartzScheduler.getJobGroupNames();
final List<ScheduledFlowTrigger> flowTriggerJobDetails = new ArrayList<>();
for (final... | [
"public",
"List",
"<",
"ScheduledFlowTrigger",
">",
"getScheduledFlowTriggerJobs",
"(",
")",
"{",
"try",
"{",
"final",
"Scheduler",
"quartzScheduler",
"=",
"this",
".",
"scheduler",
".",
"getScheduler",
"(",
")",
";",
"final",
"List",
"<",
"String",
">",
"grou... | Retrieve the list of scheduled flow triggers from quartz database | [
"Retrieve",
"the",
"list",
"of",
"scheduled",
"flow",
"triggers",
"from",
"quartz",
"database"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/flowtrigger/quartz/FlowTriggerScheduler.java#L136-L175 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java | TmdbPeople.getPersonCombinedCredits | public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
"""
Get the combined (movie and TV) credits for a specific person id.
To get the expanded details for each TV record, call the /credit method
with the provided credit_id.
This will provide ... | java | public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.... | [
"public",
"PersonCreditList",
"<",
"CreditBasic",
">",
"getPersonCombinedCredits",
"(",
"int",
"personId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
"... | Get the combined (movie and TV) credits for a specific person id.
To get the expanded details for each TV record, call the /credit method
with the provided credit_id.
This will provide details about which episode and/or season the credit is
for.
@param personId
@param language
@return
@throws MovieDbException | [
"Get",
"the",
"combined",
"(",
"movie",
"and",
"TV",
")",
"credits",
"for",
"a",
"specific",
"person",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L169-L186 |
TakahikoKawasaki/nv-bluetooth | src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java | ADPayloadParser.registerManufacturerSpecificBuilder | public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder) {
"""
Register a builder for the company ID. The given builder is added
at the beginning of the list of the builders for the company ID.
@param companyId
Company ID. The value must be in the range from 0 to 0... | java | public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder)
{
if (companyId < 0 || 0xFFFF < companyId)
{
String message = String.format("'companyId' is out of the valid range: %d", companyId);
throw new IllegalArgumentException(messag... | [
"public",
"void",
"registerManufacturerSpecificBuilder",
"(",
"int",
"companyId",
",",
"ADManufacturerSpecificBuilder",
"builder",
")",
"{",
"if",
"(",
"companyId",
"<",
"0",
"||",
"0xFFFF",
"<",
"companyId",
")",
"{",
"String",
"message",
"=",
"String",
".",
"f... | Register a builder for the company ID. The given builder is added
at the beginning of the list of the builders for the company ID.
@param companyId
Company ID. The value must be in the range from 0 to 0xFFFF.
@param builder
A builder. | [
"Register",
"a",
"builder",
"for",
"the",
"company",
"ID",
".",
"The",
"given",
"builder",
"is",
"added",
"at",
"the",
"beginning",
"of",
"the",
"list",
"of",
"the",
"builders",
"for",
"the",
"company",
"ID",
"."
] | train | https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L193-L221 |
highsource/hyperjaxb3 | ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/xjc/reader/TypeUtil.java | TypeUtil.getCommonBaseType | public static JType getCommonBaseType( JCodeModel codeModel, Collection<? extends JType> types ) {
"""
Computes the common base type of two types.
@param types
set of {@link JType} objects.
"""
return getCommonBaseType( codeModel, types.toArray(new JType[types.size()]) );
} | java | public static JType getCommonBaseType( JCodeModel codeModel, Collection<? extends JType> types ) {
return getCommonBaseType( codeModel, types.toArray(new JType[types.size()]) );
} | [
"public",
"static",
"JType",
"getCommonBaseType",
"(",
"JCodeModel",
"codeModel",
",",
"Collection",
"<",
"?",
"extends",
"JType",
">",
"types",
")",
"{",
"return",
"getCommonBaseType",
"(",
"codeModel",
",",
"types",
".",
"toArray",
"(",
"new",
"JType",
"[",
... | Computes the common base type of two types.
@param types
set of {@link JType} objects. | [
"Computes",
"the",
"common",
"base",
"type",
"of",
"two",
"types",
"."
] | train | https://github.com/highsource/hyperjaxb3/blob/c645d1628b8c26a844858d221fc9affe9c18543e/ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/xjc/reader/TypeUtil.java#L51-L53 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.element | public JSONArray element( Map value, JsonConfig jsonConfig ) {
"""
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
@param value A Map value.
@return this.
"""
if( value instanceof JSONObject ){
elements.add( value );
return this;
... | java | public JSONArray element( Map value, JsonConfig jsonConfig ) {
if( value instanceof JSONObject ){
elements.add( value );
return this;
}else{
return element( JSONObject.fromObject( value, jsonConfig ) );
}
} | [
"public",
"JSONArray",
"element",
"(",
"Map",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"value",
"instanceof",
"JSONObject",
")",
"{",
"elements",
".",
"add",
"(",
"value",
")",
";",
"return",
"this",
";",
"}",
"else",
"{",
"return",... | Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
@param value A Map value.
@return this. | [
"Put",
"a",
"value",
"in",
"the",
"JSONArray",
"where",
"the",
"value",
"will",
"be",
"a",
"JSONObject",
"which",
"is",
"produced",
"from",
"a",
"Map",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L1534-L1541 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java | DatabaseURIHelper.changesUri | public URI changesUri(String queryKey, Object queryValue) {
"""
Returns URI for {@code _changes} endpoint using passed
{@code query}.
"""
if(queryKey.equals("since")){
if(!(queryValue instanceof String)){
//json encode the seq number since it isn't a string
... | java | public URI changesUri(String queryKey, Object queryValue) {
if(queryKey.equals("since")){
if(!(queryValue instanceof String)){
//json encode the seq number since it isn't a string
Gson gson = new Gson();
queryValue = gson.toJson(queryValue);
... | [
"public",
"URI",
"changesUri",
"(",
"String",
"queryKey",
",",
"Object",
"queryValue",
")",
"{",
"if",
"(",
"queryKey",
".",
"equals",
"(",
"\"since\"",
")",
")",
"{",
"if",
"(",
"!",
"(",
"queryValue",
"instanceof",
"String",
")",
")",
"{",
"//json enco... | Returns URI for {@code _changes} endpoint using passed
{@code query}. | [
"Returns",
"URI",
"for",
"{"
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java#L91-L101 |
playn/playn | core/src/playn/core/json/JsonArray.java | JsonArray.getString | public String getString(int key, String default_) {
"""
Returns the {@link String} at the given index, or the default if it does not exist or is the wrong type.
"""
Object o = get(key);
return (o instanceof String) ? (String)o : default_;
} | java | public String getString(int key, String default_) {
Object o = get(key);
return (o instanceof String) ? (String)o : default_;
} | [
"public",
"String",
"getString",
"(",
"int",
"key",
",",
"String",
"default_",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"key",
")",
";",
"return",
"(",
"o",
"instanceof",
"String",
")",
"?",
"(",
"String",
")",
"o",
":",
"default_",
";",
"}"
] | Returns the {@link String} at the given index, or the default if it does not exist or is the wrong type. | [
"Returns",
"the",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonArray.java#L194-L197 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/io/CsvBeanReader.java | CsvBeanReader.instantiateBean | private static <T> T instantiateBean(final Class<T> clazz) {
"""
Instantiates the bean (or creates a proxy if it's an interface).
@param clazz
the bean class to instantiate (a proxy will be created if an interface is supplied), using the default
(no argument) constructor
@return the instantiated bean
@throw... | java | private static <T> T instantiateBean(final Class<T> clazz) {
final T bean;
if( clazz.isInterface() ) {
bean = BeanInterfaceProxy.createProxy(clazz);
} else {
try {
Constructor<T> c = clazz.getDeclaredConstructor(new Class[0]);
c.setAccessible(true);
bean = c.newInstance(new Object[0]);
}
c... | [
"private",
"static",
"<",
"T",
">",
"T",
"instantiateBean",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"final",
"T",
"bean",
";",
"if",
"(",
"clazz",
".",
"isInterface",
"(",
")",
")",
"{",
"bean",
"=",
"BeanInterfaceProxy",
".",
"creat... | Instantiates the bean (or creates a proxy if it's an interface).
@param clazz
the bean class to instantiate (a proxy will be created if an interface is supplied), using the default
(no argument) constructor
@return the instantiated bean
@throws SuperCsvReflectionException
if there was a reflection exception when insta... | [
"Instantiates",
"the",
"bean",
"(",
"or",
"creates",
"a",
"proxy",
"if",
"it",
"s",
"an",
"interface",
")",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/io/CsvBeanReader.java#L92-L119 |
phax/ph-oton | ph-oton-jscode/src/main/java/com/helger/html/jscode/JSRegExLiteral.java | JSRegExLiteral.gim | @Nonnull
public JSRegExLiteral gim (final boolean bGlobal, final boolean bCaseInsensitive, final boolean bMultiLine) {
"""
Set global, case insensitive and multi line at once
@param bGlobal
value for global
@param bCaseInsensitive
value for case insensitive
@param bMultiLine
value for multi line
@return... | java | @Nonnull
public JSRegExLiteral gim (final boolean bGlobal, final boolean bCaseInsensitive, final boolean bMultiLine)
{
return global (bGlobal).caseInsensitive (bCaseInsensitive).multiLine (bMultiLine);
} | [
"@",
"Nonnull",
"public",
"JSRegExLiteral",
"gim",
"(",
"final",
"boolean",
"bGlobal",
",",
"final",
"boolean",
"bCaseInsensitive",
",",
"final",
"boolean",
"bMultiLine",
")",
"{",
"return",
"global",
"(",
"bGlobal",
")",
".",
"caseInsensitive",
"(",
"bCaseInsen... | Set global, case insensitive and multi line at once
@param bGlobal
value for global
@param bCaseInsensitive
value for case insensitive
@param bMultiLine
value for multi line
@return this | [
"Set",
"global",
"case",
"insensitive",
"and",
"multi",
"line",
"at",
"once"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-jscode/src/main/java/com/helger/html/jscode/JSRegExLiteral.java#L93-L97 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeMultiply | public static long safeMultiply(long a, int b) {
"""
Safely multiply a long by an int.
@param a the first value
@param b the second value
@return the new total
@throws ArithmeticException if the result overflows a long
"""
switch (b) {
case -1:
if (a == Long.MIN_VALU... | java | public static long safeMultiply(long a, int b) {
switch (b) {
case -1:
if (a == Long.MIN_VALUE) {
throw new ArithmeticException("Multiplication overflows a long: " + a + " * " + b);
}
return -a;
case 0:
r... | [
"public",
"static",
"long",
"safeMultiply",
"(",
"long",
"a",
",",
"int",
"b",
")",
"{",
"switch",
"(",
"b",
")",
"{",
"case",
"-",
"1",
":",
"if",
"(",
"a",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"M... | Safely multiply a long by an int.
@param a the first value
@param b the second value
@return the new total
@throws ArithmeticException if the result overflows a long | [
"Safely",
"multiply",
"a",
"long",
"by",
"an",
"int",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L231-L248 |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/Handshaker.java | Handshaker.sendChangeCipherSpec | void sendChangeCipherSpec(Finished mesg, boolean lastMessage)
throws IOException {
"""
/*
Sends a change cipher spec message and updates the write side
cipher state so that future messages use the just-negotiated spec.
"""
output.flush(); // i.e. handshake data
/*
* The... | java | void sendChangeCipherSpec(Finished mesg, boolean lastMessage)
throws IOException {
output.flush(); // i.e. handshake data
/*
* The write cipher state is protected by the connection write lock
* so we must grab it while making the change. We also
* make sure no wr... | [
"void",
"sendChangeCipherSpec",
"(",
"Finished",
"mesg",
",",
"boolean",
"lastMessage",
")",
"throws",
"IOException",
"{",
"output",
".",
"flush",
"(",
")",
";",
"// i.e. handshake data",
"/*\n * The write cipher state is protected by the connection write lock\n ... | /*
Sends a change cipher spec message and updates the write side
cipher state so that future messages use the just-negotiated spec. | [
"/",
"*",
"Sends",
"a",
"change",
"cipher",
"spec",
"message",
"and",
"updates",
"the",
"write",
"side",
"cipher",
"state",
"so",
"that",
"future",
"messages",
"use",
"the",
"just",
"-",
"negotiated",
"spec",
"."
] | train | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/Handshaker.java#L987-L1048 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java | LocalNetworkGatewaysInner.getByResourceGroupAsync | public Observable<LocalNetworkGatewayInner> getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) {
"""
Gets the specified local network gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network... | java | public Observable<LocalNetworkGatewayInner> getByResourceGroupAsync(String resourceGroupName, String localNetworkGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1<ServiceResponse<LocalNetworkGatewayInner>, LocalNetworkGatewayInner>() {
... | [
"public",
"Observable",
"<",
"LocalNetworkGatewayInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"localNetworkGatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"localNetworkG... | Gets the specified local network gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the LocalNetworkGatewayInner o... | [
"Gets",
"the",
"specified",
"local",
"network",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | 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/LocalNetworkGatewaysInner.java#L310-L317 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getInternalState | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
"""
Get the value of a field using reflection. Use this method when you need
to specify in which class the field is declared. This might be useful
when you have mocked the instance you are t... | java | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
if (object == null || fieldName == null || fieldName.equals("") || fieldName.startsWith(" ")) {
throw new IllegalArgumentException("object, field name, and \"where\" must not be... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"if",
"(",
"object",
"==",
"null",
"||",
... | Get the value of a field using reflection. Use this method when you need
to specify in which class the field is declared. This might be useful
when you have mocked the instance you are trying to access. Use this
method to avoid casting.
@param <T> the expected type of the field
@param object the object to mod... | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
".",
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"specify",
"in",
"which",
"class",
"the",
"field",
"is",
"declared",
".",
"This",
"might",
"be",
"useful",
"when",
"you",
"have",... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L612-L629 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/Iterables.java | Iterables.concat | public static <T> Iterable<T> concat(Iterable<? extends T> a,
Iterable<? extends T> b, Iterable<? extends T> c,
Iterable<? extends T> d) {
"""
Combines four iterables into a single iterable. The returned iterable has
an iterator that traverses the elements in {@code a}, followed by the
elements in {@... | java | public static <T> Iterable<T> concat(Iterable<? extends T> a,
Iterable<? extends T> b, Iterable<? extends T> c,
Iterable<? extends T> d) {
return concat(ImmutableList.of(a, b, c, d));
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"concat",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"a",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"b",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"c",
",",
"Iterable"... | Combines four iterables into a single iterable. The returned iterable has
an iterator that traverses the elements in {@code a}, followed by the
elements in {@code b}, followed by the elements in {@code c}, followed by
the elements in {@code d}. The source iterators are not polled until
necessary.
<p>The returned itera... | [
"Combines",
"four",
"iterables",
"into",
"a",
"single",
"iterable",
".",
"The",
"returned",
"iterable",
"has",
"an",
"iterator",
"that",
"traverses",
"the",
"elements",
"in",
"{",
"@code",
"a",
"}",
"followed",
"by",
"the",
"elements",
"in",
"{",
"@code",
... | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/Iterables.java#L467-L471 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java | OshiPlatformCache.getFileStoreMetric | public Double getFileStoreMetric(String fileStoreNameName, ID metricToCollect) {
"""
Returns the given metric's value, or null if there is no file store with the given name.
@param fileStoreNameName name of file store
@param metricToCollect the metric to collect
@return the value of the metric, or null if the... | java | public Double getFileStoreMetric(String fileStoreNameName, ID metricToCollect) {
Map<String, OSFileStore> cache = getFileStores();
OSFileStore fileStore = cache.get(fileStoreNameName);
if (fileStore == null) {
return null;
}
if (PlatformMetricType.FILE_STORE_TOTAL_S... | [
"public",
"Double",
"getFileStoreMetric",
"(",
"String",
"fileStoreNameName",
",",
"ID",
"metricToCollect",
")",
"{",
"Map",
"<",
"String",
",",
"OSFileStore",
">",
"cache",
"=",
"getFileStores",
"(",
")",
";",
"OSFileStore",
"fileStore",
"=",
"cache",
".",
"g... | Returns the given metric's value, or null if there is no file store with the given name.
@param fileStoreNameName name of file store
@param metricToCollect the metric to collect
@return the value of the metric, or null if there is no file store with the given name | [
"Returns",
"the",
"given",
"metric",
"s",
"value",
"or",
"null",
"if",
"there",
"is",
"no",
"file",
"store",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java#L309-L324 |
autermann/yaml | src/main/java/com/github/autermann/yaml/YamlNodeRepresenter.java | YamlNodeRepresenter.delegate | private MappingNode delegate(Tag tag,
Iterable<Entry<YamlNode, YamlNode>> mapping) {
"""
Create a {@link MappingNode} from the specified entries and tag.
@param tag the tag
@param mapping the entries
@return the mapping node
"""
List<NodeTuple> value = new Li... | java | private MappingNode delegate(Tag tag,
Iterable<Entry<YamlNode, YamlNode>> mapping) {
List<NodeTuple> value = new LinkedList<>();
MappingNode node = new MappingNode(tag, value, null);
representedObjects.put(objectToRepresent, node);
boolean bestStyle = tru... | [
"private",
"MappingNode",
"delegate",
"(",
"Tag",
"tag",
",",
"Iterable",
"<",
"Entry",
"<",
"YamlNode",
",",
"YamlNode",
">",
">",
"mapping",
")",
"{",
"List",
"<",
"NodeTuple",
">",
"value",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"MappingNode",... | Create a {@link MappingNode} from the specified entries and tag.
@param tag the tag
@param mapping the entries
@return the mapping node | [
"Create",
"a",
"{",
"@link",
"MappingNode",
"}",
"from",
"the",
"specified",
"entries",
"and",
"tag",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/YamlNodeRepresenter.java#L162-L182 |
henkexbg/gallery-api | src/main/java/com/github/henkexbg/gallery/service/impl/GalleryServiceImpl.java | GalleryServiceImpl.getPublicPathFromRealFile | @Override
public String getPublicPathFromRealFile(String publicRoot, File file) throws IOException, NotAllowedException {
"""
A kind of inverse lookup - finding the public path given the actual file.
<strong>NOTE! This method does NOT verify that the current user actually
has the right to access the given pu... | java | @Override
public String getPublicPathFromRealFile(String publicRoot, File file) throws IOException, NotAllowedException {
String actualFilePath = file.getCanonicalPath();
File rootFile = galleryAuthorizationService.getRootPathsForCurrentUser().get(publicRoot);
String relativePath = actualFil... | [
"@",
"Override",
"public",
"String",
"getPublicPathFromRealFile",
"(",
"String",
"publicRoot",
",",
"File",
"file",
")",
"throws",
"IOException",
",",
"NotAllowedException",
"{",
"String",
"actualFilePath",
"=",
"file",
".",
"getCanonicalPath",
"(",
")",
";",
"Fil... | A kind of inverse lookup - finding the public path given the actual file.
<strong>NOTE! This method does NOT verify that the current user actually
has the right to access the given publicRoot! It is the responsibility of
calling methods to make sure only allowed root paths are used.</strong>
@param publicRoot
@param f... | [
"A",
"kind",
"of",
"inverse",
"lookup",
"-",
"finding",
"the",
"public",
"path",
"given",
"the",
"actual",
"file",
".",
"<strong",
">",
"NOTE!",
"This",
"method",
"does",
"NOT",
"verify",
"that",
"the",
"current",
"user",
"actually",
"has",
"the",
"right",... | train | https://github.com/henkexbg/gallery-api/blob/530e68c225b5e8fc3b608d670b34bd539a5b0a71/src/main/java/com/github/henkexbg/gallery/service/impl/GalleryServiceImpl.java#L321-L332 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPath | public static IMessageReceiver createMessageReceiverFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException {
"""
Creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceEndpointURI endp... | java | public static IMessageReceiver createMessageReceiverFromEntityPath(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(createMessageReceiverFromEntityPathAsync(namespaceEndpointURI, entityPath, clientSettings)... | [
"public",
"static",
"IMessageReceiver",
"createMessageReceiverFromEntityPath",
"(",
"URI",
"namespaceEndpointURI",
",",
"String",
"entityPath",
",",
"ClientSettings",
"clientSettings",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Utils",
... | Creates a message receiver to the entity using the client settings in PeekLock mode
@param namespaceEndpointURI endpoint uri of entity namespace
@param entityPath path of the entity
@param clientSettings client settings
@return IMessageReceiver instance
@throws InterruptedException if the current thread was interrupted... | [
"Creates",
"a",
"message",
"receiver",
"to",
"the",
"entity",
"using",
"the",
"client",
"settings",
"in",
"PeekLock",
"mode"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L308-L310 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java | CommercePriceEntryPersistenceImpl.findByGroupId | @Override
public List<CommercePriceEntry> findByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the commerce price entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are no... | java | @Override
public List<CommercePriceEntry> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
... | Returns a range of all the commerce price entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L1535-L1539 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetDeploymentResult.java | GetDeploymentResult.setApiSummary | public void setApiSummary(java.util.Map<String, java.util.Map<String, MethodSnapshot>> apiSummary) {
"""
<p>
A summary of the <a>RestApi</a> at the date and time that the deployment resource was created.
</p>
@param apiSummary
A summary of the <a>RestApi</a> at the date and time that the deployment resource ... | java | public void setApiSummary(java.util.Map<String, java.util.Map<String, MethodSnapshot>> apiSummary) {
this.apiSummary = apiSummary;
} | [
"public",
"void",
"setApiSummary",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MethodSnapshot",
">",
">",
"apiSummary",
")",
"{",
"this",
".",
"apiSummary",
"=",
"apiSummary",
";",
"}"... | <p>
A summary of the <a>RestApi</a> at the date and time that the deployment resource was created.
</p>
@param apiSummary
A summary of the <a>RestApi</a> at the date and time that the deployment resource was created. | [
"<p",
">",
"A",
"summary",
"of",
"the",
"<a",
">",
"RestApi<",
"/",
"a",
">",
"at",
"the",
"date",
"and",
"time",
"that",
"the",
"deployment",
"resource",
"was",
"created",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetDeploymentResult.java#L200-L202 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetNextHop | public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) {
"""
Gets the next hop from the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Para... | java | public NextHopResultInner beginGetNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) {
return beginGetNextHopWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body();
} | [
"public",
"NextHopResultInner",
"beginGetNextHop",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NextHopParameters",
"parameters",
")",
"{",
"return",
"beginGetNextHopWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName"... | Gets the next hop from the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters that define the source and destination endpoint.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cl... | [
"Gets",
"the",
"next",
"hop",
"from",
"the",
"specified",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1201-L1203 |
belaban/JGroups | src/org/jgroups/auth/Krb5TokenUtils.java | Krb5TokenUtils.validateSecurityContext | public static String validateSecurityContext(Subject subject, final byte[] serviceTicket) throws GSSException {
"""
Validate the service ticket by extracting the client principal name
"""
// Accept the context and return the client principal name.
return Subject.doAs(subject, (PrivilegedAction... | java | public static String validateSecurityContext(Subject subject, final byte[] serviceTicket) throws GSSException {
// Accept the context and return the client principal name.
return Subject.doAs(subject, (PrivilegedAction<String>)() -> {
try {
// Identify the server that commun... | [
"public",
"static",
"String",
"validateSecurityContext",
"(",
"Subject",
"subject",
",",
"final",
"byte",
"[",
"]",
"serviceTicket",
")",
"throws",
"GSSException",
"{",
"// Accept the context and return the client principal name.",
"return",
"Subject",
".",
"doAs",
"(",
... | Validate the service ticket by extracting the client principal name | [
"Validate",
"the",
"service",
"ticket",
"by",
"extracting",
"the",
"client",
"principal",
"name"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/auth/Krb5TokenUtils.java#L87-L103 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionsL | public static long checkPostconditionsL(
final long value,
final ContractLongConditionType... conditions)
throws PostconditionViolationException {
"""
A {@code long} specialized version of {@link #checkPostconditions(Object,
ContractConditionType[])}
@param value The value
@param conditions T... | java | public static long checkPostconditionsL(
final long value,
final ContractLongConditionType... conditions)
throws PostconditionViolationException
{
final Violations violations = innerCheckAllLong(value, conditions);
if (violations != null) {
throw failed(null, Long.valueOf(value), violations)... | [
"public",
"static",
"long",
"checkPostconditionsL",
"(",
"final",
"long",
"value",
",",
"final",
"ContractLongConditionType",
"...",
"conditions",
")",
"throws",
"PostconditionViolationException",
"{",
"final",
"Violations",
"violations",
"=",
"innerCheckAllLong",
"(",
... | A {@code long} specialized version of {@link #checkPostconditions(Object,
ContractConditionType[])}
@param value The value
@param conditions The conditions the value must obey
@return value
@throws PostconditionViolationException If any of the conditions are false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostconditions",
"(",
"Object",
"ContractConditionType",
"[]",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L122-L132 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.groupingBy | public <K, D> Map<K, D> groupingBy(Function<? super T, ? extends K> classifier,
Collector<? super T, ?, D> downstream) {
"""
Returns a {@code Map} whose keys are the values resulting from applying
the classification function to the input elements, and whose
corresponding values are the result of redu... | java | public <K, D> Map<K, D> groupingBy(Function<? super T, ? extends K> classifier,
Collector<? super T, ?, D> downstream) {
if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED))
return rawCollect(Collectors.groupingByConcurrent(classifier, downstream));
... | [
"public",
"<",
"K",
",",
"D",
">",
"Map",
"<",
"K",
",",
"D",
">",
"groupingBy",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"classifier",
",",
"Collector",
"<",
"?",
"super",
"T",
",",
"?",
",",
"D",
">",
"downstrea... | Returns a {@code Map} whose keys are the values resulting from applying
the classification function to the input elements, and whose
corresponding values are the result of reduction of the input elements
which map to the associated key under the classification function.
<p>
There are no guarantees on the type, mutabil... | [
"Returns",
"a",
"{",
"@code",
"Map",
"}",
"whose",
"keys",
"are",
"the",
"values",
"resulting",
"from",
"applying",
"the",
"classification",
"function",
"to",
"the",
"input",
"elements",
"and",
"whose",
"corresponding",
"values",
"are",
"the",
"result",
"of",
... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L532-L537 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildPackageTags | public void buildPackageTags(XMLNode node, Content packageContentTree) {
"""
Build the tags of the summary.
@param node the XML element that specifies which components to document
@param packageContentTree the tree to which the package tags will be added
"""
if (configuration.nocomment) {
... | java | public void buildPackageTags(XMLNode node, Content packageContentTree) {
if (configuration.nocomment) {
return;
}
packageWriter.addPackageTags(packageContentTree);
} | [
"public",
"void",
"buildPackageTags",
"(",
"XMLNode",
"node",
",",
"Content",
"packageContentTree",
")",
"{",
"if",
"(",
"configuration",
".",
"nocomment",
")",
"{",
"return",
";",
"}",
"packageWriter",
".",
"addPackageTags",
"(",
"packageContentTree",
")",
";",... | Build the tags of the summary.
@param node the XML element that specifies which components to document
@param packageContentTree the tree to which the package tags will be added | [
"Build",
"the",
"tags",
"of",
"the",
"summary",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java#L347-L352 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/ui/A_CmsPreviewDialog.java | A_CmsPreviewDialog.confirmSaveChanges | public void confirmSaveChanges(String message, final Command onConfirm, final Command onCancel) {
"""
Displays a confirm save changes dialog with the given message.
May insert individual message before the given one for further information.<p>
Will call the appropriate command after saving/cancel.<p>
@param m... | java | public void confirmSaveChanges(String message, final Command onConfirm, final Command onCancel) {
CmsConfirmDialog confirmDialog = new CmsConfirmDialog("Confirm", message);
confirmDialog.setHandler(new I_CmsConfirmDialogHandler() {
/**
* @see org.opencms.gwt.client.ui.I_CmsClo... | [
"public",
"void",
"confirmSaveChanges",
"(",
"String",
"message",
",",
"final",
"Command",
"onConfirm",
",",
"final",
"Command",
"onCancel",
")",
"{",
"CmsConfirmDialog",
"confirmDialog",
"=",
"new",
"CmsConfirmDialog",
"(",
"\"Confirm\"",
",",
"message",
")",
";"... | Displays a confirm save changes dialog with the given message.
May insert individual message before the given one for further information.<p>
Will call the appropriate command after saving/cancel.<p>
@param message the message to display
@param onConfirm the command executed after saving
@param onCancel the command ex... | [
"Displays",
"a",
"confirm",
"save",
"changes",
"dialog",
"with",
"the",
"given",
"message",
".",
"May",
"insert",
"individual",
"message",
"before",
"the",
"given",
"one",
"for",
"further",
"information",
".",
"<p",
">",
"Will",
"call",
"the",
"appropriate",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/A_CmsPreviewDialog.java#L181-L207 |
square/spoon | spoon-runner/src/main/java/com/squareup/spoon/html/HtmlUtils.java | HtmlUtils.processStackTrace | static ExceptionInfo processStackTrace(StackTrace exception) {
"""
Parse the string representation of an exception to a {@link ExceptionInfo} instance.
"""
if (exception == null) {
return null;
}
// Escape any special HTML characters in the exception that would otherwise break the HTML
//... | java | static ExceptionInfo processStackTrace(StackTrace exception) {
if (exception == null) {
return null;
}
// Escape any special HTML characters in the exception that would otherwise break the HTML
// rendering (e.g. the angle brackets around the default toString() for enums).
String message = Str... | [
"static",
"ExceptionInfo",
"processStackTrace",
"(",
"StackTrace",
"exception",
")",
"{",
"if",
"(",
"exception",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Escape any special HTML characters in the exception that would otherwise break the HTML",
"// rendering (e... | Parse the string representation of an exception to a {@link ExceptionInfo} instance. | [
"Parse",
"the",
"string",
"representation",
"of",
"an",
"exception",
"to",
"a",
"{"
] | train | https://github.com/square/spoon/blob/ebd51fbc1498f6bdcb61aa1281bbac2af99117b3/spoon-runner/src/main/java/com/squareup/spoon/html/HtmlUtils.java#L135-L158 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java | SignatureUtils.similarPackages | public static boolean similarPackages(String packName1, String packName2, int depth) {
"""
returns whether or not the two packages have the same first 'depth' parts, if they exist
@param packName1
the first package to check
@param packName2
the second package to check
@param depth
the number of package par... | java | public static boolean similarPackages(String packName1, String packName2, int depth) {
if (depth == 0) {
return true;
}
String dottedPackName1 = packName1.replace('/', '.');
String dottedPackName2 = packName2.replace('/', '.');
int dot1 = dottedPackName1.indexOf('.'... | [
"public",
"static",
"boolean",
"similarPackages",
"(",
"String",
"packName1",
",",
"String",
"packName2",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"depth",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"String",
"dottedPackName1",
"=",
"packName1",
"."... | returns whether or not the two packages have the same first 'depth' parts, if they exist
@param packName1
the first package to check
@param packName2
the second package to check
@param depth
the number of package parts to check
@return if they are similar | [
"returns",
"whether",
"or",
"not",
"the",
"two",
"packages",
"have",
"the",
"same",
"first",
"depth",
"parts",
"if",
"they",
"exist"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java#L117-L141 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.opentracing.1.3/src/com/ibm/ws/microprofile/opentracing/OpenTracingService.java | OpenTracingService.isNotTraced | public static boolean isNotTraced(String classOperationName, String methodOperationName) {
"""
Return true if {@code methodOperationName} is not null (i.e. it represents
something that has the {@code Traced} annotation) and if the
{@code Traced} annotation was explicitly set to {@code false}, or return
true if ... | java | public static boolean isNotTraced(String classOperationName, String methodOperationName) {
return OPERATION_NAME_UNTRACED.equals(methodOperationName) || (OPERATION_NAME_UNTRACED.equals(classOperationName) && !isTraced(methodOperationName));
} | [
"public",
"static",
"boolean",
"isNotTraced",
"(",
"String",
"classOperationName",
",",
"String",
"methodOperationName",
")",
"{",
"return",
"OPERATION_NAME_UNTRACED",
".",
"equals",
"(",
"methodOperationName",
")",
"||",
"(",
"OPERATION_NAME_UNTRACED",
".",
"equals",
... | Return true if {@code methodOperationName} is not null (i.e. it represents
something that has the {@code Traced} annotation) and if the
{@code Traced} annotation was explicitly set to {@code false}, or return
true if {@code classOperationName} is not null (i.e. it represents
something that has the {@code Traced} annota... | [
"Return",
"true",
"if",
"{",
"@code",
"methodOperationName",
"}",
"is",
"not",
"null",
"(",
"i",
".",
"e",
".",
"it",
"represents",
"something",
"that",
"has",
"the",
"{",
"@code",
"Traced",
"}",
"annotation",
")",
"and",
"if",
"the",
"{",
"@code",
"Tr... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.opentracing.1.3/src/com/ibm/ws/microprofile/opentracing/OpenTracingService.java#L104-L106 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableArray.java | MutableArray.setString | @NonNull
@Override
public MutableArray setString(int index, String value) {
"""
Sets an String object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the String object
@return The self object
"""
return setValue(index, value);
... | java | @NonNull
@Override
public MutableArray setString(int index, String value) {
return setValue(index, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableArray",
"setString",
"(",
"int",
"index",
",",
"String",
"value",
")",
"{",
"return",
"setValue",
"(",
"index",
",",
"value",
")",
";",
"}"
] | Sets an String object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the String object
@return The self object | [
"Sets",
"an",
"String",
"object",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L117-L121 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/Plan.java | Plan.registerCachedFile | public void registerCachedFile(String name, DistributedCacheEntry entry) throws IOException {
"""
register cache files in program level
@param entry contains all relevant information
@param name user defined name of that file
@throws java.io.IOException
"""
if (!this.cacheFile.containsKey(name)) {
this... | java | public void registerCachedFile(String name, DistributedCacheEntry entry) throws IOException {
if (!this.cacheFile.containsKey(name)) {
this.cacheFile.put(name, entry);
} else {
throw new IOException("cache file " + name + "already exists!");
}
} | [
"public",
"void",
"registerCachedFile",
"(",
"String",
"name",
",",
"DistributedCacheEntry",
"entry",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"this",
".",
"cacheFile",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"this",
".",
"cacheFile",
".",
... | register cache files in program level
@param entry contains all relevant information
@param name user defined name of that file
@throws java.io.IOException | [
"register",
"cache",
"files",
"in",
"program",
"level"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/Plan.java#L339-L345 |
graknlabs/grakn | server/src/server/session/TransactionOLTP.java | TransactionOLTP.addVertexElementWithEdgeIdProperty | public VertexElement addVertexElementWithEdgeIdProperty(Schema.BaseType baseType, ConceptId conceptId) {
"""
This is only used when reifying a Relation
@param baseType Concept BaseType which will become the VertexLabel
@param conceptId ConceptId to be set on the vertex
@return just created Vertex
"""
... | java | public VertexElement addVertexElementWithEdgeIdProperty(Schema.BaseType baseType, ConceptId conceptId) {
return executeLockingMethod(() -> factory().addVertexElementWithEdgeIdProperty(baseType, conceptId));
} | [
"public",
"VertexElement",
"addVertexElementWithEdgeIdProperty",
"(",
"Schema",
".",
"BaseType",
"baseType",
",",
"ConceptId",
"conceptId",
")",
"{",
"return",
"executeLockingMethod",
"(",
"(",
")",
"->",
"factory",
"(",
")",
".",
"addVertexElementWithEdgeIdProperty",
... | This is only used when reifying a Relation
@param baseType Concept BaseType which will become the VertexLabel
@param conceptId ConceptId to be set on the vertex
@return just created Vertex | [
"This",
"is",
"only",
"used",
"when",
"reifying",
"a",
"Relation"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/session/TransactionOLTP.java#L212-L214 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/file/FileNode.java | FileNode.deleteTree | @Override
public FileNode deleteTree() throws DeleteException, NodeNotFoundException {
"""
Deletes a file or directory. Directories are deleted recursively. Handles Links.
"""
if (!exists()) {
throw new NodeNotFoundException(this);
}
try {
doDeleteTree(path);... | java | @Override
public FileNode deleteTree() throws DeleteException, NodeNotFoundException {
if (!exists()) {
throw new NodeNotFoundException(this);
}
try {
doDeleteTree(path);
} catch (IOException e) {
throw new DeleteException(this, e);
}
... | [
"@",
"Override",
"public",
"FileNode",
"deleteTree",
"(",
")",
"throws",
"DeleteException",
",",
"NodeNotFoundException",
"{",
"if",
"(",
"!",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"NodeNotFoundException",
"(",
"this",
")",
";",
"}",
"try",
"{",
"d... | Deletes a file or directory. Directories are deleted recursively. Handles Links. | [
"Deletes",
"a",
"file",
"or",
"directory",
".",
"Directories",
"are",
"deleted",
"recursively",
".",
"Handles",
"Links",
"."
] | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/file/FileNode.java#L411-L422 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java | ConsumerUtil.validateSignatureAlgorithmWithKey | void validateSignatureAlgorithmWithKey(JwtConsumerConfig config, Key key) throws InvalidClaimException {
"""
Throws an exception if the provided key is null but the config specifies a
signature algorithm other than "none".
"""
String signatureAlgorithm = config.getSignatureAlgorithm();
if (key == null && ... | java | void validateSignatureAlgorithmWithKey(JwtConsumerConfig config, Key key) throws InvalidClaimException {
String signatureAlgorithm = config.getSignatureAlgorithm();
if (key == null && signatureAlgorithm != null && !signatureAlgorithm.equalsIgnoreCase("none")) {
String msg = Tr.formatMessage(tc, "JWT_MISSING_KEY"... | [
"void",
"validateSignatureAlgorithmWithKey",
"(",
"JwtConsumerConfig",
"config",
",",
"Key",
"key",
")",
"throws",
"InvalidClaimException",
"{",
"String",
"signatureAlgorithm",
"=",
"config",
".",
"getSignatureAlgorithm",
"(",
")",
";",
"if",
"(",
"key",
"==",
"null... | Throws an exception if the provided key is null but the config specifies a
signature algorithm other than "none". | [
"Throws",
"an",
"exception",
"if",
"the",
"provided",
"key",
"is",
"null",
"but",
"the",
"config",
"specifies",
"a",
"signature",
"algorithm",
"other",
"than",
"none",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java#L394-L400 |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java | KeyStoreUtils.addPrivateKey | public static void addPrivateKey(KeyStore keyStore, File pemKeyFile, char[] passwordChars, List<Certificate> certChain) throws IOException, GeneralSecurityException {
"""
Adds a private key to the specified key store from the passed private key file and certificate chain.
@param keyStore
The key store to recei... | java | public static void addPrivateKey(KeyStore keyStore, File pemKeyFile, char[] passwordChars, List<Certificate> certChain) throws IOException, GeneralSecurityException {
final String methodName = "addPrivateKey";
logger.entry(methodName, pemKeyFile, certChain);
PrivateKey privateKey = createPrivat... | [
"public",
"static",
"void",
"addPrivateKey",
"(",
"KeyStore",
"keyStore",
",",
"File",
"pemKeyFile",
",",
"char",
"[",
"]",
"passwordChars",
",",
"List",
"<",
"Certificate",
">",
"certChain",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"f... | Adds a private key to the specified key store from the passed private key file and certificate chain.
@param keyStore
The key store to receive the private key.
@param pemKeyFile
A PEM format file containing the private key.
@param passwordChars
The password that protects the private key.
@param certChain The certifica... | [
"Adds",
"a",
"private",
"key",
"to",
"the",
"specified",
"key",
"store",
"from",
"the",
"passed",
"private",
"key",
"file",
"and",
"certificate",
"chain",
"."
] | train | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java#L125-L134 |
micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/context/ServerRequestContext.java | ServerRequestContext.with | public static <T> T with(HttpRequest request, Supplier<T> callable) {
"""
Wrap the execution of the given callable in request context processing.
@param request The request
@param callable The callable
@param <T> The return type of the callable
@return The return value of the callable
"""
H... | java | public static <T> T with(HttpRequest request, Supplier<T> callable) {
HttpRequest existing = REQUEST.get();
boolean isSet = false;
try {
if (request != existing) {
isSet = true;
REQUEST.set(request);
}
return callable.get();
... | [
"public",
"static",
"<",
"T",
">",
"T",
"with",
"(",
"HttpRequest",
"request",
",",
"Supplier",
"<",
"T",
">",
"callable",
")",
"{",
"HttpRequest",
"existing",
"=",
"REQUEST",
".",
"get",
"(",
")",
";",
"boolean",
"isSet",
"=",
"false",
";",
"try",
"... | Wrap the execution of the given callable in request context processing.
@param request The request
@param callable The callable
@param <T> The return type of the callable
@return The return value of the callable | [
"Wrap",
"the",
"execution",
"of",
"the",
"given",
"callable",
"in",
"request",
"context",
"processing",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/context/ServerRequestContext.java#L79-L93 |
drapostolos/rdp4j | src/main/java/com/github/drapostolos/rdp4j/DirectoryPoller.java | DirectoryPoller.awaitTermination | public void awaitTermination() {
"""
Blocks until the last poll-cycle has finished and all {@link AfterStopEvent} has been
processed.
"""
try {
latch.await();
} catch (InterruptedException e) {
String message = "awaitTermination() method was interrupted!";
t... | java | public void awaitTermination() {
try {
latch.await();
} catch (InterruptedException e) {
String message = "awaitTermination() method was interrupted!";
throw new UnsupportedOperationException(message, e);
}
} | [
"public",
"void",
"awaitTermination",
"(",
")",
"{",
"try",
"{",
"latch",
".",
"await",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"String",
"message",
"=",
"\"awaitTermination() method was interrupted!\"",
";",
"throw",
"new",
"U... | Blocks until the last poll-cycle has finished and all {@link AfterStopEvent} has been
processed. | [
"Blocks",
"until",
"the",
"last",
"poll",
"-",
"cycle",
"has",
"finished",
"and",
"all",
"{"
] | train | https://github.com/drapostolos/rdp4j/blob/ec1db2444d245b7ccd6607182bb56a027fa66d6b/src/main/java/com/github/drapostolos/rdp4j/DirectoryPoller.java#L194-L201 |
jboss/jboss-jstl-api_spec | src/main/java/javax/servlet/jsp/jstl/core/Config.java | Config.get | public static Object get(HttpSession session, String name) {
"""
Looks up a configuration variable in the "session" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a d... | java | public static Object get(HttpSession session, String name) {
Object ret = null;
if (session != null) {
try {
ret = session.getAttribute(name + SESSION_SCOPE_SUFFIX);
} catch (IllegalStateException ex) {
} // when session is invalidated
}
... | [
"public",
"static",
"Object",
"get",
"(",
"HttpSession",
"session",
",",
"String",
"name",
")",
"{",
"Object",
"ret",
"=",
"null",
";",
"if",
"(",
"session",
"!=",
"null",
")",
"{",
"try",
"{",
"ret",
"=",
"session",
".",
"getAttribute",
"(",
"name",
... | Looks up a configuration variable in the "session" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a different scope.</p>
@param session Session object in which the configura... | [
"Looks",
"up",
"a",
"configuration",
"variable",
"in",
"the",
"session",
"scope",
".",
"<p",
">",
"The",
"lookup",
"of",
"configuration",
"variables",
"is",
"performed",
"as",
"if",
"each",
"scope",
"had",
"its",
"own",
"name",
"space",
"that",
"is",
"the"... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/javax/servlet/jsp/jstl/core/Config.java#L142-L151 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractCommandLineRunner.java | AbstractCommandLineRunner.createInputs | @GwtIncompatible("Unnecessary")
private List<SourceFile> createInputs(
List<FlagEntry<JsSourceType>> files,
List<JsonFileSpec> jsonFiles,
List<JsModuleSpec> jsModuleSpecs)
throws IOException {
"""
Creates inputs from a list of source files and json files.
@param files A list of flag en... | java | @GwtIncompatible("Unnecessary")
private List<SourceFile> createInputs(
List<FlagEntry<JsSourceType>> files,
List<JsonFileSpec> jsonFiles,
List<JsModuleSpec> jsModuleSpecs)
throws IOException {
return createInputs(files, jsonFiles, /* allowStdIn= */ false, jsModuleSpecs);
} | [
"@",
"GwtIncompatible",
"(",
"\"Unnecessary\"",
")",
"private",
"List",
"<",
"SourceFile",
">",
"createInputs",
"(",
"List",
"<",
"FlagEntry",
"<",
"JsSourceType",
">",
">",
"files",
",",
"List",
"<",
"JsonFileSpec",
">",
"jsonFiles",
",",
"List",
"<",
"JsMo... | Creates inputs from a list of source files and json files.
@param files A list of flag entries indicates js and zip file names.
@param jsonFiles A list of json encoded files.
@param jsModuleSpecs A list js module specs.
@return An array of inputs | [
"Creates",
"inputs",
"from",
"a",
"list",
"of",
"source",
"files",
"and",
"json",
"files",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L574-L581 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java | ManagementEnforcer.removeNamedPolicy | public boolean removeNamedPolicy(String ptype, String... params) {
"""
removeNamedPolicy removes an authorization rule from the current named policy.
@param ptype the policy type, can be "p", "p2", "p3", ..
@param params the "p" policy rule.
@return succeeds or not.
"""
return removeNamedPolicy(pt... | java | public boolean removeNamedPolicy(String ptype, String... params) {
return removeNamedPolicy(ptype, Arrays.asList(params));
} | [
"public",
"boolean",
"removeNamedPolicy",
"(",
"String",
"ptype",
",",
"String",
"...",
"params",
")",
"{",
"return",
"removeNamedPolicy",
"(",
"ptype",
",",
"Arrays",
".",
"asList",
"(",
"params",
")",
")",
";",
"}"
] | removeNamedPolicy removes an authorization rule from the current named policy.
@param ptype the policy type, can be "p", "p2", "p3", ..
@param params the "p" policy rule.
@return succeeds or not. | [
"removeNamedPolicy",
"removes",
"an",
"authorization",
"rule",
"from",
"the",
"current",
"named",
"policy",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L356-L358 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.newLdaptiveSearchRequest | public static SearchRequest newLdaptiveSearchRequest(final String baseDn,
final SearchFilter filter,
final String[] binaryAttributes,
final String[] ... | java | public static SearchRequest newLdaptiveSearchRequest(final String baseDn,
final SearchFilter filter,
final String[] binaryAttributes,
final String[] ... | [
"public",
"static",
"SearchRequest",
"newLdaptiveSearchRequest",
"(",
"final",
"String",
"baseDn",
",",
"final",
"SearchFilter",
"filter",
",",
"final",
"String",
"[",
"]",
"binaryAttributes",
",",
"final",
"String",
"[",
"]",
"returnAttributes",
")",
"{",
"val",
... | Builds a new request.
@param baseDn the base dn
@param filter the filter
@param binaryAttributes the binary attributes
@param returnAttributes the return attributes
@return the search request | [
"Builds",
"a",
"new",
"request",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L469-L478 |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/internal/ConfigDescriptorFactory.java | ConfigDescriptorFactory.buildDescriptor | public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt, Optional<String> overrideValue) {
"""
Build a {@link ConfigDescriptor} for a specific Method, given optional scope, and given override value.
@param method method to include in config descriptor
@param scopeOpt option... | java | public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt, Optional<String> overrideValue)
{
checkNotNull(method);
checkNotNull(scopeOpt);
checkNotNull(overrideValue);
StaticConfigHelper.MethodValidationState validationState = StaticConfigHelper.isValidConfigIn... | [
"public",
"ConfigDescriptor",
"buildDescriptor",
"(",
"Method",
"method",
",",
"Optional",
"<",
"String",
">",
"scopeOpt",
",",
"Optional",
"<",
"String",
">",
"overrideValue",
")",
"{",
"checkNotNull",
"(",
"method",
")",
";",
"checkNotNull",
"(",
"scopeOpt",
... | Build a {@link ConfigDescriptor} for a specific Method, given optional scope, and given override value.
@param method method to include in config descriptor
@param scopeOpt optional scope for the config descriptor
@param overrideValue optional override value used to override the static value in the config ... | [
"Build",
"a",
"{",
"@link",
"ConfigDescriptor",
"}",
"for",
"a",
"specific",
"Method",
"given",
"optional",
"scope",
"and",
"given",
"override",
"value",
"."
] | train | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/internal/ConfigDescriptorFactory.java#L123-L141 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLineStrings | public static MultiLineString fromLineStrings(@NonNull List<LineString> lineStrings,
@Nullable BoundingBox bbox) {
"""
Create a new instance of this class by defining a list of {@link LineString} objects and
passing that list in as a parameter in this method. The Li... | java | public static MultiLineString fromLineStrings(@NonNull List<LineString> lineStrings,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = new ArrayList<>(lineStrings.size());
for (LineString lineString : lineStrings) {
coordinates.add(lineString.coo... | [
"public",
"static",
"MultiLineString",
"fromLineStrings",
"(",
"@",
"NonNull",
"List",
"<",
"LineString",
">",
"lineStrings",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"List",
"<",
"Point",
">>",
"coordinates",
"=",
"new",
"ArrayList"... | Create a new instance of this class by defining a list of {@link LineString} objects and
passing that list in as a parameter in this method. The LineStrings should comply with the
GeoJson specifications described in the documentation. Optionally, pass in an instance of a
{@link BoundingBox} which better describes this ... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"LineString",
"}",
"objects",
"and",
"passing",
"that",
"list",
"in",
"as",
"a",
"parameter",
"in",
"this",
"method",
".",
"The",
"LineStrings",
"... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L111-L118 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.createDeviceRegistry | public final DeviceRegistry createDeviceRegistry(String parent, DeviceRegistry deviceRegistry) {
"""
Creates a device registry that contains devices.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]",... | java | public final DeviceRegistry createDeviceRegistry(String parent, DeviceRegistry deviceRegistry) {
CreateDeviceRegistryRequest request =
CreateDeviceRegistryRequest.newBuilder()
.setParent(parent)
.setDeviceRegistry(deviceRegistry)
.build();
return createDeviceRegistry... | [
"public",
"final",
"DeviceRegistry",
"createDeviceRegistry",
"(",
"String",
"parent",
",",
"DeviceRegistry",
"deviceRegistry",
")",
"{",
"CreateDeviceRegistryRequest",
"request",
"=",
"CreateDeviceRegistryRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"pa... | Creates a device registry that contains devices.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build();
DeviceRegistry response = d... | [
"Creates",
"a",
"device",
"registry",
"that",
"contains",
"devices",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L216-L224 |
duracloud/duracloud | security/src/main/java/org/duracloud/security/vote/SpaceAccessVoter.java | SpaceAccessVoter.getSpaceACLs | protected Map<String, AclType> getSpaceACLs(HttpServletRequest request) {
"""
This method returns the ACLs of the requested space, or an empty-map if
there is an error or for certain 'keyword' spaces, or null if the space
does not exist.
@param request containing spaceId and storeId
@return ACLs, empty-map, ... | java | protected Map<String, AclType> getSpaceACLs(HttpServletRequest request) {
String storeId = getStoreId(request);
String spaceId = getSpaceId(request);
return getSpaceACLs(storeId, spaceId);
} | [
"protected",
"Map",
"<",
"String",
",",
"AclType",
">",
"getSpaceACLs",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"storeId",
"=",
"getStoreId",
"(",
"request",
")",
";",
"String",
"spaceId",
"=",
"getSpaceId",
"(",
"request",
")",
";",
"retur... | This method returns the ACLs of the requested space, or an empty-map if
there is an error or for certain 'keyword' spaces, or null if the space
does not exist.
@param request containing spaceId and storeId
@return ACLs, empty-map, or null | [
"This",
"method",
"returns",
"the",
"ACLs",
"of",
"the",
"requested",
"space",
"or",
"an",
"empty",
"-",
"map",
"if",
"there",
"is",
"an",
"error",
"or",
"for",
"certain",
"keyword",
"spaces",
"or",
"null",
"if",
"the",
"space",
"does",
"not",
"exist",
... | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/security/src/main/java/org/duracloud/security/vote/SpaceAccessVoter.java#L140-L144 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/PassthroughResourcesImpl.java | PassthroughResourcesImpl.deleteRequest | public String deleteRequest(String endpoint) throws SmartsheetException {
"""
Issue an HTTP DELETE request.
@param endpoint the API endpoint
@return a JSON response string
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the... | java | public String deleteRequest(String endpoint) throws SmartsheetException {
return passthroughRequest(HttpMethod.DELETE, endpoint, null, null);
} | [
"public",
"String",
"deleteRequest",
"(",
"String",
"endpoint",
")",
"throws",
"SmartsheetException",
"{",
"return",
"passthroughRequest",
"(",
"HttpMethod",
".",
"DELETE",
",",
"endpoint",
",",
"null",
",",
"null",
")",
";",
"}"
] | Issue an HTTP DELETE request.
@param endpoint the API endpoint
@return a JSON response string
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST ... | [
"Issue",
"an",
"HTTP",
"DELETE",
"request",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/PassthroughResourcesImpl.java#L114-L116 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/QueryGraph.java | QueryGraph.unfavorVirtualEdgePair | public void unfavorVirtualEdgePair(int virtualNodeId, int virtualEdgeId) {
"""
Sets the virtual edge with virtualEdgeId and its reverse edge to 'unfavored', which
effectively penalizes both virtual edges towards an adjacent node of virtualNodeId.
This makes it more likely (but does not guarantee) that the router... | java | public void unfavorVirtualEdgePair(int virtualNodeId, int virtualEdgeId) {
if (!isVirtualNode(virtualNodeId)) {
throw new IllegalArgumentException("Node id " + virtualNodeId
+ " must be a virtual node.");
}
VirtualEdgeIteratorState incomingEdge =
... | [
"public",
"void",
"unfavorVirtualEdgePair",
"(",
"int",
"virtualNodeId",
",",
"int",
"virtualEdgeId",
")",
"{",
"if",
"(",
"!",
"isVirtualNode",
"(",
"virtualNodeId",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Node id \"",
"+",
"virtualNode... | Sets the virtual edge with virtualEdgeId and its reverse edge to 'unfavored', which
effectively penalizes both virtual edges towards an adjacent node of virtualNodeId.
This makes it more likely (but does not guarantee) that the router chooses a route towards
the other adjacent node of virtualNodeId.
<p>
@param virtual... | [
"Sets",
"the",
"virtual",
"edge",
"with",
"virtualEdgeId",
"and",
"its",
"reverse",
"edge",
"to",
"unfavored",
"which",
"effectively",
"penalizes",
"both",
"virtual",
"edges",
"towards",
"an",
"adjacent",
"node",
"of",
"virtualNodeId",
".",
"This",
"makes",
"it"... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/QueryGraph.java#L488-L502 |
aws/aws-sdk-java | aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/AwsSecurityFinding.java | AwsSecurityFinding.withProductFields | public AwsSecurityFinding withProductFields(java.util.Map<String, String> productFields) {
"""
<p>
A data type where security findings providers can include additional solution-specific details that are not part
of the defined AwsSecurityFinding format.
</p>
@param productFields
A data type where security f... | java | public AwsSecurityFinding withProductFields(java.util.Map<String, String> productFields) {
setProductFields(productFields);
return this;
} | [
"public",
"AwsSecurityFinding",
"withProductFields",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"productFields",
")",
"{",
"setProductFields",
"(",
"productFields",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A data type where security findings providers can include additional solution-specific details that are not part
of the defined AwsSecurityFinding format.
</p>
@param productFields
A data type where security findings providers can include additional solution-specific details that are
not part of the defined AwsSec... | [
"<p",
">",
"A",
"data",
"type",
"where",
"security",
"findings",
"providers",
"can",
"include",
"additional",
"solution",
"-",
"specific",
"details",
"that",
"are",
"not",
"part",
"of",
"the",
"defined",
"AwsSecurityFinding",
"format",
".",
"<",
"/",
"p",
">... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/AwsSecurityFinding.java#L1134-L1137 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_entry.java | DZcs_entry.cs_entry | public static boolean cs_entry(DZcs T, int i, int j, double [] x) {
"""
Adds an entry to a triplet matrix. Memory-space and dimension of T are
increased if necessary.
@param T
triplet matrix; new entry added on output
@param i
row index of new entry
@param j
column index of new entry
@param x
numerical ... | java | public static boolean cs_entry(DZcs T, int i, int j, double [] x)
{
return cs_entry(T, i, j, x [0], x [1]);
} | [
"public",
"static",
"boolean",
"cs_entry",
"(",
"DZcs",
"T",
",",
"int",
"i",
",",
"int",
"j",
",",
"double",
"[",
"]",
"x",
")",
"{",
"return",
"cs_entry",
"(",
"T",
",",
"i",
",",
"j",
",",
"x",
"[",
"0",
"]",
",",
"x",
"[",
"1",
"]",
")"... | Adds an entry to a triplet matrix. Memory-space and dimension of T are
increased if necessary.
@param T
triplet matrix; new entry added on output
@param i
row index of new entry
@param j
column index of new entry
@param x
numerical value of new entry
@return true if successful, false otherwise | [
"Adds",
"an",
"entry",
"to",
"a",
"triplet",
"matrix",
".",
"Memory",
"-",
"space",
"and",
"dimension",
"of",
"T",
"are",
"increased",
"if",
"necessary",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_entry.java#L55-L58 |
google/closure-compiler | src/com/google/javascript/jscomp/TypedCodeGenerator.java | TypedCodeGenerator.getParameterJSDocType | private String getParameterJSDocType(List<JSType> types, int index, int minArgs, int maxArgs) {
"""
Creates a JSDoc-suitable String representation of the type of a parameter.
"""
JSType type = types.get(index);
if (index < minArgs) {
return type.toAnnotationString(Nullability.EXPLICIT);
}
... | java | private String getParameterJSDocType(List<JSType> types, int index, int minArgs, int maxArgs) {
JSType type = types.get(index);
if (index < minArgs) {
return type.toAnnotationString(Nullability.EXPLICIT);
}
boolean isRestArgument = maxArgs == Integer.MAX_VALUE && index == types.size() - 1;
if ... | [
"private",
"String",
"getParameterJSDocType",
"(",
"List",
"<",
"JSType",
">",
"types",
",",
"int",
"index",
",",
"int",
"minArgs",
",",
"int",
"maxArgs",
")",
"{",
"JSType",
"type",
"=",
"types",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"index",... | Creates a JSDoc-suitable String representation of the type of a parameter. | [
"Creates",
"a",
"JSDoc",
"-",
"suitable",
"String",
"representation",
"of",
"the",
"type",
"of",
"a",
"parameter",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypedCodeGenerator.java#L412-L422 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java | MemoryFileManager.handleOption | @Override
public boolean handleOption(String current, Iterator<String> remaining) {
"""
Handles one option. If {@code current} is an option to this
file manager it will consume any arguments to that option from
{@code remaining} and return true, otherwise return false.
@param current current option
@par... | java | @Override
public boolean handleOption(String current, Iterator<String> remaining) {
proc.debug(DBG_FMGR, "handleOption: current: %s\n", current +
", remaining: " + remaining);
return stdFileManager.handleOption(current, remaining);
} | [
"@",
"Override",
"public",
"boolean",
"handleOption",
"(",
"String",
"current",
",",
"Iterator",
"<",
"String",
">",
"remaining",
")",
"{",
"proc",
".",
"debug",
"(",
"DBG_FMGR",
",",
"\"handleOption: current: %s\\n\"",
",",
"current",
"+",
"\", remaining: \"",
... | Handles one option. If {@code current} is an option to this
file manager it will consume any arguments to that option from
{@code remaining} and return true, otherwise return false.
@param current current option
@param remaining remaining options
@return true if this option was handled by this file manager,
false oth... | [
"Handles",
"one",
"option",
".",
"If",
"{",
"@code",
"current",
"}",
"is",
"an",
"option",
"to",
"this",
"file",
"manager",
"it",
"will",
"consume",
"any",
"arguments",
"to",
"that",
"option",
"from",
"{",
"@code",
"remaining",
"}",
"and",
"return",
"tru... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java#L339-L344 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java | DrawerBuilder.withAccountHeader | public DrawerBuilder withAccountHeader(@NonNull AccountHeader accountHeader, boolean accountHeaderSticky) {
"""
Add a AccountSwitcherHeader which will be used in this drawer instance. Pass true if it should be sticky
NOTE: This will overwrite any set headerView or stickyHeaderView (depends on the boolean).
@pa... | java | public DrawerBuilder withAccountHeader(@NonNull AccountHeader accountHeader, boolean accountHeaderSticky) {
this.mAccountHeader = accountHeader;
this.mAccountHeaderSticky = accountHeaderSticky;
return this;
} | [
"public",
"DrawerBuilder",
"withAccountHeader",
"(",
"@",
"NonNull",
"AccountHeader",
"accountHeader",
",",
"boolean",
"accountHeaderSticky",
")",
"{",
"this",
".",
"mAccountHeader",
"=",
"accountHeader",
";",
"this",
".",
"mAccountHeaderSticky",
"=",
"accountHeaderStic... | Add a AccountSwitcherHeader which will be used in this drawer instance. Pass true if it should be sticky
NOTE: This will overwrite any set headerView or stickyHeaderView (depends on the boolean).
@param accountHeader
@param accountHeaderSticky
@return | [
"Add",
"a",
"AccountSwitcherHeader",
"which",
"will",
"be",
"used",
"in",
"this",
"drawer",
"instance",
".",
"Pass",
"true",
"if",
"it",
"should",
"be",
"sticky",
"NOTE",
":",
"This",
"will",
"overwrite",
"any",
"set",
"headerView",
"or",
"stickyHeaderView",
... | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L480-L484 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.stringify | public String stringify(JsonNode json) {
"""
Converts a JsonNode to its string representation.
This implementation use a `pretty printer`.
@param json the json node
@return the String representation of the given Json Object
@throws java.lang.RuntimeException if the String form cannot be created
"""
... | java | public String stringify(JsonNode json) {
try {
return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
} catch (JsonProcessingException e) {
throw new RuntimeException("Cannot stringify the input json node", e);
}
} | [
"public",
"String",
"stringify",
"(",
"JsonNode",
"json",
")",
"{",
"try",
"{",
"return",
"mapper",
"(",
")",
".",
"writerWithDefaultPrettyPrinter",
"(",
")",
".",
"writeValueAsString",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"JsonProcessingException",
"e",
... | Converts a JsonNode to its string representation.
This implementation use a `pretty printer`.
@param json the json node
@return the String representation of the given Json Object
@throws java.lang.RuntimeException if the String form cannot be created | [
"Converts",
"a",
"JsonNode",
"to",
"its",
"string",
"representation",
".",
"This",
"implementation",
"use",
"a",
"pretty",
"printer",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L209-L215 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.createUploadResource | public CmsResource createUploadResource(String fieldName, String rawFileName, byte[] content)
throws CmsUgcException {
"""
Creates a new resource from upload data.<p>
@param fieldName the name of the form field for the upload
@param rawFileName the file name
@param content the file content
@return the ... | java | public CmsResource createUploadResource(String fieldName, String rawFileName, byte[] content)
throws CmsUgcException {
CmsResource result = null;
CmsUgcSessionSecurityUtil.checkCreateUpload(m_cms, m_configuration, rawFileName, content.length);
String baseName = rawFileName;
// if t... | [
"public",
"CmsResource",
"createUploadResource",
"(",
"String",
"fieldName",
",",
"String",
"rawFileName",
",",
"byte",
"[",
"]",
"content",
")",
"throws",
"CmsUgcException",
"{",
"CmsResource",
"result",
"=",
"null",
";",
"CmsUgcSessionSecurityUtil",
".",
"checkCre... | Creates a new resource from upload data.<p>
@param fieldName the name of the form field for the upload
@param rawFileName the file name
@param content the file content
@return the newly created resource
@throws CmsUgcException if creating the resource fails | [
"Creates",
"a",
"new",
"resource",
"from",
"upload",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L243-L292 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADECache.java | CmsADECache.getCacheGroupContainer | public CmsXmlGroupContainer getCacheGroupContainer(String key, boolean online) {
"""
Returns the cached group container under the given key and for the given project.<p>
@param key the cache key
@param online if cached in online or offline project
@return the cached group container or <code>null</code> if n... | java | public CmsXmlGroupContainer getCacheGroupContainer(String key, boolean online) {
try {
m_lock.readLock().lock();
CmsXmlGroupContainer retValue;
if (online) {
retValue = m_groupContainersOnline.get(key);
if (LOG.isDebugEnabled()) {
... | [
"public",
"CmsXmlGroupContainer",
"getCacheGroupContainer",
"(",
"String",
"key",
",",
"boolean",
"online",
")",
"{",
"try",
"{",
"m_lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"CmsXmlGroupContainer",
"retValue",
";",
"if",
"(",
"online",
"... | Returns the cached group container under the given key and for the given project.<p>
@param key the cache key
@param online if cached in online or offline project
@return the cached group container or <code>null</code> if not found | [
"Returns",
"the",
"cached",
"group",
"container",
"under",
"the",
"given",
"key",
"and",
"for",
"the",
"given",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADECache.java#L185-L227 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java | PoolManager.getMaxSlots | int getMaxSlots(String poolName, TaskType taskType) {
"""
Get the maximum map or reduce slots for the given pool.
@return the cap set on this pool, or Integer.MAX_VALUE if not set.
"""
Map<String, Integer> maxMap = (taskType == TaskType.MAP ?
poolMaxMaps : poolMaxReduces... | java | int getMaxSlots(String poolName, TaskType taskType) {
Map<String, Integer> maxMap = (taskType == TaskType.MAP ?
poolMaxMaps : poolMaxReduces);
if (maxMap.containsKey(poolName)) {
return maxMap.get(poolName);
} else {
return Integer.MAX_VALUE;
}
} | [
"int",
"getMaxSlots",
"(",
"String",
"poolName",
",",
"TaskType",
"taskType",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"maxMap",
"=",
"(",
"taskType",
"==",
"TaskType",
".",
"MAP",
"?",
"poolMaxMaps",
":",
"poolMaxReduces",
")",
";",
"if",
"(... | Get the maximum map or reduce slots for the given pool.
@return the cap set on this pool, or Integer.MAX_VALUE if not set. | [
"Get",
"the",
"maximum",
"map",
"or",
"reduce",
"slots",
"for",
"the",
"given",
"pool",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java#L693-L701 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java | JmesPathEvaluationVisitor.visit | @Override
public JsonNode visit(JmesPathMultiSelectList multiSelectList, JsonNode input) throws InvalidTypeException {
"""
Each expression in the multiselect list will be evaluated
against the JSON document. Each returned element will be the
result of evaluating the expression. A multi-select-list with
N ex... | java | @Override
public JsonNode visit(JmesPathMultiSelectList multiSelectList, JsonNode input) throws InvalidTypeException {
List<JmesPathExpression> expressionsList = multiSelectList.getExpressions();
ArrayNode evaluatedExprList = ObjectMapperSingleton.getObjectMapper().createArrayNode();
for (Jm... | [
"@",
"Override",
"public",
"JsonNode",
"visit",
"(",
"JmesPathMultiSelectList",
"multiSelectList",
",",
"JsonNode",
"input",
")",
"throws",
"InvalidTypeException",
"{",
"List",
"<",
"JmesPathExpression",
">",
"expressionsList",
"=",
"multiSelectList",
".",
"getExpressio... | Each expression in the multiselect list will be evaluated
against the JSON document. Each returned element will be the
result of evaluating the expression. A multi-select-list with
N expressions will result in a list of length N. Given a
multiselect expression [expr-1,expr-2,...,expr-n], the evaluated
expression will r... | [
"Each",
"expression",
"in",
"the",
"multiselect",
"list",
"will",
"be",
"evaluated",
"against",
"the",
"JSON",
"document",
".",
"Each",
"returned",
"element",
"will",
"be",
"the",
"result",
"of",
"evaluating",
"the",
"expression",
".",
"A",
"multi",
"-",
"se... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java#L324-L332 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static double[] removeAll(final double[] a, final double... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {... | java | @SafeVarargs
public static double[] removeAll(final double[] a, final double... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_DOUBLE_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return re... | [
"@",
"SafeVarargs",
"public",
"static",
"double",
"[",
"]",
"removeAll",
"(",
"final",
"double",
"[",
"]",
"a",
",",
"final",
"double",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23512-L23525 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.addSshKey | public SshKey addSshKey(String title, String key) throws GitLabApiException {
"""
Creates a new key owned by the currently authenticated user.
<pre><code>GitLab Endpoint: POST /user/keys</code></pre>
@param title the new SSH Key's title
@param key the new SSH key
@return an SshKey instance with info on t... | java | public SshKey addSshKey(String title, String key) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("title", title).withParam("key", key);
Response response = post(Response.Status.CREATED, formData, "user", "keys");
return (response.readEntity(SshKey.class));
... | [
"public",
"SshKey",
"addSshKey",
"(",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"title\"",
",",
"title",
")",
".",
"withParam"... | Creates a new key owned by the currently authenticated user.
<pre><code>GitLab Endpoint: POST /user/keys</code></pre>
@param title the new SSH Key's title
@param key the new SSH key
@return an SshKey instance with info on the added SSH key
@throws GitLabApiException if any exception occurs | [
"Creates",
"a",
"new",
"key",
"owned",
"by",
"the",
"currently",
"authenticated",
"user",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L656-L660 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java | FastDatePrinter.getTimeZoneDisplay | static String getTimeZoneDisplay(final TimeZone tz, final boolean daylight, final int style, final Locale locale) {
"""
<p>
Gets the time zone display name, using a cache for performance.
</p>
@param tz the zone to query
@param daylight true if daylight savings
@param style the style to use {@code TimeZone.... | java | static String getTimeZoneDisplay(final TimeZone tz, final boolean daylight, final int style, final Locale locale) {
final TimeZoneDisplayKey key = new TimeZoneDisplayKey(tz, daylight, style, locale);
String value = cTimeZoneDisplayCache.get(key);
if (value == null) {
// This is a very slow call, so cache the r... | [
"static",
"String",
"getTimeZoneDisplay",
"(",
"final",
"TimeZone",
"tz",
",",
"final",
"boolean",
"daylight",
",",
"final",
"int",
"style",
",",
"final",
"Locale",
"locale",
")",
"{",
"final",
"TimeZoneDisplayKey",
"key",
"=",
"new",
"TimeZoneDisplayKey",
"(",
... | <p>
Gets the time zone display name, using a cache for performance.
</p>
@param tz the zone to query
@param daylight true if daylight savings
@param style the style to use {@code TimeZone.LONG} or {@code TimeZone.SHORT}
@param locale the locale to use
@return the textual name of the time zone | [
"<p",
">",
"Gets",
"the",
"time",
"zone",
"display",
"name",
"using",
"a",
"cache",
"for",
"performance",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java#L1069-L1081 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java | PrimaveraXERFileReader.readRecord | private void readRecord(Tokenizer tk, List<String> record) throws IOException {
"""
Reads each token from a single record and adds it to a list.
@param tk tokenizer
@param record list of tokens
@throws IOException
"""
record.clear();
while (tk.nextToken() == Tokenizer.TT_WORD)
{
... | java | private void readRecord(Tokenizer tk, List<String> record) throws IOException
{
record.clear();
while (tk.nextToken() == Tokenizer.TT_WORD)
{
record.add(tk.getToken());
}
} | [
"private",
"void",
"readRecord",
"(",
"Tokenizer",
"tk",
",",
"List",
"<",
"String",
">",
"record",
")",
"throws",
"IOException",
"{",
"record",
".",
"clear",
"(",
")",
";",
"while",
"(",
"tk",
".",
"nextToken",
"(",
")",
"==",
"Tokenizer",
".",
"TT_WO... | Reads each token from a single record and adds it to a list.
@param tk tokenizer
@param record list of tokens
@throws IOException | [
"Reads",
"each",
"token",
"from",
"a",
"single",
"record",
"and",
"adds",
"it",
"to",
"a",
"list",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileReader.java#L529-L536 |
code4everything/util | src/main/java/com/zhazhapan/util/BeanUtils.java | BeanUtils.toJsonString | public static String toJsonString(Object object, FieldModifier modifier) throws IllegalAccessException {
"""
将Bean类指定修饰符的属性转换成JSON字符串
@param object Bean对象
@param modifier 属性的权限修饰符
@return 没有格式化的JSON字符串
@throws IllegalAccessException 异常
"""
return toJsonString(object, modifier, JsonMethod.AUTO... | java | public static String toJsonString(Object object, FieldModifier modifier) throws IllegalAccessException {
return toJsonString(object, modifier, JsonMethod.AUTO);
} | [
"public",
"static",
"String",
"toJsonString",
"(",
"Object",
"object",
",",
"FieldModifier",
"modifier",
")",
"throws",
"IllegalAccessException",
"{",
"return",
"toJsonString",
"(",
"object",
",",
"modifier",
",",
"JsonMethod",
".",
"AUTO",
")",
";",
"}"
] | 将Bean类指定修饰符的属性转换成JSON字符串
@param object Bean对象
@param modifier 属性的权限修饰符
@return 没有格式化的JSON字符串
@throws IllegalAccessException 异常 | [
"将Bean类指定修饰符的属性转换成JSON字符串"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/BeanUtils.java#L286-L288 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java | BitcoinBlockReader.parseTransactionOutputs | public List<BitcoinTransactionOutput> parseTransactionOutputs(ByteBuffer rawByteBuffer, long noOfTransactionOutputs) {
"""
/*
Parses the Bitcoin transaction outputs in a byte buffer.
@param rawByteBuffer ByteBuffer from which the transaction outputs have to be parsed
@param noOfTransactionInputs Number of exp... | java | public List<BitcoinTransactionOutput> parseTransactionOutputs(ByteBuffer rawByteBuffer, long noOfTransactionOutputs) {
ArrayList<BitcoinTransactionOutput> currentTransactionOutput = new ArrayList<>((int)(noOfTransactionOutputs));
for (int i=0;i<noOfTransactionOutputs;i++) {
// read value
byte[] currentTransacti... | [
"public",
"List",
"<",
"BitcoinTransactionOutput",
">",
"parseTransactionOutputs",
"(",
"ByteBuffer",
"rawByteBuffer",
",",
"long",
"noOfTransactionOutputs",
")",
"{",
"ArrayList",
"<",
"BitcoinTransactionOutput",
">",
"currentTransactionOutput",
"=",
"new",
"ArrayList",
... | /*
Parses the Bitcoin transaction outputs in a byte buffer.
@param rawByteBuffer ByteBuffer from which the transaction outputs have to be parsed
@param noOfTransactionInputs Number of expected transaction outputs
@return Array of transactions | [
"/",
"*",
"Parses",
"the",
"Bitcoin",
"transaction",
"outputs",
"in",
"a",
"byte",
"buffer",
"."
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L406-L424 |
belaban/JGroups | src/org/jgroups/View.java | View.sameMembersOrdered | public static boolean sameMembersOrdered(View v1, View v2) {
"""
Checks if two views have the same members observing order. E.g. {A,B,C} and {B,A,C} returns false,
{A,C,B} and {A,C,B} returns true
"""
return Arrays.equals(v1.getMembersRaw(), v2.getMembersRaw());
} | java | public static boolean sameMembersOrdered(View v1, View v2) {
return Arrays.equals(v1.getMembersRaw(), v2.getMembersRaw());
} | [
"public",
"static",
"boolean",
"sameMembersOrdered",
"(",
"View",
"v1",
",",
"View",
"v2",
")",
"{",
"return",
"Arrays",
".",
"equals",
"(",
"v1",
".",
"getMembersRaw",
"(",
")",
",",
"v2",
".",
"getMembersRaw",
"(",
")",
")",
";",
"}"
] | Checks if two views have the same members observing order. E.g. {A,B,C} and {B,A,C} returns false,
{A,C,B} and {A,C,B} returns true | [
"Checks",
"if",
"two",
"views",
"have",
"the",
"same",
"members",
"observing",
"order",
".",
"E",
".",
"g",
".",
"{",
"A",
"B",
"C",
"}",
"and",
"{",
"B",
"A",
"C",
"}",
"returns",
"false",
"{",
"A",
"C",
"B",
"}",
"and",
"{",
"A",
"C",
"B",
... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/View.java#L311-L313 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addSuccessUpdateDesignJspFile | public FessMessages addSuccessUpdateDesignJspFile(String property, String arg0) {
"""
Add the created action message for the key 'success.update_design_jsp_file' with parameters.
<pre>
message: Updated {0}.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for ... | java | public FessMessages addSuccessUpdateDesignJspFile(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(SUCCESS_update_design_jsp_file, arg0));
return this;
} | [
"public",
"FessMessages",
"addSuccessUpdateDesignJspFile",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"SUCCESS_update_design_jsp_file",
",",
... | Add the created action message for the key 'success.update_design_jsp_file' with parameters.
<pre>
message: Updated {0}.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"success",
".",
"update_design_jsp_file",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Updated",
"{",
"0",
"}",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2346-L2350 |
alkacon/opencms-core | src/org/opencms/ui/apps/resourcetypes/CmsResourceTypesTable.java | CmsResourceTypesTable.onItemClick | @SuppressWarnings("unchecked")
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {
"""
Handles the table item clicks, including clicks on images inside of a table item.<p>
@param event the click event
@param itemId of the clicked row
@param propertyId column id
"""
... | java | @SuppressWarnings("unchecked")
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {
if (!event.isCtrlKey() && !event.isShiftKey()) {
changeValueIfNotMultiSelect(itemId);
// don't interfere with multi-selection using control key
if (event.get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"void",
"onItemClick",
"(",
"MouseEvents",
".",
"ClickEvent",
"event",
",",
"Object",
"itemId",
",",
"Object",
"propertyId",
")",
"{",
"if",
"(",
"!",
"event",
".",
"isCtrlKey",
"(",
")",
"&&",
"!",
"even... | Handles the table item clicks, including clicks on images inside of a table item.<p>
@param event the click event
@param itemId of the clicked row
@param propertyId column id | [
"Handles",
"the",
"table",
"item",
"clicks",
"including",
"clicks",
"on",
"images",
"inside",
"of",
"a",
"table",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/resourcetypes/CmsResourceTypesTable.java#L701-L715 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Strings.java | Strings.asString | public static String asString(Map<?, ?> map) {
"""
Make a minimal printable string value from a typed map.
@param map The map to stringify.
@return The resulting string.
"""
if (map == null) {
return NULL;
}
StringBuilder builder = new StringBuilder();
builder.ap... | java | public static String asString(Map<?, ?> map) {
if (map == null) {
return NULL;
}
StringBuilder builder = new StringBuilder();
builder.append('{');
boolean first = true;
for (Map.Entry<?, ?> entry : map.entrySet()) {
if (first) {
fir... | [
"public",
"static",
"String",
"asString",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
"NULL",
";",
"}",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
... | Make a minimal printable string value from a typed map.
@param map The map to stringify.
@return The resulting string. | [
"Make",
"a",
"minimal",
"printable",
"string",
"value",
"from",
"a",
"typed",
"map",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Strings.java#L608-L627 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/GBSTree.java | GBSTree.getNode | GBSNode getNode(Object newKey) {
"""
Allocate a new node for the tree.
@param newKey The initial key for the new node.
@return The new node.
"""
GBSNode p;
if (_nodePool == null)
p = new GBSNode(this, newKey);
else
{
p = _nodePool;
_no... | java | GBSNode getNode(Object newKey)
{
GBSNode p;
if (_nodePool == null)
p = new GBSNode(this, newKey);
else
{
p = _nodePool;
_nodePool = p.rightChild();
p.reset(newKey);
}
return p;
} | [
"GBSNode",
"getNode",
"(",
"Object",
"newKey",
")",
"{",
"GBSNode",
"p",
";",
"if",
"(",
"_nodePool",
"==",
"null",
")",
"p",
"=",
"new",
"GBSNode",
"(",
"this",
",",
"newKey",
")",
";",
"else",
"{",
"p",
"=",
"_nodePool",
";",
"_nodePool",
"=",
"p... | Allocate a new node for the tree.
@param newKey The initial key for the new node.
@return The new node. | [
"Allocate",
"a",
"new",
"node",
"for",
"the",
"tree",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/GBSTree.java#L344-L356 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java | ColorUtils.HSVtoRGB | public static Color HSVtoRGB (float h, float s, float v, float alpha) {
"""
Converts HSV to RGB
@param h hue 0-360
@param s saturation 0-100
@param v value 0-100
@param alpha 0-1
@return RGB values in LibGDX {@link Color} class
"""
Color c = HSVtoRGB(h, s, v);
c.a = alpha;
return c;
} | java | public static Color HSVtoRGB (float h, float s, float v, float alpha) {
Color c = HSVtoRGB(h, s, v);
c.a = alpha;
return c;
} | [
"public",
"static",
"Color",
"HSVtoRGB",
"(",
"float",
"h",
",",
"float",
"s",
",",
"float",
"v",
",",
"float",
"alpha",
")",
"{",
"Color",
"c",
"=",
"HSVtoRGB",
"(",
"h",
",",
"s",
",",
"v",
")",
";",
"c",
".",
"a",
"=",
"alpha",
";",
"return"... | Converts HSV to RGB
@param h hue 0-360
@param s saturation 0-100
@param v value 0-100
@param alpha 0-1
@return RGB values in LibGDX {@link Color} class | [
"Converts",
"HSV",
"to",
"RGB"
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java#L36-L40 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java | NFSubstitution.doSubstitution | public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) {
"""
Performs a mathematical operation on the number, formats it using
either ruleSet or decimalFormat, and inserts the result into
toInsertInto.
@param number The number being formatted.
@param toInsertInt... | java | public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) {
// perform a transformation on the number being formatted that
// is dependent on the type of substitution this is
double numberToFormat = transformNumber(number);
if (Double.isInfi... | [
"public",
"void",
"doSubstitution",
"(",
"double",
"number",
",",
"StringBuilder",
"toInsertInto",
",",
"int",
"position",
",",
"int",
"recursionCount",
")",
"{",
"// perform a transformation on the number being formatted that",
"// is dependent on the type of substitution this i... | Performs a mathematical operation on the number, formats it using
either ruleSet or decimalFormat, and inserts the result into
toInsertInto.
@param number The number being formatted.
@param toInsertInto The string we insert the result into
@param position The position in toInsertInto where the owning rule's
rule text b... | [
"Performs",
"a",
"mathematical",
"operation",
"on",
"the",
"number",
"formats",
"it",
"using",
"either",
"ruleSet",
"or",
"decimalFormat",
"and",
"inserts",
"the",
"result",
"into",
"toInsertInto",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L316-L343 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java | OSMParser.checkOSMTables | private void checkOSMTables(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
"""
Check if one table already exists
@param connection
@param isH2
@param requestedTable
@param osmTableName
@throws SQLException
"""
String[] omsTables = ne... | java | private void checkOSMTables(Connection connection, boolean isH2, TableLocation requestedTable, String osmTableName) throws SQLException {
String[] omsTables = new String[]{OSMTablesFactory.TAG, OSMTablesFactory.NODE, OSMTablesFactory.NODE_TAG, OSMTablesFactory.WAY, OSMTablesFactory.WAY_NODE,
OSMTab... | [
"private",
"void",
"checkOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"TableLocation",
"requestedTable",
",",
"String",
"osmTableName",
")",
"throws",
"SQLException",
"{",
"String",
"[",
"]",
"omsTables",
"=",
"new",
"String",
"[",
"... | Check if one table already exists
@param connection
@param isH2
@param requestedTable
@param osmTableName
@throws SQLException | [
"Check",
"if",
"one",
"table",
"already",
"exists"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMParser.java#L212-L221 |
mangstadt/biweekly | src/main/java/biweekly/io/json/JCalRawWriter.java | JCalRawWriter.writeProperty | public void writeProperty(String propertyName, ICalDataType dataType, JCalValue value) throws IOException {
"""
Writes a property to the current component.
@param propertyName the property name (e.g. "version")
@param dataType the property's data type (e.g. "text")
@param value the property value
@throws Illeg... | java | public void writeProperty(String propertyName, ICalDataType dataType, JCalValue value) throws IOException {
writeProperty(propertyName, new ICalParameters(), dataType, value);
} | [
"public",
"void",
"writeProperty",
"(",
"String",
"propertyName",
",",
"ICalDataType",
"dataType",
",",
"JCalValue",
"value",
")",
"throws",
"IOException",
"{",
"writeProperty",
"(",
"propertyName",
",",
"new",
"ICalParameters",
"(",
")",
",",
"dataType",
",",
"... | Writes a property to the current component.
@param propertyName the property name (e.g. "version")
@param dataType the property's data type (e.g. "text")
@param value the property value
@throws IllegalStateException if there are no open components (
{@link #writeStartComponent(String)} must be called first) or if the l... | [
"Writes",
"a",
"property",
"to",
"the",
"current",
"component",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalRawWriter.java#L177-L179 |
galenframework/galen | galen-core/src/main/java/com/galenframework/specs/page/PageSpec.java | PageSpec.setObjects | public void setObjects(Map<String, Locator> objects) {
"""
Clears current objects list and sets new object list
@param objects
"""
this.objects.clear();
if (objects != null) {
this.objects.putAll(objects);
}
} | java | public void setObjects(Map<String, Locator> objects) {
this.objects.clear();
if (objects != null) {
this.objects.putAll(objects);
}
} | [
"public",
"void",
"setObjects",
"(",
"Map",
"<",
"String",
",",
"Locator",
">",
"objects",
")",
"{",
"this",
".",
"objects",
".",
"clear",
"(",
")",
";",
"if",
"(",
"objects",
"!=",
"null",
")",
"{",
"this",
".",
"objects",
".",
"putAll",
"(",
"obj... | Clears current objects list and sets new object list
@param objects | [
"Clears",
"current",
"objects",
"list",
"and",
"sets",
"new",
"object",
"list"
] | train | https://github.com/galenframework/galen/blob/6c7dc1f11d097e6aa49c45d6a77ee688741657a4/galen-core/src/main/java/com/galenframework/specs/page/PageSpec.java#L52-L57 |
threerings/narya | core/src/main/java/com/threerings/crowd/server/BodyManager.java | BodyManager.updateOccupantStatus | public void updateOccupantStatus (BodyObject body, final byte status) {
"""
Updates the connection status for the given body object's occupant info in the specified
location.
"""
// no need to NOOP
if (body.status != status) {
// update the status in their body object
b... | java | public void updateOccupantStatus (BodyObject body, final byte status)
{
// no need to NOOP
if (body.status != status) {
// update the status in their body object
body.setStatus(status);
body.getLocal(BodyLocal.class).statusTime = System.currentTimeMillis();
... | [
"public",
"void",
"updateOccupantStatus",
"(",
"BodyObject",
"body",
",",
"final",
"byte",
"status",
")",
"{",
"// no need to NOOP",
"if",
"(",
"body",
".",
"status",
"!=",
"status",
")",
"{",
"// update the status in their body object",
"body",
".",
"setStatus",
... | Updates the connection status for the given body object's occupant info in the specified
location. | [
"Updates",
"the",
"connection",
"status",
"for",
"the",
"given",
"body",
"object",
"s",
"occupant",
"info",
"in",
"the",
"specified",
"location",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/BodyManager.java#L68-L86 |
JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/sets/SingleWriterHashSet.java | SingleWriterHashSet.compactAndRemove | private void compactAndRemove(final E[] buffer, final long mask, int removeHashIndex) {
"""
/*
implemented as per wiki suggested algo with minor adjustments.
"""
// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,10a,9c,10b,11a,null,null]
removeHashIndex = (int) (removeHashIndex & mask);
... | java | private void compactAndRemove(final E[] buffer, final long mask, int removeHashIndex) {
// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,10a,9c,10b,11a,null,null]
removeHashIndex = (int) (removeHashIndex & mask);
int j = removeHashIndex;
// every compaction is guarded by two mod count i... | [
"private",
"void",
"compactAndRemove",
"(",
"final",
"E",
"[",
"]",
"buffer",
",",
"final",
"long",
"mask",
",",
"int",
"removeHashIndex",
")",
"{",
"// remove(9a): [9a,9b,10a,9c,10b,11a,null] -> [9b,10a,9c,10b,11a,null,null]",
"removeHashIndex",
"=",
"(",
"int",
")",
... | /*
implemented as per wiki suggested algo with minor adjustments. | [
"/",
"*",
"implemented",
"as",
"per",
"wiki",
"suggested",
"algo",
"with",
"minor",
"adjustments",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/sets/SingleWriterHashSet.java#L158-L194 |
mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/BsonUtils.java | BsonUtils.parseValue | public static <T> T parseValue(final String json, final Class<T> valueClass) {
"""
Parses the provided extended JSON string and decodes it into a T value as specified by the
provided class type. The type will decoded using the codec found for the type in the default
codec registry. If the provided type is not su... | java | public static <T> T parseValue(final String json, final Class<T> valueClass) {
final JsonReader bsonReader = new JsonReader(json);
bsonReader.readBsonType();
return DEFAULT_CODEC_REGISTRY
.get(valueClass)
.decode(bsonReader, DecoderContext.builder().build());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"parseValue",
"(",
"final",
"String",
"json",
",",
"final",
"Class",
"<",
"T",
">",
"valueClass",
")",
"{",
"final",
"JsonReader",
"bsonReader",
"=",
"new",
"JsonReader",
"(",
"json",
")",
";",
"bsonReader",
".",
... | Parses the provided extended JSON string and decodes it into a T value as specified by the
provided class type. The type will decoded using the codec found for the type in the default
codec registry. If the provided type is not supported by the default codec registry, the method
will throw a {@link org.bson.codecs.conf... | [
"Parses",
"the",
"provided",
"extended",
"JSON",
"string",
"and",
"decodes",
"it",
"into",
"a",
"T",
"value",
"as",
"specified",
"by",
"the",
"provided",
"class",
"type",
".",
"The",
"type",
"will",
"decoded",
"using",
"the",
"codec",
"found",
"for",
"the"... | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/BsonUtils.java#L80-L86 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java | KMLWrite.writeKML | public static void writeKML(Connection connection, String fileName, String tableReference) throws SQLException, IOException {
"""
This method is used to write a spatial table into a KML file
@param connection
@param fileName
@param tableReference
@throws SQLException
@throws IOException
"""
KMLDri... | java | public static void writeKML(Connection connection, String fileName, String tableReference) throws SQLException, IOException {
KMLDriverFunction kMLDriverFunction = new KMLDriverFunction();
kMLDriverFunction.exportTable(connection, tableReference, URIUtilities.fileFromString(fileName), new EmptyProgressV... | [
"public",
"static",
"void",
"writeKML",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"KMLDriverFunction",
"kMLDriverFunction",
"=",
"new",
"KMLDriverFunction",
"(",... | This method is used to write a spatial table into a KML file
@param connection
@param fileName
@param tableReference
@throws SQLException
@throws IOException | [
"This",
"method",
"is",
"used",
"to",
"write",
"a",
"spatial",
"table",
"into",
"a",
"KML",
"file"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWrite.java#L56-L59 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.averagingLong | @NotNull
public static <T> Collector<T, ?, Double> averagingLong(@NotNull final ToLongFunction<? super T> mapper) {
"""
Returns a {@code Collector} that calculates average of long-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from ... | java | @NotNull
public static <T> Collector<T, ?, Double> averagingLong(@NotNull final ToLongFunction<? super T> mapper) {
return averagingHelper(new BiConsumer<long[], T>() {
@Override
public void accept(long[] t, T u) {
t[0]++; // count
t[1] += mapper.apply... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Double",
">",
"averagingLong",
"(",
"@",
"NotNull",
"final",
"ToLongFunction",
"<",
"?",
"super",
"T",
">",
"mapper",
")",
"{",
"return",
"averagingHelper",
"(",
... | Returns a {@code Collector} that calculates average of long-valued input elements.
@param <T> the type of the input elements
@param mapper the mapping function which extracts value from element to calculate result
@return a {@code Collector}
@since 1.1.3 | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"calculates",
"average",
"of",
"long",
"-",
"valued",
"input",
"elements",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L506-L515 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBQuery.java | DBQuery.elemMatch | public static Query elemMatch(String field, Query query) {
"""
An element in the given array field matches the given query
@param field the array field
@param query The query to attempt to match against the elements of the array field
@return the query
"""
return new Query().elemMatch(field, query... | java | public static Query elemMatch(String field, Query query) {
return new Query().elemMatch(field, query);
} | [
"public",
"static",
"Query",
"elemMatch",
"(",
"String",
"field",
",",
"Query",
"query",
")",
"{",
"return",
"new",
"Query",
"(",
")",
".",
"elemMatch",
"(",
"field",
",",
"query",
")",
";",
"}"
] | An element in the given array field matches the given query
@param field the array field
@param query The query to attempt to match against the elements of the array field
@return the query | [
"An",
"element",
"in",
"the",
"given",
"array",
"field",
"matches",
"the",
"given",
"query"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBQuery.java#L267-L269 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/IntervalExtensions.java | IntervalExtensions.isBetween | public static boolean isBetween(final Interval timeRange, final Interval timeRangeToCheck) {
"""
Checks if the given time range is between the given time range to check
@param timeRange
the time range
@param timeRangeToCheck
the time range to check
@return true, if the given time range is between the given ... | java | public static boolean isBetween(final Interval timeRange, final Interval timeRangeToCheck)
{
return ((timeRange.getStart() != null
&& timeRange.getStart().isBefore(timeRangeToCheck.getStart()))
&& (timeRange.getEnd() != null
&& timeRange.getEnd().isAfter(timeRangeToCheck.getEnd())));
} | [
"public",
"static",
"boolean",
"isBetween",
"(",
"final",
"Interval",
"timeRange",
",",
"final",
"Interval",
"timeRangeToCheck",
")",
"{",
"return",
"(",
"(",
"timeRange",
".",
"getStart",
"(",
")",
"!=",
"null",
"&&",
"timeRange",
".",
"getStart",
"(",
")",... | Checks if the given time range is between the given time range to check
@param timeRange
the time range
@param timeRangeToCheck
the time range to check
@return true, if the given time range is between the given time range to check otherwise
false | [
"Checks",
"if",
"the",
"given",
"time",
"range",
"is",
"between",
"the",
"given",
"time",
"range",
"to",
"check"
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/IntervalExtensions.java#L54-L60 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/config/JsonConfigReader.java | JsonConfigReader.readConfig | public static ConfigParams readConfig(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
"""
Reads configuration from a file, parameterize it with given values and
returns a new ConfigParams object.
@param correlationId (optional) transaction id to trace execution thro... | java | public static ConfigParams readConfig(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
return new JsonConfigReader(path).readConfig(correlationId, parameters);
} | [
"public",
"static",
"ConfigParams",
"readConfig",
"(",
"String",
"correlationId",
",",
"String",
"path",
",",
"ConfigParams",
"parameters",
")",
"throws",
"ApplicationException",
"{",
"return",
"new",
"JsonConfigReader",
"(",
"path",
")",
".",
"readConfig",
"(",
"... | Reads configuration from a file, parameterize it with given values and
returns a new ConfigParams object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param path a path to configuration file.
@param parameters values to parameters the configuration.
@return ConfigP... | [
"Reads",
"configuration",
"from",
"a",
"file",
"parameterize",
"it",
"with",
"given",
"values",
"and",
"returns",
"a",
"new",
"ConfigParams",
"object",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/config/JsonConfigReader.java#L131-L134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.