repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/cfg/SystemConfiguration.java | SystemConfiguration.validateOutputPath | private void validateOutputPath(final File path) {
"""
Throws a system configuration error if the {@code path} cannot be written
to. If {@code path} does not exist, an attempt to create it will be made.
@param path Path for validation
"""
if (path.canWrite()) return;
// If the path doesn't... | java | private void validateOutputPath(final File path) {
if (path.canWrite()) return;
// If the path doesn't exist...
if (!path.exists()) {
// ... try creating it...
if (!path.mkdirs()) {
// ... or die trying.
String err = DIRECTORY_CREATION_FAI... | [
"private",
"void",
"validateOutputPath",
"(",
"final",
"File",
"path",
")",
"{",
"if",
"(",
"path",
".",
"canWrite",
"(",
")",
")",
"return",
";",
"// If the path doesn't exist...",
"if",
"(",
"!",
"path",
".",
"exists",
"(",
")",
")",
"{",
"// ... try cre... | Throws a system configuration error if the {@code path} cannot be written
to. If {@code path} does not exist, an attempt to create it will be made.
@param path Path for validation | [
"Throws",
"a",
"system",
"configuration",
"error",
"if",
"the",
"{",
"@code",
"path",
"}",
"cannot",
"be",
"written",
"to",
".",
"If",
"{",
"@code",
"path",
"}",
"does",
"not",
"exist",
"an",
"attempt",
"to",
"create",
"it",
"will",
"be",
"made",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/cfg/SystemConfiguration.java#L598-L615 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/ParseBool.java | ParseBool.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, not a String, or can't be parsed to a Boolean
"""
validateInputNotNull(value, context);
if( !(value instanceof String) ) {
throw new SuperCsvCellProcess... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if( !(value instanceof String) ) {
throw new SuperCsvCellProcessorException(String.class, value, context, this);
}
final String stringValue = (String) value;
final Boolean result;
if( contain... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"String",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, not a String, or can't be parsed to a Boolean | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseBool.java#L326-L345 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java | Main.call | public static boolean call(PrintStream out, PrintStream err, String... args) {
"""
Programmatic main entry point: initializes the tool instance to
use stdout and stderr; runs the tool, passing command-line args;
returns an exit status.
@return true on success, false otherwise
"""
return new Main(o... | java | public static boolean call(PrintStream out, PrintStream err, String... args) {
return new Main(out, err).run(args);
} | [
"public",
"static",
"boolean",
"call",
"(",
"PrintStream",
"out",
",",
"PrintStream",
"err",
",",
"String",
"...",
"args",
")",
"{",
"return",
"new",
"Main",
"(",
"out",
",",
"err",
")",
".",
"run",
"(",
"args",
")",
";",
"}"
] | Programmatic main entry point: initializes the tool instance to
use stdout and stderr; runs the tool, passing command-line args;
returns an exit status.
@return true on success, false otherwise | [
"Programmatic",
"main",
"entry",
"point",
":",
"initializes",
"the",
"tool",
"instance",
"to",
"use",
"stdout",
"and",
"stderr",
";",
"runs",
"the",
"tool",
"passing",
"command",
"-",
"line",
"args",
";",
"returns",
"an",
"exit",
"status",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java#L691-L693 |
wcm-io/wcm-io-tooling | commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java | PackageManagerHelper.executePackageManagerMethodStatus | public void executePackageManagerMethodStatus(CloseableHttpClient httpClient, HttpRequestBase method) {
"""
Execute CRX HTTP Package manager method and checks response status. If the response status is not 200 the call
fails (after retrying).
@param httpClient Http client
@param method Get or Post method
""... | java | public void executePackageManagerMethodStatus(CloseableHttpClient httpClient, HttpRequestBase method) {
PackageManagerStatusCall call = new PackageManagerStatusCall(httpClient, method, log);
executeHttpCallWithRetry(call, 0);
} | [
"public",
"void",
"executePackageManagerMethodStatus",
"(",
"CloseableHttpClient",
"httpClient",
",",
"HttpRequestBase",
"method",
")",
"{",
"PackageManagerStatusCall",
"call",
"=",
"new",
"PackageManagerStatusCall",
"(",
"httpClient",
",",
"method",
",",
"log",
")",
";... | Execute CRX HTTP Package manager method and checks response status. If the response status is not 200 the call
fails (after retrying).
@param httpClient Http client
@param method Get or Post method | [
"Execute",
"CRX",
"HTTP",
"Package",
"manager",
"method",
"and",
"checks",
"response",
"status",
".",
"If",
"the",
"response",
"status",
"is",
"not",
"200",
"the",
"call",
"fails",
"(",
"after",
"retrying",
")",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/PackageManagerHelper.java#L264-L267 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java | SQLiteEntity.buildTableName | private String buildTableName(Elements elementUtils, SQLiteDatabaseSchema schema) {
"""
Builds the table name.
@param elementUtils
the element utils
@param schema
the schema
@return the string
"""
tableName = getSimpleName();
tableName = schema.classNameConverter.convert(tableName);
String temp =... | java | private String buildTableName(Elements elementUtils, SQLiteDatabaseSchema schema) {
tableName = getSimpleName();
tableName = schema.classNameConverter.convert(tableName);
String temp = AnnotationUtility.extractAsString(getElement(), BindSqlType.class, AnnotationAttributeType.NAME);
if (StringUtils.hasText(temp... | [
"private",
"String",
"buildTableName",
"(",
"Elements",
"elementUtils",
",",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"tableName",
"=",
"getSimpleName",
"(",
")",
";",
"tableName",
"=",
"schema",
".",
"classNameConverter",
".",
"convert",
"(",
"tableName",
")",... | Builds the table name.
@param elementUtils
the element utils
@param schema
the schema
@return the string | [
"Builds",
"the",
"table",
"name",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteEntity.java#L136-L147 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java | SDLoss.meanSquaredError | public SDVariable meanSquaredError(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
"""
See {@link #meanSquaredError(String, SDVariable, SDVariable, SDVariable, LossReduce)}.
"""
return meanSquaredError(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT);
... | java | public SDVariable meanSquaredError(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
return meanSquaredError(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT);
} | [
"public",
"SDVariable",
"meanSquaredError",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"label",
",",
"@",
"NonNull",
"SDVariable",
"predictions",
")",
"{",
"return",
"meanSquaredError",
"(",
"name",
",",
"label",
",",
"predictions",
",",
"null",
... | See {@link #meanSquaredError(String, SDVariable, SDVariable, SDVariable, LossReduce)}. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java#L355-L357 |
robocup-atan/atan | src/main/java/com/github/robocup_atan/atan/model/CommandFactory.java | CommandFactory.addChangePlayerTypeCommand | public void addChangePlayerTypeCommand(String teamName, int unum, int playerType) {
"""
Trainer only command.
This command changes the specified players heterogeneous type.
@param teamName The name of the team the player belongs to.
@param unum The players uniform number (1~11 on pitch usually, subs <= 14).
... | java | public void addChangePlayerTypeCommand(String teamName, int unum, int playerType) {
StringBuilder buf = new StringBuilder();
buf.append("(change_player_type ");
buf.append(teamName);
buf.append(' ');
buf.append(unum);
buf.append(' ');
buf.append(playerType);
... | [
"public",
"void",
"addChangePlayerTypeCommand",
"(",
"String",
"teamName",
",",
"int",
"unum",
",",
"int",
"playerType",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"\"(change_player_type \"",
")",
"... | Trainer only command.
This command changes the specified players heterogeneous type.
@param teamName The name of the team the player belongs to.
@param unum The players uniform number (1~11 on pitch usually, subs <= 14).
@param playerType A player type between 0 (the standard player) and 18. However, player.conf can c... | [
"Trainer",
"only",
"command",
".",
"This",
"command",
"changes",
"the",
"specified",
"players",
"heterogeneous",
"type",
"."
] | train | https://github.com/robocup-atan/atan/blob/52237b468b09ba5b7c52d290984dbe0326c96df7/src/main/java/com/github/robocup_atan/atan/model/CommandFactory.java#L384-L394 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java | Grid.addAtoms | public void addAtoms(Atom[] iAtoms, Atom[] jAtoms) {
"""
Adds the i and j atoms and fills the grid. Their bounds will be computed.
Subsequent call to {@link #getIndicesContacts()} or {@link #getAtomContacts()} will produce the interatomic contacts.
@param iAtoms
@param jAtoms
"""
addAtoms(iAtoms, null, jA... | java | public void addAtoms(Atom[] iAtoms, Atom[] jAtoms) {
addAtoms(iAtoms, null, jAtoms, null);
} | [
"public",
"void",
"addAtoms",
"(",
"Atom",
"[",
"]",
"iAtoms",
",",
"Atom",
"[",
"]",
"jAtoms",
")",
"{",
"addAtoms",
"(",
"iAtoms",
",",
"null",
",",
"jAtoms",
",",
"null",
")",
";",
"}"
] | Adds the i and j atoms and fills the grid. Their bounds will be computed.
Subsequent call to {@link #getIndicesContacts()} or {@link #getAtomContacts()} will produce the interatomic contacts.
@param iAtoms
@param jAtoms | [
"Adds",
"the",
"i",
"and",
"j",
"atoms",
"and",
"fills",
"the",
"grid",
".",
"Their",
"bounds",
"will",
"be",
"computed",
".",
"Subsequent",
"call",
"to",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L120-L122 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.dropTable | public static <T, ID> int dropTable(Dao<T, ID> dao, boolean ignoreErrors) throws SQLException {
"""
Issue the database statements to drop the table associated with a dao.
@param dao
Associated dao.
@return The number of statements executed to do so.
"""
ConnectionSource connectionSource = dao.getConnect... | java | public static <T, ID> int dropTable(Dao<T, ID> dao, boolean ignoreErrors) throws SQLException {
ConnectionSource connectionSource = dao.getConnectionSource();
Class<T> dataClass = dao.getDataClass();
DatabaseType databaseType = connectionSource.getDatabaseType();
if (dao instanceof BaseDaoImpl<?, ?>) {
retur... | [
"public",
"static",
"<",
"T",
",",
"ID",
">",
"int",
"dropTable",
"(",
"Dao",
"<",
"T",
",",
"ID",
">",
"dao",
",",
"boolean",
"ignoreErrors",
")",
"throws",
"SQLException",
"{",
"ConnectionSource",
"connectionSource",
"=",
"dao",
".",
"getConnectionSource",... | Issue the database statements to drop the table associated with a dao.
@param dao
Associated dao.
@return The number of statements executed to do so. | [
"Issue",
"the",
"database",
"statements",
"to",
"drop",
"the",
"table",
"associated",
"with",
"a",
"dao",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L183-L193 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationHelper.java | NavigationHelper.buildInstructionString | static String buildInstructionString(RouteProgress routeProgress, Milestone milestone) {
"""
When a milestones triggered, it's instruction needs to be built either using the provided
string or an empty string.
"""
if (milestone.getInstruction() != null) {
// Create a new custom instruction based on ... | java | static String buildInstructionString(RouteProgress routeProgress, Milestone milestone) {
if (milestone.getInstruction() != null) {
// Create a new custom instruction based on the Instruction packaged with the Milestone
return milestone.getInstruction().buildInstruction(routeProgress);
}
return E... | [
"static",
"String",
"buildInstructionString",
"(",
"RouteProgress",
"routeProgress",
",",
"Milestone",
"milestone",
")",
"{",
"if",
"(",
"milestone",
".",
"getInstruction",
"(",
")",
"!=",
"null",
")",
"{",
"// Create a new custom instruction based on the Instruction pack... | When a milestones triggered, it's instruction needs to be built either using the provided
string or an empty string. | [
"When",
"a",
"milestones",
"triggered",
"it",
"s",
"instruction",
"needs",
"to",
"be",
"built",
"either",
"using",
"the",
"provided",
"string",
"or",
"an",
"empty",
"string",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationHelper.java#L51-L57 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vpc/VpcClient.java | VpcClient.createVpc | public CreateVpcResponse createVpc(CreateVpcRequest request)
throws BceClientException {
"""
Create a vpc with the specified options.
You must fill the field of clientToken,which is especially for keeping idempotent.
<p/>
@param request The request containing all options for creating a vpc.
@retu... | java | public CreateVpcResponse createVpc(CreateVpcRequest request)
throws BceClientException {
checkNotNull(request, "request should not be null.");
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(this.generateClientToken());
}
checkStringN... | [
"public",
"CreateVpcResponse",
"createVpc",
"(",
"CreateVpcRequest",
"request",
")",
"throws",
"BceClientException",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"request",
".",... | Create a vpc with the specified options.
You must fill the field of clientToken,which is especially for keeping idempotent.
<p/>
@param request The request containing all options for creating a vpc.
@return List of vpcId newly created
@throws BceClientException | [
"Create",
"a",
"vpc",
"with",
"the",
"specified",
"options",
".",
"You",
"must",
"fill",
"the",
"field",
"of",
"clientToken",
"which",
"is",
"especially",
"for",
"keeping",
"idempotent",
".",
"<p",
"/",
">"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vpc/VpcClient.java#L170-L183 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.supplyAsync | public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
"""
Returns a new CompletableFuture that is asynchronously completed by a task running in the
{@link ForkJoinPool#commonPool()} with the value obtained by calling the given Supplier.
@param supplier a function returning the value to be ... | java | public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier) {
return asyncSupplyStage(ASYNC_POOL, supplier);
} | [
"public",
"static",
"<",
"U",
">",
"CompletableFuture",
"<",
"U",
">",
"supplyAsync",
"(",
"Supplier",
"<",
"U",
">",
"supplier",
")",
"{",
"return",
"asyncSupplyStage",
"(",
"ASYNC_POOL",
",",
"supplier",
")",
";",
"}"
] | Returns a new CompletableFuture that is asynchronously completed by a task running in the
{@link ForkJoinPool#commonPool()} with the value obtained by calling the given Supplier.
@param supplier a function returning the value to be used to complete the returned
CompletableFuture
@param <U> the function's return type
@... | [
"Returns",
"a",
"new",
"CompletableFuture",
"that",
"is",
"asynchronously",
"completed",
"by",
"a",
"task",
"running",
"in",
"the",
"{",
"@link",
"ForkJoinPool#commonPool",
"()",
"}",
"with",
"the",
"value",
"obtained",
"by",
"calling",
"the",
"given",
"Supplier... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L394-L396 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.getSeries | public Cursor<Series> getSeries(Filter filter) {
"""
Returns a cursor of series specified by a filter.
@param filter The series filter
@return A Cursor of Series. The cursor.iterator().next() may throw a {@link TempoDBException} if an error occurs while making a request.
@see Cursor
@see Filter
@since 1.0... | java | public Cursor<Series> getSeries(Filter filter) {
URI uri = null;
try {
URIBuilder builder = new URIBuilder(String.format("/%s/series/", API_VERSION));
addFilterToURI(builder, filter);
uri = builder.build();
} catch (URISyntaxException e) {
String message = String.format("Could not bu... | [
"public",
"Cursor",
"<",
"Series",
">",
"getSeries",
"(",
"Filter",
"filter",
")",
"{",
"URI",
"uri",
"=",
"null",
";",
"try",
"{",
"URIBuilder",
"builder",
"=",
"new",
"URIBuilder",
"(",
"String",
".",
"format",
"(",
"\"/%s/series/\"",
",",
"API_VERSION",... | Returns a cursor of series specified by a filter.
@param filter The series filter
@return A Cursor of Series. The cursor.iterator().next() may throw a {@link TempoDBException} if an error occurs while making a request.
@see Cursor
@see Filter
@since 1.0.0 | [
"Returns",
"a",
"cursor",
"of",
"series",
"specified",
"by",
"a",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L372-L385 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java | ComponentDao.selectByKeysAndBranches | public List<ComponentDto> selectByKeysAndBranches(DbSession session, Map<String, String> branchesByKey) {
"""
Return list of components that will will mix main and branch components.
Please note that a project can only appear once in the list, it's not possible to ask for many branches on same project with this m... | java | public List<ComponentDto> selectByKeysAndBranches(DbSession session, Map<String, String> branchesByKey) {
Set<String> dbKeys = branchesByKey.entrySet().stream()
.map(entry -> generateBranchKey(entry.getKey(), entry.getValue()))
.collect(toSet());
return selectByDbKeys(session, dbKeys);
} | [
"public",
"List",
"<",
"ComponentDto",
">",
"selectByKeysAndBranches",
"(",
"DbSession",
"session",
",",
"Map",
"<",
"String",
",",
"String",
">",
"branchesByKey",
")",
"{",
"Set",
"<",
"String",
">",
"dbKeys",
"=",
"branchesByKey",
".",
"entrySet",
"(",
")"... | Return list of components that will will mix main and branch components.
Please note that a project can only appear once in the list, it's not possible to ask for many branches on same project with this method. | [
"Return",
"list",
"of",
"components",
"that",
"will",
"will",
"mix",
"main",
"and",
"branch",
"components",
".",
"Please",
"note",
"that",
"a",
"project",
"can",
"only",
"appear",
"once",
"in",
"the",
"list",
"it",
"s",
"not",
"possible",
"to",
"ask",
"f... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java#L212-L217 |
oboehm/jfachwert | src/main/java/de/jfachwert/math/internal/ToNumberSerializer.java | ToNumberSerializer.serialize | @Override
public void serialize(AbstractNumber number, JsonGenerator jgen, SerializerProvider provider) throws IOException {
"""
Fuer die Serialisierung wird die uebergebene Nummer in eine
{@link java.math.BigDecimal} gewandelt.
@param number uebergebene Nummer
@param jgen Json-Generator
@param provider ... | java | @Override
public void serialize(AbstractNumber number, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeNumber(number.toBigDecimal());
} | [
"@",
"Override",
"public",
"void",
"serialize",
"(",
"AbstractNumber",
"number",
",",
"JsonGenerator",
"jgen",
",",
"SerializerProvider",
"provider",
")",
"throws",
"IOException",
"{",
"jgen",
".",
"writeNumber",
"(",
"number",
".",
"toBigDecimal",
"(",
")",
")"... | Fuer die Serialisierung wird die uebergebene Nummer in eine
{@link java.math.BigDecimal} gewandelt.
@param number uebergebene Nummer
@param jgen Json-Generator
@param provider Provider
@throws IOException sollte nicht auftreten | [
"Fuer",
"die",
"Serialisierung",
"wird",
"die",
"uebergebene",
"Nummer",
"in",
"eine",
"{",
"@link",
"java",
".",
"math",
".",
"BigDecimal",
"}",
"gewandelt",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/math/internal/ToNumberSerializer.java#L45-L48 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newIllegalTypeException | public static IllegalTypeException newIllegalTypeException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link IllegalTypeException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@l... | java | public static IllegalTypeException newIllegalTypeException(Throwable cause, String message, Object... args) {
return new IllegalTypeException(format(message, args), cause);
} | [
"public",
"static",
"IllegalTypeException",
"newIllegalTypeException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"IllegalTypeException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"ca... | Constructs and initializes a new {@link IllegalTypeException} 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 IllegalTypeException} was thrown.
@param message {@link String} descri... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"IllegalTypeException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Obj... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L397-L399 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/InitDateOffsetHandler.java | InitDateOffsetHandler.init | public void init(BaseField field, BaseField fldSource, DateTimeField fldStartDate, int lYears, int lMonths, int lDays, boolean bCalcIfNull) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldSource The field with the source number of days to use a... | java | public void init(BaseField field, BaseField fldSource, DateTimeField fldStartDate, int lYears, int lMonths, int lDays, boolean bCalcIfNull)
{
super.init(field, fldSource, null, true, false);
m_lYears = lYears;
m_lMonths = lMonths;
m_lDays = lDays;
m_fldStartDate = fldStartDat... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"BaseField",
"fldSource",
",",
"DateTimeField",
"fldStartDate",
",",
"int",
"lYears",
",",
"int",
"lMonths",
",",
"int",
"lDays",
",",
"boolean",
"bCalcIfNull",
")",
"{",
"super",
".",
"init",
"(",
... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldSource The field with the source number of days to use as an offset.
@param lYears Offset by this number of years.
@param lMonths Offset by this number of months.
@param lDays Offset by this number of days. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/InitDateOffsetHandler.java#L88-L96 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withTimes | public Interval withTimes(LocalTime startTime, LocalTime endTime) {
"""
Returns a new interval based on this interval but with a different start
and end time.
@param startTime the new start time
@param endTime the new end time
@return a new interval
"""
requireNonNull(startTime);
requireN... | java | public Interval withTimes(LocalTime startTime, LocalTime endTime) {
requireNonNull(startTime);
requireNonNull(endTime);
return new Interval(this.startDate, startTime, this.endDate, endTime, this.zoneId);
} | [
"public",
"Interval",
"withTimes",
"(",
"LocalTime",
"startTime",
",",
"LocalTime",
"endTime",
")",
"{",
"requireNonNull",
"(",
"startTime",
")",
";",
"requireNonNull",
"(",
"endTime",
")",
";",
"return",
"new",
"Interval",
"(",
"this",
".",
"startDate",
",",
... | Returns a new interval based on this interval but with a different start
and end time.
@param startTime the new start time
@param endTime the new end time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"and",
"end",
"time",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L306-L310 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/Content.java | Content.getMap | Map<?, ?> getMap(Object scope, String propertyPath) throws TemplateException {
"""
Retrieve content map instance. Delegates {@link #getValue(Object, String)} to obtain the requested value. If value
is null warn the event an return empty map. If value is map return it, otherwise throws context exception.
@param... | java | Map<?, ?> getMap(Object scope, String propertyPath) throws TemplateException
{
Object map = getValue(scope, propertyPath);
if(map == null) {
warn(scope.getClass(), propertyPath);
return Collections.EMPTY_MAP;
}
if(!Types.isMap(map)) {
throw new TemplateException("Invalid type... | [
"Map",
"<",
"?",
",",
"?",
">",
"getMap",
"(",
"Object",
"scope",
",",
"String",
"propertyPath",
")",
"throws",
"TemplateException",
"{",
"Object",
"map",
"=",
"getValue",
"(",
"scope",
",",
"propertyPath",
")",
";",
"if",
"(",
"map",
"==",
"null",
")"... | Retrieve content map instance. Delegates {@link #getValue(Object, String)} to obtain the requested value. If value
is null warn the event an return empty map. If value is map return it, otherwise throws context exception.
@param scope scope object,
@param propertyPath object property path.
@return map instance, possib... | [
"Retrieve",
"content",
"map",
"instance",
".",
"Delegates",
"{",
"@link",
"#getValue",
"(",
"Object",
"String",
")",
"}",
"to",
"obtain",
"the",
"requested",
"value",
".",
"If",
"value",
"is",
"null",
"warn",
"the",
"event",
"an",
"return",
"empty",
"map",... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/Content.java#L182-L193 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.fillBeanWithMap | public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, boolean isIgnoreError) {
"""
使用Map填充Bean对象
@param <T> Bean类型
@param map Map
@param bean Bean
@param isIgnoreError 是否忽略注入错误
@return Bean
"""
return fillBeanWithMap(map, bean, false, isIgnoreError);
} | java | public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, boolean isIgnoreError) {
return fillBeanWithMap(map, bean, false, isIgnoreError);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fillBeanWithMap",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"T",
"bean",
",",
"boolean",
"isIgnoreError",
")",
"{",
"return",
"fillBeanWithMap",
"(",
"map",
",",
"bean",
",",
"false",
",",
"isIgnoreError"... | 使用Map填充Bean对象
@param <T> Bean类型
@param map Map
@param bean Bean
@param isIgnoreError 是否忽略注入错误
@return Bean | [
"使用Map填充Bean对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L368-L370 |
alkacon/opencms-core | src/org/opencms/gwt/CmsIconUtil.java | CmsIconUtil.getDisplayType | public static String getDisplayType(CmsObject cms, CmsResource resource) {
"""
Returns the resource type name used to display the resource icon.
This may differ from the actual resource type in case of navigation level folders and model groups.<p>
@param cms the cms context
@param resource the resource
@re... | java | public static String getDisplayType(CmsObject cms, CmsResource resource) {
String result;
if (CmsJspNavBuilder.isNavLevelFolder(cms, resource)) {
result = CmsGwtConstants.TYPE_NAVLEVEL;
} else if (CmsResourceTypeXmlContainerPage.isModelCopyGroup(cms, resource)) {
result ... | [
"public",
"static",
"String",
"getDisplayType",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"String",
"result",
";",
"if",
"(",
"CmsJspNavBuilder",
".",
"isNavLevelFolder",
"(",
"cms",
",",
"resource",
")",
")",
"{",
"result",
"=",
"Cm... | Returns the resource type name used to display the resource icon.
This may differ from the actual resource type in case of navigation level folders and model groups.<p>
@param cms the cms context
@param resource the resource
@return the display type name | [
"Returns",
"the",
"resource",
"type",
"name",
"used",
"to",
"display",
"the",
"resource",
"icon",
".",
"This",
"may",
"differ",
"from",
"the",
"actual",
"resource",
"type",
"in",
"case",
"of",
"navigation",
"level",
"folders",
"and",
"model",
"groups",
".",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsIconUtil.java#L302-L313 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.replaceFirst | public static final Function<String,String> replaceFirst(final String regex, final String replacement) {
"""
<p>
Replaces in the target String the first substring matching the specified regular expression
with the specified replacement String.
</p>
<p>
Regular expressions must conform to the <tt>java.util.reg... | java | public static final Function<String,String> replaceFirst(final String regex, final String replacement) {
return new Replace(regex, replacement, ReplaceType.FIRST);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"replaceFirst",
"(",
"final",
"String",
"regex",
",",
"final",
"String",
"replacement",
")",
"{",
"return",
"new",
"Replace",
"(",
"regex",
",",
"replacement",
",",
"ReplaceType",
".... | <p>
Replaces in the target String the first substring matching the specified regular expression
with the specified replacement String.
</p>
<p>
Regular expressions must conform to the <tt>java.util.regex.Pattern</tt> format.
</p>
@param regex the regular expression to match against
@param replacement the replacement s... | [
"<p",
">",
"Replaces",
"in",
"the",
"target",
"String",
"the",
"first",
"substring",
"matching",
"the",
"specified",
"regular",
"expression",
"with",
"the",
"specified",
"replacement",
"String",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Regular",
"expressions",
"... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L2022-L2024 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java | TitlePaneMaximizeButtonPainter.paintMaximizeEnabled | private void paintMaximizeEnabled(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the foreground maximized button enabled state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.... | java | private void paintMaximizeEnabled(Graphics2D g, JComponent c, int width, int height) {
maximizePainter.paintEnabled(g, c, width, height);
} | [
"private",
"void",
"paintMaximizeEnabled",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"maximizePainter",
".",
"paintEnabled",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
")",
";",
"}"
] | Paint the foreground maximized button enabled state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"foreground",
"maximized",
"button",
"enabled",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java#L173-L175 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/store/AbstractStoreResource.java | AbstractStoreResource.setFileInfo | protected void setFileInfo(final String _filename,
final long _fileLength)
throws EFapsException {
"""
Set the info for the file in this store reosurce.
@param _filename name of the file
@param _fileLength length of the file
@throws EFapsException on error
"""
... | java | protected void setFileInfo(final String _filename,
final long _fileLength)
throws EFapsException
{
if (!_filename.equals(this.fileName) || _fileLength != this.fileLength) {
ConnectionResource res = null;
try {
res = Context.getTh... | [
"protected",
"void",
"setFileInfo",
"(",
"final",
"String",
"_filename",
",",
"final",
"long",
"_fileLength",
")",
"throws",
"EFapsException",
"{",
"if",
"(",
"!",
"_filename",
".",
"equals",
"(",
"this",
".",
"fileName",
")",
"||",
"_fileLength",
"!=",
"thi... | Set the info for the file in this store reosurce.
@param _filename name of the file
@param _fileLength length of the file
@throws EFapsException on error | [
"Set",
"the",
"info",
"for",
"the",
"file",
"in",
"this",
"store",
"reosurce",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/store/AbstractStoreResource.java#L253-L291 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/link/FeatureTileTableCoreLinker.java | FeatureTileTableCoreLinker.getLink | public FeatureTileLink getLink(String featureTable, String tileTable) {
"""
Get the feature and tile table link if it exists
@param featureTable
feature table
@param tileTable
tile table
@return link or null
"""
FeatureTileLink link = null;
if (featureTileLinksActive()) {
FeatureTileLinkKey id =... | java | public FeatureTileLink getLink(String featureTable, String tileTable) {
FeatureTileLink link = null;
if (featureTileLinksActive()) {
FeatureTileLinkKey id = new FeatureTileLinkKey(featureTable,
tileTable);
try {
link = featureTileLinkDao.queryForId(id);
} catch (SQLException e) {
throw new Ge... | [
"public",
"FeatureTileLink",
"getLink",
"(",
"String",
"featureTable",
",",
"String",
"tileTable",
")",
"{",
"FeatureTileLink",
"link",
"=",
"null",
";",
"if",
"(",
"featureTileLinksActive",
"(",
")",
")",
"{",
"FeatureTileLinkKey",
"id",
"=",
"new",
"FeatureTil... | Get the feature and tile table link if it exists
@param featureTable
feature table
@param tileTable
tile table
@return link or null | [
"Get",
"the",
"feature",
"and",
"tile",
"table",
"link",
"if",
"it",
"exists"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/link/FeatureTileTableCoreLinker.java#L136-L154 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java | MetadataService.addToken | public CompletableFuture<Revision> addToken(Author author, String projectName,
Token token, ProjectRole role) {
"""
Adds the specified {@link Token} to the specified {@code projectName}.
"""
return addToken(author, projectName, requireNonNull(token, "toke... | java | public CompletableFuture<Revision> addToken(Author author, String projectName,
Token token, ProjectRole role) {
return addToken(author, projectName, requireNonNull(token, "token").appId(), role);
} | [
"public",
"CompletableFuture",
"<",
"Revision",
">",
"addToken",
"(",
"Author",
"author",
",",
"String",
"projectName",
",",
"Token",
"token",
",",
"ProjectRole",
"role",
")",
"{",
"return",
"addToken",
"(",
"author",
",",
"projectName",
",",
"requireNonNull",
... | Adds the specified {@link Token} to the specified {@code projectName}. | [
"Adds",
"the",
"specified",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L326-L329 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/Key.java | Key.callSetPropertyValue | private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) {
"""
Creates code to call set method. Assumes Storable and property value
are already on the stack.
"""
StorableProperty<?> property = op.getChainedProperty().getLastProperty();
TypeDesc propType = TypeDesc.forCl... | java | private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) {
StorableProperty<?> property = op.getChainedProperty().getLastProperty();
TypeDesc propType = TypeDesc.forClass(property.getType());
if (propType != TypeDesc.OBJECT) {
TypeDesc objectType = propType.... | [
"private",
"static",
"void",
"callSetPropertyValue",
"(",
"CodeBuilder",
"b",
",",
"OrderedProperty",
"<",
"?",
">",
"op",
")",
"{",
"StorableProperty",
"<",
"?",
">",
"property",
"=",
"op",
".",
"getChainedProperty",
"(",
")",
".",
"getLastProperty",
"(",
"... | Creates code to call set method. Assumes Storable and property value
are already on the stack. | [
"Creates",
"code",
"to",
"call",
"set",
"method",
".",
"Assumes",
"Storable",
"and",
"property",
"value",
"are",
"already",
"on",
"the",
"stack",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/Key.java#L257-L267 |
wiselenium/wiselenium | wiselenium-factory/src/main/java/com/github/wiselenium/factory/WisePageFactory.java | WisePageFactory.initElements | public static <T> T initElements(SearchContext searchContext, T instance) {
"""
Initializes the elements of an existing object.
@param searchContext The context that will be used to look up the elements.
@param instance The instance whose fields will be initialized.
@return The instance with its elements init... | java | public static <T> T initElements(SearchContext searchContext, T instance) {
Class<?> currentInstanceHierarchyClass = instance.getClass();
while (currentInstanceHierarchyClass != Object.class) {
proxyElements(searchContext, instance, currentInstanceHierarchyClass);
currentInstanceHierarchyClass = currentInstan... | [
"public",
"static",
"<",
"T",
">",
"T",
"initElements",
"(",
"SearchContext",
"searchContext",
",",
"T",
"instance",
")",
"{",
"Class",
"<",
"?",
">",
"currentInstanceHierarchyClass",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"while",
"(",
"currentIns... | Initializes the elements of an existing object.
@param searchContext The context that will be used to look up the elements.
@param instance The instance whose fields will be initialized.
@return The instance with its elements initialized.
@since 0.3.0 | [
"Initializes",
"the",
"elements",
"of",
"an",
"existing",
"object",
"."
] | train | https://github.com/wiselenium/wiselenium/blob/15de6484d8f516b3d02391d3bd6a56a03e632706/wiselenium-factory/src/main/java/com/github/wiselenium/factory/WisePageFactory.java#L71-L79 |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/weld/WebSphereCDIDeploymentImpl.java | WebSphereCDIDeploymentImpl.createNewBdaAndMakeWiring | private BeanDeploymentArchive createNewBdaAndMakeWiring(Class<?> beanClass) {
"""
Create a new bda and put the beanClass to the bda and then wire this bda in the deployment according to the classloading hierarchy
@param beanClass
@param beanClassCL the beanClass classloader
@return the newly created bda
"... | java | private BeanDeploymentArchive createNewBdaAndMakeWiring(Class<?> beanClass) {
try {
OnDemandArchive onDemandArchive = new OnDemandArchive(cdiRuntime, application, beanClass);
WebSphereBeanDeploymentArchive newBda = BDAFactory.createBDA(this, onDemandArchive, cdiRuntime);
Cla... | [
"private",
"BeanDeploymentArchive",
"createNewBdaAndMakeWiring",
"(",
"Class",
"<",
"?",
">",
"beanClass",
")",
"{",
"try",
"{",
"OnDemandArchive",
"onDemandArchive",
"=",
"new",
"OnDemandArchive",
"(",
"cdiRuntime",
",",
"application",
",",
"beanClass",
")",
";",
... | Create a new bda and put the beanClass to the bda and then wire this bda in the deployment according to the classloading hierarchy
@param beanClass
@param beanClassCL the beanClass classloader
@return the newly created bda | [
"Create",
"a",
"new",
"bda",
"and",
"put",
"the",
"beanClass",
"to",
"the",
"bda",
"and",
"then",
"wire",
"this",
"bda",
"in",
"the",
"deployment",
"according",
"to",
"the",
"classloading",
"hierarchy"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/weld/WebSphereCDIDeploymentImpl.java#L351-L389 |
esigate/esigate | esigate-core/src/main/java/org/esigate/util/HttpRequestHelper.java | HttpRequestHelper.getHost | public static HttpHost getHost(HttpRequest request) {
"""
Returns the target host as defined in the Host header or extracted from the request URI.
Usefull to generate Host header in a HttpRequest
@param request
@return the host formatted as host:port
"""
HttpHost httpHost = UriUtils.extractHost(... | java | public static HttpHost getHost(HttpRequest request) {
HttpHost httpHost = UriUtils.extractHost(request.getRequestLine().getUri());
String scheme = httpHost.getSchemeName();
String host = httpHost.getHostName();
int port = httpHost.getPort();
Header[] headers = request.getHeaders(... | [
"public",
"static",
"HttpHost",
"getHost",
"(",
"HttpRequest",
"request",
")",
"{",
"HttpHost",
"httpHost",
"=",
"UriUtils",
".",
"extractHost",
"(",
"request",
".",
"getRequestLine",
"(",
")",
".",
"getUri",
"(",
")",
")",
";",
"String",
"scheme",
"=",
"h... | Returns the target host as defined in the Host header or extracted from the request URI.
Usefull to generate Host header in a HttpRequest
@param request
@return the host formatted as host:port | [
"Returns",
"the",
"target",
"host",
"as",
"defined",
"in",
"the",
"Host",
"header",
"or",
"extracted",
"from",
"the",
"request",
"URI",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/util/HttpRequestHelper.java#L64-L81 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessErrorStream | public static Thread consumeProcessErrorStream(Process self, OutputStream err) {
"""
Gets the error stream from a process and reads it
to keep the process from blocking due to a full buffer.
The processed stream data is appended to the supplied OutputStream.
A new Thread is started, so this method will return i... | java | public static Thread consumeProcessErrorStream(Process self, OutputStream err) {
Thread thread = new Thread(new ByteDumper(self.getErrorStream(), err));
thread.start();
return thread;
} | [
"public",
"static",
"Thread",
"consumeProcessErrorStream",
"(",
"Process",
"self",
",",
"OutputStream",
"err",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"ByteDumper",
"(",
"self",
".",
"getErrorStream",
"(",
")",
",",
"err",
")",
")",
... | Gets the error stream from a process and reads it
to keep the process from blocking due to a full buffer.
The processed stream data is appended to the supplied OutputStream.
A new Thread is started, so this method will return immediately.
@param self a Process
@param err an OutputStream to capture the process stderr
@... | [
"Gets",
"the",
"error",
"stream",
"from",
"a",
"process",
"and",
"reads",
"it",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended",
"to",
"the",
"supplied",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L283-L287 |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java | CircularBar.loadStyledAttributes | public void loadStyledAttributes(AttributeSet attrs, int defStyleAttr) {
"""
Loads the styles and attributes defined in the xml tag of this class
@param attrs The attributes to read from
@param defStyleAttr The styles to read from
"""
if (attrs != null) {
final TypedArray attribu... | java | public void loadStyledAttributes(AttributeSet attrs, int defStyleAttr) {
if (attrs != null) {
final TypedArray attributes = mContext.getTheme().obtainStyledAttributes(attrs, R.styleable.CircularViewPager,
defStyleAttr, 0);
mStartLineEnabled = attributes.getBoolean(R.... | [
"public",
"void",
"loadStyledAttributes",
"(",
"AttributeSet",
"attrs",
",",
"int",
"defStyleAttr",
")",
"{",
"if",
"(",
"attrs",
"!=",
"null",
")",
"{",
"final",
"TypedArray",
"attributes",
"=",
"mContext",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttribu... | Loads the styles and attributes defined in the xml tag of this class
@param attrs The attributes to read from
@param defStyleAttr The styles to read from | [
"Loads",
"the",
"styles",
"and",
"attributes",
"defined",
"in",
"the",
"xml",
"tag",
"of",
"this",
"class"
] | train | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java#L438-L466 |
dadoonet/spring-elasticsearch | src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java | TypeElasticsearchUpdater.isMappingExist | private static boolean isMappingExist(RestHighLevelClient client, String index) throws Exception {
"""
Check if an index already exist
@param client Elasticsearch client
@param index Index name
@return true if the index already exist
@throws Exception if the elasticsearch call is failing
"""
GetMap... | java | private static boolean isMappingExist(RestHighLevelClient client, String index) throws Exception {
GetMappingsResponse mapping = client.indices().getMapping(new GetMappingsRequest().indices(index), RequestOptions.DEFAULT);
// Let's get the default mapping
if (mapping.mappings().isEmpty()) {
... | [
"private",
"static",
"boolean",
"isMappingExist",
"(",
"RestHighLevelClient",
"client",
",",
"String",
"index",
")",
"throws",
"Exception",
"{",
"GetMappingsResponse",
"mapping",
"=",
"client",
".",
"indices",
"(",
")",
".",
"getMapping",
"(",
"new",
"GetMappingsR... | Check if an index already exist
@param client Elasticsearch client
@param index Index name
@return true if the index already exist
@throws Exception if the elasticsearch call is failing | [
"Check",
"if",
"an",
"index",
"already",
"exist"
] | train | https://github.com/dadoonet/spring-elasticsearch/blob/b338223818a5bdf5d9c06c88cb98589c843fd293/src/main/java/fr/pilato/spring/elasticsearch/type/TypeElasticsearchUpdater.java#L92-L100 |
kiegroup/jbpm | jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java | QueryCriteriaUtil.createRangePredicate | @SuppressWarnings("unchecked")
private static <Y extends Comparable<? super Y>> Predicate createRangePredicate( CriteriaBuilder builder, Expression field, Object start, Object end, Class<Y> rangeType ) {
"""
Helper method for creating a ranged (between, open-ended) {@link Predicate}
@param builder The {@lin... | java | @SuppressWarnings("unchecked")
private static <Y extends Comparable<? super Y>> Predicate createRangePredicate( CriteriaBuilder builder, Expression field, Object start, Object end, Class<Y> rangeType ) {
if( start != null && end != null ) {
// TODO :asserts!
return builder.between(fi... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"Y",
"extends",
"Comparable",
"<",
"?",
"super",
"Y",
">",
">",
"Predicate",
"createRangePredicate",
"(",
"CriteriaBuilder",
"builder",
",",
"Expression",
"field",
",",
"Object",
"star... | Helper method for creating a ranged (between, open-ended) {@link Predicate}
@param builder The {@link CriteriaBuilder}, helpful when creating {@link Predicate}s to add to the {@link CriteriaQuery}
@param entityField The {@link Expression} representing a field/column in an entity/table.
@param start The start value of ... | [
"Helper",
"method",
"for",
"creating",
"a",
"ranged",
"(",
"between",
"open",
"-",
"ended",
")",
"{",
"@link",
"Predicate",
"}"
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java#L552-L562 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java | ICUResourceBundle.getResPathKeys | private static void getResPathKeys(String path, int num, String[] keys, int start) {
"""
Fills some of the keys array (from start) with the num keys from the path string.
@param path path string
@param num must be {@link #countPathKeys(String)}
@param keys
@param start index where the first path key is store... | java | private static void getResPathKeys(String path, int num, String[] keys, int start) {
if (num == 0) {
return;
}
if (num == 1) {
keys[start] = path;
return;
}
int i = 0;
for (;;) {
int j = path.indexOf(RES_PATH_SEP_CHAR, i);
... | [
"private",
"static",
"void",
"getResPathKeys",
"(",
"String",
"path",
",",
"int",
"num",
",",
"String",
"[",
"]",
"keys",
",",
"int",
"start",
")",
"{",
"if",
"(",
"num",
"==",
"0",
")",
"{",
"return",
";",
"}",
"if",
"(",
"num",
"==",
"1",
")",
... | Fills some of the keys array (from start) with the num keys from the path string.
@param path path string
@param num must be {@link #countPathKeys(String)}
@param keys
@param start index where the first path key is stored | [
"Fills",
"some",
"of",
"the",
"keys",
"array",
"(",
"from",
"start",
")",
"with",
"the",
"num",
"keys",
"from",
"the",
"path",
"string",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L1006-L1028 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/hook/GodHandEpilogue.java | GodHandEpilogue.handleSqlCount | protected void handleSqlCount(ActionRuntime runtime) {
"""
Handle count of SQL execution in the request.
@param runtime The runtime meta of action execute. (NotNull)
"""
final CallbackContext context = CallbackContext.getCallbackContextOnThread();
if (context == null) {
return;
... | java | protected void handleSqlCount(ActionRuntime runtime) {
final CallbackContext context = CallbackContext.getCallbackContextOnThread();
if (context == null) {
return;
}
final SqlStringFilter filter = context.getSqlStringFilter();
if (filter == null || !(filter instanceof... | [
"protected",
"void",
"handleSqlCount",
"(",
"ActionRuntime",
"runtime",
")",
"{",
"final",
"CallbackContext",
"context",
"=",
"CallbackContext",
".",
"getCallbackContextOnThread",
"(",
")",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
";",
"}",
... | Handle count of SQL execution in the request.
@param runtime The runtime meta of action execute. (NotNull) | [
"Handle",
"count",
"of",
"SQL",
"execution",
"in",
"the",
"request",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/hook/GodHandEpilogue.java#L89-L106 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java | UiCompat.setHotspotBounds | public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
"""
As our DiscreteSeekBar implementation uses a circular drawable on API < 21
we want to use the same method to set its bounds as the Ripple's hotspot bounds.
@param drawable Drawable
@param left Left
@par... | java | public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//We don't want the full size rect, Lollipop ripple would be too big
int size = (right - left) / 8;
drawable.setHots... | [
"public",
"static",
"void",
"setHotspotBounds",
"(",
"Drawable",
"drawable",
",",
"int",
"left",
",",
"int",
"top",
",",
"int",
"right",
",",
"int",
"bottom",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODE... | As our DiscreteSeekBar implementation uses a circular drawable on API < 21
we want to use the same method to set its bounds as the Ripple's hotspot bounds.
@param drawable Drawable
@param left Left
@param top Top
@param right Right
@param bottom Bottom | [
"As",
"our",
"DiscreteSeekBar",
"implementation",
"uses",
"a",
"circular",
"drawable",
"on",
"API",
"<",
"21",
"we",
"want",
"to",
"use",
"the",
"same",
"method",
"to",
"set",
"its",
"bounds",
"as",
"the",
"Ripple",
"s",
"hotspot",
"bounds",
"."
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/compat/UiCompat.java#L60-L68 |
alipay/sofa-rpc | extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperConfigObserver.java | ZookeeperConfigObserver.updateConfig | public void updateConfig(AbstractInterfaceConfig config, String configPath, ChildData data) {
"""
接口配置修改子节点Data
@param config 接口配置
@param configPath 配置Path
@param data 子节点Data
"""
if (data == null) {
if (LOGGER.isInfoEnabled(config.getAppName())) {
LOGGER.info... | java | public void updateConfig(AbstractInterfaceConfig config, String configPath, ChildData data) {
if (data == null) {
if (LOGGER.isInfoEnabled(config.getAppName())) {
LOGGER.infoWithApp(config.getAppName(), "Receive update data is null");
}
} else {
if (LO... | [
"public",
"void",
"updateConfig",
"(",
"AbstractInterfaceConfig",
"config",
",",
"String",
"configPath",
",",
"ChildData",
"data",
")",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isInfoEnabled",
"(",
"config",
".",
"getAppName... | 接口配置修改子节点Data
@param config 接口配置
@param configPath 配置Path
@param data 子节点Data | [
"接口配置修改子节点Data"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperConfigObserver.java#L79-L92 |
visallo/vertexium | core/src/main/java/org/vertexium/ElementBuilder.java | ElementBuilder.setProperty | public ElementBuilder<T> setProperty(String name, Object value, Visibility visibility) {
"""
Sets or updates a property value. The property key will be set to a constant. This is a convenience method
which allows treating the multi-valued nature of properties as only containing a single value. Care must be
taken... | java | public ElementBuilder<T> setProperty(String name, Object value, Visibility visibility) {
return setProperty(name, value, Metadata.create(FetchHints.ALL), visibility);
} | [
"public",
"ElementBuilder",
"<",
"T",
">",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"Visibility",
"visibility",
")",
"{",
"return",
"setProperty",
"(",
"name",
",",
"value",
",",
"Metadata",
".",
"create",
"(",
"FetchHints",
".",
... | Sets or updates a property value. The property key will be set to a constant. This is a convenience method
which allows treating the multi-valued nature of properties as only containing a single value. Care must be
taken when using this method because properties are not only uniquely identified by just key and name but... | [
"Sets",
"or",
"updates",
"a",
"property",
"value",
".",
"The",
"property",
"key",
"will",
"be",
"set",
"to",
"a",
"constant",
".",
"This",
"is",
"a",
"convenience",
"method",
"which",
"allows",
"treating",
"the",
"multi",
"-",
"valued",
"nature",
"of",
"... | train | https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/core/src/main/java/org/vertexium/ElementBuilder.java#L43-L45 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/MathPlag.java | MathPlag.compareSimilarMathML | public static List<Match> compareSimilarMathML(String refMathML, String compMathML) throws MathNodeException {
"""
Compare two MathML formulas against each other. The MathML string will be transformed into a {@link CMMLInfo}
document and then to a {@link MathNode} tree.
<br/>
The formulas are compared to find s... | java | public static List<Match> compareSimilarMathML(String refMathML, String compMathML) throws MathNodeException {
// switch from a string > CMMLInfo document > abstract MathNode tree
MathNode refMathNode;
MathNode compMathNode;
try {
refMathNode = MathNodeGenerator.generateMathN... | [
"public",
"static",
"List",
"<",
"Match",
">",
"compareSimilarMathML",
"(",
"String",
"refMathML",
",",
"String",
"compMathML",
")",
"throws",
"MathNodeException",
"{",
"// switch from a string > CMMLInfo document > abstract MathNode tree",
"MathNode",
"refMathNode",
";",
"... | Compare two MathML formulas against each other. The MathML string will be transformed into a {@link CMMLInfo}
document and then to a {@link MathNode} tree.
<br/>
The formulas are compared to find similar structures.
@param refMathML Reference MathML string (must contain pMML and cMML)
@param compMathML Comparison Mat... | [
"Compare",
"two",
"MathML",
"formulas",
"against",
"each",
"other",
".",
"The",
"MathML",
"string",
"will",
"be",
"transformed",
"into",
"a",
"{",
"@link",
"CMMLInfo",
"}",
"document",
"and",
"then",
"to",
"a",
"{",
"@link",
"MathNode",
"}",
"tree",
".",
... | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/MathPlag.java#L72-L87 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.asString_ApiPlanBeans | public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
"""
Converts the list of plans to a string for display/comparison.
@param plans the plans
@return the plans as a string
"""
TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
@Override
... | java | public static String asString_ApiPlanBeans(Set<ApiPlanBean> plans) {
TreeSet<ApiPlanBean> sortedPlans = new TreeSet<>(new Comparator<ApiPlanBean>() {
@Override
public int compare(ApiPlanBean o1, ApiPlanBean o2) {
String p1 = o1.getPlanId() + ":" + o1.getVersion(); //$NON-... | [
"public",
"static",
"String",
"asString_ApiPlanBeans",
"(",
"Set",
"<",
"ApiPlanBean",
">",
"plans",
")",
"{",
"TreeSet",
"<",
"ApiPlanBean",
">",
"sortedPlans",
"=",
"new",
"TreeSet",
"<>",
"(",
"new",
"Comparator",
"<",
"ApiPlanBean",
">",
"(",
")",
"{",
... | Converts the list of plans to a string for display/comparison.
@param plans the plans
@return the plans as a string | [
"Converts",
"the",
"list",
"of",
"plans",
"to",
"a",
"string",
"for",
"display",
"/",
"comparison",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L806-L829 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllSubClasses | public void forAllSubClasses(String template, Properties attributes) throws XDocletException {
"""
The <code>forAllSubClasses</code> method iterates through all sub types of the current type (classes if it is a
class or classes and interfaces for an interface).
@param template The template
@param... | java | public void forAllSubClasses(String template, Properties attributes) throws XDocletException
{
ArrayList subTypes = new ArrayList();
XClass type = getCurrentClass();
addDirectSubTypes(type, subTypes);
int pos = 0;
ClassDescriptorDef classDef;
... | [
"public",
"void",
"forAllSubClasses",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"ArrayList",
"subTypes",
"=",
"new",
"ArrayList",
"(",
")",
";",
"XClass",
"type",
"=",
"getCurrentClass",
"(",
")",
";",
... | The <code>forAllSubClasses</code> method iterates through all sub types of the current type (classes if it is a
class or classes and interfaces for an interface).
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag ... | [
"The",
"<code",
">",
"forAllSubClasses<",
"/",
"code",
">",
"method",
"iterates",
"through",
"all",
"sub",
"types",
"of",
"the",
"current",
"type",
"(",
"classes",
"if",
"it",
"is",
"a",
"class",
"or",
"classes",
"and",
"interfaces",
"for",
"an",
"interfac... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L283-L313 |
citiususc/hipster | hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java | Maze2D.updateRectangle | public void updateRectangle(Point a, Point b, Symbol symbol) {
"""
Replace all tiles inside the rectangle with the provided symbol.
@param a point a of the rectangle.
@param b point b of the rectangle.
@param symbol symbol to be inserted in each tile.
"""
int xfrom = (a.x < b.x) ? a.x : b.x;
... | java | public void updateRectangle(Point a, Point b, Symbol symbol) {
int xfrom = (a.x < b.x) ? a.x : b.x;
int xto = (a.x > b.x) ? a.x : b.x;
int yfrom = (a.y < b.y) ? a.y : b.y;
int yto = (a.y > b.y) ? a.y : b.y;
for (int x = xfrom; x <= xto; x++) {
for (int y = yfrom; y <=... | [
"public",
"void",
"updateRectangle",
"(",
"Point",
"a",
",",
"Point",
"b",
",",
"Symbol",
"symbol",
")",
"{",
"int",
"xfrom",
"=",
"(",
"a",
".",
"x",
"<",
"b",
".",
"x",
")",
"?",
"a",
".",
"x",
":",
"b",
".",
"x",
";",
"int",
"xto",
"=",
... | Replace all tiles inside the rectangle with the provided symbol.
@param a point a of the rectangle.
@param b point b of the rectangle.
@param symbol symbol to be inserted in each tile. | [
"Replace",
"all",
"tiles",
"inside",
"the",
"rectangle",
"with",
"the",
"provided",
"symbol",
"."
] | train | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java#L263-L273 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java | OverrideService.getCurrentMethodOrdinal | public int getCurrentMethodOrdinal(int overrideId, int pathId, String clientUUID, String[] filters) throws Exception {
"""
Get the ordinal value for the last of a particular override on a path
@param overrideId Id of the override to check
@param pathId Path the override is on
@param clientUUID UUID of the cli... | java | public int getCurrentMethodOrdinal(int overrideId, int pathId, String clientUUID, String[] filters) throws Exception {
int currentOrdinal = 0;
List<EnabledEndpoint> enabledEndpoints = getEnabledEndpoints(pathId, clientUUID, filters);
for (EnabledEndpoint enabledEndpoint : enabledEndpoints) {
... | [
"public",
"int",
"getCurrentMethodOrdinal",
"(",
"int",
"overrideId",
",",
"int",
"pathId",
",",
"String",
"clientUUID",
",",
"String",
"[",
"]",
"filters",
")",
"throws",
"Exception",
"{",
"int",
"currentOrdinal",
"=",
"0",
";",
"List",
"<",
"EnabledEndpoint"... | Get the ordinal value for the last of a particular override on a path
@param overrideId Id of the override to check
@param pathId Path the override is on
@param clientUUID UUID of the client
@param filters If supplied, only endpoints ending with values in filters are returned
@return The integer ordinal
@throws Except... | [
"Get",
"the",
"ordinal",
"value",
"for",
"the",
"last",
"of",
"a",
"particular",
"override",
"on",
"a",
"path"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L692-L701 |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/StagemonitorCoreConfigurationSourceInitializer.java | StagemonitorCoreConfigurationSourceInitializer.assertRemotePropertiesServerIsAvailable | private void assertRemotePropertiesServerIsAvailable(final URL configUrl) {
"""
Does a simple HEAD request to a configuration endpoint to check if it's reachable. If not an
IllegalStateException is thrown
@param configUrl Full qualified configuration url
"""
new HttpClient().send(
"HEAD",
configU... | java | private void assertRemotePropertiesServerIsAvailable(final URL configUrl) {
new HttpClient().send(
"HEAD",
configUrl.toExternalForm(),
new HashMap<String, String>(),
null,
new HttpClient.ResponseHandler<Void>() {
@Override
public Void handleResponse(HttpRequest<?> httpRequest, InputStrea... | [
"private",
"void",
"assertRemotePropertiesServerIsAvailable",
"(",
"final",
"URL",
"configUrl",
")",
"{",
"new",
"HttpClient",
"(",
")",
".",
"send",
"(",
"\"HEAD\"",
",",
"configUrl",
".",
"toExternalForm",
"(",
")",
",",
"new",
"HashMap",
"<",
"String",
",",... | Does a simple HEAD request to a configuration endpoint to check if it's reachable. If not an
IllegalStateException is thrown
@param configUrl Full qualified configuration url | [
"Does",
"a",
"simple",
"HEAD",
"request",
"to",
"a",
"configuration",
"endpoint",
"to",
"check",
"if",
"it",
"s",
"reachable",
".",
"If",
"not",
"an",
"IllegalStateException",
"is",
"thrown"
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/StagemonitorCoreConfigurationSourceInitializer.java#L103-L120 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/processors/impl/SecurityExceptionProcessor.java | SecurityExceptionProcessor.handleAccessDeniedException | protected void handleAccessDeniedException(RequestContext context, AccessDeniedException e) throws
SecurityProviderException, IOException {
"""
Handles the specified {@link AccessDeniedException}, by calling the {@link AccessDeniedHandler}.
"""
Authentication auth = SecurityUtils.getAuthent... | java | protected void handleAccessDeniedException(RequestContext context, AccessDeniedException e) throws
SecurityProviderException, IOException {
Authentication auth = SecurityUtils.getAuthentication(context.getRequest());
// If user is anonymous, authentication is required
if (auth == nul... | [
"protected",
"void",
"handleAccessDeniedException",
"(",
"RequestContext",
"context",
",",
"AccessDeniedException",
"e",
")",
"throws",
"SecurityProviderException",
",",
"IOException",
"{",
"Authentication",
"auth",
"=",
"SecurityUtils",
".",
"getAuthentication",
"(",
"co... | Handles the specified {@link AccessDeniedException}, by calling the {@link AccessDeniedHandler}. | [
"Handles",
"the",
"specified",
"{"
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/SecurityExceptionProcessor.java#L127-L145 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java | PipelineBuilder.addIntExcExpression | public void addIntExcExpression(final INodeReadTrx mTransaction, final boolean mIsIntersect) {
"""
Adds a intersect or a exception expression to the pipeline.
@param mTransaction
Transaction to operate with.
@param mIsIntersect
true, if expression is an intersection
"""
assert getPipeStack().siz... | java | public void addIntExcExpression(final INodeReadTrx mTransaction, final boolean mIsIntersect) {
assert getPipeStack().size() >= 2;
final INodeReadTrx rtx = mTransaction;
final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
final AbsAxis mOperand1 = getPipeStack().pop().getExpr();
... | [
"public",
"void",
"addIntExcExpression",
"(",
"final",
"INodeReadTrx",
"mTransaction",
",",
"final",
"boolean",
"mIsIntersect",
")",
"{",
"assert",
"getPipeStack",
"(",
")",
".",
"size",
"(",
")",
">=",
"2",
";",
"final",
"INodeReadTrx",
"rtx",
"=",
"mTransact... | Adds a intersect or a exception expression to the pipeline.
@param mTransaction
Transaction to operate with.
@param mIsIntersect
true, if expression is an intersection | [
"Adds",
"a",
"intersect",
"or",
"a",
"exception",
"expression",
"to",
"the",
"pipeline",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java#L458-L475 |
JM-Lab/utils-java9 | src/main/java/kr/jm/utils/helper/JMJson.java | JMJson.toJsonFile | public static File toJsonFile(String jsonString, File returnJsonFile) {
"""
To json file file.
@param jsonString the json string
@param returnJsonFile the return json file
@return the file
"""
try {
jsonMapper.writeValue(returnJsonFile, jsonString);
return returnJsonFil... | java | public static File toJsonFile(String jsonString, File returnJsonFile) {
try {
jsonMapper.writeValue(returnJsonFile, jsonString);
return returnJsonFile;
} catch (Exception e) {
return JMExceptionManager.handleExceptionAndReturnNull(log, e,
"toJsonFi... | [
"public",
"static",
"File",
"toJsonFile",
"(",
"String",
"jsonString",
",",
"File",
"returnJsonFile",
")",
"{",
"try",
"{",
"jsonMapper",
".",
"writeValue",
"(",
"returnJsonFile",
",",
"jsonString",
")",
";",
"return",
"returnJsonFile",
";",
"}",
"catch",
"(",... | To json file file.
@param jsonString the json string
@param returnJsonFile the return json file
@return the file | [
"To",
"json",
"file",
"file",
"."
] | train | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/helper/JMJson.java#L87-L95 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/config/PropertyLoaderFromResource.java | PropertyLoaderFromResource.loadPropsFromResource | private static Properties loadPropsFromResource(String resourceName, boolean failOnResourceNotFoundOrNotLoaded) {
"""
Load properties from a resource.
@param resourceName
@param failOnResourceNotFoundOrNotLoaded when true, a ConfigException
is raised if the resource cannot be found or loaded
@return a {@link... | java | private static Properties loadPropsFromResource(String resourceName, boolean failOnResourceNotFoundOrNotLoaded) {
Properties props = new Properties();
InputStream resource = PropertyLoaderFromResource.class.getResourceAsStream(resourceName);
boolean resourceNotFound = (resource == null);
if(resourceNotFound) {
... | [
"private",
"static",
"Properties",
"loadPropsFromResource",
"(",
"String",
"resourceName",
",",
"boolean",
"failOnResourceNotFoundOrNotLoaded",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"InputStream",
"resource",
"=",
"PropertyLoaderFromR... | Load properties from a resource.
@param resourceName
@param failOnResourceNotFoundOrNotLoaded when true, a ConfigException
is raised if the resource cannot be found or loaded
@return a {@link Properties} instance with the properties loaded from the resource;
might be empty if the resource is not found or if it cannot ... | [
"Load",
"properties",
"from",
"a",
"resource",
"."
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/config/PropertyLoaderFromResource.java#L40-L62 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/TaskExecutorManager.java | TaskExecutorManager.spawnExecutor | public TaskExecutor spawnExecutor(Task task) {
"""
启动 TaskExecutor
@param task {@link Task}
@return {@link TaskExecutor}
"""
final TaskExecutor executor = new TaskExecutor(this.scheduler, task);
synchronized (this.executors) {
this.executors.add(executor);
}
// 子线程是否为deamon线程取决于父线程,因此此处无需显示... | java | public TaskExecutor spawnExecutor(Task task) {
final TaskExecutor executor = new TaskExecutor(this.scheduler, task);
synchronized (this.executors) {
this.executors.add(executor);
}
// 子线程是否为deamon线程取决于父线程,因此此处无需显示调用
// executor.setDaemon(this.scheduler.daemon);
// executor.start();
this.schedule... | [
"public",
"TaskExecutor",
"spawnExecutor",
"(",
"Task",
"task",
")",
"{",
"final",
"TaskExecutor",
"executor",
"=",
"new",
"TaskExecutor",
"(",
"this",
".",
"scheduler",
",",
"task",
")",
";",
"synchronized",
"(",
"this",
".",
"executors",
")",
"{",
"this",
... | 启动 TaskExecutor
@param task {@link Task}
@return {@link TaskExecutor} | [
"启动",
"TaskExecutor"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/TaskExecutorManager.java#L31-L41 |
wildfly-extras/wildfly-camel | common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java | IllegalStateAssertion.assertTrue | public static Boolean assertTrue(Boolean value, String message) {
"""
Throws an IllegalStateException when the given value is not true.
"""
if (!Boolean.valueOf(value))
throw new IllegalStateException(message);
return value;
} | java | public static Boolean assertTrue(Boolean value, String message) {
if (!Boolean.valueOf(value))
throw new IllegalStateException(message);
return value;
} | [
"public",
"static",
"Boolean",
"assertTrue",
"(",
"Boolean",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"message",
")",
";",
"return",
"value... | Throws an IllegalStateException when the given value is not true. | [
"Throws",
"an",
"IllegalStateException",
"when",
"the",
"given",
"value",
"is",
"not",
"true",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java#L57-L62 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.getBulk | @Override
public Map<String, Object> getBulk(Collection<String> keys) {
"""
Get the values for multiple keys from the cache.
@param keys the keys
@return a map of the values (for each value that exists)
@throws OperationTimeoutException if the global operation timeout is
exceeded
@throws IllegalStateExcep... | java | @Override
public Map<String, Object> getBulk(Collection<String> keys) {
return getBulk(keys, transcoder);
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getBulk",
"(",
"Collection",
"<",
"String",
">",
"keys",
")",
"{",
"return",
"getBulk",
"(",
"keys",
",",
"transcoder",
")",
";",
"}"
] | Get the values for multiple keys from the cache.
@param keys the keys
@return a map of the values (for each value that exists)
@throws OperationTimeoutException if the global operation timeout is
exceeded
@throws IllegalStateException in the rare circumstance where queue is too
full to accept any more requests | [
"Get",
"the",
"values",
"for",
"multiple",
"keys",
"from",
"the",
"cache",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1614-L1617 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/Run.java | Run.attachRunListeners | static void attachRunListeners(Object runner, final RunNotifier notifier) throws Exception {
"""
Attach registered run listeners to the specified run notifier.
<p>
<b>NOTE</b>: If the specified run notifier has already been seen, do nothing.
@param runner JUnit test runner
@param notifier JUnit {@link RunNot... | java | static void attachRunListeners(Object runner, final RunNotifier notifier) throws Exception {
if (NOTIFIERS.add(notifier)) {
Description description = LifecycleHooks.invoke(runner, "getDescription");
synchronized(runListenerLoader) {
for (RunListener listener : runList... | [
"static",
"void",
"attachRunListeners",
"(",
"Object",
"runner",
",",
"final",
"RunNotifier",
"notifier",
")",
"throws",
"Exception",
"{",
"if",
"(",
"NOTIFIERS",
".",
"add",
"(",
"notifier",
")",
")",
"{",
"Description",
"description",
"=",
"LifecycleHooks",
... | Attach registered run listeners to the specified run notifier.
<p>
<b>NOTE</b>: If the specified run notifier has already been seen, do nothing.
@param runner JUnit test runner
@param notifier JUnit {@link RunNotifier} object
@throws Exception if {@code run-started} notification | [
"Attach",
"registered",
"run",
"listeners",
"to",
"the",
"specified",
"run",
"notifier",
".",
"<p",
">",
"<b",
">",
"NOTE<",
"/",
"b",
">",
":",
"If",
"the",
"specified",
"run",
"notifier",
"has",
"already",
"been",
"seen",
"do",
"nothing",
"."
] | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/Run.java#L92-L102 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisUtil.java | CmsCmisUtil.addPropertyDefault | @SuppressWarnings("unchecked")
public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
"""
Adds the default value of property if defined.
@param props the Properties object
@param propDef the property definition
@return true if the property could be added
"""... | java | @SuppressWarnings("unchecked")
public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
if ((props == null) || (props.getProperties() == null)) {
throw new IllegalArgumentException("Props must not be null!");
}
if (propDef == null) ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"addPropertyDefault",
"(",
"PropertiesImpl",
"props",
",",
"PropertyDefinition",
"<",
"?",
">",
"propDef",
")",
"{",
"if",
"(",
"(",
"props",
"==",
"null",
")",
"||",
"(",
"pr... | Adds the default value of property if defined.
@param props the Properties object
@param propDef the property definition
@return true if the property could be added | [
"Adds",
"the",
"default",
"value",
"of",
"property",
"if",
"defined",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L215-L261 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java | Util.createLocalStoredFile | public static StoredFile createLocalStoredFile(InputStream is, String sourceUrl, String localFilePath, String mimeType) {
"""
This method creates a cached file copy from the source input stream.
@param is the source input stream
@param sourceUrl the source file path or uri string
@param localFi... | java | public static StoredFile createLocalStoredFile(InputStream is, String sourceUrl, String localFilePath, String mimeType) {
if (is == null) {
return null;
}
// Copy the file contents over.
CountingOutputStream cos = null;
BufferedOutputStream bos = null;
FileOutputStream fos = null;
try {
File localF... | [
"public",
"static",
"StoredFile",
"createLocalStoredFile",
"(",
"InputStream",
"is",
",",
"String",
"sourceUrl",
",",
"String",
"localFilePath",
",",
"String",
"mimeType",
")",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Cop... | This method creates a cached file copy from the source input stream.
@param is the source input stream
@param sourceUrl the source file path or uri string
@param localFilePath the cache file path string
@param mimeType the mimeType of the source inputstream
@return null if failed, otherwise a Store... | [
"This",
"method",
"creates",
"a",
"cached",
"file",
"copy",
"from",
"the",
"source",
"input",
"stream",
"."
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/Util.java#L943-L985 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPathAsync | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) {
"""
Asynchronously creates a new message receiver to the entity on the messagingFactory.
@param messagingFactory messaging factory (which repr... | java | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) {
return createMessageReceiverFromEntityPathAsync(messagingFactory, entityPath, null, receiveMode);
} | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageReceiver",
">",
"createMessageReceiverFromEntityPathAsync",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
",",
"ReceiveMode",
"receiveMode",
")",
"{",
"return",
"createMessageReceiverFromEntityPa... | Asynchronously creates a new message receiver to the entity on the messagingFactory.
@param messagingFactory messaging factory (which represents a connection) on which receiver needs to be created.
@param entityPath path of entity
@param receiveMode PeekLock or ReceiveAndDelete
@return a CompletableFuture representing ... | [
"Asynchronously",
"creates",
"a",
"new",
"message",
"receiver",
"to",
"the",
"entity",
"on",
"the",
"messagingFactory",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L466-L468 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/api/DRUMSInstantiator.java | DRUMSInstantiator.forceCreateTable | public static <Data extends AbstractKVStorable> DRUMS<Data> forceCreateTable(AbstractHashFunction hashFunction,
DRUMSParameterSet<Data> gp)
throws IOException {
"""
This method creates a new {@link DRUMS} object. The old {@link DRUMS} will be overwritten. <br/>
If the given directory doesn... | java | public static <Data extends AbstractKVStorable> DRUMS<Data> forceCreateTable(AbstractHashFunction hashFunction,
DRUMSParameterSet<Data> gp)
throws IOException {
File databaseDirectoryFile = new File(gp.DATABASE_DIRECTORY);
databaseDirectoryFile.delete();
return createTabl... | [
"public",
"static",
"<",
"Data",
"extends",
"AbstractKVStorable",
">",
"DRUMS",
"<",
"Data",
">",
"forceCreateTable",
"(",
"AbstractHashFunction",
"hashFunction",
",",
"DRUMSParameterSet",
"<",
"Data",
">",
"gp",
")",
"throws",
"IOException",
"{",
"File",
"databas... | This method creates a new {@link DRUMS} object. The old {@link DRUMS} will be overwritten. <br/>
If the given directory doesn't exist, it will be created.<br/>
@param hashFunction
the hash function, decides where to store/search elements
@param gp
pointer to the {@link DRUMSParameterSet} used by the {@link DRUMS} to o... | [
"This",
"method",
"creates",
"a",
"new",
"{",
"@link",
"DRUMS",
"}",
"object",
".",
"The",
"old",
"{",
"@link",
"DRUMS",
"}",
"will",
"be",
"overwritten",
".",
"<br",
"/",
">",
"If",
"the",
"given",
"directory",
"doesn",
"t",
"exist",
"it",
"will",
"... | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/api/DRUMSInstantiator.java#L85-L91 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/css/sass/ruby/JawrSassResolver.java | JawrSassResolver.addLinkedResource | protected void addLinkedResource(String path) {
"""
Adds a path to the linked resource
@param path
the resource path
"""
FilePathMapping linkedResource = getFilePathMapping(path);
if (linkedResource != null) {
addLinkedResource(linkedResource);
if (bundle != null) {
bundle.getLinkedFilePathMa... | java | protected void addLinkedResource(String path) {
FilePathMapping linkedResource = getFilePathMapping(path);
if (linkedResource != null) {
addLinkedResource(linkedResource);
if (bundle != null) {
bundle.getLinkedFilePathMappings()
.add(new FilePathMapping(bundle, linkedResource.getPath(), linkedResour... | [
"protected",
"void",
"addLinkedResource",
"(",
"String",
"path",
")",
"{",
"FilePathMapping",
"linkedResource",
"=",
"getFilePathMapping",
"(",
"path",
")",
";",
"if",
"(",
"linkedResource",
"!=",
"null",
")",
"{",
"addLinkedResource",
"(",
"linkedResource",
")",
... | Adds a path to the linked resource
@param path
the resource path | [
"Adds",
"a",
"path",
"to",
"the",
"linked",
"resource"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/css/sass/ruby/JawrSassResolver.java#L189-L198 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.getMapKeyFieldType | public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel) {
"""
Determine the generic key type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
neste... | java | public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel) {
return getGenericFieldType(mapField, Map.class, 0, null, nestingLevel);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getMapKeyFieldType",
"(",
"Field",
"mapField",
",",
"int",
"nestingLevel",
")",
"{",
"return",
"getGenericFieldType",
"(",
"mapField",
",",
"Map",
".",
"class",
",",
"0",
",",
"null",
",",
"nestingLevel",
")",
"... | Determine the generic key type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
@return the generic type, ... | [
"Determine",
"the",
"generic",
"key",
"type",
"of",
"the",
"given",
"Map",
"field",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java#L125-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.getBean | public BeanO getBean(ContainerTx tx, BeanId id) {
"""
Return bean from cache for given transaction, bean id. Return null
if no entry in cache.
"""
return id.getActivationStrategy().atGet(tx, id);
} | java | public BeanO getBean(ContainerTx tx, BeanId id)
{
return id.getActivationStrategy().atGet(tx, id);
} | [
"public",
"BeanO",
"getBean",
"(",
"ContainerTx",
"tx",
",",
"BeanId",
"id",
")",
"{",
"return",
"id",
".",
"getActivationStrategy",
"(",
")",
".",
"atGet",
"(",
"tx",
",",
"id",
")",
";",
"}"
] | Return bean from cache for given transaction, bean id. Return null
if no entry in cache. | [
"Return",
"bean",
"from",
"cache",
"for",
"given",
"transaction",
"bean",
"id",
".",
"Return",
"null",
"if",
"no",
"entry",
"in",
"cache",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L368-L371 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/RowCountOutputHandler.java | RowCountOutputHandler.handle | public T handle(List<QueryParameters> outputList) {
"""
Returns amount of records updated (value is calculated by JDBC Driver)
@param outputList Query output
@return
"""
Number result = 0;
if (outputList == null || outputList.isEmpty() == true) {
throw new IllegalArgumentExcept... | java | public T handle(List<QueryParameters> outputList) {
Number result = 0;
if (outputList == null || outputList.isEmpty() == true) {
throw new IllegalArgumentException("Error! Output should always contain at least one element");
}
QueryParameters stmtParams = outputList.get(0);... | [
"public",
"T",
"handle",
"(",
"List",
"<",
"QueryParameters",
">",
"outputList",
")",
"{",
"Number",
"result",
"=",
"0",
";",
"if",
"(",
"outputList",
"==",
"null",
"||",
"outputList",
".",
"isEmpty",
"(",
")",
"==",
"true",
")",
"{",
"throw",
"new",
... | Returns amount of records updated (value is calculated by JDBC Driver)
@param outputList Query output
@return | [
"Returns",
"amount",
"of",
"records",
"updated",
"(",
"value",
"is",
"calculated",
"by",
"JDBC",
"Driver",
")"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/RowCountOutputHandler.java#L45-L61 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java | PropertiesConfigHelper.getCustomBundleVariantSets | public Map<String, VariantSet> getCustomBundleVariantSets(String bundleName) {
"""
Returns the map of variantSet for the bundle
@param bundleName
the bundle name
@return the map of variantSet for the bundle
"""
Map<String, VariantSet> variantSets = new HashMap<>();
StringTokenizer tk = new StringToke... | java | public Map<String, VariantSet> getCustomBundleVariantSets(String bundleName) {
Map<String, VariantSet> variantSets = new HashMap<>();
StringTokenizer tk = new StringTokenizer(
getCustomBundleProperty(bundleName, PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_VARIANTS, ""), ";");
while (tk.hasMoreTokens()) {
... | [
"public",
"Map",
"<",
"String",
",",
"VariantSet",
">",
"getCustomBundleVariantSets",
"(",
"String",
"bundleName",
")",
"{",
"Map",
"<",
"String",
",",
"VariantSet",
">",
"variantSets",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"StringTokenizer",
"tk",
"="... | Returns the map of variantSet for the bundle
@param bundleName
the bundle name
@return the map of variantSet for the bundle | [
"Returns",
"the",
"map",
"of",
"variantSet",
"for",
"the",
"bundle"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L241-L260 |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.getComment | public static String getComment(String comment) {
"""
Create a string containing a comment.
@param comment
the comment to generate.
@return the closing tag.
"""
StringBuffer _result = new StringBuffer();
return doAppendComment(_result, comment).toString();
} | java | public static String getComment(String comment)
{
StringBuffer _result = new StringBuffer();
return doAppendComment(_result, comment).toString();
} | [
"public",
"static",
"String",
"getComment",
"(",
"String",
"comment",
")",
"{",
"StringBuffer",
"_result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"return",
"doAppendComment",
"(",
"_result",
",",
"comment",
")",
".",
"toString",
"(",
")",
";",
"}"
] | Create a string containing a comment.
@param comment
the comment to generate.
@return the closing tag. | [
"Create",
"a",
"string",
"containing",
"a",
"comment",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L566-L570 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java | MBTilesHelper.getTile | public BufferedImage getTile( int x, int y, int z ) throws Exception {
"""
Get a Tile image from the database.
@param x
@param y
@param z
@return
@throws Exception
"""
try (PreparedStatement statement = connection.prepareStatement(SELECTQUERY)) {
statement.setInt(1, z);
s... | java | public BufferedImage getTile( int x, int y, int z ) throws Exception {
try (PreparedStatement statement = connection.prepareStatement(SELECTQUERY)) {
statement.setInt(1, z);
statement.setInt(2, x);
statement.setInt(3, y);
ResultSet resultSet = statement.executeQue... | [
"public",
"BufferedImage",
"getTile",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
")",
"throws",
"Exception",
"{",
"try",
"(",
"PreparedStatement",
"statement",
"=",
"connection",
".",
"prepareStatement",
"(",
"SELECTQUERY",
")",
")",
"{",
"statement"... | Get a Tile image from the database.
@param x
@param y
@param z
@return
@throws Exception | [
"Get",
"a",
"Tile",
"image",
"from",
"the",
"database",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java#L275-L292 |
virgo47/javasimon | core/src/main/java/org/javasimon/NullSimon.java | NullSimon.getAttribute | @Override
public <T> T getAttribute(String name, Class<T> clazz) {
"""
Returns {@code null}.
@param name ignored
@param clazz ignored
@return {@code null}
"""
return null;
} | java | @Override
public <T> T getAttribute(String name, Class<T> clazz) {
return null;
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"getAttribute",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"null",
";",
"}"
] | Returns {@code null}.
@param name ignored
@param clazz ignored
@return {@code null} | [
"Returns",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/NullSimon.java#L141-L144 |
overturetool/overture | core/interpreter/src/main/java/CSV.java | CSV.freadval | public static Value freadval(Value fval, Value indexVal) {
"""
Read a CSV live as a seq of ? in VDM
@param fval
name of the file to read from
@param indexVal
the line index
@return true + seq of ? or false and nil
"""
ValueList result = new ValueList();
try
{
File file = getFile(fval);
long... | java | public static Value freadval(Value fval, Value indexVal)
{
ValueList result = new ValueList();
try
{
File file = getFile(fval);
long index = indexVal.intValue(null);
SeqValue lineCells = new SeqValue();
boolean success = false;
try
{
CsvParser parser = new CsvParser(new CsvValueBuilder()
... | [
"public",
"static",
"Value",
"freadval",
"(",
"Value",
"fval",
",",
"Value",
"indexVal",
")",
"{",
"ValueList",
"result",
"=",
"new",
"ValueList",
"(",
")",
";",
"try",
"{",
"File",
"file",
"=",
"getFile",
"(",
"fval",
")",
";",
"long",
"index",
"=",
... | Read a CSV live as a seq of ? in VDM
@param fval
name of the file to read from
@param indexVal
the line index
@return true + seq of ? or false and nil | [
"Read",
"a",
"CSV",
"live",
"as",
"a",
"seq",
"of",
"?",
"in",
"VDM"
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/interpreter/src/main/java/CSV.java#L99-L152 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addExplicitListItemAsync | public Observable<Integer> addExplicitListItemAsync(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) {
"""
Add a new item to the explicit list for the Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@p... | java | public Observable<Integer> addExplicitListItemAsync(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) {
return addExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, addExplicitListItemOptionalParameter).map(new Func1<Service... | [
"public",
"Observable",
"<",
"Integer",
">",
"addExplicitListItemAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"AddExplicitListItemOptionalParameter",
"addExplicitListItemOptionalParameter",
")",
"{",
"return",
"addExplicitListItemW... | Add a new item to the explicit list for the Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param addExplicitListItemOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Il... | [
"Add",
"a",
"new",
"item",
"to",
"the",
"explicit",
"list",
"for",
"the",
"Pattern",
".",
"Any",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10021-L10028 |
camunda/camunda-engine-dmn | engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnDecisionContext.java | DefaultDmnDecisionContext.evaluateDecision | public DmnDecisionResult evaluateDecision(DmnDecision decision, VariableContext variableContext) {
"""
Evaluate a decision with the given {@link VariableContext}
@param decision the decision to evaluate
@param variableContext the available variable context
@return the result of the decision evaluation
"""... | java | public DmnDecisionResult evaluateDecision(DmnDecision decision, VariableContext variableContext) {
if(decision.getKey() == null) {
throw LOG.unableToFindAnyDecisionTable();
}
VariableMap variableMap = buildVariableMapFromVariableContext(variableContext);
List<DmnDecision> requiredDecisions = new... | [
"public",
"DmnDecisionResult",
"evaluateDecision",
"(",
"DmnDecision",
"decision",
",",
"VariableContext",
"variableContext",
")",
"{",
"if",
"(",
"decision",
".",
"getKey",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"LOG",
".",
"unableToFindAnyDecisionTable",
"("... | Evaluate a decision with the given {@link VariableContext}
@param decision the decision to evaluate
@param variableContext the available variable context
@return the result of the decision evaluation | [
"Evaluate",
"a",
"decision",
"with",
"the",
"given",
"{",
"@link",
"VariableContext",
"}"
] | train | https://github.com/camunda/camunda-engine-dmn/blob/6335ea29f66ac3c1b8c9404e15d89e0bb8b0a27c/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnDecisionContext.java#L70-L96 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newSalvatoriusClausePanel | protected Component newSalvatoriusClausePanel(final String id,
final IModel<HeaderContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the salvatorius clause. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide th... | java | protected Component newSalvatoriusClausePanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new SalvatoriusClausePanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newSalvatoriusClausePanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"SalvatoriusClausePanel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"model",
"... | Factory method for creating the new {@link Component} for the salvatorius clause. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the salvatorius clause.
@param id
the id
@param model
the model
@return the ne... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"salvatorius",
"clause",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overrid... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L364-L368 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_interface_GET | public ArrayList<OvhInterface> project_serviceName_instance_instanceId_interface_GET(String serviceName, String instanceId) throws IOException {
"""
Get interfaces
REST: GET /cloud/project/{serviceName}/instance/{instanceId}/interface
@param instanceId [required] Instance id
@param serviceName [required] Serv... | java | public ArrayList<OvhInterface> project_serviceName_instance_instanceId_interface_GET(String serviceName, String instanceId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/interface";
StringBuilder sb = path(qPath, serviceName, instanceId);
String resp = exec(qPath, "GET", ... | [
"public",
"ArrayList",
"<",
"OvhInterface",
">",
"project_serviceName_instance_instanceId_interface_GET",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/{instanceId}/... | Get interfaces
REST: GET /cloud/project/{serviceName}/instance/{instanceId}/interface
@param instanceId [required] Instance id
@param serviceName [required] Service name | [
"Get",
"interfaces"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1924-L1929 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonErrorResponseWriter.java | JsonErrorResponseWriter.getJsonError | public String getJsonError(ODataException exception) throws ODataRenderException {
"""
Gets the json error output according to ODataException.
@param exception ODataException
@return errorJsonResponse
@throws ODataRenderException If unable to render the json error message
"""
checkNotNull(exceptio... | java | public String getJsonError(ODataException exception) throws ODataRenderException {
checkNotNull(exception);
LOG.debug("Start building Json error document");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
JsonGenerator jsonGenerator = JSON_FACTORY.c... | [
"public",
"String",
"getJsonError",
"(",
"ODataException",
"exception",
")",
"throws",
"ODataRenderException",
"{",
"checkNotNull",
"(",
"exception",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Start building Json error document\"",
")",
";",
"ByteArrayOutputStream",
"output... | Gets the json error output according to ODataException.
@param exception ODataException
@return errorJsonResponse
@throws ODataRenderException If unable to render the json error message | [
"Gets",
"the",
"json",
"error",
"output",
"according",
"to",
"ODataException",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonErrorResponseWriter.java#L52-L79 |
cdk/cdk | storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java | InChINumbersTools.parseAuxInfo | public static void parseAuxInfo(String aux, long[] numbers) {
"""
Parse the atom numbering from the auxinfo.
@param aux InChI AuxInfo
@param numbers the atom numbers
"""
aux = aux.substring(aux.indexOf("/N:") + 3);
String numberStringAux = aux.substring(0, aux.indexOf('/'));
int i =... | java | public static void parseAuxInfo(String aux, long[] numbers) {
aux = aux.substring(aux.indexOf("/N:") + 3);
String numberStringAux = aux.substring(0, aux.indexOf('/'));
int i = 1;
for (String numberString : numberStringAux.split("[,;]"))
numbers[Integer.valueOf(numberString) -... | [
"public",
"static",
"void",
"parseAuxInfo",
"(",
"String",
"aux",
",",
"long",
"[",
"]",
"numbers",
")",
"{",
"aux",
"=",
"aux",
".",
"substring",
"(",
"aux",
".",
"indexOf",
"(",
"\"/N:\"",
")",
"+",
"3",
")",
";",
"String",
"numberStringAux",
"=",
... | Parse the atom numbering from the auxinfo.
@param aux InChI AuxInfo
@param numbers the atom numbers | [
"Parse",
"the",
"atom",
"numbering",
"from",
"the",
"auxinfo",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/graph/invariant/InChINumbersTools.java#L63-L69 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/LastaAction.java | LastaAction.toActionUrl | protected String toActionUrl(Class<?> actionType, UrlChain chain) {
"""
Convert to URL string to move the action.
<pre>
<span style="color: #3F7E5E">// /product/list/3</span>
String url = toActionUrl(ProductListAction.<span style="color: #70226C">class</span>, moreUrl(3));
</pre>
@param actionType The class t... | java | protected String toActionUrl(Class<?> actionType, UrlChain chain) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("chain", chain);
return actionPathResolver.toActionUrl(actionType, chain);
} | [
"protected",
"String",
"toActionUrl",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"UrlChain",
"chain",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"chain\"",
",",
"chain",
")",
";",
... | Convert to URL string to move the action.
<pre>
<span style="color: #3F7E5E">// /product/list/3</span>
String url = toActionUrl(ProductListAction.<span style="color: #70226C">class</span>, moreUrl(3));
</pre>
@param actionType The class type of action that it redirects to. (NotNull)
@param chain The chain of URL to bui... | [
"Convert",
"to",
"URL",
"string",
"to",
"move",
"the",
"action",
".",
"<pre",
">",
"<span",
"style",
"=",
"color",
":",
"#3F7E5E",
">",
"//",
"/",
"product",
"/",
"list",
"/",
"3<",
"/",
"span",
">",
"String",
"url",
"=",
"toActionUrl",
"(",
"Product... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L553-L557 |
jbossas/jboss-invocation | src/main/java/org/jboss/invocation/proxy/ProxyFactory.java | ProxyFactory.getInvocationHandlerStatic | public static InvocationHandler getInvocationHandlerStatic(Object proxy) {
"""
Gets the {@link InvocationHandler} for a given proxy instance. This method is less efficient than
{@link #getInvocationHandler(Object)}, however it will work for any proxy, not just proxies from a specific factory
instance.
@param ... | java | public static InvocationHandler getInvocationHandlerStatic(Object proxy) {
try {
final Field field = proxy.getClass().getDeclaredField(INVOCATION_HANDLER_FIELD);
AccessController.doPrivileged(new SetAccessiblePrivilege(field));
return (InvocationHandler) field.get(proxy);
... | [
"public",
"static",
"InvocationHandler",
"getInvocationHandlerStatic",
"(",
"Object",
"proxy",
")",
"{",
"try",
"{",
"final",
"Field",
"field",
"=",
"proxy",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"INVOCATION_HANDLER_FIELD",
")",
";",
"AccessCont... | Gets the {@link InvocationHandler} for a given proxy instance. This method is less efficient than
{@link #getInvocationHandler(Object)}, however it will work for any proxy, not just proxies from a specific factory
instance.
@param proxy the proxy
@return the invocation handler | [
"Gets",
"the",
"{",
"@link",
"InvocationHandler",
"}",
"for",
"a",
"given",
"proxy",
"instance",
".",
"This",
"method",
"is",
"less",
"efficient",
"than",
"{",
"@link",
"#getInvocationHandler",
"(",
"Object",
")",
"}",
"however",
"it",
"will",
"work",
"for",... | train | https://github.com/jbossas/jboss-invocation/blob/f72586a554264cbc78fcdad9fdd3e84b833249c9/src/main/java/org/jboss/invocation/proxy/ProxyFactory.java#L416-L428 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.lockFullInodePath | public LockedInodePath lockFullInodePath(AlluxioURI uri, LockPattern lockPattern)
throws InvalidPathException, FileDoesNotExistException {
"""
Locks a path and throws an exception if the path does not exist.
@param uri a uri to lock
@param lockPattern the pattern to lock with
@return a locked inode path... | java | public LockedInodePath lockFullInodePath(AlluxioURI uri, LockPattern lockPattern)
throws InvalidPathException, FileDoesNotExistException {
LockedInodePath inodePath = lockInodePath(uri, lockPattern);
if (!inodePath.fullPathExists()) {
inodePath.close();
throw new FileDoesNotExistException(Exce... | [
"public",
"LockedInodePath",
"lockFullInodePath",
"(",
"AlluxioURI",
"uri",
",",
"LockPattern",
"lockPattern",
")",
"throws",
"InvalidPathException",
",",
"FileDoesNotExistException",
"{",
"LockedInodePath",
"inodePath",
"=",
"lockInodePath",
"(",
"uri",
",",
"lockPattern... | Locks a path and throws an exception if the path does not exist.
@param uri a uri to lock
@param lockPattern the pattern to lock with
@return a locked inode path for the uri | [
"Locks",
"a",
"path",
"and",
"throws",
"an",
"exception",
"if",
"the",
"path",
"does",
"not",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L372-L380 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ResourceUtils.java | ResourceUtils.getResource | public static URL getResource(String resource, ClassLoader classLoader) throws IOException {
"""
Returns the URL of the resource on the classpath.
@param classLoader the class loader used to load the resource
@param resource the resource to find
@return {@code URL} object for reading the resource;
{@code nul... | java | public static URL getResource(String resource, ClassLoader classLoader) throws IOException {
URL url = null;
if (classLoader != null) {
url = classLoader.getResource(resource);
}
if (url == null) {
url = ClassLoader.getSystemResource(resource);
}
i... | [
"public",
"static",
"URL",
"getResource",
"(",
"String",
"resource",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"null",
";",
"if",
"(",
"classLoader",
"!=",
"null",
")",
"{",
"url",
"=",
"classLoader",
".",
"ge... | Returns the URL of the resource on the classpath.
@param classLoader the class loader used to load the resource
@param resource the resource to find
@return {@code URL} object for reading the resource;
{@code null} if the resource could not be found
@throws IOException if the resource cannot be found or read | [
"Returns",
"the",
"URL",
"of",
"the",
"resource",
"on",
"the",
"classpath",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ResourceUtils.java#L229-L241 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/DirectoryLoaderAdaptor.java | DirectoryLoaderAdaptor.figureChunksNumber | private int figureChunksNumber(String fileName) throws IOException {
"""
Guess in how many chunks we should split this file. Should return the same value consistently
for the same file (segments are immutable) so that a full segment can be rebuilt from the upper
layers without anyone actually specifying the chun... | java | private int figureChunksNumber(String fileName) throws IOException {
long fileLength = directory.fileLength(fileName);
return figureChunksNumber(fileName, fileLength, autoChunkSize);
} | [
"private",
"int",
"figureChunksNumber",
"(",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"long",
"fileLength",
"=",
"directory",
".",
"fileLength",
"(",
"fileName",
")",
";",
"return",
"figureChunksNumber",
"(",
"fileName",
",",
"fileLength",
",",
"... | Guess in how many chunks we should split this file. Should return the same value consistently
for the same file (segments are immutable) so that a full segment can be rebuilt from the upper
layers without anyone actually specifying the chunks numbers. | [
"Guess",
"in",
"how",
"many",
"chunks",
"we",
"should",
"split",
"this",
"file",
".",
"Should",
"return",
"the",
"same",
"value",
"consistently",
"for",
"the",
"same",
"file",
"(",
"segments",
"are",
"immutable",
")",
"so",
"that",
"a",
"full",
"segment",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/DirectoryLoaderAdaptor.java#L137-L140 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java | TrieMap.modifyData | void modifyData(final TrieNode<V> node, final V value) {
"""
Sets the given value as the new value on the given node, increases size
and modCount.
"""
node.value = value;
++modCount;
++size;
} | java | void modifyData(final TrieNode<V> node, final V value) {
node.value = value;
++modCount;
++size;
} | [
"void",
"modifyData",
"(",
"final",
"TrieNode",
"<",
"V",
">",
"node",
",",
"final",
"V",
"value",
")",
"{",
"node",
".",
"value",
"=",
"value",
";",
"++",
"modCount",
";",
"++",
"size",
";",
"}"
] | Sets the given value as the new value on the given node, increases size
and modCount. | [
"Sets",
"the",
"given",
"value",
"as",
"the",
"new",
"value",
"on",
"the",
"given",
"node",
"increases",
"size",
"and",
"modCount",
"."
] | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L200-L204 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/sliding/AbstractSliding.java | AbstractSliding.newArray | protected Object newArray(Object old, int oldLen, Object arr) {
"""
Returns new oldLen ring buffer
@param old
@param oldLen
@param arr
@return
"""
int sb = Math.floorMod(begin, oldLen);
int se = Math.floorMod(end, oldLen);
if (sb < se)
{
System.arraycopy(old, sb,... | java | protected Object newArray(Object old, int oldLen, Object arr)
{
int sb = Math.floorMod(begin, oldLen);
int se = Math.floorMod(end, oldLen);
if (sb < se)
{
System.arraycopy(old, sb, arr, sb, se - sb);
}
else
{
System.arraycopy(old, sb, a... | [
"protected",
"Object",
"newArray",
"(",
"Object",
"old",
",",
"int",
"oldLen",
",",
"Object",
"arr",
")",
"{",
"int",
"sb",
"=",
"Math",
".",
"floorMod",
"(",
"begin",
",",
"oldLen",
")",
";",
"int",
"se",
"=",
"Math",
".",
"floorMod",
"(",
"end",
... | Returns new oldLen ring buffer
@param old
@param oldLen
@param arr
@return | [
"Returns",
"new",
"oldLen",
"ring",
"buffer"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/sliding/AbstractSliding.java#L163-L177 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/LuceneIndex.java | LuceneIndex.upsert | public void upsert(Term term, Document document) {
"""
Updates the specified {@link Document} by first deleting the documents containing {@code Term} and then adding
the new document. The delete and then add are atomic as seen by a reader on the same index (flush may happen only
after the add).
@param term ... | java | public void upsert(Term term, Document document) {
Log.debug("Updating document %s with term %s", document, term);
try {
indexWriter.updateDocument(term, document);
} catch (IOException e) {
Log.error(e, "Error while updating document %s with term %s", document, term);
... | [
"public",
"void",
"upsert",
"(",
"Term",
"term",
",",
"Document",
"document",
")",
"{",
"Log",
".",
"debug",
"(",
"\"Updating document %s with term %s\"",
",",
"document",
",",
"term",
")",
";",
"try",
"{",
"indexWriter",
".",
"updateDocument",
"(",
"term",
... | Updates the specified {@link Document} by first deleting the documents containing {@code Term} and then adding
the new document. The delete and then add are atomic as seen by a reader on the same index (flush may happen only
after the add).
@param term The {@link Term} to identify the document(s) to be deleted.
@p... | [
"Updates",
"the",
"specified",
"{",
"@link",
"Document",
"}",
"by",
"first",
"deleting",
"the",
"documents",
"containing",
"{",
"@code",
"Term",
"}",
"and",
"then",
"adding",
"the",
"new",
"document",
".",
"The",
"delete",
"and",
"then",
"add",
"are",
"ato... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/LuceneIndex.java#L147-L155 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setCost | public void setCost(int index, Number value) {
"""
Set a cost value.
@param index cost index (1-10)
@param value cost value
"""
set(selectField(ResourceFieldLists.CUSTOM_COST, index), value);
} | java | public void setCost(int index, Number value)
{
set(selectField(ResourceFieldLists.CUSTOM_COST, index), value);
} | [
"public",
"void",
"setCost",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_COST",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a cost value.
@param index cost index (1-10)
@param value cost value | [
"Set",
"a",
"cost",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1705-L1708 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java | MatFileReader.readHeader | private void readHeader(ByteBuffer buf) throws IOException {
"""
Reads MAT-file header.
Modifies <code>buf</code> position.
@param buf
<code>ByteBuffer</code>
@throws IOException
if reading from buffer fails or if this is not a valid
MAT-file
"""
//header values
String description;
... | java | private void readHeader(ByteBuffer buf) throws IOException
{
//header values
String description;
int version;
byte[] endianIndicator = new byte[2];
// This part of the header is missing if the file isn't a regular mat file. So ignore.
if (matType == MatFileType.Regu... | [
"private",
"void",
"readHeader",
"(",
"ByteBuffer",
"buf",
")",
"throws",
"IOException",
"{",
"//header values",
"String",
"description",
";",
"int",
"version",
";",
"byte",
"[",
"]",
"endianIndicator",
"=",
"new",
"byte",
"[",
"2",
"]",
";",
"// This part of ... | Reads MAT-file header.
Modifies <code>buf</code> position.
@param buf
<code>ByteBuffer</code>
@throws IOException
if reading from buffer fails or if this is not a valid
MAT-file | [
"Reads",
"MAT",
"-",
"file",
"header",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1370-L1422 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.getRule | public JSONObject getRule(String objectID, RequestOptions requestOptions) throws AlgoliaException {
"""
Get a query rule
@param objectID the objectID of the query rule to get
@param requestOptions Options to pass to this request
"""
if (objectID == null || objectID.length() == 0) {
throw ne... | java | public JSONObject getRule(String objectID, RequestOptions requestOptions) throws AlgoliaException {
if (objectID == null || objectID.length() == 0) {
throw new AlgoliaException("Invalid objectID");
}
try {
return client.getRequest("/1/indexes/" + encodedIndexName + "/rules/" + URLEncoder.encode(... | [
"public",
"JSONObject",
"getRule",
"(",
"String",
"objectID",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"if",
"(",
"objectID",
"==",
"null",
"||",
"objectID",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new"... | Get a query rule
@param objectID the objectID of the query rule to get
@param requestOptions Options to pass to this request | [
"Get",
"a",
"query",
"rule"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1779-L1788 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java | Partitioner.adjustWatermark | private static long adjustWatermark(String baseWatermark, WatermarkType watermarkType) {
"""
Adjust a watermark based on watermark type
@param baseWatermark the original watermark
@param watermarkType Watermark Type
@return the adjusted watermark value
"""
long result = ConfigurationKeys.DEFAULT_WATER... | java | private static long adjustWatermark(String baseWatermark, WatermarkType watermarkType) {
long result = ConfigurationKeys.DEFAULT_WATERMARK_VALUE;
switch (watermarkType) {
case SIMPLE:
result = SimpleWatermark.adjustWatermark(baseWatermark, 0);
break;
case DATE:
result = DateW... | [
"private",
"static",
"long",
"adjustWatermark",
"(",
"String",
"baseWatermark",
",",
"WatermarkType",
"watermarkType",
")",
"{",
"long",
"result",
"=",
"ConfigurationKeys",
".",
"DEFAULT_WATERMARK_VALUE",
";",
"switch",
"(",
"watermarkType",
")",
"{",
"case",
"SIMPL... | Adjust a watermark based on watermark type
@param baseWatermark the original watermark
@param watermarkType Watermark Type
@return the adjusted watermark value | [
"Adjust",
"a",
"watermark",
"based",
"on",
"watermark",
"type"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java#L285-L302 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.getList | public ListItem<MovieInfo> getList(String listId) throws MovieDbException {
"""
Get a list by its ID
@param listId
@return The list and its items
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, listId);
URL url = new ApiUrl(a... | java | public ListItem<MovieInfo> getList(String listId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, listId);
URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {
... | [
"public",
"ListItem",
"<",
"MovieInfo",
">",
"getList",
"(",
"String",
"listId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
",",
"lis... | Get a list by its ID
@param listId
@return The list and its items
@throws MovieDbException | [
"Get",
"a",
"list",
"by",
"its",
"ID"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L66-L79 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/utils/InstancesDistributor.java | InstancesDistributor.removeFromCache | public static void removeFromCache(Configuration conf, String filename) throws IOException {
"""
Delete a file that has been distributed using
{@link #distribute(Object, String, Configuration)}.
"""
FileSystem fS = FileSystem.get(conf);
fS.delete(locateFileInCache(conf, filename), true);
} | java | public static void removeFromCache(Configuration conf, String filename) throws IOException {
FileSystem fS = FileSystem.get(conf);
fS.delete(locateFileInCache(conf, filename), true);
} | [
"public",
"static",
"void",
"removeFromCache",
"(",
"Configuration",
"conf",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fS",
"=",
"FileSystem",
".",
"get",
"(",
"conf",
")",
";",
"fS",
".",
"delete",
"(",
"locateFileInCache",
... | Delete a file that has been distributed using
{@link #distribute(Object, String, Configuration)}. | [
"Delete",
"a",
"file",
"that",
"has",
"been",
"distributed",
"using",
"{"
] | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/utils/InstancesDistributor.java#L157-L160 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.toHTML | public static String toHTML(Node node) throws ExpressionException {
"""
/*
* cast a xml node to a String
@param node
@return xml node as String
@throws ExpressionException / public static String toString(Node node) throws ExpressionException
{ //Transformer tf; try { OutputFormat format = new OutputForm... | java | public static String toHTML(Node node) throws ExpressionException {
if (Node.DOCUMENT_NODE == node.getNodeType()) return toHTML(XMLUtil.getRootElement(node, true));
StringBuilder sb = new StringBuilder();
toHTML(node, sb);
return sb.toString();
} | [
"public",
"static",
"String",
"toHTML",
"(",
"Node",
"node",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"Node",
".",
"DOCUMENT_NODE",
"==",
"node",
".",
"getNodeType",
"(",
")",
")",
"return",
"toHTML",
"(",
"XMLUtil",
".",
"getRootElement",
"(",
... | /*
* cast a xml node to a String
@param node
@return xml node as String
@throws ExpressionException / public static String toString(Node node) throws ExpressionException
{ //Transformer tf; try { OutputFormat format = new OutputFormat();
StringWriter writer = new StringWriter(); XMLSerializer serializer = new XMLSe... | [
"/",
"*",
"*",
"cast",
"a",
"xml",
"node",
"to",
"a",
"String"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L461-L467 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java | Enter.visitTypeParameter | @Override
public void visitTypeParameter(JCTypeParameter tree) {
"""
Class enter visitor method for type parameters.
Enter a symbol for type parameter in local scope, after checking that it
is unique.
"""
TypeVar a = (tree.type != null)
? (TypeVar)tree.type
: new TypeVar(t... | java | @Override
public void visitTypeParameter(JCTypeParameter tree) {
TypeVar a = (tree.type != null)
? (TypeVar)tree.type
: new TypeVar(tree.name, env.info.scope.owner, syms.botType);
tree.type = a;
if (chk.checkUnique(tree.pos(), a.tsym, env.info.scope)) {
en... | [
"@",
"Override",
"public",
"void",
"visitTypeParameter",
"(",
"JCTypeParameter",
"tree",
")",
"{",
"TypeVar",
"a",
"=",
"(",
"tree",
".",
"type",
"!=",
"null",
")",
"?",
"(",
"TypeVar",
")",
"tree",
".",
"type",
":",
"new",
"TypeVar",
"(",
"tree",
".",... | Class enter visitor method for type parameters.
Enter a symbol for type parameter in local scope, after checking that it
is unique. | [
"Class",
"enter",
"visitor",
"method",
"for",
"type",
"parameters",
".",
"Enter",
"a",
"symbol",
"for",
"type",
"parameter",
"in",
"local",
"scope",
"after",
"checking",
"that",
"it",
"is",
"unique",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java#L522-L532 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.toResultCheckIfNull | public static Object toResultCheckIfNull(Object value, String desc) {
"""
Convert a value to the requested descriptor. For null values where the caller needs a primitive, this returns the
appropriate (boxed) default. This method will not attempt conversion, it is basically checking what to do if the
result is nu... | java | public static Object toResultCheckIfNull(Object value, String desc) {
if (value == null) {
if (desc.length() == 1) {
switch (desc.charAt(0)) {
case 'I':
return DEFAULT_INT;
case 'B':
return DEFAULT_BYTE;
case 'C':
return DEFAULT_CHAR;
case 'S':
return DEFAULT_SHORT;
... | [
"public",
"static",
"Object",
"toResultCheckIfNull",
"(",
"Object",
"value",
",",
"String",
"desc",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"desc",
".",
"length",
"(",
")",
"==",
"1",
")",
"{",
"switch",
"(",
"desc",
".",
"... | Convert a value to the requested descriptor. For null values where the caller needs a primitive, this returns the
appropriate (boxed) default. This method will not attempt conversion, it is basically checking what to do if the
result is null - and ensuring the caller gets back what they expect (the appropriate primitiv... | [
"Convert",
"a",
"value",
"to",
"the",
"requested",
"descriptor",
".",
"For",
"null",
"values",
"where",
"the",
"caller",
"needs",
"a",
"primitive",
"this",
"returns",
"the",
"appropriate",
"(",
"boxed",
")",
"default",
".",
"This",
"method",
"will",
"not",
... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L1565-L1596 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java | VpnConnectionsInner.beginCreateOrUpdate | public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) {
"""
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
@param resourceGroupName The resource ... | java | public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(... | [
"public",
"VpnConnectionInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
",",
"String",
"connectionName",
",",
"VpnConnectionInner",
"vpnConnectionParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"("... | Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@param connectionName The name of the connection.
@param vpnConnectionParameters Parameters suppli... | [
"Creates",
"a",
"vpn",
"connection",
"to",
"a",
"scalable",
"vpn",
"gateway",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"connection",
"."
] | 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/VpnConnectionsInner.java#L279-L281 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/autocomplete/AutocompleteUtil.java | AutocompleteUtil.getCombinedForSection | public static String getCombinedForSection(final String sectionName, final String... args) {
"""
Combine autocomplete values into a single String suitable to apply to a named auto-fill section.
@param sectionName the name of the autocomplete section
@param args any other valid autocomplete values
@return a si... | java | public static String getCombinedForSection(final String sectionName, final String... args) {
return getCombinedAutocomplete(getNamedSection(sectionName), args);
} | [
"public",
"static",
"String",
"getCombinedForSection",
"(",
"final",
"String",
"sectionName",
",",
"final",
"String",
"...",
"args",
")",
"{",
"return",
"getCombinedAutocomplete",
"(",
"getNamedSection",
"(",
"sectionName",
")",
",",
"args",
")",
";",
"}"
] | Combine autocomplete values into a single String suitable to apply to a named auto-fill section.
@param sectionName the name of the autocomplete section
@param args any other valid autocomplete values
@return a single attribute value useful to apply an autocomplete helper to a named section | [
"Combine",
"autocomplete",
"values",
"into",
"a",
"single",
"String",
"suitable",
"to",
"apply",
"to",
"a",
"named",
"auto",
"-",
"fill",
"section",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/autocomplete/AutocompleteUtil.java#L116-L118 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java | SessionDataManager.getItemData | public ItemData getItemData(String identifier,boolean checkChangesLogOnly) throws RepositoryException {
"""
Return item data by identifier in this transient storage then in workspace container.
@param identifier
@param checkChangesLogOnly
@return existed item data or null if not found
@throws RepositoryExcep... | java | public ItemData getItemData(String identifier,boolean checkChangesLogOnly) throws RepositoryException
{
ItemData data = null;
// 1. Try in transient changes
ItemState state = changesLog.getItemState(identifier);
if (state == null)
{
// 2. Try from txdatamanager
data = ... | [
"public",
"ItemData",
"getItemData",
"(",
"String",
"identifier",
",",
"boolean",
"checkChangesLogOnly",
")",
"throws",
"RepositoryException",
"{",
"ItemData",
"data",
"=",
"null",
";",
"// 1. Try in transient changes",
"ItemState",
"state",
"=",
"changesLog",
".",
"g... | Return item data by identifier in this transient storage then in workspace container.
@param identifier
@param checkChangesLogOnly
@return existed item data or null if not found
@throws RepositoryException
@see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getItemData(java.lang.String) | [
"Return",
"item",
"data",
"by",
"identifier",
"in",
"this",
"transient",
"storage",
"then",
"in",
"workspace",
"container",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java#L316-L332 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.iterateObjects | public int iterateObjects(HashtableAction action, int index, int length)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
"""
*******************************... | java | public int iterateObjects(HashtableAction action, int index, int length)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
return walkHash(action, RETRIEVE... | [
"public",
"int",
"iterateObjects",
"(",
"HashtableAction",
"action",
",",
"int",
"index",
",",
"int",
"length",
")",
"throws",
"IOException",
",",
"EOFException",
",",
"FileManagerException",
",",
"ClassNotFoundException",
",",
"HashtableOnDiskException",
"{",
"return... | ************************************************************************
This invokes the action's "execute" method once for every
object, passing both the key and the object to the interface.
The iteration is synchronized with concurrent get and put operations
to avoid locking the HTOD for long periods of time. Some ... | [
"************************************************************************",
"This",
"invokes",
"the",
"action",
"s",
"execute",
"method",
"once",
"for",
"every",
"object",
"passing",
"both",
"the",
"key",
"and",
"the",
"object",
"to",
"the",
"interface",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1319-L1326 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.isAssignable | @GwtIncompatible("incompatible method")
public static boolean isAssignable(final Class<?> cls, final Class<?> toClass) {
"""
<p>Checks if one {@code Class} can be assigned to a variable of
another {@code Class}.</p>
<p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
this method takes in... | java | @GwtIncompatible("incompatible method")
public static boolean isAssignable(final Class<?> cls, final Class<?> toClass) {
return isAssignable(cls, toClass, SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_5));
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"boolean",
"isAssignable",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"Class",
"<",
"?",
">",
"toClass",
")",
"{",
"return",
"isAssignable",
"(",
"cls",
",",
"... | <p>Checks if one {@code Class} can be assigned to a variable of
another {@code Class}.</p>
<p>Unlike the {@link Class#isAssignableFrom(java.lang.Class)} method,
this method takes into account widenings of primitive classes and
{@code null}s.</p>
<p>Primitive widenings allow an int to be assigned to a long, float or
d... | [
"<p",
">",
"Checks",
"if",
"one",
"{",
"@code",
"Class",
"}",
"can",
"be",
"assigned",
"to",
"a",
"variable",
"of",
"another",
"{",
"@code",
"Class",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L766-L769 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/store/Store.java | Store.getResource | public Resource getResource(final Instance _instance)
throws EFapsException {
"""
Method to get a instance of the resource.
@param _instance instance the resource is wanted for
@return Resource
@throws EFapsException on error
"""
Resource ret = null;
try {
Store.LOG.deb... | java | public Resource getResource(final Instance _instance)
throws EFapsException
{
Resource ret = null;
try {
Store.LOG.debug("Getting resource for: {} with properties: {}", this.resource, this.resourceProperties);
ret = (Resource) Class.forName(this.resource).newInstance(... | [
"public",
"Resource",
"getResource",
"(",
"final",
"Instance",
"_instance",
")",
"throws",
"EFapsException",
"{",
"Resource",
"ret",
"=",
"null",
";",
"try",
"{",
"Store",
".",
"LOG",
".",
"debug",
"(",
"\"Getting resource for: {} with properties: {}\"",
",",
"thi... | Method to get a instance of the resource.
@param _instance instance the resource is wanted for
@return Resource
@throws EFapsException on error | [
"Method",
"to",
"get",
"a",
"instance",
"of",
"the",
"resource",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/store/Store.java#L160-L176 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newGooglePlayIntent | public static Intent newGooglePlayIntent(Context context, String packageName) {
"""
Intent that should open either the Google Play app or if not available, the web browser on the Google Play website
@param context The context associated to the application
@param packageName The package name of the applicat... | java | public static Intent newGooglePlayIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = MediaIntents.newOpenWebBrowserIntent("https://play... | [
"public",
"static",
"Intent",
"newGooglePlayIntent",
"(",
"Context",
"context",
",",
"String",
"packageName",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"market://details?id=\"",
"+",
... | Intent that should open either the Google Play app or if not available, the web browser on the Google Play website
@param context The context associated to the application
@param packageName The package name of the application to find on the market
@return the intent for native application or an intent to redirect... | [
"Intent",
"that",
"should",
"open",
"either",
"the",
"Google",
"Play",
"app",
"or",
"if",
"not",
"available",
"the",
"web",
"browser",
"on",
"the",
"Google",
"Play",
"website"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L70-L83 |
lets-blade/blade | src/main/java/com/blade/kit/StringKit.java | StringKit.isNotBlankThen | public static void isNotBlankThen(String str, Consumer<String> consumer) {
"""
Execute consumer when the string is not empty
@param str string value
@param consumer consumer
"""
notBankAccept(str, Function.identity(), consumer);
} | java | public static void isNotBlankThen(String str, Consumer<String> consumer) {
notBankAccept(str, Function.identity(), consumer);
} | [
"public",
"static",
"void",
"isNotBlankThen",
"(",
"String",
"str",
",",
"Consumer",
"<",
"String",
">",
"consumer",
")",
"{",
"notBankAccept",
"(",
"str",
",",
"Function",
".",
"identity",
"(",
")",
",",
"consumer",
")",
";",
"}"
] | Execute consumer when the string is not empty
@param str string value
@param consumer consumer | [
"Execute",
"consumer",
"when",
"the",
"string",
"is",
"not",
"empty"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/StringKit.java#L77-L79 |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.getInfoByBizIdService | public Map getInfoByBizIdService(String bizId,String tableName,String bizCol) {
"""
���ҵ��id��ȡ��ݼ�¼
@param bizId ҵ��id
@param tableName �����
@param bizCol ҵ�������
@return
@throws Exception
"""
//add 20170831 ninghao
Map filterViewRet=filterView4Select(tableName,new HashMap(),bizId,bizCol,TYPE_SEL... | java | public Map getInfoByBizIdService(String bizId,String tableName,String bizCol){
//add 20170831 ninghao
Map filterViewRet=filterView4Select(tableName,new HashMap(),bizId,bizCol,TYPE_SELECT_BIZID);
if(filterViewRet!=null ){
return filterViewRet;
}
Map retMap=getInnerDao().queryObjJoinByBizId(tableNa... | [
"public",
"Map",
"getInfoByBizIdService",
"(",
"String",
"bizId",
",",
"String",
"tableName",
",",
"String",
"bizCol",
")",
"{",
"//add 20170831 ninghao\r",
"Map",
"filterViewRet",
"=",
"filterView4Select",
"(",
"tableName",
",",
"new",
"HashMap",
"(",
")",
",",
... | ���ҵ��id��ȡ��ݼ�¼
@param bizId ҵ��id
@param tableName �����
@param bizCol ҵ�������
@return
@throws Exception | [
"���ҵ��id��ȡ��ݼ�¼"
] | train | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L1918-L1932 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.toDateBin | public Date toDateBin(TimeZone tz, byte[] bytes) throws PSQLException {
"""
Returns the SQL Date object matching the given bytes with {@link Oid#DATE}.
@param tz The timezone used.
@param bytes The binary encoded date value.
@return The parsed date object.
@throws PSQLException If binary format could not be ... | java | public Date toDateBin(TimeZone tz, byte[] bytes) throws PSQLException {
if (bytes.length != 4) {
throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.", "date"),
PSQLState.BAD_DATETIME_FORMAT);
}
int days = ByteConverter.int4(bytes, 0);
if (tz == null) {
tz = getDefaul... | [
"public",
"Date",
"toDateBin",
"(",
"TimeZone",
"tz",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"PSQLException",
"{",
"if",
"(",
"bytes",
".",
"length",
"!=",
"4",
")",
"{",
"throw",
"new",
"PSQLException",
"(",
"GT",
".",
"tr",
"(",
"\"Unsupporte... | Returns the SQL Date object matching the given bytes with {@link Oid#DATE}.
@param tz The timezone used.
@param bytes The binary encoded date value.
@return The parsed date object.
@throws PSQLException If binary format could not be parsed. | [
"Returns",
"the",
"SQL",
"Date",
"object",
"matching",
"the",
"given",
"bytes",
"with",
"{",
"@link",
"Oid#DATE",
"}",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L910-L933 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/LinkUtil.java | LinkUtil.getMappedUrl | public static String getMappedUrl(SlingHttpServletRequest request, String url) {
"""
Builds a mapped link to a path (resource path) without selectors and a determined extension.
@param request the request context for path mapping (the result is always mapped)
@param url the URL to use (complete) or the pat... | java | public static String getMappedUrl(SlingHttpServletRequest request, String url) {
return getUrl(request, url, null, null, LinkMapper.RESOLVER);
} | [
"public",
"static",
"String",
"getMappedUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"url",
")",
"{",
"return",
"getUrl",
"(",
"request",
",",
"url",
",",
"null",
",",
"null",
",",
"LinkMapper",
".",
"RESOLVER",
")",
";",
"}"
] | Builds a mapped link to a path (resource path) without selectors and a determined extension.
@param request the request context for path mapping (the result is always mapped)
@param url the URL to use (complete) or the path to an addressed resource (without any extension)
@return the mapped url for the referenced ... | [
"Builds",
"a",
"mapped",
"link",
"to",
"a",
"path",
"(",
"resource",
"path",
")",
"without",
"selectors",
"and",
"a",
"determined",
"extension",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/LinkUtil.java#L65-L67 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.