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 |
|---|---|---|---|---|---|---|---|---|---|---|
Erudika/para | para-server/src/main/java/com/erudika/para/utils/HttpUtils.java | HttpUtils.getCookieValue | public static String getCookieValue(HttpServletRequest req, String name) {
"""
Reads a cookie.
@param name the name
@param req HTTP request
@return the cookie value
"""
if (StringUtils.isBlank(name) || req == null) {
return null;
}
Cookie[] cookies = req.getCookies();
if (cookies == null) {
re... | java | public static String getCookieValue(HttpServletRequest req, String name) {
if (StringUtils.isBlank(name) || req == null) {
return null;
}
Cookie[] cookies = req.getCookies();
if (cookies == null) {
return null;
}
//Otherwise, we have to do a linear scan for the cookie.
for (Cookie cookie : cookies) ... | [
"public",
"static",
"String",
"getCookieValue",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"name",
")",
"||",
"req",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Cookie",
"[",... | Reads a cookie.
@param name the name
@param req HTTP request
@return the cookie value | [
"Reads",
"a",
"cookie",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/utils/HttpUtils.java#L123-L138 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java | BinarySerde.writeArrayToDisk | public static void writeArrayToDisk(INDArray arr, File toWrite) throws IOException {
"""
Write an ndarray to disk in
binary format
@param arr the array to write
@param toWrite the file tow rite to
@throws IOException
"""
try (FileOutputStream os = new FileOutputStream(toWrite)) {
FileCh... | java | public static void writeArrayToDisk(INDArray arr, File toWrite) throws IOException {
try (FileOutputStream os = new FileOutputStream(toWrite)) {
FileChannel channel = os.getChannel();
ByteBuffer buffer = BinarySerde.toByteBuffer(arr);
channel.write(buffer);
}
} | [
"public",
"static",
"void",
"writeArrayToDisk",
"(",
"INDArray",
"arr",
",",
"File",
"toWrite",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"toWrite",
")",
")",
"{",
"FileChannel",
"channel",
"=... | Write an ndarray to disk in
binary format
@param arr the array to write
@param toWrite the file tow rite to
@throws IOException | [
"Write",
"an",
"ndarray",
"to",
"disk",
"in",
"binary",
"format"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/serde/binary/BinarySerde.java#L277-L283 |
spotbugs/spotbugs | eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java | ASTUtil.addImports | public static void addImports(ASTRewrite rewrite, CompilationUnit compilationUnit, SortedSet<ImportDeclaration> imports) {
"""
Adds <CODE>ImportDeclaration</CODE>s to the list of imports in the
specified <CODE>CompilationUnit</CODE>. If an import already exists, the
import will not be inserted. The imports are i... | java | public static void addImports(ASTRewrite rewrite, CompilationUnit compilationUnit, SortedSet<ImportDeclaration> imports) {
requireNonNull(rewrite, "ast-rewrite");
requireNonNull(compilationUnit, "compilation-unit");
requireNonNull(imports, "imports");
ListRewrite importRewrite = rewrite.... | [
"public",
"static",
"void",
"addImports",
"(",
"ASTRewrite",
"rewrite",
",",
"CompilationUnit",
"compilationUnit",
",",
"SortedSet",
"<",
"ImportDeclaration",
">",
"imports",
")",
"{",
"requireNonNull",
"(",
"rewrite",
",",
"\"ast-rewrite\"",
")",
";",
"requireNonNu... | Adds <CODE>ImportDeclaration</CODE>s to the list of imports in the
specified <CODE>CompilationUnit</CODE>. If an import already exists, the
import will not be inserted. The imports are inserted in an ordered way.
The <CODE>Comparator</CODE> of the <CODE>SortedSet</CODE> is used to sort
the imports.
@param rewrite
the ... | [
"Adds",
"<CODE",
">",
"ImportDeclaration<",
"/",
"CODE",
">",
"s",
"to",
"the",
"list",
"of",
"imports",
"in",
"the",
"specified",
"<CODE",
">",
"CompilationUnit<",
"/",
"CODE",
">",
".",
"If",
"an",
"import",
"already",
"exists",
"the",
"import",
"will",
... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L146-L152 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCertificateRequest | public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair)
throws GeneralSecurityException {
"""
Creates a certificate request from the specified subject name, signing algorithm, and a key pair.
@param subjectDN
the subject name of the certificate request.
@param si... | java | public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair)
throws GeneralSecurityException {
DERSet attrs = null;
PKCS10CertificationRequest certReq = null;
certReq = new PKCS10CertificationRequest(sigAlgName, subjectDN, keyPair.getPublic(), attrs, key... | [
"public",
"byte",
"[",
"]",
"createCertificateRequest",
"(",
"X509Name",
"subjectDN",
",",
"String",
"sigAlgName",
",",
"KeyPair",
"keyPair",
")",
"throws",
"GeneralSecurityException",
"{",
"DERSet",
"attrs",
"=",
"null",
";",
"PKCS10CertificationRequest",
"certReq",
... | Creates a certificate request from the specified subject name, signing algorithm, and a key pair.
@param subjectDN
the subject name of the certificate request.
@param sigAlgName
the signing algorithm name.
@param keyPair
the key pair of the certificate request
@return the certificate request.
@exception GeneralSecurit... | [
"Creates",
"a",
"certificate",
"request",
"from",
"the",
"specified",
"subject",
"name",
"signing",
"algorithm",
"and",
"a",
"key",
"pair",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L983-L991 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java | PointReducer.douglasPeuckerReduction | private static void douglasPeuckerReduction(ArrayList<GeoPoint> shape, boolean[] marked, double tolerance, int firstIdx, int lastIdx) {
"""
Reduce the points in shape between the specified first and last
index. Mark the points to keep in marked[]
@param shape The original shape
@param marked The points to... | java | private static void douglasPeuckerReduction(ArrayList<GeoPoint> shape, boolean[] marked, double tolerance, int firstIdx, int lastIdx)
{
if (lastIdx <= firstIdx + 1) {
// overlapping indexes, just return
return;
}
// loop over the points between the first and last poi... | [
"private",
"static",
"void",
"douglasPeuckerReduction",
"(",
"ArrayList",
"<",
"GeoPoint",
">",
"shape",
",",
"boolean",
"[",
"]",
"marked",
",",
"double",
"tolerance",
",",
"int",
"firstIdx",
",",
"int",
"lastIdx",
")",
"{",
"if",
"(",
"lastIdx",
"<=",
"f... | Reduce the points in shape between the specified first and last
index. Mark the points to keep in marked[]
@param shape The original shape
@param marked The points to keep (marked as true)
@param tolerance The tolerance to determine if a point is kept
@param firstIdx The index in original shape's point of
t... | [
"Reduce",
"the",
"points",
"in",
"shape",
"between",
"the",
"specified",
"first",
"and",
"last",
"index",
".",
"Mark",
"the",
"points",
"to",
"keep",
"in",
"marked",
"[]"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java#L84-L123 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/FullKeyMapper.java | FullKeyMapper.addFields | public void addFields(Document document, DecoratedKey partitionKey, CellName clusteringKey) {
"""
Adds to the specified Lucene {@link Document} the full row key formed by the specified partition key and the
clustering key.
@param document A Lucene {@link Document}.
@param partitionKey A partition key.
... | java | public void addFields(Document document, DecoratedKey partitionKey, CellName clusteringKey) {
ByteBuffer fullKey = byteBuffer(partitionKey, clusteringKey);
Field field = new StringField(FIELD_NAME, ByteBufferUtils.toString(fullKey), Store.NO);
document.add(field);
} | [
"public",
"void",
"addFields",
"(",
"Document",
"document",
",",
"DecoratedKey",
"partitionKey",
",",
"CellName",
"clusteringKey",
")",
"{",
"ByteBuffer",
"fullKey",
"=",
"byteBuffer",
"(",
"partitionKey",
",",
"clusteringKey",
")",
";",
"Field",
"field",
"=",
"... | Adds to the specified Lucene {@link Document} the full row key formed by the specified partition key and the
clustering key.
@param document A Lucene {@link Document}.
@param partitionKey A partition key.
@param clusteringKey A clustering key. | [
"Adds",
"to",
"the",
"specified",
"Lucene",
"{",
"@link",
"Document",
"}",
"the",
"full",
"row",
"key",
"formed",
"by",
"the",
"specified",
"partition",
"key",
"and",
"the",
"clustering",
"key",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/FullKeyMapper.java#L89-L93 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/DiskRange.java | DiskRange.span | public DiskRange span(DiskRange otherDiskRange) {
"""
Returns the minimal DiskRange that encloses both this DiskRange
and otherDiskRange. If there was a gap between the ranges the
new range will cover that gap.
"""
requireNonNull(otherDiskRange, "otherDiskRange is null");
long start = Math.mi... | java | public DiskRange span(DiskRange otherDiskRange)
{
requireNonNull(otherDiskRange, "otherDiskRange is null");
long start = Math.min(this.offset, otherDiskRange.getOffset());
long end = Math.max(getEnd(), otherDiskRange.getEnd());
return new DiskRange(start, toIntExact(end - start));
... | [
"public",
"DiskRange",
"span",
"(",
"DiskRange",
"otherDiskRange",
")",
"{",
"requireNonNull",
"(",
"otherDiskRange",
",",
"\"otherDiskRange is null\"",
")",
";",
"long",
"start",
"=",
"Math",
".",
"min",
"(",
"this",
".",
"offset",
",",
"otherDiskRange",
".",
... | Returns the minimal DiskRange that encloses both this DiskRange
and otherDiskRange. If there was a gap between the ranges the
new range will cover that gap. | [
"Returns",
"the",
"minimal",
"DiskRange",
"that",
"encloses",
"both",
"this",
"DiskRange",
"and",
"otherDiskRange",
".",
"If",
"there",
"was",
"a",
"gap",
"between",
"the",
"ranges",
"the",
"new",
"range",
"will",
"cover",
"that",
"gap",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/DiskRange.java#L62-L68 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.processIncomingHeaders | private boolean processIncomingHeaders(final Context context,final HttpsURLConnection conn) {
"""
Processes the incoming response headers for a change in domain and/or mute.
@return True to continue sending requests, false otherwise.
"""
final String muteCommand = conn.getHeaderField(Constants.HEAD... | java | private boolean processIncomingHeaders(final Context context,final HttpsURLConnection conn) {
final String muteCommand = conn.getHeaderField(Constants.HEADER_MUTE);
if (muteCommand != null && muteCommand.trim().length() > 0) {
if (muteCommand.equals("true")) {
setMuted(conte... | [
"private",
"boolean",
"processIncomingHeaders",
"(",
"final",
"Context",
"context",
",",
"final",
"HttpsURLConnection",
"conn",
")",
"{",
"final",
"String",
"muteCommand",
"=",
"conn",
".",
"getHeaderField",
"(",
"Constants",
".",
"HEADER_MUTE",
")",
";",
"if",
... | Processes the incoming response headers for a change in domain and/or mute.
@return True to continue sending requests, false otherwise. | [
"Processes",
"the",
"incoming",
"response",
"headers",
"for",
"a",
"change",
"in",
"domain",
"and",
"/",
"or",
"mute",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L1829-L1849 |
crossoverJie/distributed-redis-tool | src/main/java/com/crossoverjie/distributed/lock/RedisLock.java | RedisLock.tryLock | public boolean tryLock(String key, String request) {
"""
Non-blocking lock
@param key lock business type
@param request value
@return true lock success
false lock fail
"""
//get connection
Object connection = getConnection();
String result ;
if (connection instanceof J... | java | public boolean tryLock(String key, String request) {
//get connection
Object connection = getConnection();
String result ;
if (connection instanceof Jedis){
result = ((Jedis) connection).set(lockPrefix + key, request, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, 10 * TIME);
... | [
"public",
"boolean",
"tryLock",
"(",
"String",
"key",
",",
"String",
"request",
")",
"{",
"//get connection",
"Object",
"connection",
"=",
"getConnection",
"(",
")",
";",
"String",
"result",
";",
"if",
"(",
"connection",
"instanceof",
"Jedis",
")",
"{",
"res... | Non-blocking lock
@param key lock business type
@param request value
@return true lock success
false lock fail | [
"Non",
"-",
"blocking",
"lock"
] | train | https://github.com/crossoverJie/distributed-redis-tool/blob/57169feaccb6a56ab8821fa34e8e15954bb7b3b9/src/main/java/com/crossoverjie/distributed/lock/RedisLock.java#L84-L101 |
tweea/matrixjavalib-main-common | src/main/java/net/matrix/util/Calendars.java | Calendars.isValidDate | public static boolean isValidDate(final int year, final int month, final int day) {
"""
校验日期的年、月、日数值是否符合历法。
@param year
年
@param month
月 1-12
@param day
日
@return true 符合历法
"""
try {
buildDate(year, month, day);
return true;
} catch (IllegalFieldValueException e) {
if (LOG.isTraceEna... | java | public static boolean isValidDate(final int year, final int month, final int day) {
try {
buildDate(year, month, day);
return true;
} catch (IllegalFieldValueException e) {
if (LOG.isTraceEnabled()) {
LOG.trace("", e);
}
return false;
}
} | [
"public",
"static",
"boolean",
"isValidDate",
"(",
"final",
"int",
"year",
",",
"final",
"int",
"month",
",",
"final",
"int",
"day",
")",
"{",
"try",
"{",
"buildDate",
"(",
"year",
",",
"month",
",",
"day",
")",
";",
"return",
"true",
";",
"}",
"catc... | 校验日期的年、月、日数值是否符合历法。
@param year
年
@param month
月 1-12
@param day
日
@return true 符合历法 | [
"校验日期的年、月、日数值是否符合历法。"
] | train | https://github.com/tweea/matrixjavalib-main-common/blob/ac8f98322a422e3ef76c3e12d47b98268cec7006/src/main/java/net/matrix/util/Calendars.java#L41-L51 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/jazz_license.java | jazz_license.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
jazz_license_responses result = (jazz_license_responses) service.get_pa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
jazz_license_responses result = (jazz_license_responses) service.get_payload_formatter().string_to_resource(jazz_license_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"jazz_license_responses",
"result",
"=",
"(",
"jazz_license_responses",
")",
"service",
".",
"get_payload_form... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/jazz_license.java#L412-L429 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteProjectMember | public void deleteProjectMember(Integer projectId, Integer userId) throws IOException {
"""
Delete a project team member.
@param projectId the project id
@param userId the user id
@throws IOException on gitlab api call error
"""
String tailUrl = GitlabProject.URL + "/" + projectId + "/" + Gitla... | java | public void deleteProjectMember(Integer projectId, Integer userId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + projectId + "/" + GitlabProjectMember.URL + "/" + userId;
retrieve().method(DELETE).to(tailUrl, Void.class);
} | [
"public",
"void",
"deleteProjectMember",
"(",
"Integer",
"projectId",
",",
"Integer",
"userId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"projectId",
"+",
"\"/\"",
"+",
"GitlabProjectMember",
".... | Delete a project team member.
@param projectId the project id
@param userId the user id
@throws IOException on gitlab api call error | [
"Delete",
"a",
"project",
"team",
"member",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3068-L3071 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/utils/Events.java | Events.toJson | public static String toJson(CouchbaseEvent source, boolean pretty) {
"""
Takes a {@link CouchbaseEvent} and generates a JSON string.
@param source the source event.
@param pretty if pretty print should be used.
@return the generated json string.
"""
try {
if (pretty) {
... | java | public static String toJson(CouchbaseEvent source, boolean pretty) {
try {
if (pretty) {
return DefaultObjectMapper.prettyWriter().writeValueAsString(source.toMap());
} else {
return DefaultObjectMapper.writeValueAsString(source.toMap());
}
... | [
"public",
"static",
"String",
"toJson",
"(",
"CouchbaseEvent",
"source",
",",
"boolean",
"pretty",
")",
"{",
"try",
"{",
"if",
"(",
"pretty",
")",
"{",
"return",
"DefaultObjectMapper",
".",
"prettyWriter",
"(",
")",
".",
"writeValueAsString",
"(",
"source",
... | Takes a {@link CouchbaseEvent} and generates a JSON string.
@param source the source event.
@param pretty if pretty print should be used.
@return the generated json string. | [
"Takes",
"a",
"{",
"@link",
"CouchbaseEvent",
"}",
"and",
"generates",
"a",
"JSON",
"string",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/Events.java#L57-L67 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/MapPolylineTreeSet.java | MapPolylineTreeSet.getNearestEnd | @Override
@Pure
public final P getNearestEnd(Point2D<?, ?> position) {
"""
{@inheritDoc}
The nearest neighbor (NN) algorithm, to find the NN to a given target
point not in the tree, relies on the ability to discard large portions
of the tree by performing a simple test. To perform the NN calculation,
the tre... | java | @Override
@Pure
public final P getNearestEnd(Point2D<?, ?> position) {
return getNearestEnd(position.getX(), position.getY());
} | [
"@",
"Override",
"@",
"Pure",
"public",
"final",
"P",
"getNearestEnd",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"position",
")",
"{",
"return",
"getNearestEnd",
"(",
"position",
".",
"getX",
"(",
")",
",",
"position",
".",
"getY",
"(",
")",
")",
";",... | {@inheritDoc}
The nearest neighbor (NN) algorithm, to find the NN to a given target
point not in the tree, relies on the ability to discard large portions
of the tree by performing a simple test. To perform the NN calculation,
the tree is searched in a depth-first fashion, refining the nearest
distance. First the root ... | [
"{"
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/MapPolylineTreeSet.java#L124-L128 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java | ZipFileSliceReader.getInt | static int getInt(final byte[] arr, final long off) throws IOException {
"""
Get an int from a byte array.
@param arr
the byte array
@param off
the offset to start reading from
@return the int
@throws IOException
if an I/O exception occurs.
"""
final int ioff = (int) off;
if (ioff < 0 ... | java | static int getInt(final byte[] arr, final long off) throws IOException {
final int ioff = (int) off;
if (ioff < 0 || ioff > arr.length - 4) {
throw new IndexOutOfBoundsException();
}
return ((arr[ioff + 3] & 0xff) << 24) //
| ((arr[ioff + 2] & 0xff) << 16) //
... | [
"static",
"int",
"getInt",
"(",
"final",
"byte",
"[",
"]",
"arr",
",",
"final",
"long",
"off",
")",
"throws",
"IOException",
"{",
"final",
"int",
"ioff",
"=",
"(",
"int",
")",
"off",
";",
"if",
"(",
"ioff",
"<",
"0",
"||",
"ioff",
">",
"arr",
"."... | Get an int from a byte array.
@param arr
the byte array
@param off
the offset to start reading from
@return the int
@throws IOException
if an I/O exception occurs. | [
"Get",
"an",
"int",
"from",
"a",
"byte",
"array",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java#L194-L203 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.detectCharIfNone | public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone) {
"""
Find the first element that returns true for the specified {@code predicate}. Return the first char of the
default string if no value is found.
"""
Character result = StringIterate.detectChar(s... | java | public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone)
{
Character result = StringIterate.detectChar(string, predicate);
return result == null ? Character.valueOf(resultIfNone.charAt(0)) : result;
} | [
"public",
"static",
"Character",
"detectCharIfNone",
"(",
"String",
"string",
",",
"CharPredicate",
"predicate",
",",
"String",
"resultIfNone",
")",
"{",
"Character",
"result",
"=",
"StringIterate",
".",
"detectChar",
"(",
"string",
",",
"predicate",
")",
";",
"... | Find the first element that returns true for the specified {@code predicate}. Return the first char of the
default string if no value is found. | [
"Find",
"the",
"first",
"element",
"that",
"returns",
"true",
"for",
"the",
"specified",
"{"
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L714-L718 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToXMLStream.java | ToXMLStream.getXMLVersion | private String getXMLVersion() {
"""
This method checks for the XML version of output document.
If XML version of output document is not specified, then output
document is of version XML 1.0.
If XML version of output doucment is specified, but it is not either
XML 1.0 or XML 1.1, a warning message is generated... | java | private String getXMLVersion()
{
String xmlVersion = getVersion();
if(xmlVersion == null || xmlVersion.equals(XMLVERSION10))
{
xmlVersion = XMLVERSION10;
}
else if(xmlVersion.equals(XMLVERSION11))
{
xmlVersion = XMLVERSION11;
}
... | [
"private",
"String",
"getXMLVersion",
"(",
")",
"{",
"String",
"xmlVersion",
"=",
"getVersion",
"(",
")",
";",
"if",
"(",
"xmlVersion",
"==",
"null",
"||",
"xmlVersion",
".",
"equals",
"(",
"XMLVERSION10",
")",
")",
"{",
"xmlVersion",
"=",
"XMLVERSION10",
... | This method checks for the XML version of output document.
If XML version of output document is not specified, then output
document is of version XML 1.0.
If XML version of output doucment is specified, but it is not either
XML 1.0 or XML 1.1, a warning message is generated, the XML Version of
output document is set to... | [
"This",
"method",
"checks",
"for",
"the",
"XML",
"version",
"of",
"output",
"document",
".",
"If",
"XML",
"version",
"of",
"output",
"document",
"is",
"not",
"specified",
"then",
"output",
"document",
"is",
"of",
"version",
"XML",
"1",
".",
"0",
".",
"If... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToXMLStream.java#L615-L645 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java | IndentedPrintStream.println | public void println(int tempIndent, String x) {
"""
Indent the current line and print a string on the same line,
then print a line break
@param tempIndent magnitude of the indent (number of tab spaces)
@param x string to be printed
"""
if (startOfLine) {
doIndent(tempIndent);
}
if (noNl) ... | java | public void println(int tempIndent, String x) {
if (startOfLine) {
doIndent(tempIndent);
}
if (noNl) {
super.print(x);
} else {
super.println(x);
if (oNlCr) { super.write('\r'); }
}
startOfLine = true;
} | [
"public",
"void",
"println",
"(",
"int",
"tempIndent",
",",
"String",
"x",
")",
"{",
"if",
"(",
"startOfLine",
")",
"{",
"doIndent",
"(",
"tempIndent",
")",
";",
"}",
"if",
"(",
"noNl",
")",
"{",
"super",
".",
"print",
"(",
"x",
")",
";",
"}",
"e... | Indent the current line and print a string on the same line,
then print a line break
@param tempIndent magnitude of the indent (number of tab spaces)
@param x string to be printed | [
"Indent",
"the",
"current",
"line",
"and",
"print",
"a",
"string",
"on",
"the",
"same",
"line",
"then",
"print",
"a",
"line",
"break"
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java#L370-L382 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/ManagementPoliciesInner.java | ManagementPoliciesInner.createOrUpdate | public ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, ManagementPolicySchema policy) {
"""
Sets the managementpolicy to the specified storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param... | java | public ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, ManagementPolicySchema policy) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).toBlocking().single().body();
} | [
"public",
"ManagementPolicyInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"ManagementPolicySchema",
"policy",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"... | Sets the managementpolicy to the specified storage account.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 charac... | [
"Sets",
"the",
"managementpolicy",
"to",
"the",
"specified",
"storage",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/ManagementPoliciesInner.java#L172-L174 |
camunda/camunda-spin | dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/util/DomXmlEnsure.java | DomXmlEnsure.ensureXPathNotNull | public static void ensureXPathNotNull(Node node, String expression) {
"""
Ensure that the node is not null.
@param node the node to ensure to be not null
@param expression the expression was used to find the node
@throws SpinXPathException if the node is null
"""
if (node == null) {
throw LOG.un... | java | public static void ensureXPathNotNull(Node node, String expression) {
if (node == null) {
throw LOG.unableToFindXPathExpression(expression);
}
} | [
"public",
"static",
"void",
"ensureXPathNotNull",
"(",
"Node",
"node",
",",
"String",
"expression",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"throw",
"LOG",
".",
"unableToFindXPathExpression",
"(",
"expression",
")",
";",
"}",
"}"
] | Ensure that the node is not null.
@param node the node to ensure to be not null
@param expression the expression was used to find the node
@throws SpinXPathException if the node is null | [
"Ensure",
"that",
"the",
"node",
"is",
"not",
"null",
"."
] | train | https://github.com/camunda/camunda-spin/blob/cfe65161eb97fd5023a945cb97c47fbfe69e9fdd/dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/util/DomXmlEnsure.java#L72-L76 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.disableSchedulingAsync | public Observable<Void> disableSchedulingAsync(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption, ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions) {
"""
Disables task scheduling on the specified compute node.
You can disable task scheduling on a n... | java | public Observable<Void> disableSchedulingAsync(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption, ComputeNodeDisableSchedulingOptions computeNodeDisableSchedulingOptions) {
return disableSchedulingWithServiceResponseAsync(poolId, nodeId, nodeDisableSchedulingOption, co... | [
"public",
"Observable",
"<",
"Void",
">",
"disableSchedulingAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"DisableComputeNodeSchedulingOption",
"nodeDisableSchedulingOption",
",",
"ComputeNodeDisableSchedulingOptions",
"computeNodeDisableSchedulingOptions",
")",
... | Disables task scheduling on the specified compute node.
You can disable task scheduling on a node only if its current scheduling state is enabled.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node on which you want to disable task scheduling.
@param nodeDisableSc... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"disable",
"task",
"scheduling",
"on",
"a",
"node",
"only",
"if",
"its",
"current",
"scheduling",
"state",
"is",
"enabled",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1630-L1637 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.sqlRestriction | public org.grails.datastore.mapping.query.api.Criteria sqlRestriction(String sqlRestriction) {
"""
Applies a sql restriction to the results to allow something like:
@param sqlRestriction the sql restriction
@return a Criteria instance
"""
if (!validateSimpleExpression()) {
throwRuntimeE... | java | public org.grails.datastore.mapping.query.api.Criteria sqlRestriction(String sqlRestriction) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sqlRestriction] with value [" +
sqlRestriction + "] not allowed here."));
}
... | [
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"Criteria",
"sqlRestriction",
"(",
"String",
"sqlRestriction",
")",
"{",
"if",
"(",
"!",
"validateSimpleExpression",
"(",
")",
")",
"{",
"throwRuntimeException",
... | Applies a sql restriction to the results to allow something like:
@param sqlRestriction the sql restriction
@return a Criteria instance | [
"Applies",
"a",
"sql",
"restriction",
"to",
"the",
"results",
"to",
"allow",
"something",
"like",
":"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L1143-L1149 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresent | private boolean isNotPresent(String action, String expected, String extra) {
"""
Determines if the element is present. If it isn't, it'll wait up to the
default time (5 seconds) for the element to be present
@param action - what action is occurring
@param expected - what is the expected result
@param extra... | java | private boolean isNotPresent(String action, String expected, String extra) {
// wait for element to be present
if (!is.present()) {
waitForState.present();
}
if (!is.present()) {
reporter.fail(action, expected, extra + prettyOutput() + NOT_PRESENT);
//... | [
"private",
"boolean",
"isNotPresent",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be present",
"if",
"(",
"!",
"is",
".",
"present",
"(",
")",
")",
"{",
"waitForState",
".",
"present",
"(",
")... | Determines if the element is present. If it isn't, it'll wait up to the
default time (5 seconds) for the element to be present
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element present? | [
"Determines",
"if",
"the",
"element",
"is",
"present",
".",
"If",
"it",
"isn",
"t",
"it",
"ll",
"wait",
"up",
"to",
"the",
"default",
"time",
"(",
"5",
"seconds",
")",
"for",
"the",
"element",
"to",
"be",
"present"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L593-L604 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | StrSubstitutor.replaceIn | public boolean replaceIn(final StringBuffer source, final int offset, final int length) {
"""
Replaces all the occurrences of variables within the given source buffer
with their matching values from the resolver.
The buffer is updated with the result.
<p>
Only the specified portion of the buffer will be proces... | java | public boolean replaceIn(final StringBuffer source, final int offset, final int length) {
if (source == null) {
return false;
}
final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
if (substitute(buf, 0, length) == false) {
return false;
... | [
"public",
"boolean",
"replaceIn",
"(",
"final",
"StringBuffer",
"source",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"final",
"StrBuilder",
"buf",
"=",... | Replaces all the occurrences of variables within the given source buffer
with their matching values from the resolver.
The buffer is updated with the result.
<p>
Only the specified portion of the buffer will be processed.
The rest of the buffer is not processed, but it is not deleted.
@param source the buffer to repl... | [
"Replaces",
"all",
"the",
"occurrences",
"of",
"variables",
"within",
"the",
"given",
"source",
"buffer",
"with",
"their",
"matching",
"values",
"from",
"the",
"resolver",
".",
"The",
"buffer",
"is",
"updated",
"with",
"the",
"result",
".",
"<p",
">",
"Only"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L641-L651 |
micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java | AnnotationUtils.hasStereotype | protected boolean hasStereotype(Element element, String... stereotypes) {
"""
Return whether the given element is annotated with the given annotation stereotypes.
@param element The element
@param stereotypes The stereotypes
@return True if it is
"""
return hasStereotype(element, Arrays.asList... | java | protected boolean hasStereotype(Element element, String... stereotypes) {
return hasStereotype(element, Arrays.asList(stereotypes));
} | [
"protected",
"boolean",
"hasStereotype",
"(",
"Element",
"element",
",",
"String",
"...",
"stereotypes",
")",
"{",
"return",
"hasStereotype",
"(",
"element",
",",
"Arrays",
".",
"asList",
"(",
"stereotypes",
")",
")",
";",
"}"
] | Return whether the given element is annotated with the given annotation stereotypes.
@param element The element
@param stereotypes The stereotypes
@return True if it is | [
"Return",
"whether",
"the",
"given",
"element",
"is",
"annotated",
"with",
"the",
"given",
"annotation",
"stereotypes",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java#L151-L153 |
litsec/swedish-eid-shibboleth-base | shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java | AbstractExternalAuthenticationController.processIsPassive | protected void processIsPassive(ProfileRequestContext<?, ?> profileRequestContext) throws ExternalAutenticationErrorCodeException {
"""
Checks if the IsPassive flag is set in the AuthnRequest and fails with a NO_PASSIVE error code if this is the case.
<p>
Implementations that do support passive authentication MU... | java | protected void processIsPassive(ProfileRequestContext<?, ?> profileRequestContext) throws ExternalAutenticationErrorCodeException {
final AuthnRequest authnRequest = this.getAuthnRequest(profileRequestContext);
if (authnRequest != null && authnRequest.isPassive() != null && authnRequest.isPassive() == Boolean.T... | [
"protected",
"void",
"processIsPassive",
"(",
"ProfileRequestContext",
"<",
"?",
",",
"?",
">",
"profileRequestContext",
")",
"throws",
"ExternalAutenticationErrorCodeException",
"{",
"final",
"AuthnRequest",
"authnRequest",
"=",
"this",
".",
"getAuthnRequest",
"(",
"pr... | Checks if the IsPassive flag is set in the AuthnRequest and fails with a NO_PASSIVE error code if this is the case.
<p>
Implementations that do support passive authentication MUST override this method and handle the IsPassive
processing themselves.
</p>
@param profileRequestContext
the context
@throws ExternalAutentic... | [
"Checks",
"if",
"the",
"IsPassive",
"flag",
"is",
"set",
"in",
"the",
"AuthnRequest",
"and",
"fails",
"with",
"a",
"NO_PASSIVE",
"error",
"code",
"if",
"this",
"is",
"the",
"case",
".",
"<p",
">",
"Implementations",
"that",
"do",
"support",
"passive",
"aut... | train | https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java#L191-L201 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsByAttributeValueContaining | public Elements getElementsByAttributeValueContaining(String key, String match) {
"""
Find elements that have attributes whose value contains the match string. Case insensitive.
@param key name of the attribute
@param match substring of value to search for
@return elements that have attributes containing this... | java | public Elements getElementsByAttributeValueContaining(String key, String match) {
return Collector.collect(new Evaluator.AttributeWithValueContaining(key, match), this);
} | [
"public",
"Elements",
"getElementsByAttributeValueContaining",
"(",
"String",
"key",
",",
"String",
"match",
")",
"{",
"return",
"Collector",
".",
"collect",
"(",
"new",
"Evaluator",
".",
"AttributeWithValueContaining",
"(",
"key",
",",
"match",
")",
",",
"this",
... | Find elements that have attributes whose value contains the match string. Case insensitive.
@param key name of the attribute
@param match substring of value to search for
@return elements that have attributes containing this text | [
"Find",
"elements",
"that",
"have",
"attributes",
"whose",
"value",
"contains",
"the",
"match",
"string",
".",
"Case",
"insensitive",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L907-L909 |
hawkular/hawkular-agent | hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/config/ConfigManager.java | ConfigManager.updateConfiguration | public void updateConfiguration(Configuration config, boolean createBackup) throws Exception {
"""
Updates the configuration and writes it to the {@link #getConfigFile() file}, overwriting
the previous content of the file.
@param config the new configuration
@param createBackup if true a .bak file is copied f... | java | public void updateConfiguration(Configuration config, boolean createBackup) throws Exception {
if (config == null) {
throw new IllegalArgumentException("config must not be null");
}
Lock lock = this.configurationLock.writeLock();
lock.lock();
try {
save(th... | [
"public",
"void",
"updateConfiguration",
"(",
"Configuration",
"config",
",",
"boolean",
"createBackup",
")",
"throws",
"Exception",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"config must not be null\"",
")"... | Updates the configuration and writes it to the {@link #getConfigFile() file}, overwriting
the previous content of the file.
@param config the new configuration
@param createBackup if true a .bak file is copied from the original as a backup
@throws Exception if the new configuration cannot be written to the file | [
"Updates",
"the",
"configuration",
"and",
"writes",
"it",
"to",
"the",
"{",
"@link",
"#getConfigFile",
"()",
"file",
"}",
"overwriting",
"the",
"previous",
"content",
"of",
"the",
"file",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/config/ConfigManager.java#L122-L134 |
google/closure-templates | java/src/com/google/template/soy/passes/PassManager.java | PassManager.runWholeFilesetPasses | public void runWholeFilesetPasses(SoyFileSetNode soyTree, TemplateRegistry templateRegistry) {
"""
Runs all the fileset passes including the autoescaper and optimization passes if configured.
"""
ImmutableList<SoyFileNode> sourceFiles = ImmutableList.copyOf(soyTree.getChildren());
IdGenerator idGenerat... | java | public void runWholeFilesetPasses(SoyFileSetNode soyTree, TemplateRegistry templateRegistry) {
ImmutableList<SoyFileNode> sourceFiles = ImmutableList.copyOf(soyTree.getChildren());
IdGenerator idGenerator = soyTree.getNodeIdGenerator();
for (CompilerFileSetPass pass : crossTemplateCheckingPasses) {
Co... | [
"public",
"void",
"runWholeFilesetPasses",
"(",
"SoyFileSetNode",
"soyTree",
",",
"TemplateRegistry",
"templateRegistry",
")",
"{",
"ImmutableList",
"<",
"SoyFileNode",
">",
"sourceFiles",
"=",
"ImmutableList",
".",
"copyOf",
"(",
"soyTree",
".",
"getChildren",
"(",
... | Runs all the fileset passes including the autoescaper and optimization passes if configured. | [
"Runs",
"all",
"the",
"fileset",
"passes",
"including",
"the",
"autoescaper",
"and",
"optimization",
"passes",
"if",
"configured",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/PassManager.java#L98-L107 |
fuinorg/units4j | src/main/java/org/fuin/units4j/AssertDependencies.java | AssertDependencies.assertRules | public static final void assertRules(final Dependencies dependencies, final File classesDir) {
"""
Asserts that a set of dependency rules is kept.
@param dependencies
Definition of allowed or forbidden dependencies - Cannot be <code>null</code>.
@param classesDir
Directory with the ".class" files to check - ... | java | public static final void assertRules(final Dependencies dependencies, final File classesDir) {
Utils4J.checkNotNull("dependencies", dependencies);
Utils4J.checkNotNull("classesDir", classesDir);
Utils4J.checkValidDir(classesDir);
try {
final DependencyAnalyzer analyzer =... | [
"public",
"static",
"final",
"void",
"assertRules",
"(",
"final",
"Dependencies",
"dependencies",
",",
"final",
"File",
"classesDir",
")",
"{",
"Utils4J",
".",
"checkNotNull",
"(",
"\"dependencies\"",
",",
"dependencies",
")",
";",
"Utils4J",
".",
"checkNotNull",
... | Asserts that a set of dependency rules is kept.
@param dependencies
Definition of allowed or forbidden dependencies - Cannot be <code>null</code>.
@param classesDir
Directory with the ".class" files to check - Cannot be <code>null</code> and must be a valid directory. | [
"Asserts",
"that",
"a",
"set",
"of",
"dependency",
"rules",
"is",
"kept",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/AssertDependencies.java#L63-L73 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/FileUtil.java | FileUtil.setTimes | public static final void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime, Path... files) throws IOException {
"""
Set files times. Non null times are changed.
@param lastModifiedTime Can be null
@param lastAccessTime Can be null
@param createTime Can be null
@param files
@thro... | java | public static final void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime, Path... files) throws IOException
{
for (Path file : files)
{
BasicFileAttributeView view = Files.getFileAttributeView(file, BasicFileAttributeView.class);
view.set... | [
"public",
"static",
"final",
"void",
"setTimes",
"(",
"FileTime",
"lastModifiedTime",
",",
"FileTime",
"lastAccessTime",
",",
"FileTime",
"createTime",
",",
"Path",
"...",
"files",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Path",
"file",
":",
"files",
")... | Set files times. Non null times are changed.
@param lastModifiedTime Can be null
@param lastAccessTime Can be null
@param createTime Can be null
@param files
@throws IOException | [
"Set",
"files",
"times",
".",
"Non",
"null",
"times",
"are",
"changed",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/FileUtil.java#L245-L252 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/AccountingDate.java | AccountingDate.now | public static AccountingDate now(AccountingChronology chronology, ZoneId zone) {
"""
Obtains the current {@code AccountingDate} from the system clock in the specified time-zone,
translated with the given AccountingChronology.
<p>
This will query the {@link Clock#system(ZoneId) system clock} to obtain the curren... | java | public static AccountingDate now(AccountingChronology chronology, ZoneId zone) {
return now(chronology, Clock.system(zone));
} | [
"public",
"static",
"AccountingDate",
"now",
"(",
"AccountingChronology",
"chronology",
",",
"ZoneId",
"zone",
")",
"{",
"return",
"now",
"(",
"chronology",
",",
"Clock",
".",
"system",
"(",
"zone",
")",
")",
";",
"}"
] | Obtains the current {@code AccountingDate} from the system clock in the specified time-zone,
translated with the given AccountingChronology.
<p>
This will query the {@link Clock#system(ZoneId) system clock} to obtain the current date.
Specifying the time-zone avoids dependence on the default time-zone.
<p>
Using this m... | [
"Obtains",
"the",
"current",
"{",
"@code",
"AccountingDate",
"}",
"from",
"the",
"system",
"clock",
"in",
"the",
"specified",
"time",
"-",
"zone",
"translated",
"with",
"the",
"given",
"AccountingChronology",
".",
"<p",
">",
"This",
"will",
"query",
"the",
"... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/AccountingDate.java#L146-L148 |
dequelabs/axe-selenium-java | src/main/java/com/deque/axe/AXE.java | AXE.injectIntoFrames | private static void injectIntoFrames(final WebDriver driver, final String script, final ArrayList<WebElement> parents) {
"""
Recursively find frames and inject a script into them.
@param driver An initialized WebDriver
@param script Script to inject
@param parents A list of all toplevel frames
"""
final J... | java | private static void injectIntoFrames(final WebDriver driver, final String script, final ArrayList<WebElement> parents) {
final JavascriptExecutor js = (JavascriptExecutor) driver;
final List<WebElement> frames = driver.findElements(By.tagName("iframe"));
for (WebElement frame : frames) {
driver.switchTo().def... | [
"private",
"static",
"void",
"injectIntoFrames",
"(",
"final",
"WebDriver",
"driver",
",",
"final",
"String",
"script",
",",
"final",
"ArrayList",
"<",
"WebElement",
">",
"parents",
")",
"{",
"final",
"JavascriptExecutor",
"js",
"=",
"(",
"JavascriptExecutor",
"... | Recursively find frames and inject a script into them.
@param driver An initialized WebDriver
@param script Script to inject
@param parents A list of all toplevel frames | [
"Recursively",
"find",
"frames",
"and",
"inject",
"a",
"script",
"into",
"them",
"."
] | train | https://github.com/dequelabs/axe-selenium-java/blob/68b35ff46c59111b0e9a9f573380c3d250bcfd65/src/main/java/com/deque/axe/AXE.java#L97-L118 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/util/LruCache.java | LruCache.put | public synchronized void put(Key key, Value value) {
"""
Returns given value to the cache.
@param key key
@param value value
"""
long valueSize = value.getSize();
if (maxSizeBytes == 0 || maxSizeEntries == 0 || valueSize * 2 > maxSizeBytes) {
// Just destroy the value if cache is disabled or ... | java | public synchronized void put(Key key, Value value) {
long valueSize = value.getSize();
if (maxSizeBytes == 0 || maxSizeEntries == 0 || valueSize * 2 > maxSizeBytes) {
// Just destroy the value if cache is disabled or if entry would consume more than a half of
// the cache
evictValue(value);
... | [
"public",
"synchronized",
"void",
"put",
"(",
"Key",
"key",
",",
"Value",
"value",
")",
"{",
"long",
"valueSize",
"=",
"value",
".",
"getSize",
"(",
")",
";",
"if",
"(",
"maxSizeBytes",
"==",
"0",
"||",
"maxSizeEntries",
"==",
"0",
"||",
"valueSize",
"... | Returns given value to the cache.
@param key key
@param value value | [
"Returns",
"given",
"value",
"to",
"the",
"cache",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/LruCache.java#L127-L145 |
tipsy/javalin | src/main/java/io/javalin/Javalin.java | Javalin.addHandler | public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {
"""
Adds a request handler for the specified handlerType and path to the instance.
This is the method that all the verb-methods (get/post/put/etc) call.
@see <a href="https://javalin.io/documentation#ha... | java | public Javalin addHandler(@NotNull HandlerType httpMethod, @NotNull String path, @NotNull Handler handler) {
return addHandler(httpMethod, path, handler, new HashSet<>()); // no roles set for this route (open to everyone with default access manager)
} | [
"public",
"Javalin",
"addHandler",
"(",
"@",
"NotNull",
"HandlerType",
"httpMethod",
",",
"@",
"NotNull",
"String",
"path",
",",
"@",
"NotNull",
"Handler",
"handler",
")",
"{",
"return",
"addHandler",
"(",
"httpMethod",
",",
"path",
",",
"handler",
",",
"new... | Adds a request handler for the specified handlerType and path to the instance.
This is the method that all the verb-methods (get/post/put/etc) call.
@see <a href="https://javalin.io/documentation#handlers">Handlers in docs</a> | [
"Adds",
"a",
"request",
"handler",
"for",
"the",
"specified",
"handlerType",
"and",
"path",
"to",
"the",
"instance",
".",
"This",
"is",
"the",
"method",
"that",
"all",
"the",
"verb",
"-",
"methods",
"(",
"get",
"/",
"post",
"/",
"put",
"/",
"etc",
")",... | train | https://github.com/tipsy/javalin/blob/68b2f7592f237db1c2b597e645697eb75fdaee53/src/main/java/io/javalin/Javalin.java#L280-L282 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_volume_snapshot_GET | public ArrayList<OvhSnapshot> project_serviceName_volume_snapshot_GET(String serviceName, String region) throws IOException {
"""
Get volume snapshots
REST: GET /cloud/project/{serviceName}/volume/snapshot
@param region [required] Snapshots region
@param serviceName [required] Project id
"""
String qPat... | java | public ArrayList<OvhSnapshot> project_serviceName_volume_snapshot_GET(String serviceName, String region) throws IOException {
String qPath = "/cloud/project/{serviceName}/volume/snapshot";
StringBuilder sb = path(qPath, serviceName);
query(sb, "region", region);
String resp = exec(qPath, "GET", sb.toString(), n... | [
"public",
"ArrayList",
"<",
"OvhSnapshot",
">",
"project_serviceName_volume_snapshot_GET",
"(",
"String",
"serviceName",
",",
"String",
"region",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/volume/snapshot\"",
";",
"StringBuild... | Get volume snapshots
REST: GET /cloud/project/{serviceName}/volume/snapshot
@param region [required] Snapshots region
@param serviceName [required] Project id | [
"Get",
"volume",
"snapshots"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1249-L1255 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxWebHook.java | BoxWebHook.validateTriggers | public static void validateTriggers(String targetType, Collection<BoxWebHook.Trigger> triggers) {
"""
Validates that provided {@link BoxWebHook.Trigger}-s can be applied on the provided {@link BoxResourceType}.
@param targetType
on which target the triggers should be applied to
@param triggers
for check
@... | java | public static void validateTriggers(String targetType, Collection<BoxWebHook.Trigger> triggers) {
for (BoxWebHook.Trigger trigger : triggers) {
validateTrigger(targetType, trigger);
}
} | [
"public",
"static",
"void",
"validateTriggers",
"(",
"String",
"targetType",
",",
"Collection",
"<",
"BoxWebHook",
".",
"Trigger",
">",
"triggers",
")",
"{",
"for",
"(",
"BoxWebHook",
".",
"Trigger",
"trigger",
":",
"triggers",
")",
"{",
"validateTrigger",
"("... | Validates that provided {@link BoxWebHook.Trigger}-s can be applied on the provided {@link BoxResourceType}.
@param targetType
on which target the triggers should be applied to
@param triggers
for check
@see #validateTrigger(String, Trigger) | [
"Validates",
"that",
"provided",
"{",
"@link",
"BoxWebHook",
".",
"Trigger",
"}",
"-",
"s",
"can",
"be",
"applied",
"on",
"the",
"provided",
"{",
"@link",
"BoxResourceType",
"}",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHook.java#L234-L238 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java | CmsForm.validateAndSubmit | public void validateAndSubmit() {
"""
Validates the form fields and submits their values if the validation was successful.<p>
"""
CmsValidationController validationController = new CmsValidationController(
m_fields.values(),
new I_CmsValidationHandler() {
/**
... | java | public void validateAndSubmit() {
CmsValidationController validationController = new CmsValidationController(
m_fields.values(),
new I_CmsValidationHandler() {
/**
* @see org.opencms.gwt.client.validation.I_CmsValidationHandler#onValidationFinished(bool... | [
"public",
"void",
"validateAndSubmit",
"(",
")",
"{",
"CmsValidationController",
"validationController",
"=",
"new",
"CmsValidationController",
"(",
"m_fields",
".",
"values",
"(",
")",
",",
"new",
"I_CmsValidationHandler",
"(",
")",
"{",
"/**\n * @see o... | Validates the form fields and submits their values if the validation was successful.<p> | [
"Validates",
"the",
"form",
"fields",
"and",
"submits",
"their",
"values",
"if",
"the",
"validation",
"was",
"successful",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L371-L398 |
apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java | Runner.writeJobDetails | private static void writeJobDetails(ExecutionEnvironment env, String jobDetailsPath) throws IOException {
"""
Write the following job details as a JSON encoded file: runtime environment
job ID, runtime, parameters, and accumulators.
@param env the execution environment
@param jobDetailsPath filesystem path to... | java | private static void writeJobDetails(ExecutionEnvironment env, String jobDetailsPath) throws IOException {
JobExecutionResult result = env.getLastJobExecutionResult();
File jsonFile = new File(jobDetailsPath);
try (JsonGenerator json = new JsonFactory().createGenerator(jsonFile, JsonEncoding.UTF8)) {
json.wri... | [
"private",
"static",
"void",
"writeJobDetails",
"(",
"ExecutionEnvironment",
"env",
",",
"String",
"jobDetailsPath",
")",
"throws",
"IOException",
"{",
"JobExecutionResult",
"result",
"=",
"env",
".",
"getLastJobExecutionResult",
"(",
")",
";",
"File",
"jsonFile",
"... | Write the following job details as a JSON encoded file: runtime environment
job ID, runtime, parameters, and accumulators.
@param env the execution environment
@param jobDetailsPath filesystem path to write job details
@throws IOException on error writing to jobDetailsPath | [
"Write",
"the",
"following",
"job",
"details",
"as",
"a",
"JSON",
"encoded",
"file",
":",
"runtime",
"environment",
"job",
"ID",
"runtime",
"parameters",
"and",
"accumulators",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java#L473-L504 |
groovy/groovy-core | src/main/org/codehaus/groovy/ast/ASTNode.java | ASTNode.setNodeMetaData | public void setNodeMetaData(Object key, Object value) {
"""
Sets the node meta data.
@param key - the meta data key
@param value - the meta data value
@throws GroovyBugError if key is null or there is already meta
data under that key
"""
if (key==null) throw new GroovyBugError("Tried to set meta ... | java | public void setNodeMetaData(Object key, Object value) {
if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
if (metaDataMap == null) {
metaDataMap = new ListHashMap();
}
Object old = metaDataMap.put(key,value);
if (old!=null) ... | [
"public",
"void",
"setNodeMetaData",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"GroovyBugError",
"(",
"\"Tried to set meta data with null key on \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"if",
... | Sets the node meta data.
@param key - the meta data key
@param value - the meta data value
@throws GroovyBugError if key is null or there is already meta
data under that key | [
"Sets",
"the",
"node",
"meta",
"data",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ASTNode.java#L148-L155 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java | GeometryExtrude.extractWalls | public static MultiPolygon extractWalls(Polygon polygon, double height) {
"""
Extract the walls from a polygon
@param polygon
@param height
@return
"""
GeometryFactory factory = polygon.getFactory();
//We process the exterior ring
final LineString shell = getClockWise(polygon.getExt... | java | public static MultiPolygon extractWalls(Polygon polygon, double height){
GeometryFactory factory = polygon.getFactory();
//We process the exterior ring
final LineString shell = getClockWise(polygon.getExteriorRing());
ArrayList<Polygon> walls = new ArrayList<Polygon>();
for (in... | [
"public",
"static",
"MultiPolygon",
"extractWalls",
"(",
"Polygon",
"polygon",
",",
"double",
"height",
")",
"{",
"GeometryFactory",
"factory",
"=",
"polygon",
".",
"getFactory",
"(",
")",
";",
"//We process the exterior ring ",
"final",
"LineString",
"shell",
"=",
... | Extract the walls from a polygon
@param polygon
@param height
@return | [
"Extract",
"the",
"walls",
"from",
"a",
"polygon"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/volume/GeometryExtrude.java#L121-L141 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsNameBasedDiskCache.java | CmsVfsNameBasedDiskCache.getCacheName | public String getCacheName(CmsResource resource, String parameters) {
"""
Returns the RFS name to use for caching the given VFS resource with parameters in the disk cache.<p>
@param resource the VFS resource to generate the cache name for
@param parameters the parameters of the request to the VFS resource
@... | java | public String getCacheName(CmsResource resource, String parameters) {
// calculate the base cache path for the resource
String rfsName = m_rfsRepository + resource.getRootPath();
String extension = CmsFileUtil.getExtension(rfsName);
// create a StringBuffer for the result
Strin... | [
"public",
"String",
"getCacheName",
"(",
"CmsResource",
"resource",
",",
"String",
"parameters",
")",
"{",
"// calculate the base cache path for the resource",
"String",
"rfsName",
"=",
"m_rfsRepository",
"+",
"resource",
".",
"getRootPath",
"(",
")",
";",
"String",
"... | Returns the RFS name to use for caching the given VFS resource with parameters in the disk cache.<p>
@param resource the VFS resource to generate the cache name for
@param parameters the parameters of the request to the VFS resource
@return the RFS name to use for caching the given VFS resource with parameters | [
"Returns",
"the",
"RFS",
"name",
"to",
"use",
"for",
"caching",
"the",
"given",
"VFS",
"resource",
"with",
"parameters",
"in",
"the",
"disk",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsNameBasedDiskCache.java#L111-L148 |
tvbarthel/Cheerleader | library/src/main/java/fr/tvbarthel/cheerleader/library/player/NotificationManager.java | NotificationManager.initializePendingIntent | private void initializePendingIntent(Context context) {
"""
Initialize {@link android.app.PendingIntent} used for notification actions.
@param context context used to instantiate intent.
"""
// toggle playback
Intent togglePlaybackIntent = new Intent(context, PlaybackService.class);
... | java | private void initializePendingIntent(Context context) {
// toggle playback
Intent togglePlaybackIntent = new Intent(context, PlaybackService.class);
togglePlaybackIntent.setAction(PlaybackService.ACTION_TOGGLE_PLAYBACK);
mTogglePlaybackPendingIntent = PendingIntent.getService(context, R... | [
"private",
"void",
"initializePendingIntent",
"(",
"Context",
"context",
")",
"{",
"// toggle playback",
"Intent",
"togglePlaybackIntent",
"=",
"new",
"Intent",
"(",
"context",
",",
"PlaybackService",
".",
"class",
")",
";",
"togglePlaybackIntent",
".",
"setAction",
... | Initialize {@link android.app.PendingIntent} used for notification actions.
@param context context used to instantiate intent. | [
"Initialize",
"{",
"@link",
"android",
".",
"app",
".",
"PendingIntent",
"}",
"used",
"for",
"notification",
"actions",
"."
] | train | https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/player/NotificationManager.java#L256-L281 |
jtmelton/appsensor | analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java | AggregateEventAnalysisEngine.checkExpression | protected boolean checkExpression(Expression expression, Queue<Notification> notifications) {
"""
Evaluates an {@link Expression}'s logic by evaluating all {@link Clause}s. Any
{@link Clause} must evaluate to true for the {@link Expression} to evaluate to true.
Equivalent to checking "OR" logic between {@link ... | java | protected boolean checkExpression(Expression expression, Queue<Notification> notifications) {
for (Clause clause : expression.getClauses()) {
if (checkClause(clause, notifications)) {
return true;
}
}
return false;
} | [
"protected",
"boolean",
"checkExpression",
"(",
"Expression",
"expression",
",",
"Queue",
"<",
"Notification",
">",
"notifications",
")",
"{",
"for",
"(",
"Clause",
"clause",
":",
"expression",
".",
"getClauses",
"(",
")",
")",
"{",
"if",
"(",
"checkClause",
... | Evaluates an {@link Expression}'s logic by evaluating all {@link Clause}s. Any
{@link Clause} must evaluate to true for the {@link Expression} to evaluate to true.
Equivalent to checking "OR" logic between {@link Clause}s.
@param expression the {@link Expression} being evaluated
@param notifications the {@link Notifi... | [
"Evaluates",
"an",
"{",
"@link",
"Expression",
"}",
"s",
"logic",
"by",
"evaluating",
"all",
"{",
"@link",
"Clause",
"}",
"s",
".",
"Any",
"{",
"@link",
"Clause",
"}",
"must",
"evaluate",
"to",
"true",
"for",
"the",
"{",
"@link",
"Expression",
"}",
"to... | train | https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java#L119-L127 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.handleBugCategories | public static Set<String> handleBugCategories(String categories) {
"""
Process -bugCategories option.
@param categories
comma-separated list of bug categories
@return Set of categories to be used
"""
// Parse list of bug categories
Set<String> categorySet = new HashSet<>();
Strin... | java | public static Set<String> handleBugCategories(String categories) {
// Parse list of bug categories
Set<String> categorySet = new HashSet<>();
StringTokenizer tok = new StringTokenizer(categories, ",");
while (tok.hasMoreTokens()) {
categorySet.add(tok.nextToken());
}
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"handleBugCategories",
"(",
"String",
"categories",
")",
"{",
"// Parse list of bug categories",
"Set",
"<",
"String",
">",
"categorySet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"StringTokenizer",
"tok",
"=",
... | Process -bugCategories option.
@param categories
comma-separated list of bug categories
@return Set of categories to be used | [
"Process",
"-",
"bugCategories",
"option",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L305-L314 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/manager/internal/ManagerConnectionImpl.java | ManagerConnectionImpl.sendAction | public ManagerResponse sendAction(ManagerAction action, long timeout)
throws IOException, TimeoutException, IllegalArgumentException, IllegalStateException {
"""
Implements synchronous sending of "simple" actions.
@param timeout - in milliseconds
"""
ResponseHandlerResult result = new Re... | java | public ManagerResponse sendAction(ManagerAction action, long timeout)
throws IOException, TimeoutException, IllegalArgumentException, IllegalStateException
{
ResponseHandlerResult result = new ResponseHandlerResult();
SendActionCallback callbackHandler = new DefaultSendActionCallback(res... | [
"public",
"ManagerResponse",
"sendAction",
"(",
"ManagerAction",
"action",
",",
"long",
"timeout",
")",
"throws",
"IOException",
",",
"TimeoutException",
",",
"IllegalArgumentException",
",",
"IllegalStateException",
"{",
"ResponseHandlerResult",
"result",
"=",
"new",
"... | Implements synchronous sending of "simple" actions.
@param timeout - in milliseconds | [
"Implements",
"synchronous",
"sending",
"of",
"simple",
"actions",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/manager/internal/ManagerConnectionImpl.java#L817-L854 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.checkCacheConfig | public static void checkCacheConfig(CacheConfig cacheConfig, CacheMergePolicyProvider mergePolicyProvider) {
"""
Validates the given {@link CacheConfig}.
@param cacheConfig the {@link CacheConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolve merge policy classes
... | java | public static void checkCacheConfig(CacheConfig cacheConfig, CacheMergePolicyProvider mergePolicyProvider) {
checkCacheConfig(cacheConfig.getInMemoryFormat(), cacheConfig.getEvictionConfig(), cacheConfig.getMergePolicy(),
cacheConfig, mergePolicyProvider);
} | [
"public",
"static",
"void",
"checkCacheConfig",
"(",
"CacheConfig",
"cacheConfig",
",",
"CacheMergePolicyProvider",
"mergePolicyProvider",
")",
"{",
"checkCacheConfig",
"(",
"cacheConfig",
".",
"getInMemoryFormat",
"(",
")",
",",
"cacheConfig",
".",
"getEvictionConfig",
... | Validates the given {@link CacheConfig}.
@param cacheConfig the {@link CacheConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolve merge policy classes | [
"Validates",
"the",
"given",
"{",
"@link",
"CacheConfig",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L330-L333 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java | ResourceManager.closeTaskManagerConnection | protected void closeTaskManagerConnection(final ResourceID resourceID, final Exception cause) {
"""
This method should be called by the framework once it detects that a currently registered
task executor has failed.
@param resourceID Id of the TaskManager that has failed.
@param cause The exception which caus... | java | protected void closeTaskManagerConnection(final ResourceID resourceID, final Exception cause) {
taskManagerHeartbeatManager.unmonitorTarget(resourceID);
WorkerRegistration<WorkerType> workerRegistration = taskExecutors.remove(resourceID);
if (workerRegistration != null) {
log.info("Closing TaskExecutor conne... | [
"protected",
"void",
"closeTaskManagerConnection",
"(",
"final",
"ResourceID",
"resourceID",
",",
"final",
"Exception",
"cause",
")",
"{",
"taskManagerHeartbeatManager",
".",
"unmonitorTarget",
"(",
"resourceID",
")",
";",
"WorkerRegistration",
"<",
"WorkerType",
">",
... | This method should be called by the framework once it detects that a currently registered
task executor has failed.
@param resourceID Id of the TaskManager that has failed.
@param cause The exception which cause the TaskManager failed. | [
"This",
"method",
"should",
"be",
"called",
"by",
"the",
"framework",
"once",
"it",
"detects",
"that",
"a",
"currently",
"registered",
"task",
"executor",
"has",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L794-L812 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java | AbstractBcX509CertificateGenerator.buildTBSCertificate | public TBSCertificate buildTBSCertificate(PrincipalIndentifier subjectName,
PublicKeyParameters subject, X509CertificateParameters parameters) throws IOException {
"""
Build the TBS Certificate.
@param subjectName the identifier of the public key owner.
@param subject the public key to certify.
@param... | java | public TBSCertificate buildTBSCertificate(PrincipalIndentifier subjectName,
PublicKeyParameters subject, X509CertificateParameters parameters) throws IOException
{
PrincipalIndentifier issuerName;
CertifiedPublicKey issuer = null;
if (this.signer instanceof CertifyingSigner) {
... | [
"public",
"TBSCertificate",
"buildTBSCertificate",
"(",
"PrincipalIndentifier",
"subjectName",
",",
"PublicKeyParameters",
"subject",
",",
"X509CertificateParameters",
"parameters",
")",
"throws",
"IOException",
"{",
"PrincipalIndentifier",
"issuerName",
";",
"CertifiedPublicKe... | Build the TBS Certificate.
@param subjectName the identifier of the public key owner.
@param subject the public key to certify.
@param parameters the subject parameters for this certificate.
@return the TBS certificate.
@throws IOException on encoding error. | [
"Build",
"the",
"TBS",
"Certificate",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/AbstractBcX509CertificateGenerator.java#L105-L127 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Custom | public JBBPDslBuilder Custom(final String type, final String name, final String param) {
"""
Add named parametric custom variable.
@param type custom type, must not be null
@param name name of the field, can be null for anonymous
@param param optional parameter for the field, can be null
@return the builde... | java | public JBBPDslBuilder Custom(final String type, final String name, final String param) {
final ItemCustom custom = new ItemCustom(type, name, this.byteOrder);
custom.bitLenExpression = param == null ? null : assertExpressionChars(param);
this.addItem(custom);
return this;
} | [
"public",
"JBBPDslBuilder",
"Custom",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"name",
",",
"final",
"String",
"param",
")",
"{",
"final",
"ItemCustom",
"custom",
"=",
"new",
"ItemCustom",
"(",
"type",
",",
"name",
",",
"this",
".",
"byteOrd... | Add named parametric custom variable.
@param type custom type, must not be null
@param name name of the field, can be null for anonymous
@param param optional parameter for the field, can be null
@return the builder instance, must not be null | [
"Add",
"named",
"parametric",
"custom",
"variable",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L310-L315 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java | CmsDefaultLinkSubstitutionHandler.getRootPathForSite | protected String getRootPathForSite(CmsObject cms, String path, String siteRoot, boolean isRootPath) {
"""
Returns the root path for given site.<p>
This method is required as a hook used in {@link CmsLocalePrefixLinkSubstitutionHandler}.<p>
@param cms the cms context
@param path the path
@param siteRoot the si... | java | protected String getRootPathForSite(CmsObject cms, String path, String siteRoot, boolean isRootPath) {
if (isRootPath || (siteRoot == null)) {
return CmsStringUtil.joinPaths("/", path);
} else {
return cms.getRequestContext().addSiteRoot(siteRoot, path);
}
} | [
"protected",
"String",
"getRootPathForSite",
"(",
"CmsObject",
"cms",
",",
"String",
"path",
",",
"String",
"siteRoot",
",",
"boolean",
"isRootPath",
")",
"{",
"if",
"(",
"isRootPath",
"||",
"(",
"siteRoot",
"==",
"null",
")",
")",
"{",
"return",
"CmsStringU... | Returns the root path for given site.<p>
This method is required as a hook used in {@link CmsLocalePrefixLinkSubstitutionHandler}.<p>
@param cms the cms context
@param path the path
@param siteRoot the site root, will be null in case of the root site
@param isRootPath in case the path is already a root path
@return th... | [
"Returns",
"the",
"root",
"path",
"for",
"given",
"site",
".",
"<p",
">",
"This",
"method",
"is",
"required",
"as",
"a",
"hook",
"used",
"in",
"{",
"@link",
"CmsLocalePrefixLinkSubstitutionHandler",
"}",
".",
"<p",
">",
"@param",
"cms",
"the",
"cms",
"cont... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java#L462-L469 |
alkacon/opencms-core | src/org/opencms/newsletter/CmsNewsletter.java | CmsNewsletter.replaceMacros | private String replaceMacros(String msg, I_CmsNewsletterRecipient recipient) {
"""
Replaces the macros in the given message.<p>
@param msg the message in which the macros are replaced
@param recipient the recipient in the message
@return the message with the macros replaced
"""
CmsMacroResolver... | java | private String replaceMacros(String msg, I_CmsNewsletterRecipient recipient) {
CmsMacroResolver resolver = CmsMacroResolver.newInstance();
resolver.addMacro(MACRO_USER_FIRSTNAME, recipient.getFirstname());
resolver.addMacro(MACRO_USER_LASTNAME, recipient.getLastname());
resolver.addMacr... | [
"private",
"String",
"replaceMacros",
"(",
"String",
"msg",
",",
"I_CmsNewsletterRecipient",
"recipient",
")",
"{",
"CmsMacroResolver",
"resolver",
"=",
"CmsMacroResolver",
".",
"newInstance",
"(",
")",
";",
"resolver",
".",
"addMacro",
"(",
"MACRO_USER_FIRSTNAME",
... | Replaces the macros in the given message.<p>
@param msg the message in which the macros are replaced
@param recipient the recipient in the message
@return the message with the macros replaced | [
"Replaces",
"the",
"macros",
"in",
"the",
"given",
"message",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/newsletter/CmsNewsletter.java#L180-L191 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putAlways | public JSONObject putAlways(String key, CharSequence value) {
"""
Add a {@link JSONString} representing the supplied {@link CharSequence} ({@link String},
{@link StringBuilder} etc.) to the {@code JSONObject}, storing a {@code null} if the
value is {@code null}.
@param key the key to use when storing th... | java | public JSONObject putAlways(String key, CharSequence value) {
put(key, value == null ? null : new JSONString(value));
return this;
} | [
"public",
"JSONObject",
"putAlways",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"put",
"(",
"key",
",",
"value",
"==",
"null",
"?",
"null",
":",
"new",
"JSONString",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONString} representing the supplied {@link CharSequence} ({@link String},
{@link StringBuilder} etc.) to the {@code JSONObject}, storing a {@code null} if the
value is {@code null}.
@param key the key to use when storing the value
@param value the value (may be {@code null})
@return {... | [
"Add",
"a",
"{",
"@link",
"JSONString",
"}",
"representing",
"the",
"supplied",
"{",
"@link",
"CharSequence",
"}",
"(",
"{",
"@link",
"String",
"}",
"{",
"@link",
"StringBuilder",
"}",
"etc",
".",
")",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"stori... | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L87-L90 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET | public OvhTrunkExternalDisplayedNumber billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET(String billingAccount, String serviceName, String number) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}
@pa... | java | public OvhTrunkExternalDisplayedNumber billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET(String billingAccount, String serviceName, String number) throws IOException {
String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}";
StringBuilder sb = path(qPath, ... | [
"public",
"OvhTrunkExternalDisplayedNumber",
"billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{... | Get this object properties
REST: GET /telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] Name of the service
@param number [required] External displayed number linked to a trunk | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8135-L8140 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java | WDataTableRenderer.paintRowSelectionElement | private void paintRowSelectionElement(final WDataTable table, final XmlStringBuilder xml) {
"""
Paint the rowSelection aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use
"""
boolean multiple = table.getSelectMode() == SelectMode.MULTIPLE;
xml.appen... | java | private void paintRowSelectionElement(final WDataTable table, final XmlStringBuilder xml) {
boolean multiple = table.getSelectMode() == SelectMode.MULTIPLE;
xml.appendTagOpen("ui:rowselection");
xml.appendOptionalAttribute("multiple", multiple, "true");
if (multiple) {
switch (table.getSelectAllMode()) {
... | [
"private",
"void",
"paintRowSelectionElement",
"(",
"final",
"WDataTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"boolean",
"multiple",
"=",
"table",
".",
"getSelectMode",
"(",
")",
"==",
"SelectMode",
".",
"MULTIPLE",
";",
"xml",
".",
"a... | Paint the rowSelection aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use | [
"Paint",
"the",
"rowSelection",
"aspects",
"of",
"the",
"WDataTable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L159-L183 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java | MmffAromaticTypeMapping.getAromaticType | static String getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion) {
"""
Obtain the aromatic atom type for an atom in the alpha or beta position of a 5-member
aromatic ring. The method primarily uses an HashMap to lookup up the aromatic type. The two
maps are, {@... | java | static String getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion) {
if (anion && symb.startsWith("N")) symb = "N5M";
if (map.containsKey(symb)) symb = map.get(symb);
if ((imidazolium || anion) && symb.charAt(symb.length() - 1) == suffix)
... | [
"static",
"String",
"getAromaticType",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"char",
"suffix",
",",
"String",
"symb",
",",
"boolean",
"imidazolium",
",",
"boolean",
"anion",
")",
"{",
"if",
"(",
"anion",
"&&",
"symb",
".",
"startsWit... | Obtain the aromatic atom type for an atom in the alpha or beta position of a 5-member
aromatic ring. The method primarily uses an HashMap to lookup up the aromatic type. The two
maps are, {@link #alphaTypes} and {@link #betaTypes}. Depending on the position (alpha or
beta), one map is passed to the method. The exceptio... | [
"Obtain",
"the",
"aromatic",
"atom",
"type",
"for",
"an",
"atom",
"in",
"the",
"alpha",
"or",
"beta",
"position",
"of",
"a",
"5",
"-",
"member",
"aromatic",
"ring",
".",
"The",
"method",
"primarily",
"uses",
"an",
"HashMap",
"to",
"lookup",
"up",
"the",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java#L307-L313 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowColumnsStringSingle | public static List<FieldVector> toArrowColumnsStringSingle(final BufferAllocator bufferAllocator, final Schema schema, List<String> dataVecRecord) {
"""
Convert a set of input strings to arrow columns
@param bufferAllocator the buffer allocator to use
@param schema the schema to use
@param dataVecRecord the co... | java | public static List<FieldVector> toArrowColumnsStringSingle(final BufferAllocator bufferAllocator, final Schema schema, List<String> dataVecRecord) {
return toArrowColumnsString(bufferAllocator,schema, Arrays.asList(dataVecRecord));
} | [
"public",
"static",
"List",
"<",
"FieldVector",
">",
"toArrowColumnsStringSingle",
"(",
"final",
"BufferAllocator",
"bufferAllocator",
",",
"final",
"Schema",
"schema",
",",
"List",
"<",
"String",
">",
"dataVecRecord",
")",
"{",
"return",
"toArrowColumnsString",
"("... | Convert a set of input strings to arrow columns
@param bufferAllocator the buffer allocator to use
@param schema the schema to use
@param dataVecRecord the collection of input strings to process
@return the created vectors | [
"Convert",
"a",
"set",
"of",
"input",
"strings",
"to",
"arrow",
"columns"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L663-L665 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByAddress1 | public Iterable<DContact> queryByAddress1(Object parent, java.lang.String address1) {
"""
query-by method for field address1
@param address1 the specified attribute
@return an Iterable of DContacts for the specified address1
"""
return queryByField(parent, DContactMapper.Field.ADDRESS1.getFieldName(), ad... | java | public Iterable<DContact> queryByAddress1(Object parent, java.lang.String address1) {
return queryByField(parent, DContactMapper.Field.ADDRESS1.getFieldName(), address1);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByAddress1",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"address1",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"ADDRESS1",
".",
"getFie... | query-by method for field address1
@param address1 the specified attribute
@return an Iterable of DContacts for the specified address1 | [
"query",
"-",
"by",
"method",
"for",
"field",
"address1"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L70-L72 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java | ThingAttribute.withAttributes | public ThingAttribute withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
A list of thing attributes which are name-value pairs.
</p>
@param attributes
A list of thing attributes which are name-value pairs.
@return Returns a reference to this object so that method calls can be chained togethe... | java | public ThingAttribute withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"ThingAttribute",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A list of thing attributes which are name-value pairs.
</p>
@param attributes
A list of thing attributes which are name-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"list",
"of",
"thing",
"attributes",
"which",
"are",
"name",
"-",
"value",
"pairs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java#L214-L217 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java | MmffAromaticTypeMapping.updateAromaticTypesInFiveMemberRing | private void updateAromaticTypesInFiveMemberRing(int[] cycle, String[] symbs) {
"""
Update the symbolic for a 5-member cycle/ring. The cycle should first be normalised with
{@link #normaliseCycle(int[], int[])} to put the unique 'pi-lone-pair' in position 1 (index
0). Using predefined mappings the symbolic atom ... | java | private void updateAromaticTypesInFiveMemberRing(int[] cycle, String[] symbs) {
final String hetro = symbs[cycle[0]];
// simple conditions tell is the 'IM' and 'AN' flags
final boolean imidazolium = NCN_PLUS.equals(hetro) || NGD_PLUS.equals(hetro);
final boolean anion = "NM".equals(het... | [
"private",
"void",
"updateAromaticTypesInFiveMemberRing",
"(",
"int",
"[",
"]",
"cycle",
",",
"String",
"[",
"]",
"symbs",
")",
"{",
"final",
"String",
"hetro",
"=",
"symbs",
"[",
"cycle",
"[",
"0",
"]",
"]",
";",
"// simple conditions tell is the 'IM' and 'AN' ... | Update the symbolic for a 5-member cycle/ring. The cycle should first be normalised with
{@link #normaliseCycle(int[], int[])} to put the unique 'pi-lone-pair' in position 1 (index
0). Using predefined mappings the symbolic atom types are updated in the 'symbs[]' vector.
@param cycle normalised 5-member cycle (6 indic... | [
"Update",
"the",
"symbolic",
"for",
"a",
"5",
"-",
"member",
"cycle",
"/",
"ring",
".",
"The",
"cycle",
"should",
"first",
"be",
"normalised",
"with",
"{",
"@link",
"#normaliseCycle",
"(",
"int",
"[]",
"int",
"[]",
")",
"}",
"to",
"put",
"the",
"unique... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java#L245-L260 |
infinispan/infinispan | jcache/commons/src/main/java/org/infinispan/jcache/RIMBeanServerRegistrationUtility.java | RIMBeanServerRegistrationUtility.calculateObjectName | private static <K, V> ObjectName calculateObjectName(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
"""
Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,name=<cacheName>"
"""
String cacheManagerName =... | java | private static <K, V> ObjectName calculateObjectName(AbstractJCache<K, V> cache, ObjectNameType objectNameType) {
String cacheManagerName = mbeanSafe(cache.getCacheManager().getURI().toString());
String cacheName = mbeanSafe(cache.getName());
try {
return new ObjectName("javax.cache:type=Cac... | [
"private",
"static",
"<",
"K",
",",
"V",
">",
"ObjectName",
"calculateObjectName",
"(",
"AbstractJCache",
"<",
"K",
",",
"V",
">",
"cache",
",",
"ObjectNameType",
"objectNameType",
")",
"{",
"String",
"cacheManagerName",
"=",
"mbeanSafe",
"(",
"cache",
".",
... | Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,name=<cacheName>" | [
"Creates",
"an",
"object",
"name",
"using",
"the",
"scheme",
"javax",
".",
"cache",
":",
"type",
"=",
"Cache<",
";",
"Statistics|Configuration>",
";",
"CacheManager",
"=",
"<",
";",
"cacheManagerName>",
";",
"name",
"=",
"<",
";",
"cacheName>",
";"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/commons/src/main/java/org/infinispan/jcache/RIMBeanServerRegistrationUtility.java#L126-L138 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java | TypeFrameModelingVisitor.consumeStack | protected void consumeStack(Instruction ins) {
"""
Consume stack. This is a convenience method for instructions where the
types of popped operands can be ignored.
"""
ConstantPoolGen cpg = getCPG();
TypeFrame frame = getFrame();
int numWordsConsumed = ins.consumeStack(cpg);
if... | java | protected void consumeStack(Instruction ins) {
ConstantPoolGen cpg = getCPG();
TypeFrame frame = getFrame();
int numWordsConsumed = ins.consumeStack(cpg);
if (numWordsConsumed == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack consumption for "... | [
"protected",
"void",
"consumeStack",
"(",
"Instruction",
"ins",
")",
"{",
"ConstantPoolGen",
"cpg",
"=",
"getCPG",
"(",
")",
";",
"TypeFrame",
"frame",
"=",
"getFrame",
"(",
")",
";",
"int",
"numWordsConsumed",
"=",
"ins",
".",
"consumeStack",
"(",
"cpg",
... | Consume stack. This is a convenience method for instructions where the
types of popped operands can be ignored. | [
"Consume",
"stack",
".",
"This",
"is",
"a",
"convenience",
"method",
"for",
"instructions",
"where",
"the",
"types",
"of",
"popped",
"operands",
"can",
"be",
"ignored",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java#L214-L232 |
Alluxio/alluxio | integration/yarn/src/main/java/alluxio/yarn/ApplicationMaster.java | ApplicationMaster.runApplicationMaster | private static void runApplicationMaster(final CommandLine cliParser,
AlluxioConfiguration alluxioConf) throws Exception {
"""
Run the application master.
@param cliParser client arguments parser
"""
int numWorkers = Integer.parseInt(cliParser.getOptionValue("num_workers", "1"));
String master... | java | private static void runApplicationMaster(final CommandLine cliParser,
AlluxioConfiguration alluxioConf) throws Exception {
int numWorkers = Integer.parseInt(cliParser.getOptionValue("num_workers", "1"));
String masterAddress = cliParser.getOptionValue("master_address");
String resourcePath = cliParser... | [
"private",
"static",
"void",
"runApplicationMaster",
"(",
"final",
"CommandLine",
"cliParser",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"Exception",
"{",
"int",
"numWorkers",
"=",
"Integer",
".",
"parseInt",
"(",
"cliParser",
".",
"getOptionValue",
... | Run the application master.
@param cliParser client arguments parser | [
"Run",
"the",
"application",
"master",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/yarn/src/main/java/alluxio/yarn/ApplicationMaster.java#L233-L245 |
menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.writeString | public static ChannelBuffer writeString(String msg, Charset charset) {
"""
Creates a channel buffer of which the first 2 bytes contain the length of
the string in bytes and the remaining is the actual string in binary with
specified format. Defaults to UTF-8 encoding in case charset passed in is
null
@param ... | java | public static ChannelBuffer writeString(String msg, Charset charset)
{
ChannelBuffer buffer = null;
try
{
ChannelBuffer stringBuffer = null;
if (null == charset)
{
charset = CharsetUtil.UTF_8;
}
stringBuffer = copiedBuffer(ByteOrder.BIG_ENDIAN, msg, charset);
int length = stringBuffer.read... | [
"public",
"static",
"ChannelBuffer",
"writeString",
"(",
"String",
"msg",
",",
"Charset",
"charset",
")",
"{",
"ChannelBuffer",
"buffer",
"=",
"null",
";",
"try",
"{",
"ChannelBuffer",
"stringBuffer",
"=",
"null",
";",
"if",
"(",
"null",
"==",
"charset",
")"... | Creates a channel buffer of which the first 2 bytes contain the length of
the string in bytes and the remaining is the actual string in binary with
specified format. Defaults to UTF-8 encoding in case charset passed in is
null
@param msg
The string to be written.
@param charset
The Charset say 'UTF-8' in which the enc... | [
"Creates",
"a",
"channel",
"buffer",
"of",
"which",
"the",
"first",
"2",
"bytes",
"contain",
"the",
"length",
"of",
"the",
"string",
"in",
"bytes",
"and",
"the",
"remaining",
"is",
"the",
"actual",
"string",
"in",
"binary",
"with",
"specified",
"format",
"... | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L270-L291 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java | RocksDbWrapper.openReadOnly | public static RocksDbWrapper openReadOnly(File directory) throws RocksDbException, IOException {
"""
Open a {@link RocksDB} with default options in read-only mode.
@param directory
existing {@link RocksDB} data directory
@return
@throws RocksDBException
@throws IOException
"""
RocksDbWrapper roc... | java | public static RocksDbWrapper openReadOnly(File directory) throws RocksDbException, IOException {
RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(directory, true);
rocksDbWrapper.init();
return rocksDbWrapper;
} | [
"public",
"static",
"RocksDbWrapper",
"openReadOnly",
"(",
"File",
"directory",
")",
"throws",
"RocksDbException",
",",
"IOException",
"{",
"RocksDbWrapper",
"rocksDbWrapper",
"=",
"new",
"RocksDbWrapper",
"(",
"directory",
",",
"true",
")",
";",
"rocksDbWrapper",
"... | Open a {@link RocksDB} with default options in read-only mode.
@param directory
existing {@link RocksDB} data directory
@return
@throws RocksDBException
@throws IOException | [
"Open",
"a",
"{",
"@link",
"RocksDB",
"}",
"with",
"default",
"options",
"in",
"read",
"-",
"only",
"mode",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java#L53-L57 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/model/event/InternalEvent.java | InternalEvent.createEventParameters | private EventParameters createEventParameters(Map<String,String> pParams) {
"""
Method that creates the event params based on the passed in Map
@param pParams
@return EventParameters
"""
EventParameters evParams = EventParameters.Factory.newInstance();
for (String name : pParams.keySet()) {
... | java | private EventParameters createEventParameters(Map<String,String> pParams){
EventParameters evParams = EventParameters.Factory.newInstance();
for (String name : pParams.keySet()) {
String val = pParams.get(name);
if(val == null){
continue;
}
... | [
"private",
"EventParameters",
"createEventParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pParams",
")",
"{",
"EventParameters",
"evParams",
"=",
"EventParameters",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"for",
"(",
"String",
"name",
"... | Method that creates the event params based on the passed in Map
@param pParams
@return EventParameters | [
"Method",
"that",
"creates",
"the",
"event",
"params",
"based",
"on",
"the",
"passed",
"in",
"Map"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/model/event/InternalEvent.java#L104-L117 |
google/closure-compiler | src/com/google/javascript/jscomp/PureFunctionIdentifier.java | FunctionBodyAnalyzer.checkIteratesImpureIterable | private void checkIteratesImpureIterable(Node node, AmbiguatedFunctionSummary encloserSummary) {
"""
Inspect {@code node} for impure iteration and assign the appropriate side-effects to {@code
encloserSummary} if so.
"""
if (!NodeUtil.iteratesImpureIterable(node)) {
return;
}
// Tre... | java | private void checkIteratesImpureIterable(Node node, AmbiguatedFunctionSummary encloserSummary) {
if (!NodeUtil.iteratesImpureIterable(node)) {
return;
}
// Treat the (possibly implicit) call to `iterator.next()` as having the same effects as any
// other unknown function call.
enc... | [
"private",
"void",
"checkIteratesImpureIterable",
"(",
"Node",
"node",
",",
"AmbiguatedFunctionSummary",
"encloserSummary",
")",
"{",
"if",
"(",
"!",
"NodeUtil",
".",
"iteratesImpureIterable",
"(",
"node",
")",
")",
"{",
"return",
";",
"}",
"// Treat the (possibly i... | Inspect {@code node} for impure iteration and assign the appropriate side-effects to {@code
encloserSummary} if so. | [
"Inspect",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PureFunctionIdentifier.java#L826-L838 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/A_CmsFormFieldPanel.java | A_CmsFormFieldPanel.truncatePanel | protected void truncatePanel(Panel panel, String textMetricsKey, int clientWidth) {
"""
Truncates all children of the given panel implementing the I_CmsTruncable.<p>
@param panel the panel
@param textMetricsKey the metrics key
@param clientWidth the client width
"""
for (Widget widget : panel) {
... | java | protected void truncatePanel(Panel panel, String textMetricsKey, int clientWidth) {
for (Widget widget : panel) {
if (widget instanceof I_CmsTruncable) {
((I_CmsTruncable)widget).truncate(textMetricsKey, clientWidth);
}
}
} | [
"protected",
"void",
"truncatePanel",
"(",
"Panel",
"panel",
",",
"String",
"textMetricsKey",
",",
"int",
"clientWidth",
")",
"{",
"for",
"(",
"Widget",
"widget",
":",
"panel",
")",
"{",
"if",
"(",
"widget",
"instanceof",
"I_CmsTruncable",
")",
"{",
"(",
"... | Truncates all children of the given panel implementing the I_CmsTruncable.<p>
@param panel the panel
@param textMetricsKey the metrics key
@param clientWidth the client width | [
"Truncates",
"all",
"children",
"of",
"the",
"given",
"panel",
"implementing",
"the",
"I_CmsTruncable",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/A_CmsFormFieldPanel.java#L200-L207 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java | JmsBytesMessageImpl.readBytes | @Override
public int readBytes(byte[] value, int length) throws JMSException {
"""
Read a portion of the bytes message stream.
<P>If the length of array <code>value</code> is less than
the bytes remaining to be read from the stream, the array should
be filled. A subsequent call reads the next increment, e... | java | @Override
public int readBytes(byte[] value, int length) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "readBytes", new Object[] { value, length });
try {
// Check that we are in read mode
checkBodyRe... | [
"@",
"Override",
"public",
"int",
"readBytes",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"length",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
... | Read a portion of the bytes message stream.
<P>If the length of array <code>value</code> is less than
the bytes remaining to be read from the stream, the array should
be filled. A subsequent call reads the next increment, etc.
<P>If the bytes remaining in the stream is less than the length of
array <code>value</code>... | [
"Read",
"a",
"portion",
"of",
"the",
"bytes",
"message",
"stream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java#L438-L470 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.deleteByScope | public void deleteByScope(String scope, String lockName) {
"""
Delete a management lock by scope.
@param scope The scope for the lock.
@param lockName The name of lock.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server... | java | public void deleteByScope(String scope, String lockName) {
deleteByScopeWithServiceResponseAsync(scope, lockName).toBlocking().single().body();
} | [
"public",
"void",
"deleteByScope",
"(",
"String",
"scope",
",",
"String",
"lockName",
")",
"{",
"deleteByScopeWithServiceResponseAsync",
"(",
"scope",
",",
"lockName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
"... | Delete a management lock by scope.
@param scope The scope for the lock.
@param lockName The name of lock.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the req... | [
"Delete",
"a",
"management",
"lock",
"by",
"scope",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L516-L518 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java | PropertyColumnTableDescription.addPropertyColumn | public PropertyColumn addPropertyColumn(String propertyName, Class<?> propertyType) {
"""
Create and add a column for the given property. Property type is passed or determined (when
<code>null</code>) by examining the {@link Accessor} and headerKeys are added based upon the id of
the {@link PropertyColumnTableDe... | java | public PropertyColumn addPropertyColumn(String propertyName, Class<?> propertyType)
{
String[] headerKeys = getMessageResolver().getMessageKeys(this.id, propertyName, MessageConstants.HEADER);
Accessor accessor = ClassUtils.getAccessorForProperty(entityClass, propertyName);
if (propertyType ... | [
"public",
"PropertyColumn",
"addPropertyColumn",
"(",
"String",
"propertyName",
",",
"Class",
"<",
"?",
">",
"propertyType",
")",
"{",
"String",
"[",
"]",
"headerKeys",
"=",
"getMessageResolver",
"(",
")",
".",
"getMessageKeys",
"(",
"this",
".",
"id",
",",
... | Create and add a column for the given property. Property type is passed or determined (when
<code>null</code>) by examining the {@link Accessor} and headerKeys are added based upon the id of
the {@link PropertyColumnTableDescription}, the propertyName and the postfix "HEADER".
@param propertyName
name of the property.... | [
"Create",
"and",
"add",
"a",
"column",
"for",
"the",
"given",
"property",
".",
"Property",
"type",
"is",
"passed",
"or",
"determined",
"(",
"when",
"<code",
">",
"null<",
"/",
"code",
">",
")",
"by",
"examining",
"the",
"{",
"@link",
"Accessor",
"}",
"... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java#L185-L197 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java | InputUtils.defineOrder | public static void defineOrder(ProcessedInput processedInput, QueryParameters parameters) {
"""
Defines order of @parameters based on @processedInput
@param processedInput InputHandler processedInput
@param parameters Query Parameters ordering of which would be updated
"""
String parameterName ... | java | public static void defineOrder(ProcessedInput processedInput, QueryParameters parameters) {
String parameterName = null;
for (int i = 0; i < processedInput.getAmountOfParameters(); i++) {
parameterName = processedInput.getParameterName(i);
if (parameterName != null) {
... | [
"public",
"static",
"void",
"defineOrder",
"(",
"ProcessedInput",
"processedInput",
",",
"QueryParameters",
"parameters",
")",
"{",
"String",
"parameterName",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"processedInput",
".",
"getAmountO... | Defines order of @parameters based on @processedInput
@param processedInput InputHandler processedInput
@param parameters Query Parameters ordering of which would be updated | [
"Defines",
"order",
"of",
"@parameters",
"based",
"on",
"@processedInput"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java#L39-L49 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addIdInCommaSeparatedListCondition | protected void addIdInCommaSeparatedListCondition(final String propertyName, final String value) throws NumberFormatException {
"""
Add a Field Search Condition that will check if the id field exists in a comma separated list of ids. eg.
{@code field IN (value)}
@param propertyName The name of the field id as ... | java | protected void addIdInCommaSeparatedListCondition(final String propertyName, final String value) throws NumberFormatException {
addIdInArrayCondition(propertyName, value.split(","));
} | [
"protected",
"void",
"addIdInCommaSeparatedListCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"throws",
"NumberFormatException",
"{",
"addIdInArrayCondition",
"(",
"propertyName",
",",
"value",
".",
"split",
"(",
"\",\"",
")"... | Add a Field Search Condition that will check if the id field exists in a comma separated list of ids. eg.
{@code field IN (value)}
@param propertyName The name of the field id as defined in the Entity mapping class.
@param value The comma separated list of ids.
@throws NumberFormatException Thrown if one of the... | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"check",
"if",
"the",
"id",
"field",
"exists",
"in",
"a",
"comma",
"separated",
"list",
"of",
"ids",
".",
"eg",
".",
"{",
"@code",
"field",
"IN",
"(",
"value",
")",
"}"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L347-L349 |
beanshell/beanshell | src/main/java/bsh/Reflect.java | Reflect.getLHSObjectField | static LHS getLHSObjectField( Object object, String fieldName )
throws UtilEvalError, ReflectError {
"""
Get an LHS reference to an object field.
This method also deals with the field style property access.
In the field does not exist we check for a property setter.
"""
if ( object inst... | java | static LHS getLHSObjectField( Object object, String fieldName )
throws UtilEvalError, ReflectError {
if ( object instanceof This )
return new LHS( ((This)object).namespace, fieldName, false );
try {
Invocable f = resolveExpectedJavaField(
object.getCla... | [
"static",
"LHS",
"getLHSObjectField",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"throws",
"UtilEvalError",
",",
"ReflectError",
"{",
"if",
"(",
"object",
"instanceof",
"This",
")",
"return",
"new",
"LHS",
"(",
"(",
"(",
"This",
")",
"object",... | Get an LHS reference to an object field.
This method also deals with the field style property access.
In the field does not exist we check for a property setter. | [
"Get",
"an",
"LHS",
"reference",
"to",
"an",
"object",
"field",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L189-L211 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/core/fs/Path.java | Path.hasWindowsDrive | private boolean hasWindowsDrive(String path, boolean slashed) {
"""
Checks if the provided path string contains a windows drive letter.
@param path
the path to check
@param slashed
<code>true</code> to indicate the first character of the string is a slash, <code>false</code> otherwise
@return <code>true</co... | java | private boolean hasWindowsDrive(String path, boolean slashed) {
if (!OperatingSystem.isWindows()) {
return false;
}
final int start = slashed ? 1 : 0;
return path.length() >= start + 2
&& (slashed ? path.charAt(0) == '/' : true)
&& path.charAt(start + 1) == ':'
&& ((path.charAt(start) >= 'A' && path... | [
"private",
"boolean",
"hasWindowsDrive",
"(",
"String",
"path",
",",
"boolean",
"slashed",
")",
"{",
"if",
"(",
"!",
"OperatingSystem",
".",
"isWindows",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"int",
"start",
"=",
"slashed",
"?",
"1",
... | Checks if the provided path string contains a windows drive letter.
@param path
the path to check
@param slashed
<code>true</code> to indicate the first character of the string is a slash, <code>false</code> otherwise
@return <code>true</code> if the path string contains a windows drive letter, <code>false</code> othe... | [
"Checks",
"if",
"the",
"provided",
"path",
"string",
"contains",
"a",
"windows",
"drive",
"letter",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/core/fs/Path.java#L264-L274 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/webui/WebUtils.java | WebUtils.convertByteArrayToStringWithoutEscape | public static String convertByteArrayToStringWithoutEscape(byte[] data, int offset, int length) {
"""
Converts a byte array to string.
@param data byte array
@param offset offset
@param length number of bytes to encode
@return string representation of the encoded byte sub-array
"""
StringBuilder sb =... | java | public static String convertByteArrayToStringWithoutEscape(byte[] data, int offset, int length) {
StringBuilder sb = new StringBuilder(length);
for (int i = offset; i < length && i < data.length; i++) {
sb.append((char) data[i]);
}
return sb.toString();
} | [
"public",
"static",
"String",
"convertByteArrayToStringWithoutEscape",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"length",
")",
";",
"for",
"(",
"int",
"i",
... | Converts a byte array to string.
@param data byte array
@param offset offset
@param length number of bytes to encode
@return string representation of the encoded byte sub-array | [
"Converts",
"a",
"byte",
"array",
"to",
"string",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/webui/WebUtils.java#L37-L43 |
infinispan/infinispan | jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheLookupHelper.java | CacheLookupHelper.getCacheName | public static String getCacheName(Method method, String methodCacheName, CacheDefaults cacheDefaultsAnnotation, boolean generate) {
"""
Resolves the cache name of a method annotated with a JCACHE annotation.
@param method the annotated method.
@param methodCacheName the cache name defi... | java | public static String getCacheName(Method method, String methodCacheName, CacheDefaults cacheDefaultsAnnotation, boolean generate) {
assertNotNull(method, "method parameter must not be null");
assertNotNull(methodCacheName, "methodCacheName parameter must not be null");
String cacheName = methodCacheN... | [
"public",
"static",
"String",
"getCacheName",
"(",
"Method",
"method",
",",
"String",
"methodCacheName",
",",
"CacheDefaults",
"cacheDefaultsAnnotation",
",",
"boolean",
"generate",
")",
"{",
"assertNotNull",
"(",
"method",
",",
"\"method parameter must not be null\"",
... | Resolves the cache name of a method annotated with a JCACHE annotation.
@param method the annotated method.
@param methodCacheName the cache name defined on the JCACHE annotation.
@param cacheDefaultsAnnotation the {@link javax.cache.annotation.CacheDefaults} annotation instance.
@param genera... | [
"Resolves",
"the",
"cache",
"name",
"of",
"a",
"method",
"annotated",
"with",
"a",
"JCACHE",
"annotation",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/jcache/embedded/src/main/java/org/infinispan/jcache/annotation/CacheLookupHelper.java#L42-L57 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.expectMatch | public void expectMatch(String name, List<String> values) {
"""
Validates to list of given values to (case-sensitive) match
@param name The field to check
@param values A list of given values to check against
"""
expectMatch(name, messages.get(Validation.MATCH_VALUES_KEY.name(), name), values);
... | java | public void expectMatch(String name, List<String> values) {
expectMatch(name, messages.get(Validation.MATCH_VALUES_KEY.name(), name), values);
} | [
"public",
"void",
"expectMatch",
"(",
"String",
"name",
",",
"List",
"<",
"String",
">",
"values",
")",
"{",
"expectMatch",
"(",
"name",
",",
"messages",
".",
"get",
"(",
"Validation",
".",
"MATCH_VALUES_KEY",
".",
"name",
"(",
")",
",",
"name",
")",
"... | Validates to list of given values to (case-sensitive) match
@param name The field to check
@param values A list of given values to check against | [
"Validates",
"to",
"list",
"of",
"given",
"values",
"to",
"(",
"case",
"-",
"sensitive",
")",
"match"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L223-L225 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.backupKeyAsync | public ServiceFuture<BackupKeyResult> backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<BackupKeyResult> serviceCallback) {
"""
Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure Key Vault in a protected form. Note tha... | java | public ServiceFuture<BackupKeyResult> backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<BackupKeyResult> serviceCallback) {
return ServiceFuture.fromResponse(backupKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"BackupKeyResult",
">",
"backupKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"final",
"ServiceCallback",
"<",
"BackupKeyResult",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse"... | Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to ... | [
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"key",
"be",
"downloaded",
"to",
"the",
"client",
".",
"The",
"Key",
"Backup",
"operation",
"exports",
"a",
"key",
"from",
"Azure",
"Key",
"Vault",
"in",
"a",
"protected",
"form",
".",
"Note",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1979-L1981 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/Tensor.java | Tensor.ravelIndex | public static int ravelIndex(int[] indices, int[] dims) {
"""
Gets the index into the values array that corresponds to the indices.
"""
int c = 0;
int[] strides = getStrides(dims);
for (int i=0; i<indices.length; i++) {
c += strides[i] * indices[i];
}
return ... | java | public static int ravelIndex(int[] indices, int[] dims) {
int c = 0;
int[] strides = getStrides(dims);
for (int i=0; i<indices.length; i++) {
c += strides[i] * indices[i];
}
return c;
} | [
"public",
"static",
"int",
"ravelIndex",
"(",
"int",
"[",
"]",
"indices",
",",
"int",
"[",
"]",
"dims",
")",
"{",
"int",
"c",
"=",
"0",
";",
"int",
"[",
"]",
"strides",
"=",
"getStrides",
"(",
"dims",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",... | Gets the index into the values array that corresponds to the indices. | [
"Gets",
"the",
"index",
"into",
"the",
"values",
"array",
"that",
"corresponds",
"to",
"the",
"indices",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/Tensor.java#L168-L175 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginContextEntryImpl.java | JAASLoginContextEntryImpl.setJaasLoginModuleConfig | @Reference(cardinality = ReferenceCardinality.MULTIPLE)
protected void setJaasLoginModuleConfig(JAASLoginModuleConfig lmc, Map<String, Object> props) {
"""
SINCE THIS IS A STATIC REFERENCE DS provides enough synchronization so that we don't need to synchronize on the map.
"""
String pid = (String) ... | java | @Reference(cardinality = ReferenceCardinality.MULTIPLE)
protected void setJaasLoginModuleConfig(JAASLoginModuleConfig lmc, Map<String, Object> props) {
String pid = (String) props.get(KEY_SERVICE_PID);
loginModuleMap.put(pid, lmc);
} | [
"@",
"Reference",
"(",
"cardinality",
"=",
"ReferenceCardinality",
".",
"MULTIPLE",
")",
"protected",
"void",
"setJaasLoginModuleConfig",
"(",
"JAASLoginModuleConfig",
"lmc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"String",
"pid",
"=",... | SINCE THIS IS A STATIC REFERENCE DS provides enough synchronization so that we don't need to synchronize on the map. | [
"SINCE",
"THIS",
"IS",
"A",
"STATIC",
"REFERENCE",
"DS",
"provides",
"enough",
"synchronization",
"so",
"that",
"we",
"don",
"t",
"need",
"to",
"synchronize",
"on",
"the",
"map",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginContextEntryImpl.java#L55-L59 |
alkacon/opencms-core | src/org/opencms/ui/login/CmsLoginHelper.java | CmsLoginHelper.getCookie | protected static Cookie getCookie(HttpServletRequest request, String name) {
"""
Returns the cookie with the given name, if not cookie is found a new one is created.<p>
@param request the current request
@param name the name of the cookie
@return the cookie
"""
Cookie[] cookies = request.getCoo... | java | protected static Cookie getCookie(HttpServletRequest request, String name) {
Cookie[] cookies = request.getCookies();
for (int i = 0; (cookies != null) && (i < cookies.length); i++) {
if (name.equalsIgnoreCase(cookies[i].getName())) {
return cookies[i];
}
... | [
"protected",
"static",
"Cookie",
"getCookie",
"(",
"HttpServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"request",
".",
"getCookies",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"(",
"cookies",
... | Returns the cookie with the given name, if not cookie is found a new one is created.<p>
@param request the current request
@param name the name of the cookie
@return the cookie | [
"Returns",
"the",
"cookie",
"with",
"the",
"given",
"name",
"if",
"not",
"cookie",
"is",
"found",
"a",
"new",
"one",
"is",
"created",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsLoginHelper.java#L599-L608 |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverSp.java | JCusolverSp.cusolverSpScsreigvsi | public static int cusolverSpScsreigvsi(
cusolverSpHandle handle,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrValA,
Pointer csrRowPtrA,
Pointer csrColIndA,
float mu0,
Pointer x0,
int maxite,
float eps,
... | java | public static int cusolverSpScsreigvsi(
cusolverSpHandle handle,
int m,
int nnz,
cusparseMatDescr descrA,
Pointer csrValA,
Pointer csrRowPtrA,
Pointer csrColIndA,
float mu0,
Pointer x0,
int maxite,
float eps,
... | [
"public",
"static",
"int",
"cusolverSpScsreigvsi",
"(",
"cusolverSpHandle",
"handle",
",",
"int",
"m",
",",
"int",
"nnz",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrValA",
",",
"Pointer",
"csrRowPtrA",
",",
"Pointer",
"csrColIndA",
",",
"float",
"mu0... | <pre>
--------- GPU eigenvalue solver by shift inverse
solve A*x = lambda * x
where lambda is the eigenvalue nearest mu0.
[eig] stands for eigenvalue solver
[si] stands for shift-inverse
</pre> | [
"<pre",
">",
"---------",
"GPU",
"eigenvalue",
"solver",
"by",
"shift",
"inverse",
"solve",
"A",
"*",
"x",
"=",
"lambda",
"*",
"x",
"where",
"lambda",
"is",
"the",
"eigenvalue",
"nearest",
"mu0",
".",
"[",
"eig",
"]",
"stands",
"for",
"eigenvalue",
"solv... | train | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverSp.java#L1106-L1122 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginCreateOrUpdate | public DatabaseAccountInner beginCreateOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) {
"""
Creates or updates an Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB databa... | java | public DatabaseAccountInner beginCreateOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).toBlocking().single().body();
} | [
"public",
"DatabaseAccountInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"DatabaseAccountCreateUpdateParameters",
"createUpdateParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupN... | Creates or updates an Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param createUpdateParameters The parameters to provide for the current database account.
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Creates",
"or",
"updates",
"an",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L522-L524 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorManagerFactory.java | EvaluatorManagerFactory.getNewEvaluatorManagerInstance | private EvaluatorManager getNewEvaluatorManagerInstance(final String id, final EvaluatorDescriptor desc) {
"""
Helper method to create a new EvaluatorManager instance.
@param id identifier of the Evaluator
@param desc NodeDescriptor on which the Evaluator executes.
@return a new EvaluatorManager instance.
... | java | private EvaluatorManager getNewEvaluatorManagerInstance(final String id, final EvaluatorDescriptor desc) {
LOG.log(Level.FINEST, "Creating Evaluator Manager for Evaluator ID {0}", id);
final Injector child = this.injector.forkInjector();
try {
child.bindVolatileParameter(EvaluatorManager.EvaluatorIde... | [
"private",
"EvaluatorManager",
"getNewEvaluatorManagerInstance",
"(",
"final",
"String",
"id",
",",
"final",
"EvaluatorDescriptor",
"desc",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Creating Evaluator Manager for Evaluator ID {0}\"",
",",
"id",
... | Helper method to create a new EvaluatorManager instance.
@param id identifier of the Evaluator
@param desc NodeDescriptor on which the Evaluator executes.
@return a new EvaluatorManager instance. | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"EvaluatorManager",
"instance",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorManagerFactory.java#L100-L118 |
biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java | SurvivalInfoHelper.isCategorical | private static boolean isCategorical(LinkedHashMap<String, Double> values) {
"""
If any not numeric value then categorical
@param values
@return
"""
try {
for (String value : values.keySet()) {
Double.parseDouble(value);
}
return false;
} catch (Exception e) {
return true;
}
} | java | private static boolean isCategorical(LinkedHashMap<String, Double> values) {
try {
for (String value : values.keySet()) {
Double.parseDouble(value);
}
return false;
} catch (Exception e) {
return true;
}
} | [
"private",
"static",
"boolean",
"isCategorical",
"(",
"LinkedHashMap",
"<",
"String",
",",
"Double",
">",
"values",
")",
"{",
"try",
"{",
"for",
"(",
"String",
"value",
":",
"values",
".",
"keySet",
"(",
")",
")",
"{",
"Double",
".",
"parseDouble",
"(",
... | If any not numeric value then categorical
@param values
@return | [
"If",
"any",
"not",
"numeric",
"value",
"then",
"categorical"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/SurvivalInfoHelper.java#L70-L80 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.registerGooglePush | @ObjectiveCName("registerGooglePushWithProjectId:withToken:")
public void registerGooglePush(long projectId, String token) {
"""
Register google push
@param projectId GCM project id
@param token GCM token
"""
modules.getPushesModule().registerGooglePush(projectId, token);
} | java | @ObjectiveCName("registerGooglePushWithProjectId:withToken:")
public void registerGooglePush(long projectId, String token) {
modules.getPushesModule().registerGooglePush(projectId, token);
} | [
"@",
"ObjectiveCName",
"(",
"\"registerGooglePushWithProjectId:withToken:\"",
")",
"public",
"void",
"registerGooglePush",
"(",
"long",
"projectId",
",",
"String",
"token",
")",
"{",
"modules",
".",
"getPushesModule",
"(",
")",
".",
"registerGooglePush",
"(",
"project... | Register google push
@param projectId GCM project id
@param token GCM token | [
"Register",
"google",
"push"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L2677-L2680 |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/PluginTypeRegistry.java | PluginTypeRegistry.registerPluginType | public static <T> void registerPluginType(String pluginType, StatsFactory statsFactory, StatusFetcherFactory<T> statusFetcherFactory, StatusParser<T,StatusData> parser) {
"""
Register plugin type and associate given factories with it.
@param pluginType plugin type: "apache"/"nginx"/etc..
@param statsFactory fact... | java | public static <T> void registerPluginType(String pluginType, StatsFactory statsFactory, StatusFetcherFactory<T> statusFetcherFactory, StatusParser<T,StatusData> parser) {
PluginTypeConfiguration conf = new PluginTypeConfiguration<>(statsFactory, statusFetcherFactory, parser);
PluginTypeConfiguration pre... | [
"public",
"static",
"<",
"T",
">",
"void",
"registerPluginType",
"(",
"String",
"pluginType",
",",
"StatsFactory",
"statsFactory",
",",
"StatusFetcherFactory",
"<",
"T",
">",
"statusFetcherFactory",
",",
"StatusParser",
"<",
"T",
",",
"StatusData",
">",
"parser",
... | Register plugin type and associate given factories with it.
@param pluginType plugin type: "apache"/"nginx"/etc..
@param statsFactory factory that creates corresponding stats.
@param statusFetcherFactory factory that creates {@link StatusFetcher} for the given plugin type.
@param parser parser instance that can parse s... | [
"Register",
"plugin",
"type",
"and",
"associate",
"given",
"factories",
"with",
"it",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/PluginTypeRegistry.java#L34-L40 |
LearnLib/automatalib | visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java | DOT.runDOT | public static void runDOT(String dotText, String format, File out) throws IOException {
"""
Invokes the DOT utility on a string, producing an output file. Convenience method, see {@link #runDOT(Reader,
String, File)}.
"""
runDOT(new StringReader(dotText), format, out);
} | java | public static void runDOT(String dotText, String format, File out) throws IOException {
runDOT(new StringReader(dotText), format, out);
} | [
"public",
"static",
"void",
"runDOT",
"(",
"String",
"dotText",
",",
"String",
"format",
",",
"File",
"out",
")",
"throws",
"IOException",
"{",
"runDOT",
"(",
"new",
"StringReader",
"(",
"dotText",
")",
",",
"format",
",",
"out",
")",
";",
"}"
] | Invokes the DOT utility on a string, producing an output file. Convenience method, see {@link #runDOT(Reader,
String, File)}. | [
"Invokes",
"the",
"DOT",
"utility",
"on",
"a",
"string",
"producing",
"an",
"output",
"file",
".",
"Convenience",
"method",
"see",
"{"
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L157-L159 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_csp2_GET | public ArrayList<OvhGenericProductDefinition> cart_cartId_csp2_GET(String cartId) throws IOException {
"""
Get informations about SaaS CSP2 offers
REST: GET /order/cart/{cartId}/csp2
@param cartId [required] Cart identifier
"""
String qPath = "/order/cart/{cartId}/csp2";
StringBuilder sb = path(qPath, ... | java | public ArrayList<OvhGenericProductDefinition> cart_cartId_csp2_GET(String cartId) throws IOException {
String qPath = "/order/cart/{cartId}/csp2";
StringBuilder sb = path(qPath, cartId);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t3);
} | [
"public",
"ArrayList",
"<",
"OvhGenericProductDefinition",
">",
"cart_cartId_csp2_GET",
"(",
"String",
"cartId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/csp2\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"... | Get informations about SaaS CSP2 offers
REST: GET /order/cart/{cartId}/csp2
@param cartId [required] Cart identifier | [
"Get",
"informations",
"about",
"SaaS",
"CSP2",
"offers"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L10257-L10262 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.beginCreateOrUpdate | public VirtualNetworkTapInner beginCreateOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
"""
Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param parameters Paramete... | java | public VirtualNetworkTapInner beginCreateOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualNetworkTapInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
",",
"VirtualNetworkTapInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
"... | Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param parameters Parameters supplied to the create or update virtual network tap operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Creates",
"or",
"updates",
"a",
"Virtual",
"Network",
"Tap",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L437-L439 |
febit/wit | wit-core/src/main/java/org/febit/wit/InternalContext.java | InternalContext.getBeanProperty | public <T> Object getBeanProperty(final T bean, final Object property) {
"""
Get a bean's property.
@param <T> bean type
@param bean bean
@param property property
@return value
"""
if (bean != null) {
@SuppressWarnings("unchecked")
GetResolver<T> resolver = this.g... | java | public <T> Object getBeanProperty(final T bean, final Object property) {
if (bean != null) {
@SuppressWarnings("unchecked")
GetResolver<T> resolver = this.getters.unsafeGet(bean.getClass());
if (resolver != null) {
return resolver.get(bean, property);
... | [
"public",
"<",
"T",
">",
"Object",
"getBeanProperty",
"(",
"final",
"T",
"bean",
",",
"final",
"Object",
"property",
")",
"{",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"GetResolver",
"<",
"T",
">",
... | Get a bean's property.
@param <T> bean type
@param bean bean
@param property property
@return value | [
"Get",
"a",
"bean",
"s",
"property",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/InternalContext.java#L255-L264 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountUrl.java | DiscountUrl.getDiscountContentUrl | public static MozuUrl getDiscountContentUrl(Integer discountId, String responseFields) {
"""
Get Resource Url for GetDiscountContent
@param discountId discountId parameter description DOCUMENT_HERE
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned ... | java | public static MozuUrl getDiscountContentUrl(Integer discountId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discounts/{discountId}/content?responseFields={responseFields}");
formatter.formatUrl("discountId", discountId);
formatter.formatUrl("responseFields"... | [
"public",
"static",
"MozuUrl",
"getDiscountContentUrl",
"(",
"Integer",
"discountId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/discounts/{discountId}/content?responseFields={responseFie... | Get Resource Url for GetDiscountContent
@param discountId discountId parameter description DOCUMENT_HERE
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data... | [
"Get",
"Resource",
"Url",
"for",
"GetDiscountContent"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountUrl.java#L42-L48 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/io/BinaryReader.java | BinaryReader.expectInt | public int expectInt() throws IOException {
"""
Read an int from the input stream.
@return The number read.
@throws IOException if unable to read from stream.
"""
int b1 = in.read();
if (b1 < 0) {
throw new IOException("Missing byte 1 to expected int");
}
int b2 ... | java | public int expectInt() throws IOException {
int b1 = in.read();
if (b1 < 0) {
throw new IOException("Missing byte 1 to expected int");
}
int b2 = in.read();
if (b2 < 0) {
throw new IOException("Missing byte 2 to expected int");
}
int b3 = i... | [
"public",
"int",
"expectInt",
"(",
")",
"throws",
"IOException",
"{",
"int",
"b1",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"b1",
"<",
"0",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Missing byte 1 to expected int\"",
")",
";",
"}",
"int... | Read an int from the input stream.
@return The number read.
@throws IOException if unable to read from stream. | [
"Read",
"an",
"int",
"from",
"the",
"input",
"stream",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/io/BinaryReader.java#L147-L165 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java | ChunkAnnotationUtils.annotateChunkTokens | public static void annotateChunkTokens(CoreMap chunk, Class tokenChunkKey, Class tokenLabelKey) {
"""
Annotates tokens in chunk
@param chunk - CoreMap representing chunk (should have TextAnnotation and TokensAnnotation)
@param tokenChunkKey - If not null, each token is annotated with the chunk using this key
@p... | java | public static void annotateChunkTokens(CoreMap chunk, Class tokenChunkKey, Class tokenLabelKey)
{
List<CoreLabel> chunkTokens = chunk.get(CoreAnnotations.TokensAnnotation.class);
if (tokenLabelKey != null) {
String text = chunk.get(CoreAnnotations.TextAnnotation.class);
for (CoreLabel t: chun... | [
"public",
"static",
"void",
"annotateChunkTokens",
"(",
"CoreMap",
"chunk",
",",
"Class",
"tokenChunkKey",
",",
"Class",
"tokenLabelKey",
")",
"{",
"List",
"<",
"CoreLabel",
">",
"chunkTokens",
"=",
"chunk",
".",
"get",
"(",
"CoreAnnotations",
".",
"TokensAnnota... | Annotates tokens in chunk
@param chunk - CoreMap representing chunk (should have TextAnnotation and TokensAnnotation)
@param tokenChunkKey - If not null, each token is annotated with the chunk using this key
@param tokenLabelKey - If not null, each token is annotated with the text associated with the chunk using this k... | [
"Annotates",
"tokens",
"in",
"chunk"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java#L583-L597 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaGLGetDevices | public static int cudaGLGetDevices(int pCudaDeviceCount[], int pCudaDevices[], int cudaDeviceCount, int cudaGLDeviceList_deviceList) {
"""
Gets the CUDA devices associated with the current OpenGL context.
<pre>
cudaError_t cudaGLGetDevices (
unsigned int* pCudaDeviceCount,
int* pCudaDevices,
unsigned int c... | java | public static int cudaGLGetDevices(int pCudaDeviceCount[], int pCudaDevices[], int cudaDeviceCount, int cudaGLDeviceList_deviceList)
{
return checkResult(cudaGLGetDevicesNative(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, cudaGLDeviceList_deviceList));
} | [
"public",
"static",
"int",
"cudaGLGetDevices",
"(",
"int",
"pCudaDeviceCount",
"[",
"]",
",",
"int",
"pCudaDevices",
"[",
"]",
",",
"int",
"cudaDeviceCount",
",",
"int",
"cudaGLDeviceList_deviceList",
")",
"{",
"return",
"checkResult",
"(",
"cudaGLGetDevicesNative",... | Gets the CUDA devices associated with the current OpenGL context.
<pre>
cudaError_t cudaGLGetDevices (
unsigned int* pCudaDeviceCount,
int* pCudaDevices,
unsigned int cudaDeviceCount,
cudaGLDeviceList deviceList )
</pre>
<div>
<p>Gets the CUDA devices associated with
the current OpenGL context. Returns in <tt>*pCuda... | [
"Gets",
"the",
"CUDA",
"devices",
"associated",
"with",
"the",
"current",
"OpenGL",
"context",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L10476-L10479 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/UpdateInputSecurityGroupRequest.java | UpdateInputSecurityGroupRequest.withTags | public UpdateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
... | java | public UpdateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"UpdateInputSecurityGroupRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/UpdateInputSecurityGroupRequest.java#L100-L103 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitListTypeSpecifier | public T visitListTypeSpecifier(ListTypeSpecifier elm, C context) {
"""
Visit a ListTypeSpecifier. This method will be called for
every node in the tree that is a ListTypeSpecifier.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
visitEl... | java | public T visitListTypeSpecifier(ListTypeSpecifier elm, C context) {
visitElement(elm.getElementType(), context);
return null;
} | [
"public",
"T",
"visitListTypeSpecifier",
"(",
"ListTypeSpecifier",
"elm",
",",
"C",
"context",
")",
"{",
"visitElement",
"(",
"elm",
".",
"getElementType",
"(",
")",
",",
"context",
")",
";",
"return",
"null",
";",
"}"
] | Visit a ListTypeSpecifier. This method will be called for
every node in the tree that is a ListTypeSpecifier.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"ListTypeSpecifier",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"ListTypeSpecifier",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L84-L87 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java | SegmentUtilities.inSubNetwork | public static boolean inSubNetwork(RightInputAdapterNode riaNode, LeftTupleSource leftTupleSource) {
"""
Is the LeftTupleSource a node in the sub network for the RightInputAdapterNode
To be in the same network, it must be a node is after the two output of the parent
and before the rianode.
"""
LeftTu... | java | public static boolean inSubNetwork(RightInputAdapterNode riaNode, LeftTupleSource leftTupleSource) {
LeftTupleSource startTupleSource = riaNode.getStartTupleSource();
LeftTupleSource parent = riaNode.getLeftTupleSource();
while (parent != startTupleSource) {
if (parent == leftTupleS... | [
"public",
"static",
"boolean",
"inSubNetwork",
"(",
"RightInputAdapterNode",
"riaNode",
",",
"LeftTupleSource",
"leftTupleSource",
")",
"{",
"LeftTupleSource",
"startTupleSource",
"=",
"riaNode",
".",
"getStartTupleSource",
"(",
")",
";",
"LeftTupleSource",
"parent",
"=... | Is the LeftTupleSource a node in the sub network for the RightInputAdapterNode
To be in the same network, it must be a node is after the two output of the parent
and before the rianode. | [
"Is",
"the",
"LeftTupleSource",
"a",
"node",
"in",
"the",
"sub",
"network",
"for",
"the",
"RightInputAdapterNode",
"To",
"be",
"in",
"the",
"same",
"network",
"it",
"must",
"be",
"a",
"node",
"is",
"after",
"the",
"two",
"output",
"of",
"the",
"parent",
... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java#L363-L375 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java | CheckedExceptionsFactory.newTimeoutException | public static TimeoutException newTimeoutException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link TimeoutException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwabl... | java | public static TimeoutException newTimeoutException(Throwable cause, String message, Object... args) {
return (TimeoutException) new TimeoutException(format(message, args)).initCause(cause);
} | [
"public",
"static",
"TimeoutException",
"newTimeoutException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"(",
"TimeoutException",
")",
"new",
"TimeoutException",
"(",
"format",
"(",
"message",
",",
"ar... | Constructs and initializes a new {@link TimeoutException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link TimeoutException} was thrown.
@param message {@link String} describing the... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"TimeoutException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java#L117-L119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.