repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
jenkinsci/jenkins | core/src/main/java/hudson/model/Fingerprint.java | Fingerprint.getSortedFacets | public @Nonnull Collection<FingerprintFacet> getSortedFacets() {
List<FingerprintFacet> r = new ArrayList<>(getFacets());
r.sort(new Comparator<FingerprintFacet>() {
public int compare(FingerprintFacet o1, FingerprintFacet o2) {
long a = o1.getTimestamp();
lon... | java | public @Nonnull Collection<FingerprintFacet> getSortedFacets() {
List<FingerprintFacet> r = new ArrayList<>(getFacets());
r.sort(new Comparator<FingerprintFacet>() {
public int compare(FingerprintFacet o1, FingerprintFacet o2) {
long a = o1.getTimestamp();
lon... | [
"public",
"@",
"Nonnull",
"Collection",
"<",
"FingerprintFacet",
">",
"getSortedFacets",
"(",
")",
"{",
"List",
"<",
"FingerprintFacet",
">",
"r",
"=",
"new",
"ArrayList",
"<>",
"(",
"getFacets",
"(",
")",
")",
";",
"r",
".",
"sort",
"(",
"new",
"Compara... | Sorts {@link FingerprintFacet}s by their timestamps.
@return Sorted list of {@link FingerprintFacet}s | [
"Sorts",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1201-L1213 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateZipCode | public static <T extends CharSequence> T validateZipCode(T value, String errorMsg) throws ValidateException {
if (false == isZipCode(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | java | public static <T extends CharSequence> T validateZipCode(T value, String errorMsg) throws ValidateException {
if (false == isZipCode(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateZipCode",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isZipCode",
"(",
"value",
")",
")",
"{",
"throw",
"new",... | 验证是否为邮政编码(中国)
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为邮政编码(中国)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L625-L630 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.setOrtho2D | public Matrix4x3f setOrtho2D(float left, float right, float bottom, float top) {
MemUtil.INSTANCE.identity(this);
m00 = 2.0f / (right - left);
m11 = 2.0f / (top - bottom);
m22 = -1.0f;
m30 = -(right + left) / (right - left);
m31 = -(top + bottom) / (top - bottom);
... | java | public Matrix4x3f setOrtho2D(float left, float right, float bottom, float top) {
MemUtil.INSTANCE.identity(this);
m00 = 2.0f / (right - left);
m11 = 2.0f / (top - bottom);
m22 = -1.0f;
m30 = -(right + left) / (right - left);
m31 = -(top + bottom) / (top - bottom);
... | [
"public",
"Matrix4x3f",
"setOrtho2D",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"identity",
"(",
"this",
")",
";",
"m00",
"=",
"2.0f",
"/",
"(",
"right",
"-",
... | Set this matrix to be an orthographic projection transformation for a right-handed coordinate system.
<p>
This method is equivalent to calling {@link #setOrtho(float, float, float, float, float, float) setOrtho()} with
<code>zNear=-1</code> and <code>zFar=+1</code>.
<p>
In order to apply the orthographic projection to ... | [
"Set",
"this",
"matrix",
"to",
"be",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#setOrtho",
"(",
"flo... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L5857-L5866 |
square/jna-gmp | jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java | Gmp.getPeer | private mpz_t getPeer(BigInteger value, mpz_t sharedPeer) {
if (value instanceof GmpInteger) {
return ((GmpInteger) value).getPeer();
}
mpzImport(sharedPeer, value.signum(), value.abs().toByteArray());
return sharedPeer;
} | java | private mpz_t getPeer(BigInteger value, mpz_t sharedPeer) {
if (value instanceof GmpInteger) {
return ((GmpInteger) value).getPeer();
}
mpzImport(sharedPeer, value.signum(), value.abs().toByteArray());
return sharedPeer;
} | [
"private",
"mpz_t",
"getPeer",
"(",
"BigInteger",
"value",
",",
"mpz_t",
"sharedPeer",
")",
"{",
"if",
"(",
"value",
"instanceof",
"GmpInteger",
")",
"{",
"return",
"(",
"(",
"GmpInteger",
")",
"value",
")",
".",
"getPeer",
"(",
")",
";",
"}",
"mpzImport... | If {@code value} is a {@link GmpInteger}, return its peer. Otherwise, import {@code value} into
{@code sharedPeer} and return {@code sharedPeer}. | [
"If",
"{"
] | train | https://github.com/square/jna-gmp/blob/192d26d97d6773bc3c68ccfa97450f4257d54838/jnagmp/src/main/java/com/squareup/jnagmp/Gmp.java#L335-L341 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.createIndex | public void createIndex(String collectionName, List<String> columnList, int order)
{
DBCollection coll = mongoDb.getCollection(collectionName);
List<DBObject> indexes = coll.getIndexInfo(); // List of all current
// indexes on collection
Set<String> indexNames = new HashSet<String>(... | java | public void createIndex(String collectionName, List<String> columnList, int order)
{
DBCollection coll = mongoDb.getCollection(collectionName);
List<DBObject> indexes = coll.getIndexInfo(); // List of all current
// indexes on collection
Set<String> indexNames = new HashSet<String>(... | [
"public",
"void",
"createIndex",
"(",
"String",
"collectionName",
",",
"List",
"<",
"String",
">",
"columnList",
",",
"int",
"order",
")",
"{",
"DBCollection",
"coll",
"=",
"mongoDb",
".",
"getCollection",
"(",
"collectionName",
")",
";",
"List",
"<",
"DBObj... | Creates the index.
@param collectionName
the collection name
@param columnList
the column list
@param order
the order | [
"Creates",
"the",
"index",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L975-L1000 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.taskShouldExecute | private boolean taskShouldExecute(Task task, TaskRecord taskRecord) {
String taskID = taskRecord.getTaskID();
if (taskRecord.getStatus() == TaskStatus.NEVER_EXECUTED) {
m_logger.debug("Task '{}' has never executed", taskID);
return true;
}
if (taskRecord.getStatus... | java | private boolean taskShouldExecute(Task task, TaskRecord taskRecord) {
String taskID = taskRecord.getTaskID();
if (taskRecord.getStatus() == TaskStatus.NEVER_EXECUTED) {
m_logger.debug("Task '{}' has never executed", taskID);
return true;
}
if (taskRecord.getStatus... | [
"private",
"boolean",
"taskShouldExecute",
"(",
"Task",
"task",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"String",
"taskID",
"=",
"taskRecord",
".",
"getTaskID",
"(",
")",
";",
"if",
"(",
"taskRecord",
".",
"getStatus",
"(",
")",
"==",
"TaskStatus",
".",
... | and (2) enough time has passed since its last execution that it's time to run. | [
"and",
"(",
"2",
")",
"enough",
"time",
"has",
"passed",
"since",
"its",
"last",
"execution",
"that",
"it",
"s",
"time",
"to",
"run",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L364-L388 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/entity/CassandraCell.java | CassandraCell.create | public static <E extends IDeepType> Cell create(E e, Field field) {
return new CassandraCell(e, field);
} | java | public static <E extends IDeepType> Cell create(E e, Field field) {
return new CassandraCell(e, field);
} | [
"public",
"static",
"<",
"E",
"extends",
"IDeepType",
">",
"Cell",
"create",
"(",
"E",
"e",
",",
"Field",
"field",
")",
"{",
"return",
"new",
"CassandraCell",
"(",
"e",
",",
"field",
")",
";",
"}"
] | Constructs a Cell from a {@link com.stratio.deep.commons.annotations.DeepField} property.
@param e instance of the testentity whose field is going to generate a Cell.
@param field field that will generate the Cell.
@param <E> a subclass of IDeepType.
@return an instance of a Cell object for the provided paramete... | [
"Constructs",
"a",
"Cell",
"from",
"a",
"{",
"@link",
"com",
".",
"stratio",
".",
"deep",
".",
"commons",
".",
"annotations",
".",
"DeepField",
"}",
"property",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/entity/CassandraCell.java#L123-L125 |
Chorus-bdd/Chorus | extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java | DefaultSqlManager.executeJdbcStatements | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
Statement stmt = createStatement(configName, connection);
try {
log.debug("Executing statement [" + description + "]");
List<String> stmtsToExecute =... | java | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
Statement stmt = createStatement(configName, connection);
try {
log.debug("Executing statement [" + description + "]");
List<String> stmtsToExecute =... | [
"private",
"void",
"executeJdbcStatements",
"(",
"Connection",
"connection",
",",
"String",
"configName",
",",
"String",
"statements",
",",
"String",
"description",
")",
"{",
"Statement",
"stmt",
"=",
"createStatement",
"(",
"configName",
",",
"connection",
")",
"... | Execute one or more SQL statements
@param statements, a String which may contain one or more semi-colon-delimited SQL statements | [
"Execute",
"one",
"or",
"more",
"SQL",
"statements"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java#L148-L173 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/sse/ServerSentEventConnection.java | ServerSentEventConnection.sendRetry | public synchronized void sendRetry(long retry, EventCallback callback) {
if (open == 0 || shutdown) {
if (callback != null) {
callback.failed(this, null, null, null, new ClosedChannelException());
}
return;
}
queue.add(new SSEData(retry, callb... | java | public synchronized void sendRetry(long retry, EventCallback callback) {
if (open == 0 || shutdown) {
if (callback != null) {
callback.failed(this, null, null, null, new ClosedChannelException());
}
return;
}
queue.add(new SSEData(retry, callb... | [
"public",
"synchronized",
"void",
"sendRetry",
"(",
"long",
"retry",
",",
"EventCallback",
"callback",
")",
"{",
"if",
"(",
"open",
"==",
"0",
"||",
"shutdown",
")",
"{",
"if",
"(",
"callback",
"!=",
"null",
")",
"{",
"callback",
".",
"failed",
"(",
"t... | Sends the 'retry' message to the client, instructing it how long to wait before attempting a reconnect.
@param retry The retry time in milliseconds
@param callback The callback that is notified on success or failure | [
"Sends",
"the",
"retry",
"message",
"to",
"the",
"client",
"instructing",
"it",
"how",
"long",
"to",
"wait",
"before",
"attempting",
"a",
"reconnect",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/sse/ServerSentEventConnection.java#L213-L233 |
mscharhag/oleaster | oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/FloatingPointNumberMatcher.java | FloatingPointNumberMatcher.toBeBetween | public void toBeBetween(double lower, double upper) {
Arguments.ensureTrue(lower < upper, "upper has to be greater than lower");
boolean isBetween = this.value >= lower && this.value <= upper;
Expectations.expectTrue(isBetween, "Expected %s to be between %s and %s", this.value, lower, upper);
} | java | public void toBeBetween(double lower, double upper) {
Arguments.ensureTrue(lower < upper, "upper has to be greater than lower");
boolean isBetween = this.value >= lower && this.value <= upper;
Expectations.expectTrue(isBetween, "Expected %s to be between %s and %s", this.value, lower, upper);
} | [
"public",
"void",
"toBeBetween",
"(",
"double",
"lower",
",",
"double",
"upper",
")",
"{",
"Arguments",
".",
"ensureTrue",
"(",
"lower",
"<",
"upper",
",",
"\"upper has to be greater than lower\"",
")",
";",
"boolean",
"isBetween",
"=",
"this",
".",
"value",
"... | Checks if the stored value is between a lower and an upper bound.
<p>This method throws an {@code AssertionError} if:
<ul>
<li>the stored value is smaller than the lower bound</li>
<li>the stored value is greater than the upper bound</li>
</ul>
<p>It is ok if the stored value is equal to the lower or the upper bound
@p... | [
"Checks",
"if",
"the",
"stored",
"value",
"is",
"between",
"a",
"lower",
"and",
"an",
"upper",
"bound",
".",
"<p",
">",
"This",
"method",
"throws",
"an",
"{"
] | train | https://github.com/mscharhag/oleaster/blob/ce8c6fe2346cd0c0cf5f641417ff85019d1d09ac/oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/FloatingPointNumberMatcher.java#L110-L114 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.computeStartGalleryPreselection | private String computeStartGalleryPreselection(HttpServletRequest request, String galleryType) {
// first check presence of the setting in request parameter
String preSelection = request.getParameter(PARAM_STARTGALLERY_PREFIX + galleryType);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(preSelec... | java | private String computeStartGalleryPreselection(HttpServletRequest request, String galleryType) {
// first check presence of the setting in request parameter
String preSelection = request.getParameter(PARAM_STARTGALLERY_PREFIX + galleryType);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(preSelec... | [
"private",
"String",
"computeStartGalleryPreselection",
"(",
"HttpServletRequest",
"request",
",",
"String",
"galleryType",
")",
"{",
"// first check presence of the setting in request parameter",
"String",
"preSelection",
"=",
"request",
".",
"getParameter",
"(",
"PARAM_STARTG... | Returns the preferred editor preselection value either from the request, if not present, from the user settings.<p>
@param request the current http servlet request
@param galleryType the preferred gallery type
@return the preferred editor preselection value or null, if none found | [
"Returns",
"the",
"preferred",
"editor",
"preselection",
"value",
"either",
"from",
"the",
"request",
"if",
"not",
"present",
"from",
"the",
"user",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L2308-L2320 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java | PrincipalUser.findByUserName | public static PrincipalUser findByUserName(EntityManager em, String userName) {
Class<PrincipalUser> type = PrincipalUser.class;
TypedQuery<PrincipalUser> query = em.createNamedQuery("PrincipalUser.findByUserName", type);
try {
return query.setParameter("userName", userName).getSing... | java | public static PrincipalUser findByUserName(EntityManager em, String userName) {
Class<PrincipalUser> type = PrincipalUser.class;
TypedQuery<PrincipalUser> query = em.createNamedQuery("PrincipalUser.findByUserName", type);
try {
return query.setParameter("userName", userName).getSing... | [
"public",
"static",
"PrincipalUser",
"findByUserName",
"(",
"EntityManager",
"em",
",",
"String",
"userName",
")",
"{",
"Class",
"<",
"PrincipalUser",
">",
"type",
"=",
"PrincipalUser",
".",
"class",
";",
"TypedQuery",
"<",
"PrincipalUser",
">",
"query",
"=",
... | Finds the application database user account for the provided user name.
@param em The entity manager to use.
@param userName The user name for which to retrieve the account information for.
@return The user account or null if no account exists. | [
"Finds",
"the",
"application",
"database",
"user",
"account",
"for",
"the",
"provided",
"user",
"name",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L260-L269 |
amzn/ion-java | src/com/amazon/ion/facet/Facets.java | Facets.assumeFacet | public static <T> T assumeFacet(Class<T> facetType, Faceted subject)
{
if (subject != null)
{
T facet = subject.asFacet(facetType);
if (facet != null) return facet;
}
throw new UnsupportedFacetException(facetType, subject);
} | java | public static <T> T assumeFacet(Class<T> facetType, Faceted subject)
{
if (subject != null)
{
T facet = subject.asFacet(facetType);
if (facet != null) return facet;
}
throw new UnsupportedFacetException(facetType, subject);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"assumeFacet",
"(",
"Class",
"<",
"T",
">",
"facetType",
",",
"Faceted",
"subject",
")",
"{",
"if",
"(",
"subject",
"!=",
"null",
")",
"{",
"T",
"facet",
"=",
"subject",
".",
"asFacet",
"(",
"facetType",
")",
... | Returns a facet of the given subject if supported, throwing an
exception otherwise.
<p>
This does not attempt to cast the subject to the requested type, since
the {@link Faceted} interface declares the intent to control the
conversion.
@return not null.
@throws UnsupportedFacetException if {@code subject} is null or ... | [
"Returns",
"a",
"facet",
"of",
"the",
"given",
"subject",
"if",
"supported",
"throwing",
"an",
"exception",
"otherwise",
".",
"<p",
">",
"This",
"does",
"not",
"attempt",
"to",
"cast",
"the",
"subject",
"to",
"the",
"requested",
"type",
"since",
"the",
"{"... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/facet/Facets.java#L90-L99 |
amzn/ion-java | src/com/amazon/ion/util/IonTextUtils.java | IonTextUtils.printJsonString | public static void printJsonString(Appendable out, CharSequence text)
throws IOException
{
if (text == null)
{
out.append("null");
}
else
{
out.append('"');
printCodePoints(out, text, EscapeMode.JSON);
out.append('"');
... | java | public static void printJsonString(Appendable out, CharSequence text)
throws IOException
{
if (text == null)
{
out.append("null");
}
else
{
out.append('"');
printCodePoints(out, text, EscapeMode.JSON);
out.append('"');
... | [
"public",
"static",
"void",
"printJsonString",
"(",
"Appendable",
"out",
",",
"CharSequence",
"text",
")",
"throws",
"IOException",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"out",
".",
"append",
"(",
"\"null\"",
")",
";",
"}",
"else",
"{",
"out",
... | Prints characters as an ASCII-encoded JSON string, including surrounding
double-quotes.
If the {@code text} is null, this prints {@code null}.
@param out the stream to receive the JSON data.
@param text the text to print; may be {@code null}.
@throws IOException if the {@link Appendable} throws an exception.
@throws ... | [
"Prints",
"characters",
"as",
"an",
"ASCII",
"-",
"encoded",
"JSON",
"string",
"including",
"surrounding",
"double",
"-",
"quotes",
".",
"If",
"the",
"{",
"@code",
"text",
"}",
"is",
"null",
"this",
"prints",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L432-L445 |
Wikidata/Wikidata-Toolkit | wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java | WmfDumpFileManager.findDumpDatesOnline | List<String> findDumpDatesOnline(DumpContentType dumpContentType) {
List<String> result = new ArrayList<>();
try (InputStream in = this.webResourceFetcher
.getInputStreamForUrl(WmfDumpFile.getDumpFileWebDirectory(
dumpContentType, this.projectName))) {
BufferedReader bufferedReader = new BufferedReade... | java | List<String> findDumpDatesOnline(DumpContentType dumpContentType) {
List<String> result = new ArrayList<>();
try (InputStream in = this.webResourceFetcher
.getInputStreamForUrl(WmfDumpFile.getDumpFileWebDirectory(
dumpContentType, this.projectName))) {
BufferedReader bufferedReader = new BufferedReade... | [
"List",
"<",
"String",
">",
"findDumpDatesOnline",
"(",
"DumpContentType",
"dumpContentType",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"(",
"InputStream",
"in",
"=",
"this",
".",
"webResourceFetcher... | Finds out which dump files are available for download in a given
directory. The result is a list of YYYYMMDD date stamps, ordered newest
to oldest. The list is based on the directories or files found at the
target location, without considering whether or not each dump is actually
available.
<p>
The implementation is ra... | [
"Finds",
"out",
"which",
"dump",
"files",
"are",
"available",
"for",
"download",
"in",
"a",
"given",
"directory",
".",
"The",
"result",
"is",
"a",
"list",
"of",
"YYYYMMDD",
"date",
"stamps",
"ordered",
"newest",
"to",
"oldest",
".",
"The",
"list",
"is",
... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java#L333-L362 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/DiagnosticRenderUtil.java | DiagnosticRenderUtil.renderDiagnostics | public static void renderDiagnostics(final Diagnosable component, final WebXmlRenderContext renderContext) {
List<Diagnostic> diags = component.getDiagnostics(Diagnostic.ERROR);
if (diags != null) {
renderHelper(renderContext, component, diags, Diagnostic.ERROR);
}
diags = component.getDiagnostics(Diagnostic... | java | public static void renderDiagnostics(final Diagnosable component, final WebXmlRenderContext renderContext) {
List<Diagnostic> diags = component.getDiagnostics(Diagnostic.ERROR);
if (diags != null) {
renderHelper(renderContext, component, diags, Diagnostic.ERROR);
}
diags = component.getDiagnostics(Diagnostic... | [
"public",
"static",
"void",
"renderDiagnostics",
"(",
"final",
"Diagnosable",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"List",
"<",
"Diagnostic",
">",
"diags",
"=",
"component",
".",
"getDiagnostics",
"(",
"Diagnostic",
".",
"ER... | Render diagnostics for the component.
@param component the component being rendered
@param renderContext the RenderContext to paint to. | [
"Render",
"diagnostics",
"for",
"the",
"component",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/DiagnosticRenderUtil.java#L87-L104 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getBooleanWithDefault | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
return retrieve(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return configuration.getBoolean(key);
}
}, defaultValue);
} | java | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
return retrieve(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return configuration.getBoolean(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Boolean",
"getBooleanWithDefault",
"(",
"final",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"c... | Get a Boolean property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Boolean",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L227-L236 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateEnumerationDeclaration(enumeration, it, context);
} | java | protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateEnumerationDeclaration(enumeration, it, context);
} | [
"protected",
"void",
"_generate",
"(",
"SarlEnumeration",
"enumeration",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"generateEnumerationDeclaration",
"(",
"enumeration",
",",
"it",
",",
"context",
")",
";",
"}"
] | Generate the given object.
@param enumeration the enumeration.
@param it the target for the generated content.
@param context the context. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L913-L915 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java | SRTPCryptoContext.authenticatePacketHMCSHA1 | private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) {
ByteBuffer buf = pkt.getBuffer();
buf.rewind();
int len = buf.remaining();
buf.get(tempBuffer, 0, len);
mac.update(tempBuffer, 0, len);
rbStore[0] = (byte) (rocIn >> 24);
rbStore[1] = (byte) (rocIn >> 16);
rbStore[2] = (byte) (rocIn >> 8... | java | private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) {
ByteBuffer buf = pkt.getBuffer();
buf.rewind();
int len = buf.remaining();
buf.get(tempBuffer, 0, len);
mac.update(tempBuffer, 0, len);
rbStore[0] = (byte) (rocIn >> 24);
rbStore[1] = (byte) (rocIn >> 16);
rbStore[2] = (byte) (rocIn >> 8... | [
"private",
"void",
"authenticatePacketHMCSHA1",
"(",
"RawPacket",
"pkt",
",",
"int",
"rocIn",
")",
"{",
"ByteBuffer",
"buf",
"=",
"pkt",
".",
"getBuffer",
"(",
")",
";",
"buf",
".",
"rewind",
"(",
")",
";",
"int",
"len",
"=",
"buf",
".",
"remaining",
"... | Authenticate a packet. Calculated authentication tag is returned.
@param pkt
the RTP packet to be authenticated
@param rocIn
Roll-Over-Counter | [
"Authenticate",
"a",
"packet",
".",
"Calculated",
"authentication",
"tag",
"is",
"returned",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L522-L534 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/DoubleBindingChecker.java | DoubleBindingChecker.findSource | private GinjectorBindings findSource(GinjectorBindings ginjector, Key<?> key) {
Set<GinjectorBindings> visited = new LinkedHashSet<GinjectorBindings>();
GinjectorBindings lastGinjector = null;
while (ginjector != null) {
if (!visited.add(ginjector)) {
logger.log(Type.ERROR, PrettyPrinter.form... | java | private GinjectorBindings findSource(GinjectorBindings ginjector, Key<?> key) {
Set<GinjectorBindings> visited = new LinkedHashSet<GinjectorBindings>();
GinjectorBindings lastGinjector = null;
while (ginjector != null) {
if (!visited.add(ginjector)) {
logger.log(Type.ERROR, PrettyPrinter.form... | [
"private",
"GinjectorBindings",
"findSource",
"(",
"GinjectorBindings",
"ginjector",
",",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"Set",
"<",
"GinjectorBindings",
">",
"visited",
"=",
"new",
"LinkedHashSet",
"<",
"GinjectorBindings",
">",
"(",
")",
";",
"Ginjec... | Find the ginjector that we "really" get the binding for key from. That is,
if it is inherited from a child/parent, return that injector. | [
"Find",
"the",
"ginjector",
"that",
"we",
"really",
"get",
"the",
"binding",
"for",
"key",
"from",
".",
"That",
"is",
"if",
"it",
"is",
"inherited",
"from",
"a",
"child",
"/",
"parent",
"return",
"that",
"injector",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/DoubleBindingChecker.java#L93-L111 |
google/closure-templates | java/src/com/google/template/soy/shared/SoyAstCache.java | SoyAstCache.put | public synchronized void put(String fileName, VersionedFile versionedFile) {
cache.put(fileName, versionedFile.copy());
} | java | public synchronized void put(String fileName, VersionedFile versionedFile) {
cache.put(fileName, versionedFile.copy());
} | [
"public",
"synchronized",
"void",
"put",
"(",
"String",
"fileName",
",",
"VersionedFile",
"versionedFile",
")",
"{",
"cache",
".",
"put",
"(",
"fileName",
",",
"versionedFile",
".",
"copy",
"(",
")",
")",
";",
"}"
] | Stores a cached version of the AST.
<p>Please treat this as superpackage-private for Soy internals.
@param fileName The name of the file.
@param versionedFile The compiled AST at the particular version. The node is defensively
copied; the caller is free to modify it. | [
"Stores",
"a",
"cached",
"version",
"of",
"the",
"AST",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/SoyAstCache.java#L80-L82 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/DropinMonitor.java | DropinMonitor.getAppMessageHelper | private AppMessageHelper getAppMessageHelper(String type, String fileName) {
if (type == null && fileName != null) {
String[] parts = fileName.split("[\\\\/]");
if (parts.length > 0) {
String last = parts[parts.length - 1];
int dot = last.indexOf('.');
... | java | private AppMessageHelper getAppMessageHelper(String type, String fileName) {
if (type == null && fileName != null) {
String[] parts = fileName.split("[\\\\/]");
if (parts.length > 0) {
String last = parts[parts.length - 1];
int dot = last.indexOf('.');
... | [
"private",
"AppMessageHelper",
"getAppMessageHelper",
"(",
"String",
"type",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"&&",
"fileName",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"fileName",
".",
"split",
"(",
... | Returns the message helper for the specified application handler type.
@param type application handler type
@param fileName file name from which type can be inferred if not specified
@return the message helper for the specified application handler type. | [
"Returns",
"the",
"message",
"helper",
"for",
"the",
"specified",
"application",
"handler",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/DropinMonitor.java#L354-L381 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readString | public String readString () {
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
// Null, empty, or UTF8.
int charCount = readVarIntFlag(true);
switch (charCount) {
case 0:
return null;
case 1:
return "";
}
charCount--;
readUtf8Chars(charCount);
return new String(chars, 0, ... | java | public String readString () {
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
// Null, empty, or UTF8.
int charCount = readVarIntFlag(true);
switch (charCount) {
case 0:
return null;
case 1:
return "";
}
charCount--;
readUtf8Chars(charCount);
return new String(chars, 0, ... | [
"public",
"String",
"readString",
"(",
")",
"{",
"if",
"(",
"!",
"readVarIntFlag",
"(",
")",
")",
"return",
"readAsciiString",
"(",
")",
";",
"// ASCII.\r",
"// Null, empty, or UTF8.\r",
"int",
"charCount",
"=",
"readVarIntFlag",
"(",
"true",
")",
";",
"switch... | Reads the length and string of UTF8 characters, or null. This can read strings written by
{@link Output#writeString(String)} and {@link Output#writeAscii(String)}.
@return May be null. | [
"Reads",
"the",
"length",
"and",
"string",
"of",
"UTF8",
"characters",
"or",
"null",
".",
"This",
"can",
"read",
"strings",
"written",
"by",
"{"
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L774-L787 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java | ResourceLoader.getInputStream | public static InputStream getInputStream(final String baseDir, final String resource) throws IOException {
return getInputStream(new File(baseDir), resource);
} | java | public static InputStream getInputStream(final String baseDir, final String resource) throws IOException {
return getInputStream(new File(baseDir), resource);
} | [
"public",
"static",
"InputStream",
"getInputStream",
"(",
"final",
"String",
"baseDir",
",",
"final",
"String",
"resource",
")",
"throws",
"IOException",
"{",
"return",
"getInputStream",
"(",
"new",
"File",
"(",
"baseDir",
")",
",",
"resource",
")",
";",
"}"
] | Loads a resource as {@link InputStream}.
@param baseDir
If not {@code null}, the directory relative to which resources are loaded.
@param resource
The resource to be loaded. If {@code baseDir} is not {@code null}, it is loaded
relative to {@code baseDir}.
@return The stream | [
"Loads",
"a",
"resource",
"as",
"{",
"@link",
"InputStream",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java#L259-L261 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getDouble | public double getDouble(String key, double defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Double.parseDouble(argument);
} | java | public double getDouble(String key, double defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Double.parseDouble(argument);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Double",
".",
"parse... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L93-L98 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java | PoolManager.incRunningTasks | public void incRunningTasks(String poolName, TaskType type, int inc) {
Map<String, Integer> runningMap = (type == TaskType.MAP ?
poolRunningMaps : poolRunningReduces);
if (!runningMap.containsKey(poolName)) {
runningMap.put(poolName, 0);
}
int runningTasks = ... | java | public void incRunningTasks(String poolName, TaskType type, int inc) {
Map<String, Integer> runningMap = (type == TaskType.MAP ?
poolRunningMaps : poolRunningReduces);
if (!runningMap.containsKey(poolName)) {
runningMap.put(poolName, 0);
}
int runningTasks = ... | [
"public",
"void",
"incRunningTasks",
"(",
"String",
"poolName",
",",
"TaskType",
"type",
",",
"int",
"inc",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"runningMap",
"=",
"(",
"type",
"==",
"TaskType",
".",
"MAP",
"?",
"poolRunningMaps",
":",
"p... | Set the number of running tasks in a pool
@param poolName name of the pool
@param type type of task to be set
@param runningTasks number of current running tasks | [
"Set",
"the",
"number",
"of",
"running",
"tasks",
"in",
"a",
"pool"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java#L725-L733 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionSequencer.java | RaftSessionSequencer.sequenceEvent | public void sequenceEvent(PublishRequest request, Runnable callback) {
if (requestSequence == responseSequence) {
log.trace("Completing {}", request);
callback.run();
eventIndex = request.eventIndex();
} else {
eventCallbacks.add(new EventCallback(request, callback));
completeRespo... | java | public void sequenceEvent(PublishRequest request, Runnable callback) {
if (requestSequence == responseSequence) {
log.trace("Completing {}", request);
callback.run();
eventIndex = request.eventIndex();
} else {
eventCallbacks.add(new EventCallback(request, callback));
completeRespo... | [
"public",
"void",
"sequenceEvent",
"(",
"PublishRequest",
"request",
",",
"Runnable",
"callback",
")",
"{",
"if",
"(",
"requestSequence",
"==",
"responseSequence",
")",
"{",
"log",
".",
"trace",
"(",
"\"Completing {}\"",
",",
"request",
")",
";",
"callback",
"... | Sequences an event.
<p>
This method relies on the session event protocol to ensure that events are applied in sequential order.
When an event is received, if no operations are outstanding, the event is immediately completed since
the event could not have occurred concurrently with any other operation. Otherwise, the ev... | [
"Sequences",
"an",
"event",
".",
"<p",
">",
"This",
"method",
"relies",
"on",
"the",
"session",
"event",
"protocol",
"to",
"ensure",
"that",
"events",
"are",
"applied",
"in",
"sequential",
"order",
".",
"When",
"an",
"event",
"is",
"received",
"if",
"no",
... | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionSequencer.java#L102-L111 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withInputStream | public static Object withInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure closure) throws IOException {
return IOGroovyMethods.withStream(newInputStream(file), closure);
} | java | public static Object withInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure closure) throws IOException {
return IOGroovyMethods.withStream(newInputStream(file), closure);
} | [
"public",
"static",
"Object",
"withInputStream",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.InputStream\"",
")",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"return"... | Create a new InputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param file a File
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see IOGroovyMethods#withStream(java.io.Input... | [
"Create",
"a",
"new",
"InputStream",
"for",
"this",
"file",
"and",
"passes",
"it",
"into",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1842-L1844 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/util/Util.java | Util.logPrintf | public static void logPrintf(String format, String... v) {
if (enableLog) {
String tmp = String.format(format, (Object[]) v);
logger.log(Level.INFO, tmp);
}
} | java | public static void logPrintf(String format, String... v) {
if (enableLog) {
String tmp = String.format(format, (Object[]) v);
logger.log(Level.INFO, tmp);
}
} | [
"public",
"static",
"void",
"logPrintf",
"(",
"String",
"format",
",",
"String",
"...",
"v",
")",
"{",
"if",
"(",
"enableLog",
")",
"{",
"String",
"tmp",
"=",
"String",
".",
"format",
"(",
"format",
",",
"(",
"Object",
"[",
"]",
")",
"v",
")",
";",... | logPrintf prints the log with the format.
@param format the format of the log.
@param v the log. | [
"logPrintf",
"prints",
"the",
"log",
"with",
"the",
"format",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/util/Util.java#L47-L52 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Version.java | Version.overlapping | public static boolean overlapping(Version min1, Version max1, Version min2, Version max2)
{
// Versions overlap if:
// - either Min or Max values are identical (fast test for real scenarios)
// - Min1|Max1 are within the range Min2-Max2
// - Min2|Max2 are within the range Min1-Max1
return min1.equals(min2) ... | java | public static boolean overlapping(Version min1, Version max1, Version min2, Version max2)
{
// Versions overlap if:
// - either Min or Max values are identical (fast test for real scenarios)
// - Min1|Max1 are within the range Min2-Max2
// - Min2|Max2 are within the range Min1-Max1
return min1.equals(min2) ... | [
"public",
"static",
"boolean",
"overlapping",
"(",
"Version",
"min1",
",",
"Version",
"max1",
",",
"Version",
"min2",
",",
"Version",
"max2",
")",
"{",
"// Versions overlap if:",
"// - either Min or Max values are identical (fast test for real scenarios)",
"// - Min1|Max1 are... | Determines if 2 version ranges have any overlap
@param min1
Version The 1st range
@param max1
Version The 1st range
@param min2
Version The 2nd range
@param max2
Version The 2nd range
@return boolean True if the version ranges overlap | [
"Determines",
"if",
"2",
"version",
"ranges",
"have",
"any",
"overlap"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Version.java#L210-L219 |
sannies/mp4parser | muxer/src/main/java/org/mp4parser/muxer/tracks/AbstractH26XTrack.java | AbstractH26XTrack.createSampleObject | protected Sample createSampleObject(List<? extends ByteBuffer> nals) {
byte[] sizeInfo = new byte[nals.size() * 4];
ByteBuffer sizeBuf = ByteBuffer.wrap(sizeInfo);
for (ByteBuffer b : nals) {
sizeBuf.putInt(b.remaining());
}
ByteBuffer[] data = new ByteBuffer[nals.si... | java | protected Sample createSampleObject(List<? extends ByteBuffer> nals) {
byte[] sizeInfo = new byte[nals.size() * 4];
ByteBuffer sizeBuf = ByteBuffer.wrap(sizeInfo);
for (ByteBuffer b : nals) {
sizeBuf.putInt(b.remaining());
}
ByteBuffer[] data = new ByteBuffer[nals.si... | [
"protected",
"Sample",
"createSampleObject",
"(",
"List",
"<",
"?",
"extends",
"ByteBuffer",
">",
"nals",
")",
"{",
"byte",
"[",
"]",
"sizeInfo",
"=",
"new",
"byte",
"[",
"nals",
".",
"size",
"(",
")",
"*",
"4",
"]",
";",
"ByteBuffer",
"sizeBuf",
"=",
... | Builds an MP4 sample from a list of NALs. Each NAL will be preceded by its
4 byte (unit32) length.
@param nals a list of NALs that form the sample
@return sample as it appears in the MP4 file | [
"Builds",
"an",
"MP4",
"sample",
"from",
"a",
"list",
"of",
"NALs",
".",
"Each",
"NAL",
"will",
"be",
"preceded",
"by",
"its",
"4",
"byte",
"(",
"unit32",
")",
"length",
"."
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/tracks/AbstractH26XTrack.java#L81-L96 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.getRelativeSubPath | public static String getRelativeSubPath(String base, String path) {
String result = null;
base = CmsStringUtil.joinPaths(base, "/");
path = CmsStringUtil.joinPaths(path, "/");
if (path.startsWith(base)) {
result = path.substring(base.length());
}
if (result !... | java | public static String getRelativeSubPath(String base, String path) {
String result = null;
base = CmsStringUtil.joinPaths(base, "/");
path = CmsStringUtil.joinPaths(path, "/");
if (path.startsWith(base)) {
result = path.substring(base.length());
}
if (result !... | [
"public",
"static",
"String",
"getRelativeSubPath",
"(",
"String",
"base",
",",
"String",
"path",
")",
"{",
"String",
"result",
"=",
"null",
";",
"base",
"=",
"CmsStringUtil",
".",
"joinPaths",
"(",
"base",
",",
"\"/\"",
")",
";",
"path",
"=",
"CmsStringUt... | Converts the given path to a path relative to a base folder,
but only if it actually is a sub-path of the latter,
otherwise <code>null</code> is returned.<p>
<b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
@param base the base path
@param path the path which should b... | [
"Converts",
"the",
"given",
"path",
"to",
"a",
"path",
"relative",
"to",
"a",
"base",
"folder",
"but",
"only",
"if",
"it",
"actually",
"is",
"a",
"sub",
"-",
"path",
"of",
"the",
"latter",
"otherwise",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L992-L1009 |
jmeetsma/Iglu-Http | src/main/java/org/ijsberg/iglu/util/http/MultiPartReader.java | MultiPartReader.readMultipartUpload | public long readMultipartUpload() throws IOException
{
input = request.getInputStream();
//the next variable stores all post data and is useful for debug purposes
bytesReadAsLine = input.readLine(line, 0, BUFFER_SIZE);
if (bytesReadAsLine <= 2)
{
return 0;
}
bytesRead = bytesReadAsLine;
//save ... | java | public long readMultipartUpload() throws IOException
{
input = request.getInputStream();
//the next variable stores all post data and is useful for debug purposes
bytesReadAsLine = input.readLine(line, 0, BUFFER_SIZE);
if (bytesReadAsLine <= 2)
{
return 0;
}
bytesRead = bytesReadAsLine;
//save ... | [
"public",
"long",
"readMultipartUpload",
"(",
")",
"throws",
"IOException",
"{",
"input",
"=",
"request",
".",
"getInputStream",
"(",
")",
";",
"//the next variable stores all post data and is useful for debug purposes",
"bytesReadAsLine",
"=",
"input",
".",
"readLine",
"... | Reads uploaded files and form variables from POSTed data.
Files are stored on disk in case uploadDir is not null.
Otherwise files are stored as attributes on the http-request in the form of FileObjects, using the name of the html-form-variable as key.
Plain properties are stored as String attributes on the http-request... | [
"Reads",
"uploaded",
"files",
"and",
"form",
"variables",
"from",
"POSTed",
"data",
".",
"Files",
"are",
"stored",
"on",
"disk",
"in",
"case",
"uploadDir",
"is",
"not",
"null",
".",
"Otherwise",
"files",
"are",
"stored",
"as",
"attributes",
"on",
"the",
"h... | train | https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/util/http/MultiPartReader.java#L87-L151 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.addAutoText | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment, int width) {
HorizontalBandAlignment alignment_ = HorizontalBandAlignment.buildAligment(alignment);
AutoText text = new AutoText(message, position, alignment_, width);
addAutoText(text);
return this;
... | java | public DynamicReportBuilder addAutoText(String message, byte position, byte alignment, int width) {
HorizontalBandAlignment alignment_ = HorizontalBandAlignment.buildAligment(alignment);
AutoText text = new AutoText(message, position, alignment_, width);
addAutoText(text);
return this;
... | [
"public",
"DynamicReportBuilder",
"addAutoText",
"(",
"String",
"message",
",",
"byte",
"position",
",",
"byte",
"alignment",
",",
"int",
"width",
")",
"{",
"HorizontalBandAlignment",
"alignment_",
"=",
"HorizontalBandAlignment",
".",
"buildAligment",
"(",
"alignment"... | Adds a custom fixed message (literal) in header or footer. The message
width will be the page width<br>
The parameters are all constants from the
<code>ar.com.fdvs.dj.domain.AutoText</code> class
<br>
<br>
@param message The text to show
@param position POSITION_HEADER or POSITION_FOOTER
@param alignment <br>ALIGME... | [
"Adds",
"a",
"custom",
"fixed",
"message",
"(",
"literal",
")",
"in",
"header",
"or",
"footer",
".",
"The",
"message",
"width",
"will",
"be",
"the",
"page",
"width<br",
">",
"The",
"parameters",
"are",
"all",
"constants",
"from",
"the",
"<code",
">",
"ar... | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L223-L228 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.getFieldName | private static String getFieldName(Class<?> aClass,String regex){
for (Field field : aClass.getDeclaredFields())
if(field.getName().matches(regex))
return field.getName();
return null;
} | java | private static String getFieldName(Class<?> aClass,String regex){
for (Field field : aClass.getDeclaredFields())
if(field.getName().matches(regex))
return field.getName();
return null;
} | [
"private",
"static",
"String",
"getFieldName",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"regex",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"aClass",
".",
"getDeclaredFields",
"(",
")",
")",
"if",
"(",
"field",
".",
"getName",
"(",
")",
... | This method returns the name of the field whose name matches with regex.
@param aClass class to check
@param regex regex used to find the field
@return the field name if exists, null otherwise | [
"This",
"method",
"returns",
"the",
"name",
"of",
"the",
"field",
"whose",
"name",
"matches",
"with",
"regex",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L413-L419 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/EmailApi.java | EmailApi.saveEmail | public ApiSuccessResponse saveEmail(String id, SaveData saveData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = saveEmailWithHttpInfo(id, saveData);
return resp.getData();
} | java | public ApiSuccessResponse saveEmail(String id, SaveData saveData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = saveEmailWithHttpInfo(id, saveData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"saveEmail",
"(",
"String",
"id",
",",
"SaveData",
"saveData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"saveEmailWithHttpInfo",
"(",
"id",
",",
"saveData",
")",
";",
"return",
... | Save email information to UCS
Save email information of interaction specified in the id path parameter
@param id id of interaction to save (required)
@param saveData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the respon... | [
"Save",
"email",
"information",
"to",
"UCS",
"Save",
"email",
"information",
"of",
"interaction",
"specified",
"in",
"the",
"id",
"path",
"parameter"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/EmailApi.java#L763-L766 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getFraction | public static float getFraction(@NonNull final Context context, @AttrRes final int resourceId,
final int base, final int pbase) {
return getFraction(context, -1, resourceId, base, pbase);
} | java | public static float getFraction(@NonNull final Context context, @AttrRes final int resourceId,
final int base, final int pbase) {
return getFraction(context, -1, resourceId, base, pbase);
} | [
"public",
"static",
"float",
"getFraction",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
",",
"final",
"int",
"base",
",",
"final",
"int",
"pbase",
")",
"{",
"return",
"getFraction",
"(",
"context",
... | Obtains the fraction, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The re... | [
"Obtains",
"the",
"fraction",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
".",
"If",
"the",
"given",
"resource",
"id",
"is",
"invalid",
"a",
"{",
"@link",
"NotFoundException",
"}",
"will",
"be",
"t... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L603-L606 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java | SVGSaveDialog.showError | private static void showError(Component parent, String title, String msg) {
JOptionPane.showMessageDialog(parent, msg, title, JOptionPane.ERROR_MESSAGE);
} | java | private static void showError(Component parent, String title, String msg) {
JOptionPane.showMessageDialog(parent, msg, title, JOptionPane.ERROR_MESSAGE);
} | [
"private",
"static",
"void",
"showError",
"(",
"Component",
"parent",
",",
"String",
"title",
",",
"String",
"msg",
")",
"{",
"JOptionPane",
".",
"showMessageDialog",
"(",
"parent",
",",
"msg",
",",
"title",
",",
"JOptionPane",
".",
"ERROR_MESSAGE",
")",
";"... | Helper method to show a error message as "popup". Calls
{@link JOptionPane#showMessageDialog(java.awt.Component, Object)}.
@param parent The parent component for the popup.
@param msg The message to be displayed. | [
"Helper",
"method",
"to",
"show",
"a",
"error",
"message",
"as",
"popup",
".",
"Calls",
"{",
"@link",
"JOptionPane#showMessageDialog",
"(",
"java",
".",
"awt",
".",
"Component",
"Object",
")",
"}",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java#L220-L222 |
astrapi69/mystic-crypt | crypt-core/src/main/java/de/alpharogroup/crypto/gm/GoogleMapsUrlSigner.java | GoogleMapsUrlSigner.signRequest | public static String signRequest(final URL url, final String yourGooglePrivateKeyString)
throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException,
URISyntaxException
{
// Retrieve the proper URL components to sign
final String resource = url.getPath() + '?' + url.getQuery();
// Ge... | java | public static String signRequest(final URL url, final String yourGooglePrivateKeyString)
throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException,
URISyntaxException
{
// Retrieve the proper URL components to sign
final String resource = url.getPath() + '?' + url.getQuery();
// Ge... | [
"public",
"static",
"String",
"signRequest",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"yourGooglePrivateKeyString",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"UnsupportedEncodingException",
",",
"URISyntaxException",
"{",
"// R... | Returns the full url as String object with the signature as parameter.
@param url
the url
@param yourGooglePrivateKeyString
the your google private key string
@return the string
@throws NoSuchAlgorithmException
the no such algorithm exception
@throws InvalidKeyException
the invalid key exception
@throws UnsupportedEnc... | [
"Returns",
"the",
"full",
"url",
"as",
"String",
"object",
"with",
"the",
"signature",
"as",
"parameter",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-core/src/main/java/de/alpharogroup/crypto/gm/GoogleMapsUrlSigner.java#L130-L162 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java | EasyPredictModelWrapper.predictMultinomial | public MultinomialModelPrediction predictMultinomial(RowData data, double offset) throws PredictException {
double[] preds = preamble(ModelCategory.Multinomial, data, offset);
MultinomialModelPrediction p = new MultinomialModelPrediction();
if (enableLeafAssignment) { // only get leaf node assignment if en... | java | public MultinomialModelPrediction predictMultinomial(RowData data, double offset) throws PredictException {
double[] preds = preamble(ModelCategory.Multinomial, data, offset);
MultinomialModelPrediction p = new MultinomialModelPrediction();
if (enableLeafAssignment) { // only get leaf node assignment if en... | [
"public",
"MultinomialModelPrediction",
"predictMultinomial",
"(",
"RowData",
"data",
",",
"double",
"offset",
")",
"throws",
"PredictException",
"{",
"double",
"[",
"]",
"preds",
"=",
"preamble",
"(",
"ModelCategory",
".",
"Multinomial",
",",
"data",
",",
"offset... | Make a prediction on a new data point using a Multinomial model.
@param data A new data point.
@param offset Prediction offset
@return The prediction.
@throws PredictException | [
"Make",
"a",
"prediction",
"on",
"a",
"new",
"data",
"point",
"using",
"a",
"Multinomial",
"model",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/EasyPredictModelWrapper.java#L603-L623 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.createOrUpdate | public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body();
} | java | public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VirtualNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to create or update virtual network gateway operation.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L209-L211 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodePath | public static String encodePath(String path, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(path, encoding, HierarchicalUriComponents.Type.PATH);
} | java | public static String encodePath(String path, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(path, encoding, HierarchicalUriComponents.Type.PATH);
} | [
"public",
"static",
"String",
"encodePath",
"(",
"String",
"path",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"HierarchicalUriComponents",
".",
"encodeUriComponent",
"(",
"path",
",",
"encoding",
",",
"HierarchicalUriCompone... | Encodes the given URI path with the given encoding.
@param path the path to be encoded
@param encoding the character encoding to encode to
@return the encoded path
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"Encodes",
"the",
"given",
"URI",
"path",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L274-L276 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.withObjectInputStream | public static <T> T withObjectInputStream(Path self, ClassLoader classLoader, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectInputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectInputStream(self, classLoader), closure);
} | java | public static <T> T withObjectInputStream(Path self, ClassLoader classLoader, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectInputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectInputStream(self, classLoader), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectInputStream",
"(",
"Path",
"self",
",",
"ClassLoader",
"classLoader",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectInputStream\"",
")",
"Closure... | Create a new ObjectInputStream for this file associated with the given class loader and pass it to the closure.
This method ensures the stream is closed after the closure returns.
@param self a Path
@param classLoader the class loader to use when loading the class
@param closure a closure
@return the value ... | [
"Create",
"a",
"new",
"ObjectInputStream",
"for",
"this",
"file",
"associated",
"with",
"the",
"given",
"class",
"loader",
"and",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closur... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L191-L193 |
JavaKoan/koan-annotations | src/main/java/com/javakoan/fixture/io/KoanReader.java | KoanReader.getProblemFromFile | public static String getProblemFromFile(Class<?> koanClass, String methodName) {
return getSourceFromFile(koanClass, methodName, PROBLEM_EXTENSION);
} | java | public static String getProblemFromFile(Class<?> koanClass, String methodName) {
return getSourceFromFile(koanClass, methodName, PROBLEM_EXTENSION);
} | [
"public",
"static",
"String",
"getProblemFromFile",
"(",
"Class",
"<",
"?",
">",
"koanClass",
",",
"String",
"methodName",
")",
"{",
"return",
"getSourceFromFile",
"(",
"koanClass",
",",
"methodName",
",",
"PROBLEM_EXTENSION",
")",
";",
"}"
] | Gets problem for a koan by method name.
@param koanClass the koan class
@param methodName the method name of the problem required
@return the problem content to be inserted between the koan start and end markers | [
"Gets",
"problem",
"for",
"a",
"koan",
"by",
"method",
"name",
"."
] | train | https://github.com/JavaKoan/koan-annotations/blob/e3c4872ae57051a0b74b2efa6f15f4ee9e37d263/src/main/java/com/javakoan/fixture/io/KoanReader.java#L114-L116 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java | ServerSentEvents.fromStream | public static <T> HttpResponse fromStream(Stream<T> contentStream, Executor executor,
Function<? super T, ? extends ServerSentEvent> converter) {
return fromStream(defaultHttpHeaders, contentStream, HttpHeaders.EMPTY_HEADERS, executor, converter);
} | java | public static <T> HttpResponse fromStream(Stream<T> contentStream, Executor executor,
Function<? super T, ? extends ServerSentEvent> converter) {
return fromStream(defaultHttpHeaders, contentStream, HttpHeaders.EMPTY_HEADERS, executor, converter);
} | [
"public",
"static",
"<",
"T",
">",
"HttpResponse",
"fromStream",
"(",
"Stream",
"<",
"T",
">",
"contentStream",
",",
"Executor",
"executor",
",",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"ServerSentEvent",
">",
"converter",
")",
"{",
"retur... | Creates a new Server-Sent Events stream from the specified {@link Stream} and {@code converter}.
@param contentStream the {@link Stream} which publishes the objects supposed to send as contents
@param executor the executor which iterates the stream
@param converter the converter which converts published objects into {... | [
"Creates",
"a",
"new",
"Server",
"-",
"Sent",
"Events",
"stream",
"from",
"the",
"specified",
"{",
"@link",
"Stream",
"}",
"and",
"{",
"@code",
"converter",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L213-L216 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadModel | public GVRSceneObject loadModel(final String filePath, final GVRScene scene) throws IOException
{
GVRSceneObject model = new GVRSceneObject(mContext);
AssetRequest assetRequest = new AssetRequest(model, new GVRResourceVolume(mContext, filePath), scene, null, false);
String ext = filePath.sub... | java | public GVRSceneObject loadModel(final String filePath, final GVRScene scene) throws IOException
{
GVRSceneObject model = new GVRSceneObject(mContext);
AssetRequest assetRequest = new AssetRequest(model, new GVRResourceVolume(mContext, filePath), scene, null, false);
String ext = filePath.sub... | [
"public",
"GVRSceneObject",
"loadModel",
"(",
"final",
"String",
"filePath",
",",
"final",
"GVRScene",
"scene",
")",
"throws",
"IOException",
"{",
"GVRSceneObject",
"model",
"=",
"new",
"GVRSceneObject",
"(",
"mContext",
")",
";",
"AssetRequest",
"assetRequest",
"... | Loads a hierarchy of scene objects {@link GVRSceneObject} from a 3D model
and adds it to the specified scene.
IAssetEvents are emitted to event listener attached to the context.
This function blocks the current thread while loading the model
but loads the textures asynchronously in the background.
<p>
If you are loadin... | [
"Loads",
"a",
"hierarchy",
"of",
"scene",
"objects",
"{",
"@link",
"GVRSceneObject",
"}",
"from",
"a",
"3D",
"model",
"and",
"adds",
"it",
"to",
"the",
"specified",
"scene",
".",
"IAssetEvents",
"are",
"emitted",
"to",
"event",
"listener",
"attached",
"to",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L1092-L1109 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputBuffer.java | DerInputBuffer.getBigInteger | BigInteger getBigInteger(int len, boolean makePositive) throws IOException {
if (len > available())
throw new IOException("short read of integer");
if (len == 0) {
throw new IOException("Invalid encoding: zero length Int value");
}
byte[] bytes = new byte[len];
... | java | BigInteger getBigInteger(int len, boolean makePositive) throws IOException {
if (len > available())
throw new IOException("short read of integer");
if (len == 0) {
throw new IOException("Invalid encoding: zero length Int value");
}
byte[] bytes = new byte[len];
... | [
"BigInteger",
"getBigInteger",
"(",
"int",
"len",
",",
"boolean",
"makePositive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
">",
"available",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"short read of integer\"",
")",
";",
"if",
"(",
"len... | Returns the integer which takes up the specified number
of bytes in this buffer as a BigInteger.
@param len the number of bytes to use.
@param makePositive whether to always return a positive value,
irrespective of actual encoding
@return the integer as a BigInteger. | [
"Returns",
"the",
"integer",
"which",
"takes",
"up",
"the",
"specified",
"number",
"of",
"bytes",
"in",
"this",
"buffer",
"as",
"a",
"BigInteger",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerInputBuffer.java#L149-L172 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.checkRatio | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
float value = conf.getFloat(key);
Preconditions.checkState(value <= 1.0, "Property %s must not exceed 1, but it is set to %s",
key.getName(), value);
Preconditions.checkState(value >= 0.0, "Property %s must be non-negative,... | java | public static float checkRatio(AlluxioConfiguration conf, PropertyKey key) {
float value = conf.getFloat(key);
Preconditions.checkState(value <= 1.0, "Property %s must not exceed 1, but it is set to %s",
key.getName(), value);
Preconditions.checkState(value >= 0.0, "Property %s must be non-negative,... | [
"public",
"static",
"float",
"checkRatio",
"(",
"AlluxioConfiguration",
"conf",
",",
"PropertyKey",
"key",
")",
"{",
"float",
"value",
"=",
"conf",
".",
"getFloat",
"(",
"key",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"value",
"<=",
"1.0",
",",
"... | Checks that the given property key is a ratio from 0.0 and 1.0, throwing an exception if it is
not.
@param conf the configuration for looking up the property key
@param key the property key
@return the property value | [
"Checks",
"that",
"the",
"given",
"property",
"key",
"is",
"a",
"ratio",
"from",
"0",
".",
"0",
"and",
"1",
".",
"0",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"not",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L318-L325 |
mike10004/common-helper | imnetio-helper/src/main/java/com/github/mike10004/common/image/ImageInfo.java | ImageInfo.run | private static void run(String sourceName, InputStream in, ImageInfo imageInfo, boolean verbose) {
imageInfo.setInput(in);
imageInfo.setDetermineImageNumber(true);
imageInfo.setCollectComments(verbose);
if (imageInfo.check()) {
print(sourceName, imageInfo, verbose);
}
} | java | private static void run(String sourceName, InputStream in, ImageInfo imageInfo, boolean verbose) {
imageInfo.setInput(in);
imageInfo.setDetermineImageNumber(true);
imageInfo.setCollectComments(verbose);
if (imageInfo.check()) {
print(sourceName, imageInfo, verbose);
}
} | [
"private",
"static",
"void",
"run",
"(",
"String",
"sourceName",
",",
"InputStream",
"in",
",",
"ImageInfo",
"imageInfo",
",",
"boolean",
"verbose",
")",
"{",
"imageInfo",
".",
"setInput",
"(",
"in",
")",
";",
"imageInfo",
".",
"setDetermineImageNumber",
"(",
... | /* private String readLine(int firstChar) throws IOException {
StringBuffer result = new StringBuffer();
result.append((char)firstChar);
return readLine(result);
} | [
"/",
"*",
"private",
"String",
"readLine",
"(",
"int",
"firstChar",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"()",
";",
"result",
".",
"append",
"((",
"char",
")",
"firstChar",
")",
";",
"return",
"readLine",
... | train | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/imnetio-helper/src/main/java/com/github/mike10004/common/image/ImageInfo.java#L1248-L1255 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java | NetworkInfo.of | public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) {
return newBuilder(networkId, configuration).build();
} | java | public static NetworkInfo of(NetworkId networkId, NetworkConfiguration configuration) {
return newBuilder(networkId, configuration).build();
} | [
"public",
"static",
"NetworkInfo",
"of",
"(",
"NetworkId",
"networkId",
",",
"NetworkConfiguration",
"configuration",
")",
"{",
"return",
"newBuilder",
"(",
"networkId",
",",
"configuration",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a {@code NetworkInfo} object given the network identity. Use {@link
StandardNetworkConfiguration} to create a standard network with associated address range. Use
{@link SubnetNetworkConfiguration} to create a network that supports subnetworks, up to one per
region, each with its own address range. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/NetworkInfo.java#L268-L270 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newRelation | public Relation newRelation(String id, Relational from, Relational to) {
idManager.updateCounter(AnnotationType.RELATION, id);
Relation newRelation = new Relation(id, from, to);
annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION);
return newRelation;
} | java | public Relation newRelation(String id, Relational from, Relational to) {
idManager.updateCounter(AnnotationType.RELATION, id);
Relation newRelation = new Relation(id, from, to);
annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION);
return newRelation;
} | [
"public",
"Relation",
"newRelation",
"(",
"String",
"id",
",",
"Relational",
"from",
",",
"Relational",
"to",
")",
"{",
"idManager",
".",
"updateCounter",
"(",
"AnnotationType",
".",
"RELATION",
",",
"id",
")",
";",
"Relation",
"newRelation",
"=",
"new",
"Re... | Creates a new relation between entities and/or sentiment features. It receives its ID as an argument. The relation is added to the document.
@param id the ID of the relation
@param from source of the relation
@param to target of the relation
@return a new relation | [
"Creates",
"a",
"new",
"relation",
"between",
"entities",
"and",
"/",
"or",
"sentiment",
"features",
".",
"It",
"receives",
"its",
"ID",
"as",
"an",
"argument",
".",
"The",
"relation",
"is",
"added",
"to",
"the",
"document",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L984-L989 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.getCache | private static CmsXmlContainerPage getCache(CmsObject cms, CmsResource resource, boolean keepEncoding) {
if (resource instanceof I_CmsHistoryResource) {
return null;
}
return getCache().getCacheContainerPage(
getCache().getCacheKey(resource.getStructureId(), keepEncoding... | java | private static CmsXmlContainerPage getCache(CmsObject cms, CmsResource resource, boolean keepEncoding) {
if (resource instanceof I_CmsHistoryResource) {
return null;
}
return getCache().getCacheContainerPage(
getCache().getCacheKey(resource.getStructureId(), keepEncoding... | [
"private",
"static",
"CmsXmlContainerPage",
"getCache",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"boolean",
"keepEncoding",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"I_CmsHistoryResource",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Returns the cached container page.<p>
@param cms the cms context
@param resource the container page resource
@param keepEncoding if to keep the encoding while unmarshalling
@return the cached container page, or <code>null</code> if not found | [
"Returns",
"the",
"cached",
"container",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L436-L444 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.isValidRememberMeCookie | protected boolean isValidRememberMeCookie(String userKey, String expireDate) {
final String currentDate = formatForRememberMeExpireDate(timeManager.currentHandyDate());
if (currentDate.compareTo(expireDate) < 0) { // String v.s. String
return true; // valid access token within time limit
... | java | protected boolean isValidRememberMeCookie(String userKey, String expireDate) {
final String currentDate = formatForRememberMeExpireDate(timeManager.currentHandyDate());
if (currentDate.compareTo(expireDate) < 0) { // String v.s. String
return true; // valid access token within time limit
... | [
"protected",
"boolean",
"isValidRememberMeCookie",
"(",
"String",
"userKey",
",",
"String",
"expireDate",
")",
"{",
"final",
"String",
"currentDate",
"=",
"formatForRememberMeExpireDate",
"(",
"timeManager",
".",
"currentHandyDate",
"(",
")",
")",
";",
"if",
"(",
... | Are the user ID and expire date extracted from cookie valid?
@param userKey The key of the login user. (NotNull)
@param expireDate The string expression for expire date of remember-me access token. (NotNull)
@return Is a validation for remember-me OK? | [
"Are",
"the",
"user",
"ID",
"and",
"expire",
"date",
"extracted",
"from",
"cookie",
"valid?"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L593-L601 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java | ElemLiteralResult.throwDOMException | public void throwDOMException(short code, String msg)
{
String themsg = XSLMessages.createMessage(msg, null);
throw new DOMException(code, themsg);
} | java | public void throwDOMException(short code, String msg)
{
String themsg = XSLMessages.createMessage(msg, null);
throw new DOMException(code, themsg);
} | [
"public",
"void",
"throwDOMException",
"(",
"short",
"code",
",",
"String",
"msg",
")",
"{",
"String",
"themsg",
"=",
"XSLMessages",
".",
"createMessage",
"(",
"msg",
",",
"null",
")",
";",
"throw",
"new",
"DOMException",
"(",
"code",
",",
"themsg",
")",
... | Throw a DOMException
@param msg key of the error that occured. | [
"Throw",
"a",
"DOMException"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java#L1470-L1476 |
opentracing-contrib/java-kafka-client | opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java | TracingKafkaUtils.extractSpanContext | public static SpanContext extractSpanContext(Headers headers, Tracer tracer) {
return tracer
.extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers, true));
} | java | public static SpanContext extractSpanContext(Headers headers, Tracer tracer) {
return tracer
.extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers, true));
} | [
"public",
"static",
"SpanContext",
"extractSpanContext",
"(",
"Headers",
"headers",
",",
"Tracer",
"tracer",
")",
"{",
"return",
"tracer",
".",
"extract",
"(",
"Format",
".",
"Builtin",
".",
"TEXT_MAP",
",",
"new",
"HeadersMapExtractAdapter",
"(",
"headers",
","... | Extract Span Context from Consumer record headers
@param headers Consumer record headers
@return span context | [
"Extract",
"Span",
"Context",
"from",
"Consumer",
"record",
"headers"
] | train | https://github.com/opentracing-contrib/java-kafka-client/blob/e3aeec8d68d3a2dead89b9dbdfea3791817e1a26/opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java#L52-L55 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java | Ingest.getLagBytes | public long getLagBytes() {
try {
if (inputEditStream != null && inputEditStream.isInProgress()) {
// for file journals it may happen that we read a segment finalized
// by primary, but not refreshed by the standby, so length() returns 0
// hence we take max(-1,lag)
return Math... | java | public long getLagBytes() {
try {
if (inputEditStream != null && inputEditStream.isInProgress()) {
// for file journals it may happen that we read a segment finalized
// by primary, but not refreshed by the standby, so length() returns 0
// hence we take max(-1,lag)
return Math... | [
"public",
"long",
"getLagBytes",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"inputEditStream",
"!=",
"null",
"&&",
"inputEditStream",
".",
"isInProgress",
"(",
")",
")",
"{",
"// for file journals it may happen that we read a segment finalized",
"// by primary, but not refresh... | Returns the distance in bytes between the current position inside of the
edits log and the length of the edits log | [
"Returns",
"the",
"distance",
"in",
"bytes",
"between",
"the",
"current",
"position",
"inside",
"of",
"the",
"edits",
"log",
"and",
"the",
"length",
"of",
"the",
"edits",
"log"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L169-L183 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java | HostAddress.withDefaultPort | public HostAddress withDefaultPort(int defaultPort)
{
if (!isValidPort(defaultPort)) {
throw new IllegalArgumentException("Port number out of range: " + defaultPort);
}
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAddress(host... | java | public HostAddress withDefaultPort(int defaultPort)
{
if (!isValidPort(defaultPort)) {
throw new IllegalArgumentException("Port number out of range: " + defaultPort);
}
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAddress(host... | [
"public",
"HostAddress",
"withDefaultPort",
"(",
"int",
"defaultPort",
")",
"{",
"if",
"(",
"!",
"isValidPort",
"(",
"defaultPort",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Port number out of range: \"",
"+",
"defaultPort",
")",
";",
"}",... | Provide a default port if the parsed string contained only a host.
<p>
You can chain this after {@link #fromString(String)} to include a port in
case the port was omitted from the input string. If a port was already
provided, then this method is a no-op.
@param defaultPort a port number, from [0..65535]
@return a Hos... | [
"Provide",
"a",
"default",
"port",
"if",
"the",
"parsed",
"string",
"contained",
"only",
"a",
"host",
".",
"<p",
">",
"You",
"can",
"chain",
"this",
"after",
"{",
"@link",
"#fromString",
"(",
"String",
")",
"}",
"to",
"include",
"a",
"port",
"in",
"cas... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java#L232-L242 |
google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeMessagesProvider.java | FakeMessagesProvider.getFake | @Override
@SuppressWarnings("unchecked") // safe since the proxy implements type
public T getFake(Class<?> type) {
return (T) Proxy.newProxyInstance(FakeMessagesProvider.class.getClassLoader(), new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object pro... | java | @Override
@SuppressWarnings("unchecked") // safe since the proxy implements type
public T getFake(Class<?> type) {
return (T) Proxy.newProxyInstance(FakeMessagesProvider.class.getClassLoader(), new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object pro... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// safe since the proxy implements type",
"public",
"T",
"getFake",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"T",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"FakeMessages... | Returns a new instance of the given type that implements methods as
described in the class description.
@param type interface to be implemented by the returned type. | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"given",
"type",
"that",
"implements",
"methods",
"as",
"described",
"in",
"the",
"class",
"description",
"."
] | train | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeMessagesProvider.java#L45-L68 |
sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.createPersistent | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
createPersistent(path, createParents, ZooDefs.Ids.OPEN_ACL_UNSAFE);
} | java | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
createPersistent(path, createParents, ZooDefs.Ids.OPEN_ACL_UNSAFE);
} | [
"public",
"void",
"createPersistent",
"(",
"String",
"path",
",",
"boolean",
"createParents",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"createPersistent",
"(",
"path",
",",
"createParents... | Create a persistent node and set its ACLs.
@param path
@param createParents
if true all parent dirs are created as well and no {@link ZkNodeExistsException} is thrown in case the
path already exists
@throws ZkInterruptedException
if operation was interrupted, or a required reconnection got interrupted
@throws IllegalA... | [
"Create",
"a",
"persistent",
"node",
"and",
"set",
"its",
"ACLs",
"."
] | train | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L270-L272 |
alkacon/opencms-core | src/org/opencms/file/collectors/CmsDefaultResourceCollector.java | CmsDefaultResourceCollector.allInFolderNavPos | protected List<CmsResource> allInFolderNavPos(CmsObject cms, String param, boolean readSubTree, int numResults)
throws CmsException {
CmsCollectorData data = new CmsCollectorData(param);
String foldername = CmsResource.getFolderPath(data.getFileName());
CmsResourceFilter filter = CmsResour... | java | protected List<CmsResource> allInFolderNavPos(CmsObject cms, String param, boolean readSubTree, int numResults)
throws CmsException {
CmsCollectorData data = new CmsCollectorData(param);
String foldername = CmsResource.getFolderPath(data.getFileName());
CmsResourceFilter filter = CmsResour... | [
"protected",
"List",
"<",
"CmsResource",
">",
"allInFolderNavPos",
"(",
"CmsObject",
"cms",
",",
"String",
"param",
",",
"boolean",
"readSubTree",
",",
"int",
"numResults",
")",
"throws",
"CmsException",
"{",
"CmsCollectorData",
"data",
"=",
"new",
"CmsCollectorDa... | Collects all resources in a folder (or subtree) sorted by the NavPos property.<p>
@param cms the current user's Cms object
@param param the collector's parameter(s)
@param readSubTree if true, collects all resources in the subtree
@param numResults the number of results
@return a List of Cms resources found by the col... | [
"Collects",
"all",
"resources",
"in",
"a",
"folder",
"(",
"or",
"subtree",
")",
"sorted",
"by",
"the",
"NavPos",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/CmsDefaultResourceCollector.java#L255-L304 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L3_L93 | @Pure
public static Point2d L3_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93... | java | @Pure
public static Point2d L3_L93(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L3_L93",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_3_N",
",",
"LAMBERT_3_C",
",",
"LAMBERT_3_XS",
",",
... | This function convert France Lambert III coordinate to
France Lambert 93 coordinate.
@param x is the coordinate in France Lambert III
@param y is the coordinate in France Lambert III
@return the France Lambert 93 coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"III",
"coordinate",
"to",
"France",
"Lambert",
"93",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L651-L664 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/FilterVirtualFileVisitor.java | FilterVirtualFileVisitor.checkAttributes | private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) {
if (filter == null) {
throw MESSAGES.nullArgument("filter");
}
// Specified
if (attributes != null) { return attributes; }
// From the filter
if (filter ... | java | private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) {
if (filter == null) {
throw MESSAGES.nullArgument("filter");
}
// Specified
if (attributes != null) { return attributes; }
// From the filter
if (filter ... | [
"private",
"static",
"VisitorAttributes",
"checkAttributes",
"(",
"VirtualFileFilter",
"filter",
",",
"VisitorAttributes",
"attributes",
")",
"{",
"if",
"(",
"filter",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"filter\"",
")",
";",
... | Check the attributes
@param filter the filter
@param attributes the attributes
@return the attributes
@throws IllegalArgumentException for a null filter | [
"Check",
"the",
"attributes"
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/FilterVirtualFileVisitor.java#L57-L67 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newUserException | public static UserException newUserException(Throwable cause, String message, Object... args) {
return new UserException(format(message, args), cause);
} | java | public static UserException newUserException(Throwable cause, String message, Object... args) {
return new UserException(format(message, args), cause);
} | [
"public",
"static",
"UserException",
"newUserException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"UserException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause",
")",
";",
... | Constructs and initializes a new {@link UserException} 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 UserException} was thrown.
@param message {@link String} describing the {@lin... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"UserException",
"}",
"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/ElementsExceptionsFactory.java#L943-L945 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/text/Selection.java | Selection.setSelection | public static void setSelection(Spannable text, int start, int stop) {
// int len = text.length();
// start = pin(start, 0, len); XXX remove unless we really need it
// stop = pin(stop, 0, len);
int ostart = getSelectionStart(text);
int oend = getSelectionEnd(text);
if... | java | public static void setSelection(Spannable text, int start, int stop) {
// int len = text.length();
// start = pin(start, 0, len); XXX remove unless we really need it
// stop = pin(stop, 0, len);
int ostart = getSelectionStart(text);
int oend = getSelectionEnd(text);
if... | [
"public",
"static",
"void",
"setSelection",
"(",
"Spannable",
"text",
",",
"int",
"start",
",",
"int",
"stop",
")",
"{",
"// int len = text.length();",
"// start = pin(start, 0, len); XXX remove unless we really need it",
"// stop = pin(stop, 0, len);",
"int",
"ostart",
"=",... | Set the selection anchor to <code>start</code> and the selection edge
to <code>stop</code>. | [
"Set",
"the",
"selection",
"anchor",
"to",
"<code",
">",
"start<",
"/",
"code",
">",
"and",
"the",
"selection",
"edge",
"to",
"<code",
">",
"stop<",
"/",
"code",
">",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/text/Selection.java#L65-L79 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedParetoDistribution.java | GeneralizedParetoDistribution.logpdf | public static double logpdf(double x, double mu, double sigma, double xi) {
x = (x - mu) / sigma;
// Check support:
if(x < 0 || (xi < 0 && x > -1. / xi)) {
return Double.NEGATIVE_INFINITY;
}
if(xi == 0) {
return Double.POSITIVE_INFINITY;
}
return ((xi == -1) ? 0. : FastMath.log(1... | java | public static double logpdf(double x, double mu, double sigma, double xi) {
x = (x - mu) / sigma;
// Check support:
if(x < 0 || (xi < 0 && x > -1. / xi)) {
return Double.NEGATIVE_INFINITY;
}
if(xi == 0) {
return Double.POSITIVE_INFINITY;
}
return ((xi == -1) ? 0. : FastMath.log(1... | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"xi",
")",
"{",
"x",
"=",
"(",
"x",
"-",
"mu",
")",
"/",
"sigma",
";",
"// Check support:",
"if",
"(",
"x",
"<",
"0",
"||",
"(... | PDF of GPD distribution
@param x Value
@param mu Location parameter mu
@param sigma Scale parameter sigma
@param xi Shape parameter xi (= -kappa)
@return PDF at position x. | [
"PDF",
"of",
"GPD",
"distribution"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedParetoDistribution.java#L143-L153 |
powermock/powermock | powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/SuppressCode.java | SuppressCode.suppressMethod | public static synchronized void suppressMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
Method method = null;
if (parameterTypes.length > 0) {
method = Whitebox.getMethod(clazz, methodName, parameterTypes);
} else {
method = WhiteboxImpl.findMethodOrThrowException(clazz, methodName, p... | java | public static synchronized void suppressMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
Method method = null;
if (parameterTypes.length > 0) {
method = Whitebox.getMethod(clazz, methodName, parameterTypes);
} else {
method = WhiteboxImpl.findMethodOrThrowException(clazz, methodName, p... | [
"public",
"static",
"synchronized",
"void",
"suppressMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"Method",
"method",
"=",
"null",
";",
"if",
"(",
"paramete... | Suppress a specific method call. Use this for overloaded methods. | [
"Suppress",
"a",
"specific",
"method",
"call",
".",
"Use",
"this",
"for",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/SuppressCode.java#L235-L243 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PartitionReplicaSyncRequest.java | PartitionReplicaSyncRequest.sendResponse | private void sendResponse(Collection<Operation> operations, ServiceNamespace ns) {
NodeEngine nodeEngine = getNodeEngine();
PartitionReplicaSyncResponse syncResponse = createResponse(operations, ns);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.i... | java | private void sendResponse(Collection<Operation> operations, ServiceNamespace ns) {
NodeEngine nodeEngine = getNodeEngine();
PartitionReplicaSyncResponse syncResponse = createResponse(operations, ns);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.i... | [
"private",
"void",
"sendResponse",
"(",
"Collection",
"<",
"Operation",
">",
"operations",
",",
"ServiceNamespace",
"ns",
")",
"{",
"NodeEngine",
"nodeEngine",
"=",
"getNodeEngine",
"(",
")",
";",
"PartitionReplicaSyncResponse",
"syncResponse",
"=",
"createResponse",
... | Send a synchronization response to the caller replica containing the replication operations to be executed | [
"Send",
"a",
"synchronization",
"response",
"to",
"the",
"caller",
"replica",
"containing",
"the",
"replication",
"operations",
"to",
"be",
"executed"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PartitionReplicaSyncRequest.java#L192-L208 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/Query.java | Query.withStringIgnoreCase | public static Query withStringIgnoreCase(String field, String value) {
return Query.withString(field, value, true);
} | java | public static Query withStringIgnoreCase(String field, String value) {
return Query.withString(field, value, true);
} | [
"public",
"static",
"Query",
"withStringIgnoreCase",
"(",
"String",
"field",
",",
"String",
"value",
")",
"{",
"return",
"Query",
".",
"withString",
"(",
"field",
",",
"value",
",",
"true",
")",
";",
"}"
] | <pre>
{ field: <field>, regex: <^string$>, caseInsensitive: true, ... }
</pre> | [
"<pre",
">",
"{",
"field",
":",
"<field",
">",
"regex",
":",
"<^string$",
">",
"caseInsensitive",
":",
"true",
"...",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/Query.java#L211-L213 |
netty/netty | codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java | ByteToMessageDecoder.decodeRemovalReentryProtection | final void decodeRemovalReentryProtection(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
throws Exception {
decodeState = STATE_CALLING_CHILD_DECODE;
try {
decode(ctx, in, out);
} finally {
boolean removePending = decodeState == STATE_HANDLER_REMOVED... | java | final void decodeRemovalReentryProtection(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
throws Exception {
decodeState = STATE_CALLING_CHILD_DECODE;
try {
decode(ctx, in, out);
} finally {
boolean removePending = decodeState == STATE_HANDLER_REMOVED... | [
"final",
"void",
"decodeRemovalReentryProtection",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"in",
",",
"List",
"<",
"Object",
">",
"out",
")",
"throws",
"Exception",
"{",
"decodeState",
"=",
"STATE_CALLING_CHILD_DECODE",
";",
"try",
"{",
"decode",
"(",... | Decode the from one {@link ByteBuf} to an other. This method will be called till either the input
{@link ByteBuf} has nothing to read when return from this method or till nothing was read from the input
{@link ByteBuf}.
@param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belo... | [
"Decode",
"the",
"from",
"one",
"{",
"@link",
"ByteBuf",
"}",
"to",
"an",
"other",
".",
"This",
"method",
"will",
"be",
"called",
"till",
"either",
"the",
"input",
"{",
"@link",
"ByteBuf",
"}",
"has",
"nothing",
"to",
"read",
"when",
"return",
"from",
... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java#L498-L510 |
foundation-runtime/monitoring | monitoring-api/src/main/java/com/cisco/oss/foundation/monitoring/ServerInfo.java | ServerInfo.sendAttributeChangeNotification | @Override
public void sendAttributeChangeNotification(String msg, String attributeName, String attributeType,
Object oldValue, Object newValue) {
LOGGER.debug("Sending Notification " + (attrNotificationSeq + 1) + ":" + msg + ":"
+ attributeName... | java | @Override
public void sendAttributeChangeNotification(String msg, String attributeName, String attributeType,
Object oldValue, Object newValue) {
LOGGER.debug("Sending Notification " + (attrNotificationSeq + 1) + ":" + msg + ":"
+ attributeName... | [
"@",
"Override",
"public",
"void",
"sendAttributeChangeNotification",
"(",
"String",
"msg",
",",
"String",
"attributeName",
",",
"String",
"attributeType",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Sending Noti... | Sends a notification to registered clients about the change in value of
an attribute.
@param msg A String containing the message of the notification.
@param attributeName A String giving the name of the attribute.
@param attributeType A String containing the type of the attribute.
@param oldValue An obj... | [
"Sends",
"a",
"notification",
"to",
"registered",
"clients",
"about",
"the",
"change",
"in",
"value",
"of",
"an",
"attribute",
"."
] | train | https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-api/src/main/java/com/cisco/oss/foundation/monitoring/ServerInfo.java#L117-L127 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.debugSendAsync | public Observable<DebugSendResponseInner> debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<DebugSendResponseInner>, DebugSendResponseInner>() ... | java | public Observable<DebugSendResponseInner> debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<DebugSendResponseInner>, DebugSendResponseInner>() ... | [
"public",
"Observable",
"<",
"DebugSendResponseInner",
">",
"debugSendAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"debugSendWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | test send a push notification.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DebugSendResponseInner object | [
"test",
"send",
"a",
"push",
"notification",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L742-L749 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java | MutableNode.splitKey | MutableNode splitKey(final int prefixLength, final byte nextByte) {
final byte[] keyBytes = keySequence.getBytesUnsafe();
final ByteIterable prefixKey;
if (prefixLength == 0) {
prefixKey = ByteIterable.EMPTY;
} else if (prefixLength == 1) {
prefixKey = SingleByteI... | java | MutableNode splitKey(final int prefixLength, final byte nextByte) {
final byte[] keyBytes = keySequence.getBytesUnsafe();
final ByteIterable prefixKey;
if (prefixLength == 0) {
prefixKey = ByteIterable.EMPTY;
} else if (prefixLength == 1) {
prefixKey = SingleByteI... | [
"MutableNode",
"splitKey",
"(",
"final",
"int",
"prefixLength",
",",
"final",
"byte",
"nextByte",
")",
"{",
"final",
"byte",
"[",
"]",
"keyBytes",
"=",
"keySequence",
".",
"getBytesUnsafe",
"(",
")",
";",
"final",
"ByteIterable",
"prefixKey",
";",
"if",
"(",... | Splits current node onto two ones: prefix defined by prefix length and suffix linked with suffix via nextByte.
@param prefixLength length of the prefix.
@param nextByte next byte after prefix linking it with suffix.
@return the prefix node. | [
"Splits",
"current",
"node",
"onto",
"two",
"ones",
":",
"prefix",
"defined",
"by",
"prefix",
"length",
"and",
"suffix",
"linked",
"with",
"suffix",
"via",
"nextByte",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java#L209-L234 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendOnPlayStatus | private void sendOnPlayStatus(String code, int duration, long bytes) {
if (log.isDebugEnabled()) {
log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
}
// create the buffer
IoBuffer buf = IoBuffer.allocate(102);
buf.setAutoExpa... | java | private void sendOnPlayStatus(String code, int duration, long bytes) {
if (log.isDebugEnabled()) {
log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
}
// create the buffer
IoBuffer buf = IoBuffer.allocate(102);
buf.setAutoExpa... | [
"private",
"void",
"sendOnPlayStatus",
"(",
"String",
"code",
",",
"int",
"duration",
",",
"long",
"bytes",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending onPlayStatus - code: {} duration: {} bytes: {}... | Sends an onPlayStatus message.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
@param code
@param duration
@param bytes | [
"Sends",
"an",
"onPlayStatus",
"message",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1163-L1194 |
symulakr/gwt-generators | src/main/java/com/github/symulakr/gwt/generators/rebind/Logger.java | Logger.die | public void die(String message, Object... params) throws UnableToCompleteException
{
internalLog(TreeLogger.ERROR, String.format(message, params));
throw new UnableToCompleteException();
} | java | public void die(String message, Object... params) throws UnableToCompleteException
{
internalLog(TreeLogger.ERROR, String.format(message, params));
throw new UnableToCompleteException();
} | [
"public",
"void",
"die",
"(",
"String",
"message",
",",
"Object",
"...",
"params",
")",
"throws",
"UnableToCompleteException",
"{",
"internalLog",
"(",
"TreeLogger",
".",
"ERROR",
",",
"String",
".",
"format",
"(",
"message",
",",
"params",
")",
")",
";",
... | Post an error message and halt processing. This method always throws an {@link com.google.gwt.core.ext.UnableToCompleteException} | [
"Post",
"an",
"error",
"message",
"and",
"halt",
"processing",
".",
"This",
"method",
"always",
"throws",
"an",
"{"
] | train | https://github.com/symulakr/gwt-generators/blob/fb34ea6a5dcc9e83b5ab2e420b638bbef3cfe589/src/main/java/com/github/symulakr/gwt/generators/rebind/Logger.java#L46-L50 |
pierre/serialization | hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/ThriftStorage.java | ThriftStorage.setLocation | @Override
public void setLocation(String location, Job job) throws IOException
{
setIOSerializations(job.getConfiguration());
FileInputFormat.setInputPaths(job, location);
} | java | @Override
public void setLocation(String location, Job job) throws IOException
{
setIOSerializations(job.getConfiguration());
FileInputFormat.setInputPaths(job, location);
} | [
"@",
"Override",
"public",
"void",
"setLocation",
"(",
"String",
"location",
",",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"setIOSerializations",
"(",
"job",
".",
"getConfiguration",
"(",
")",
")",
";",
"FileInputFormat",
".",
"setInputPaths",
"(",
"jo... | Communicate to the loader the location of the object(s) being loaded.
The location string passed to the LoadFunc here is the return value of
{@link org.apache.pig.LoadFunc#relativeToAbsolutePath(String, org.apache.hadoop.fs.Path)}. Implementations
should use this method to communicate the location (and any other inform... | [
"Communicate",
"to",
"the",
"loader",
"the",
"location",
"of",
"the",
"object",
"(",
"s",
")",
"being",
"loaded",
".",
"The",
"location",
"string",
"passed",
"to",
"the",
"LoadFunc",
"here",
"is",
"the",
"return",
"value",
"of",
"{",
"@link",
"org",
".",... | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/ThriftStorage.java#L101-L106 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java | CCheckOracle.checkAlive | private List<Metric> checkAlive(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
List<Metric> metricList = new ArrayList<Metric>();
Statement stmt = null;
ResultSet rs = null;
long lStart = System.currentTimeMillis();
try {
... | java | private List<Metric> checkAlive(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
List<Metric> metricList = new ArrayList<Metric>();
Statement stmt = null;
ResultSet rs = null;
long lStart = System.currentTimeMillis();
try {
... | [
"private",
"List",
"<",
"Metric",
">",
"checkAlive",
"(",
"final",
"Connection",
"c",
",",
"final",
"ICommandLine",
"cl",
")",
"throws",
"BadThresholdException",
",",
"SQLException",
"{",
"List",
"<",
"Metric",
">",
"metricList",
"=",
"new",
"ArrayList",
"<",
... | Checks if the database is reacheble.
@param c
The connection to the database
@param cl
The command line as received from JNRPE
@return The plugin result
@throws BadThresholdException
-
@throws SQLException | [
"Checks",
"if",
"the",
"database",
"is",
"reacheble",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java#L96-L123 |
lecousin/java-compression | lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java | Optimum.set3 | void set3(int newPrice, int optCur, int back2, int len2, int back) {
price = newPrice;
optPrev = optCur + len2 + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = true;
optPrev2 = optCur;
backPrev2 = back2;
} | java | void set3(int newPrice, int optCur, int back2, int len2, int back) {
price = newPrice;
optPrev = optCur + len2 + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = true;
optPrev2 = optCur;
backPrev2 = back2;
} | [
"void",
"set3",
"(",
"int",
"newPrice",
",",
"int",
"optCur",
",",
"int",
"back2",
",",
"int",
"len2",
",",
"int",
"back",
")",
"{",
"price",
"=",
"newPrice",
";",
"optPrev",
"=",
"optCur",
"+",
"len2",
"+",
"1",
";",
"backPrev",
"=",
"back",
";",
... | Sets to indicate three LZMA symbols of which the second one
is a literal. | [
"Sets",
"to",
"indicate",
"three",
"LZMA",
"symbols",
"of",
"which",
"the",
"second",
"one",
"is",
"a",
"literal",
"."
] | train | https://github.com/lecousin/java-compression/blob/19c8001fb3655817a52a3b8ab69501e3df7a2b4a/lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java#L54-L62 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.attachMetadataCache | public void attachMetadataCache(SlotReference slot, File file)
throws IOException {
ensureRunning();
if (slot.player < 1 || slot.player > 4 || DeviceFinder.getInstance().getLatestAnnouncementFrom(slot.player) == null) {
throw new IllegalArgumentException("unable to attach metadat... | java | public void attachMetadataCache(SlotReference slot, File file)
throws IOException {
ensureRunning();
if (slot.player < 1 || slot.player > 4 || DeviceFinder.getInstance().getLatestAnnouncementFrom(slot.player) == null) {
throw new IllegalArgumentException("unable to attach metadat... | [
"public",
"void",
"attachMetadataCache",
"(",
"SlotReference",
"slot",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"ensureRunning",
"(",
")",
";",
"if",
"(",
"slot",
".",
"player",
"<",
"1",
"||",
"slot",
".",
"player",
">",
"4",
"||",
"Devic... | Attach a metadata cache file to a particular player media slot, so the cache will be used instead of querying
the player for metadata. This supports operation with metadata during shows where DJs are using all four player
numbers and heavily cross-linking between them.
If the media is ejected from that player slot, th... | [
"Attach",
"a",
"metadata",
"cache",
"file",
"to",
"a",
"particular",
"player",
"media",
"slot",
"so",
"the",
"cache",
"will",
"be",
"used",
"instead",
"of",
"querying",
"the",
"player",
"for",
"metadata",
".",
"This",
"supports",
"operation",
"with",
"metada... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L540-L563 |
google/closure-compiler | src/com/google/javascript/jscomp/ProcessClosurePrimitives.java | ProcessClosurePrimitives.processForwardDeclare | private void processForwardDeclare(Node n, Node parent) {
CodingConvention convention = compiler.getCodingConvention();
String typeDeclaration = null;
try {
typeDeclaration = Iterables.getOnlyElement(
convention.identifyTypeDeclarationCall(n));
} catch (NullPointerException | NoSuchElem... | java | private void processForwardDeclare(Node n, Node parent) {
CodingConvention convention = compiler.getCodingConvention();
String typeDeclaration = null;
try {
typeDeclaration = Iterables.getOnlyElement(
convention.identifyTypeDeclarationCall(n));
} catch (NullPointerException | NoSuchElem... | [
"private",
"void",
"processForwardDeclare",
"(",
"Node",
"n",
",",
"Node",
"parent",
")",
"{",
"CodingConvention",
"convention",
"=",
"compiler",
".",
"getCodingConvention",
"(",
")",
";",
"String",
"typeDeclaration",
"=",
"null",
";",
"try",
"{",
"typeDeclarati... | Process a goog.forwardDeclare() call and record the specified forward declaration. | [
"Process",
"a",
"goog",
".",
"forwardDeclare",
"()",
"call",
"and",
"record",
"the",
"specified",
"forward",
"declaration",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java#L927-L948 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java | AtomDODeserializer.addObjectProperties | private void addObjectProperties(Feed feed, DigitalObject obj)
throws ObjectIntegrityException {
PID pid;
try {
pid = new PID(feed.getId().toString());
} catch (MalformedPIDException e) {
throw new ObjectIntegrityException(e.getMessage(), e);
}
... | java | private void addObjectProperties(Feed feed, DigitalObject obj)
throws ObjectIntegrityException {
PID pid;
try {
pid = new PID(feed.getId().toString());
} catch (MalformedPIDException e) {
throw new ObjectIntegrityException(e.getMessage(), e);
}
... | [
"private",
"void",
"addObjectProperties",
"(",
"Feed",
"feed",
",",
"DigitalObject",
"obj",
")",
"throws",
"ObjectIntegrityException",
"{",
"PID",
"pid",
";",
"try",
"{",
"pid",
"=",
"new",
"PID",
"(",
"feed",
".",
"getId",
"(",
")",
".",
"toString",
"(",
... | Set the Fedora Object properties from the Feed metadata.
@throws ObjectIntegrityException | [
"Set",
"the",
"Fedora",
"Object",
"properties",
"from",
"the",
"Feed",
"metadata",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java#L160-L191 |
arquillian/arquillian-core | config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/StringPropertyReplacer.java | StringPropertyReplacer.replaceProperties | public static String replaceProperties(final String string) {
Properties props = System.getProperties();
for (Map.Entry<String, String> var : System.getenv().entrySet()) {
String propKey = ENV_VAR_BASE_PROPERTY_KEY + var.getKey();
// honor overridden environment variable (primari... | java | public static String replaceProperties(final String string) {
Properties props = System.getProperties();
for (Map.Entry<String, String> var : System.getenv().entrySet()) {
String propKey = ENV_VAR_BASE_PROPERTY_KEY + var.getKey();
// honor overridden environment variable (primari... | [
"public",
"static",
"String",
"replaceProperties",
"(",
"final",
"String",
"string",
")",
"{",
"Properties",
"props",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"var",
":",
"Sys... | Go through the input string and replace any occurrence of ${p} with
the System.getProtocolProperty(p) value. If there is no such property p defined,
then the ${p} reference will remain unchanged.
<p>
If the property reference is of the form ${p:v} and there is no such property p,
then the default value v will be return... | [
"Go",
"through",
"the",
"input",
"string",
"and",
"replace",
"any",
"occurrence",
"of",
"$",
"{",
"p",
"}",
"with",
"the",
"System",
".",
"getProtocolProperty",
"(",
"p",
")",
"value",
".",
"If",
"there",
"is",
"no",
"such",
"property",
"p",
"defined",
... | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/StringPropertyReplacer.java#L95-L105 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java | CompressorHttp2ConnectionEncoder.cleanup | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
if (compressor.finish()) {
for (;;) {
final ByteBuf buf = compressor.readOutbound();
if (buf == null) {
break;
}
buf.release();
}
}
... | java | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
if (compressor.finish()) {
for (;;) {
final ByteBuf buf = compressor.readOutbound();
if (buf == null) {
break;
}
buf.release();
}
}
... | [
"void",
"cleanup",
"(",
"Http2Stream",
"stream",
",",
"EmbeddedChannel",
"compressor",
")",
"{",
"if",
"(",
"compressor",
".",
"finish",
"(",
")",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"final",
"ByteBuf",
"buf",
"=",
"compressor",
".",
"readOutbound"... | Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}.
@param stream The stream for which {@code compressor} is the compressor for
@param compressor The compressor for {@code stream} | [
"Release",
"remaining",
"content",
"from",
"{",
"@link",
"EmbeddedChannel",
"}",
"and",
"remove",
"the",
"compressor",
"from",
"the",
"{",
"@link",
"Http2Stream",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L286-L298 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java | MessageMLContext.parseMarkdown | public void parseMarkdown(String message, JsonNode entities, JsonNode media) throws InvalidInputException {
this.messageML = markdownParser.parse(message, entities, media);
this.entityJson = messageML.asEntityJson(this.entityJson);
this.markdownRenderer = new MarkdownRenderer(messageML.asMarkdown());
} | java | public void parseMarkdown(String message, JsonNode entities, JsonNode media) throws InvalidInputException {
this.messageML = markdownParser.parse(message, entities, media);
this.entityJson = messageML.asEntityJson(this.entityJson);
this.markdownRenderer = new MarkdownRenderer(messageML.asMarkdown());
} | [
"public",
"void",
"parseMarkdown",
"(",
"String",
"message",
",",
"JsonNode",
"entities",
",",
"JsonNode",
"media",
")",
"throws",
"InvalidInputException",
"{",
"this",
".",
"messageML",
"=",
"markdownParser",
".",
"parse",
"(",
"message",
",",
"entities",
",",
... | Parse a Markdown message into its MessageMLV2 representation. Generates document tree structures for
serialization into output formats with the respective get() methods.
@param message string containing a message in Markdown
@param entities additional entity data in JSON | [
"Parse",
"a",
"Markdown",
"message",
"into",
"its",
"MessageMLV2",
"representation",
".",
"Generates",
"document",
"tree",
"structures",
"for",
"serialization",
"into",
"output",
"formats",
"with",
"the",
"respective",
"get",
"()",
"methods",
"."
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java#L83-L87 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java | ModelUtil.getPrototypeOrCentroid | public static NumberVector getPrototypeOrCentroid(Model model, Relation<? extends NumberVector> relation, DBIDs ids) {
assert (ids.size() > 0);
NumberVector v = getPrototype(model, relation);
return v != null ? v : Centroid.make(relation, ids);
} | java | public static NumberVector getPrototypeOrCentroid(Model model, Relation<? extends NumberVector> relation, DBIDs ids) {
assert (ids.size() > 0);
NumberVector v = getPrototype(model, relation);
return v != null ? v : Centroid.make(relation, ids);
} | [
"public",
"static",
"NumberVector",
"getPrototypeOrCentroid",
"(",
"Model",
"model",
",",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"DBIDs",
"ids",
")",
"{",
"assert",
"(",
"ids",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"N... | Get the representative vector for a cluster model, or compute the centroid.
@param model Model
@param relation Data relation (for representatives specified per DBID)
@param ids Cluster ids (must not be empty.
@return Some {@link NumberVector}. | [
"Get",
"the",
"representative",
"vector",
"for",
"a",
"cluster",
"model",
"or",
"compute",
"the",
"centroid",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java#L141-L145 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java | HystrixThreadPoolMetrics.getInstance | public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) {
// attempt to retrieve from cache first
HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(key.name());
if (threadPoolMetrics != null) {
... | java | public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) {
// attempt to retrieve from cache first
HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(key.name());
if (threadPoolMetrics != null) {
... | [
"public",
"static",
"HystrixThreadPoolMetrics",
"getInstance",
"(",
"HystrixThreadPoolKey",
"key",
",",
"ThreadPoolExecutor",
"threadPool",
",",
"HystrixThreadPoolProperties",
"properties",
")",
"{",
"// attempt to retrieve from cache first",
"HystrixThreadPoolMetrics",
"threadPool... | Get or create the {@link HystrixThreadPoolMetrics} instance for a given {@link HystrixThreadPoolKey}.
<p>
This is thread-safe and ensures only 1 {@link HystrixThreadPoolMetrics} per {@link HystrixThreadPoolKey}.
@param key
{@link HystrixThreadPoolKey} of {@link HystrixThreadPool} instance requesting the {@link Hystrix... | [
"Get",
"or",
"create",
"the",
"{",
"@link",
"HystrixThreadPoolMetrics",
"}",
"instance",
"for",
"a",
"given",
"{",
"@link",
"HystrixThreadPoolKey",
"}",
".",
"<p",
">",
"This",
"is",
"thread",
"-",
"safe",
"and",
"ensures",
"only",
"1",
"{",
"@link",
"Hyst... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java#L62-L79 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.createNameNode | private Name createNameNode(boolean checkActivation, int token) {
int beg = ts.tokenBeg;
String s = ts.getString();
int lineno = ts.lineno;
if (!"".equals(prevNameTokenString)) {
beg = prevNameTokenStart;
s = prevNameTokenString;
lineno = prevNameToken... | java | private Name createNameNode(boolean checkActivation, int token) {
int beg = ts.tokenBeg;
String s = ts.getString();
int lineno = ts.lineno;
if (!"".equals(prevNameTokenString)) {
beg = prevNameTokenStart;
s = prevNameTokenString;
lineno = prevNameToken... | [
"private",
"Name",
"createNameNode",
"(",
"boolean",
"checkActivation",
",",
"int",
"token",
")",
"{",
"int",
"beg",
"=",
"ts",
".",
"tokenBeg",
";",
"String",
"s",
"=",
"ts",
".",
"getString",
"(",
")",
";",
"int",
"lineno",
"=",
"ts",
".",
"lineno",
... | Create a {@code Name} node using the token info from the
last scanned name. In some cases we need to either synthesize
a name node, or we lost the name token information by peeking.
If the {@code token} parameter is not {@link Token#NAME}, then
we use token info saved in instance vars. | [
"Create",
"a",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L3748-L3773 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java | OGraphDatabase.getEdgesBetweenVertexes | public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2) {
return getEdgesBetweenVertexes(iVertex1, iVertex2, null, null);
} | java | public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2) {
return getEdgesBetweenVertexes(iVertex1, iVertex2, null, null);
} | [
"public",
"Set",
"<",
"ODocument",
">",
"getEdgesBetweenVertexes",
"(",
"final",
"ODocument",
"iVertex1",
",",
"final",
"ODocument",
"iVertex2",
")",
"{",
"return",
"getEdgesBetweenVertexes",
"(",
"iVertex1",
",",
"iVertex2",
",",
"null",
",",
"null",
")",
";",
... | Returns all the edges between the vertexes iVertex1 and iVertex2.
@param iVertex1
First Vertex
@param iVertex2
Second Vertex
@return The Set with the common Edges between the two vertexes. If edges aren't found the set is empty | [
"Returns",
"all",
"the",
"edges",
"between",
"the",
"vertexes",
"iVertex1",
"and",
"iVertex2",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java#L338-L340 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.cancelConsultationChat | public ApiSuccessResponse cancelConsultationChat(String id, CancelConsultData cancelConsultData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = cancelConsultationChatWithHttpInfo(id, cancelConsultData);
return resp.getData();
} | java | public ApiSuccessResponse cancelConsultationChat(String id, CancelConsultData cancelConsultData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = cancelConsultationChatWithHttpInfo(id, cancelConsultData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"cancelConsultationChat",
"(",
"String",
"id",
",",
"CancelConsultData",
"cancelConsultData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"cancelConsultationChatWithHttpInfo",
"(",
"id",
"... | Cancel a chat consultation request
Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#consultByQueue). If the agent has already accepted the invitation, the Workspace API can't cancel the consultation.
@param id T... | [
"Cancel",
"a",
"chat",
"consultation",
"request",
"Cancel",
"a",
"chat",
"consultation",
"request",
"that",
"was",
"initialized",
"by",
"calling",
"[",
"/",
"media",
"/",
"chat",
"/",
"interactions",
"/",
"{",
"id",
"}",
"/",
"consult",
"-",
"by",
"-",
"... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L408-L411 |
google/closure-compiler | src/com/google/javascript/jscomp/FileInstrumentationData.java | FileInstrumentationData.getBranchNode | Node getBranchNode(int lineNumber, int branchNumber) {
Preconditions.checkArgument(
lineNumber > 0, "Expected non-zero positive integer as line number: %s", lineNumber);
Preconditions.checkArgument(
branchNumber > 0, "Expected non-zero positive integer as branch number: %s", branchNumber);
... | java | Node getBranchNode(int lineNumber, int branchNumber) {
Preconditions.checkArgument(
lineNumber > 0, "Expected non-zero positive integer as line number: %s", lineNumber);
Preconditions.checkArgument(
branchNumber > 0, "Expected non-zero positive integer as branch number: %s", branchNumber);
... | [
"Node",
"getBranchNode",
"(",
"int",
"lineNumber",
",",
"int",
"branchNumber",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"lineNumber",
">",
"0",
",",
"\"Expected non-zero positive integer as line number: %s\"",
",",
"lineNumber",
")",
";",
"Preconditions",
... | Get the block node to be instrumented for branch coverage.
@param lineNumber 1-based line number
@param branchNumber 1-based branch number
@return the node of the conditional block. | [
"Get",
"the",
"block",
"node",
"to",
"be",
"instrumented",
"for",
"branch",
"coverage",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FileInstrumentationData.java#L139-L146 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java | Channels.newReader | public static Reader newReader(ReadableByteChannel ch,
String csName)
{
checkNotNull(csName, "csName");
return newReader(ch, Charset.forName(csName).newDecoder(), -1);
} | java | public static Reader newReader(ReadableByteChannel ch,
String csName)
{
checkNotNull(csName, "csName");
return newReader(ch, Charset.forName(csName).newDecoder(), -1);
} | [
"public",
"static",
"Reader",
"newReader",
"(",
"ReadableByteChannel",
"ch",
",",
"String",
"csName",
")",
"{",
"checkNotNull",
"(",
"csName",
",",
"\"csName\"",
")",
";",
"return",
"newReader",
"(",
"ch",
",",
"Charset",
".",
"forName",
"(",
"csName",
")",
... | Constructs a reader that decodes bytes from the given channel according
to the named charset.
<p> An invocation of this method of the form
<blockquote><pre>
Channels.newReader(ch, csname)</pre></blockquote>
behaves in exactly the same way as the expression
<blockquote><pre>
Channels.newReader(ch,
Charset.forName(cs... | [
"Constructs",
"a",
"reader",
"that",
"decodes",
"bytes",
"from",
"the",
"given",
"channel",
"according",
"to",
"the",
"named",
"charset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java#L386-L391 |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/flowable/Transformers.java | Transformers.collectStats | @SuppressWarnings("unchecked")
public static <T extends Number> FlowableTransformer<T, Statistics> collectStats() {
return (FlowableTransformer<T, Statistics>) CollectStatsHolder.INSTANCE;
} | java | @SuppressWarnings("unchecked")
public static <T extends Number> FlowableTransformer<T, Statistics> collectStats() {
return (FlowableTransformer<T, Statistics>) CollectStatsHolder.INSTANCE;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Number",
">",
"FlowableTransformer",
"<",
"T",
",",
"Statistics",
">",
"collectStats",
"(",
")",
"{",
"return",
"(",
"FlowableTransformer",
"<",
"T",
",",
"Statistics... | <p>
Converts a stream of {@code Number} to a stream of {@link Statistics} about
those numbers.
<p>
<img src=
"https://raw.githubusercontent.com/davidmoten/rxjava2-extras/master/src/docs/collectStats.png"
alt="image">
@param <T>
item type
@return transformer that converts a stream of Number to a stream of
Statistics | [
"<p",
">",
"Converts",
"a",
"stream",
"of",
"{",
"@code",
"Number",
"}",
"to",
"a",
"stream",
"of",
"{",
"@link",
"Statistics",
"}",
"about",
"those",
"numbers",
"."
] | train | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/flowable/Transformers.java#L169-L172 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/CausticUtil.java | CausticUtil.getImageData | public static ByteBuffer getImageData(InputStream source, Format format, Rectangle size) {
try {
final BufferedImage image = ImageIO.read(source);
size.setSize(image.getWidth(), image.getHeight());
return getImageData(image, format);
} catch (IOException ex) {
... | java | public static ByteBuffer getImageData(InputStream source, Format format, Rectangle size) {
try {
final BufferedImage image = ImageIO.read(source);
size.setSize(image.getWidth(), image.getHeight());
return getImageData(image, format);
} catch (IOException ex) {
... | [
"public",
"static",
"ByteBuffer",
"getImageData",
"(",
"InputStream",
"source",
",",
"Format",
"format",
",",
"Rectangle",
"size",
")",
"{",
"try",
"{",
"final",
"BufferedImage",
"image",
"=",
"ImageIO",
".",
"read",
"(",
"source",
")",
";",
"size",
".",
"... | Gets the {@link java.io.InputStream}'s data as a {@link java.nio.ByteBuffer}. The image data reading is done according to the {@link com.flowpowered.caustic.api.gl.Texture.Format}. The image size is
stored in the passed {@link Rectangle} instance. The returned buffer is flipped an ready for reading.
@param source The ... | [
"Gets",
"the",
"{",
"@link",
"java",
".",
"io",
".",
"InputStream",
"}",
"s",
"data",
"as",
"a",
"{",
"@link",
"java",
".",
"nio",
".",
"ByteBuffer",
"}",
".",
"The",
"image",
"data",
"reading",
"is",
"done",
"according",
"to",
"the",
"{",
"@link",
... | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/CausticUtil.java#L126-L134 |
lucee/Lucee | core/src/main/java/lucee/commons/img/Captcha.java | Captcha.writeOut | public static void writeOut(BufferedImage image, OutputStream os, String format) throws IOException {
ImageIO.write(image, format, os);
} | java | public static void writeOut(BufferedImage image, OutputStream os, String format) throws IOException {
ImageIO.write(image, format, os);
} | [
"public",
"static",
"void",
"writeOut",
"(",
"BufferedImage",
"image",
",",
"OutputStream",
"os",
",",
"String",
"format",
")",
"throws",
"IOException",
"{",
"ImageIO",
".",
"write",
"(",
"image",
",",
"format",
",",
"os",
")",
";",
"}"
] | write out image object to a output stream
@param image
@param os
@param format
@throws IOException | [
"write",
"out",
"image",
"object",
"to",
"a",
"output",
"stream"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/img/Captcha.java#L51-L54 |
aws/aws-sdk-java | aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java | ReEncryptRequest.setSourceEncryptionContext | public void setSourceEncryptionContext(java.util.Map<String, String> sourceEncryptionContext) {
this.sourceEncryptionContext = sourceEncryptionContext == null ? null : new com.amazonaws.internal.SdkInternalMap<String, String>(
sourceEncryptionContext);
} | java | public void setSourceEncryptionContext(java.util.Map<String, String> sourceEncryptionContext) {
this.sourceEncryptionContext = sourceEncryptionContext == null ? null : new com.amazonaws.internal.SdkInternalMap<String, String>(
sourceEncryptionContext);
} | [
"public",
"void",
"setSourceEncryptionContext",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"sourceEncryptionContext",
")",
"{",
"this",
".",
"sourceEncryptionContext",
"=",
"sourceEncryptionContext",
"==",
"null",
"?",
"null",
":",
... | <p>
Encryption context used to encrypt and decrypt the data specified in the <code>CiphertextBlob</code> parameter.
</p>
@param sourceEncryptionContext
Encryption context used to encrypt and decrypt the data specified in the <code>CiphertextBlob</code>
parameter. | [
"<p",
">",
"Encryption",
"context",
"used",
"to",
"encrypt",
"and",
"decrypt",
"the",
"data",
"specified",
"in",
"the",
"<code",
">",
"CiphertextBlob<",
"/",
"code",
">",
"parameter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java#L190-L193 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/hoverbar/CmsCreateCategoryMenuEntry.java | CmsCreateCategoryMenuEntry.askForNewCategoryInfo | public static void askForNewCategoryInfo(CmsUUID parentId, final AsyncCallback<CmsCategoryTitleAndName> callback) {
CmsSitemapCategoryData categoryData = CmsSitemapView.getInstance().getController().getCategoryData();
CmsCategoryTreeEntry entry = categoryData.getEntryById(parentId);
String cap... | java | public static void askForNewCategoryInfo(CmsUUID parentId, final AsyncCallback<CmsCategoryTitleAndName> callback) {
CmsSitemapCategoryData categoryData = CmsSitemapView.getInstance().getController().getCategoryData();
CmsCategoryTreeEntry entry = categoryData.getEntryById(parentId);
String cap... | [
"public",
"static",
"void",
"askForNewCategoryInfo",
"(",
"CmsUUID",
"parentId",
",",
"final",
"AsyncCallback",
"<",
"CmsCategoryTitleAndName",
">",
"callback",
")",
"{",
"CmsSitemapCategoryData",
"categoryData",
"=",
"CmsSitemapView",
".",
"getInstance",
"(",
")",
".... | Asks the user for a new category's name and title.<p>
@param parentId the parent category
@param callback the callback to call with the user-supplied information | [
"Asks",
"the",
"user",
"for",
"a",
"new",
"category",
"s",
"name",
"and",
"title",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/hoverbar/CmsCreateCategoryMenuEntry.java#L116-L150 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.resetAllFiltersForWebApp | public void resetAllFiltersForWebApp(String resourceGroupName, String siteName) {
resetAllFiltersForWebAppWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().body();
} | java | public void resetAllFiltersForWebApp(String resourceGroupName, String siteName) {
resetAllFiltersForWebAppWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().body();
} | [
"public",
"void",
"resetAllFiltersForWebApp",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
")",
"{",
"resetAllFiltersForWebAppWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"siteName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
... | Reset all recommendation opt-out settings for an app.
Reset all recommendation opt-out settings for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExceptio... | [
"Reset",
"all",
"recommendation",
"opt",
"-",
"out",
"settings",
"for",
"an",
"app",
".",
"Reset",
"all",
"recommendation",
"opt",
"-",
"out",
"settings",
"for",
"an",
"app",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1119-L1121 |
taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertNotNull | public static void assertNotNull(final Object object, final StatusType status) {
RESTAssert.assertTrue(object != null, status);
} | java | public static void assertNotNull(final Object object, final StatusType status) {
RESTAssert.assertTrue(object != null, status);
} | [
"public",
"static",
"void",
"assertNotNull",
"(",
"final",
"Object",
"object",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertTrue",
"(",
"object",
"!=",
"null",
",",
"status",
")",
";",
"}"
] | assert that object is not null
@param object the object to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"object",
"is",
"not",
"null"
] | train | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L160-L162 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionL | public static long checkPostconditionL(
final long value,
final LongPredicate predicate,
final LongFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
throw failed(
e,
Long.valueOf(value),
singleVio... | java | public static long checkPostconditionL(
final long value,
final LongPredicate predicate,
final LongFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
throw failed(
e,
Long.valueOf(value),
singleVio... | [
"public",
"static",
"long",
"checkPostconditionL",
"(",
"final",
"long",
"value",
",",
"final",
"LongPredicate",
"predicate",
",",
"final",
"LongFunction",
"<",
"String",
">",
"describer",
")",
"{",
"final",
"boolean",
"ok",
";",
"try",
"{",
"ok",
"=",
"pred... | A {@code long} specialized version of {@link #checkPostcondition(Object,
Predicate, Function)}
@param value The value
@param predicate The predicate
@param describer The describer of the predicate
@return value
@throws PostconditionViolationException If the predicate is false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostcondition",
"(",
"Object",
"Predicate",
"Function",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L445-L461 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java | GalleryImagesInner.update | public GalleryImageInner update(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).toBlocking().single().body();
} | java | public GalleryImageInner update(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).toBlocking().single().body();
} | [
"public",
"GalleryImageInner",
"update",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"galleryImageName",
",",
"GalleryImageFragment",
"galleryImage",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Modify properties of gallery images.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param galleryImageName The name of the gallery Image.
@param galleryImage Represents an image from the Azure Marketplace
@throws IllegalArgumentException thrown if parameter... | [
"Modify",
"properties",
"of",
"gallery",
"images",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java#L746-L748 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getSignatureForTable | public static String getSignatureForTable(String name, SortedMap<Integer, VoltType> schema) {
StringBuilder sb = new StringBuilder();
sb.append(name).append(SIGNATURE_TABLE_NAME_SEPARATOR);
for (VoltType t : schema.values()) {
sb.append(t.getSignatureChar());
}
return... | java | public static String getSignatureForTable(String name, SortedMap<Integer, VoltType> schema) {
StringBuilder sb = new StringBuilder();
sb.append(name).append(SIGNATURE_TABLE_NAME_SEPARATOR);
for (VoltType t : schema.values()) {
sb.append(t.getSignatureChar());
}
return... | [
"public",
"static",
"String",
"getSignatureForTable",
"(",
"String",
"name",
",",
"SortedMap",
"<",
"Integer",
",",
"VoltType",
">",
"schema",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"name",
")... | Get a string signature for the table represented by the args
@param name The name of the table
@param schema A sorted map of the columns in the table, keyed by column index
@return The table signature string. | [
"Get",
"a",
"string",
"signature",
"for",
"the",
"table",
"represented",
"by",
"the",
"args"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L2875-L2882 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.