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 |
|---|---|---|---|---|---|---|---|---|---|---|
pravega/pravega | bindings/src/main/java/io/pravega/storage/extendeds3/ExtendedS3Storage.java | ExtendedS3Storage.doConcat | private Void doConcat(SegmentHandle targetHandle, long offset, String sourceSegment) throws StreamSegmentNotExistsException {
"""
The concat is implemented using extended S3 implementation of multipart copy API. Please see here for
more detail on multipart copy:
http://docs.aws.amazon.com/AmazonS3/latest/dev/Cop... | java | private Void doConcat(SegmentHandle targetHandle, long offset, String sourceSegment) throws StreamSegmentNotExistsException {
Preconditions.checkArgument(!targetHandle.isReadOnly(), "target handle must not be read-only.");
long traceId = LoggerHelpers.traceEnter(log, "concat", targetHandle.getSegmentNam... | [
"private",
"Void",
"doConcat",
"(",
"SegmentHandle",
"targetHandle",
",",
"long",
"offset",
",",
"String",
"sourceSegment",
")",
"throws",
"StreamSegmentNotExistsException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"targetHandle",
".",
"isReadOnly",
"(",
... | The concat is implemented using extended S3 implementation of multipart copy API. Please see here for
more detail on multipart copy:
http://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingLLJavaMPUapi.html
The multipart copy is an atomic operation. We schedule two parts and commit them atomically using
compl... | [
"The",
"concat",
"is",
"implemented",
"using",
"extended",
"S3",
"implementation",
"of",
"multipart",
"copy",
"API",
".",
"Please",
"see",
"here",
"for",
"more",
"detail",
"on",
"multipart",
"copy",
":",
"http",
":",
"//",
"docs",
".",
"aws",
".",
"amazon"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/extendeds3/ExtendedS3Storage.java#L371-L422 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperSphere.java | SVGHyperSphere.drawEuclidean | public static Element drawEuclidean(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius) {
"""
Wireframe "euclidean" hypersphere
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param radius radius
@return path element
"""
double[] v_mid = mid.toArray();... | java | public static Element drawEuclidean(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius) {
double[] v_mid = mid.toArray(); // a copy
long[] dims = proj.getVisibleDimensions2D();
SVGPath path = new SVGPath();
for(int dim = BitsUtil.nextSetBit(dims, 0); dim >= 0; dim = BitsUtil.nextSetBit(di... | [
"public",
"static",
"Element",
"drawEuclidean",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"NumberVector",
"mid",
",",
"double",
"radius",
")",
"{",
"double",
"[",
"]",
"v_mid",
"=",
"mid",
".",
"toArray",
"(",
")",
";",
"// a copy",
"long",... | Wireframe "euclidean" hypersphere
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param radius radius
@return path element | [
"Wireframe",
"euclidean",
"hypersphere"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperSphere.java#L102-L139 |
apereo/cas | support/cas-server-support-cosmosdb-core/src/main/java/org/apereo/cas/cosmosdb/CosmosDbObjectFactory.java | CosmosDbObjectFactory.createDocumentDbTemplate | public DocumentDbTemplate createDocumentDbTemplate(final DocumentDbFactory documentDbFactory,
final BaseCosmosDbProperties properties) {
"""
Create document db template document db template.
@param documentDbFactory the document db factory
@param propertie... | java | public DocumentDbTemplate createDocumentDbTemplate(final DocumentDbFactory documentDbFactory,
final BaseCosmosDbProperties properties) {
val documentDbMappingContext = createDocumentDbMappingContext();
val mappingDocumentDbConverter = createMappingD... | [
"public",
"DocumentDbTemplate",
"createDocumentDbTemplate",
"(",
"final",
"DocumentDbFactory",
"documentDbFactory",
",",
"final",
"BaseCosmosDbProperties",
"properties",
")",
"{",
"val",
"documentDbMappingContext",
"=",
"createDocumentDbMappingContext",
"(",
")",
";",
"val",
... | Create document db template document db template.
@param documentDbFactory the document db factory
@param properties the properties
@return the document db template | [
"Create",
"document",
"db",
"template",
"document",
"db",
"template",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-cosmosdb-core/src/main/java/org/apereo/cas/cosmosdb/CosmosDbObjectFactory.java#L103-L108 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java | LoginForm.getAuthentication | public Authentication getAuthentication() {
"""
Get an Authentication token that contains the current username and password.
@return authentication token
"""
String username = getValueModel(LoginDetails.PROPERTY_USERNAME, String.class).getValue();
String password = getValueModel(LoginDetails.P... | java | public Authentication getAuthentication() {
String username = getValueModel(LoginDetails.PROPERTY_USERNAME, String.class).getValue();
String password = getValueModel(LoginDetails.PROPERTY_PASSWORD, String.class).getValue();
return new UsernamePasswordAuthenticationToken( username, password );
... | [
"public",
"Authentication",
"getAuthentication",
"(",
")",
"{",
"String",
"username",
"=",
"getValueModel",
"(",
"LoginDetails",
".",
"PROPERTY_USERNAME",
",",
"String",
".",
"class",
")",
".",
"getValue",
"(",
")",
";",
"String",
"password",
"=",
"getValueModel... | Get an Authentication token that contains the current username and password.
@return authentication token | [
"Get",
"an",
"Authentication",
"token",
"that",
"contains",
"the",
"current",
"username",
"and",
"password",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java#L58-L62 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java | FileHelper.getDirectoryContent | @Nonnull
@ReturnsMutableCopy
public static ICommonsList <File> getDirectoryContent (@Nonnull final File aDirectory) {
"""
This is a replacement for <code>File.listFiles()</code> doing some
additional checks on permissions. The order of the returned files is
defined by the underlying {@link File#listFiles()} ... | java | @Nonnull
@ReturnsMutableCopy
public static ICommonsList <File> getDirectoryContent (@Nonnull final File aDirectory)
{
ValueEnforcer.notNull (aDirectory, "Directory");
return _getDirectoryContent (aDirectory, aDirectory.listFiles ());
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"ICommonsList",
"<",
"File",
">",
"getDirectoryContent",
"(",
"@",
"Nonnull",
"final",
"File",
"aDirectory",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDirectory",
",",
"\"Directory\"",
")",
"... | This is a replacement for <code>File.listFiles()</code> doing some
additional checks on permissions. The order of the returned files is
defined by the underlying {@link File#listFiles()} method.
@param aDirectory
The directory to be listed. May not be <code>null</code>.
@return Never <code>null</code>. | [
"This",
"is",
"a",
"replacement",
"for",
"<code",
">",
"File",
".",
"listFiles",
"()",
"<",
"/",
"code",
">",
"doing",
"some",
"additional",
"checks",
"on",
"permissions",
".",
"The",
"order",
"of",
"the",
"returned",
"files",
"is",
"defined",
"by",
"the... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java#L690-L697 |
sargue/mailgun | src/main/java/net/sargue/mailgun/MailBuilder.java | MailBuilder.to | public MailBuilder to(String name, String email) {
"""
Adds a destination recipient's address.
@param name the name of the destination recipient
@param email the address of the destination recipient
@return this builder
"""
return param("to", email(name, email));
} | java | public MailBuilder to(String name, String email) {
return param("to", email(name, email));
} | [
"public",
"MailBuilder",
"to",
"(",
"String",
"name",
",",
"String",
"email",
")",
"{",
"return",
"param",
"(",
"\"to\"",
",",
"email",
"(",
"name",
",",
"email",
")",
")",
";",
"}"
] | Adds a destination recipient's address.
@param name the name of the destination recipient
@param email the address of the destination recipient
@return this builder | [
"Adds",
"a",
"destination",
"recipient",
"s",
"address",
"."
] | train | https://github.com/sargue/mailgun/blob/2ffb0a156f3f3666eb1bb2db661451b9377c3d11/src/main/java/net/sargue/mailgun/MailBuilder.java#L108-L110 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/cglib3_2_0/core/EmitUtils.java | EmitUtils.not_equals | public static void not_equals(final CodeEmitter e, Type type, final Label notEquals, final Customizer customizer) {
"""
Branches to the specified label if the top two items on the stack
are not equal. The items must both be of the specified
class. Equality is determined by comparing primitive values
directly an... | java | public static void not_equals(final CodeEmitter e, Type type, final Label notEquals, final Customizer customizer) {
(new ProcessArrayCallback() {
public void processElement(Type type) {
not_equals_helper(e, type, notEquals, customizer, this);
}
}).processElement(t... | [
"public",
"static",
"void",
"not_equals",
"(",
"final",
"CodeEmitter",
"e",
",",
"Type",
"type",
",",
"final",
"Label",
"notEquals",
",",
"final",
"Customizer",
"customizer",
")",
"{",
"(",
"new",
"ProcessArrayCallback",
"(",
")",
"{",
"public",
"void",
"pro... | Branches to the specified label if the top two items on the stack
are not equal. The items must both be of the specified
class. Equality is determined by comparing primitive values
directly and by invoking the <code>equals</code> method for
Objects. Arrays are recursively processed in the same manner. | [
"Branches",
"to",
"the",
"specified",
"label",
"if",
"the",
"top",
"two",
"items",
"on",
"the",
"stack",
"are",
"not",
"equal",
".",
"The",
"items",
"must",
"both",
"be",
"of",
"the",
"specified",
"class",
".",
"Equality",
"is",
"determined",
"by",
"comp... | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/cglib3_2_0/core/EmitUtils.java#L480-L486 |
flow/commons | src/main/java/com/flowpowered/commons/StringUtil.java | StringUtil.startsWithIgnoreCase | public static boolean startsWithIgnoreCase(String input, String prefix) {
"""
Tests if this string starts with the specified prefix, ignoring case
@param input the input
@param prefix the prefix
@return True if the input starts with the prefix when ignoring case, False if not
"""
if (input == null... | java | public static boolean startsWithIgnoreCase(String input, String prefix) {
if (input == null || prefix == null || prefix.length() > input.length()) {
return false;
} else {
final char[] inputCharArray = input.toCharArray();
final char[] prefixCharArray = prefix.toCharA... | [
"public",
"static",
"boolean",
"startsWithIgnoreCase",
"(",
"String",
"input",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"prefix",
"==",
"null",
"||",
"prefix",
".",
"length",
"(",
")",
">",
"input",
".",
"length",
"(",
... | Tests if this string starts with the specified prefix, ignoring case
@param input the input
@param prefix the prefix
@return True if the input starts with the prefix when ignoring case, False if not | [
"Tests",
"if",
"this",
"string",
"starts",
"with",
"the",
"specified",
"prefix",
"ignoring",
"case"
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/StringUtil.java#L39-L52 |
real-logic/agrona | agrona/src/main/java/org/agrona/IoUtil.java | IoUtil.mapExistingFile | public static MappedByteBuffer mapExistingFile(final File location, final String descriptionLabel) {
"""
Check that file exists, open file, and return MappedByteBuffer for entire file as
{@link java.nio.channels.FileChannel.MapMode#READ_WRITE}.
<p>
The file itself will be closed, but the mapping will persist.
... | java | public static MappedByteBuffer mapExistingFile(final File location, final String descriptionLabel)
{
return mapExistingFile(location, READ_WRITE, descriptionLabel);
} | [
"public",
"static",
"MappedByteBuffer",
"mapExistingFile",
"(",
"final",
"File",
"location",
",",
"final",
"String",
"descriptionLabel",
")",
"{",
"return",
"mapExistingFile",
"(",
"location",
",",
"READ_WRITE",
",",
"descriptionLabel",
")",
";",
"}"
] | Check that file exists, open file, and return MappedByteBuffer for entire file as
{@link java.nio.channels.FileChannel.MapMode#READ_WRITE}.
<p>
The file itself will be closed, but the mapping will persist.
@param location of the file to map
@param descriptionLabel to be associated for any exceptions
@return {@... | [
"Check",
"that",
"file",
"exists",
"open",
"file",
"and",
"return",
"MappedByteBuffer",
"for",
"entire",
"file",
"as",
"{",
"@link",
"java",
".",
"nio",
".",
"channels",
".",
"FileChannel",
".",
"MapMode#READ_WRITE",
"}",
".",
"<p",
">",
"The",
"file",
"it... | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/IoUtil.java#L280-L283 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicy.java | transformpolicy.get | public static transformpolicy get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch transformpolicy resource of given name .
"""
transformpolicy obj = new transformpolicy();
obj.set_name(name);
transformpolicy response = (transformpolicy) obj.get_resource(service);
return... | java | public static transformpolicy get(nitro_service service, String name) throws Exception{
transformpolicy obj = new transformpolicy();
obj.set_name(name);
transformpolicy response = (transformpolicy) obj.get_resource(service);
return response;
} | [
"public",
"static",
"transformpolicy",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"transformpolicy",
"obj",
"=",
"new",
"transformpolicy",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"tra... | Use this API to fetch transformpolicy resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"transformpolicy",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/transform/transformpolicy.java#L429-L434 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java | PathOverrideService.setRequestType | public void setRequestType(int pathId, Integer requestType) {
"""
Sets the request type for this ID. Defaults to GET
@param pathId ID of path
@param requestType type of request to service
"""
if (requestType == null) {
requestType = Constants.REQUEST_TYPE_GET;
}
Prepare... | java | public void setRequestType(int pathId, Integer requestType) {
if (requestType == null) {
requestType = Constants.REQUEST_TYPE_GET;
}
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepar... | [
"public",
"void",
"setRequestType",
"(",
"int",
"pathId",
",",
"Integer",
"requestType",
")",
"{",
"if",
"(",
"requestType",
"==",
"null",
")",
"{",
"requestType",
"=",
"Constants",
".",
"REQUEST_TYPE_GET",
";",
"}",
"PreparedStatement",
"statement",
"=",
"nul... | Sets the request type for this ID. Defaults to GET
@param pathId ID of path
@param requestType type of request to service | [
"Sets",
"the",
"request",
"type",
"for",
"this",
"ID",
".",
"Defaults",
"to",
"GET"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1237-L1262 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getCrossReference | @Override
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException {
"""
Retrieves a description of the foreign key columns in the given foreign key table that reference the primary ke... | java | @Override
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"ResultSet",
"getCrossReference",
"(",
"String",
"parentCatalog",
",",
"String",
"parentSchema",
",",
"String",
"parentTable",
",",
"String",
"foreignCatalog",
",",
"String",
"foreignSchema",
",",
"String",
"foreignTable",
")",
"throws",
"... | Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table). | [
"Retrieves",
"a",
"description",
"of",
"the",
"foreign",
"key",
"columns",
"in",
"the",
"given",
"foreign",
"key",
"table",
"that",
"reference",
"the",
"primary",
"key",
"or",
"the",
"columns",
"representing",
"a",
"unique",
"constraint",
"of",
"the",
"parent"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L242-L247 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanPrimitiveDistanceKNNQuery.java | LinearScanPrimitiveDistanceKNNQuery.linearScanBatchKNN | protected void linearScanBatchKNN(List<O> objs, List<KNNHeap> heaps) {
"""
Perform a linear scan batch kNN for primitive distance functions.
@param objs Objects list
@param heaps Heaps array
"""
final PrimitiveDistanceFunction<? super O> rawdist = this.rawdist;
final Relation<? extends O> relation ... | java | protected void linearScanBatchKNN(List<O> objs, List<KNNHeap> heaps) {
final PrimitiveDistanceFunction<? super O> rawdist = this.rawdist;
final Relation<? extends O> relation = getRelation();
final int size = objs.size();
// Linear scan style KNN.
for(DBIDIter iter = relation.getDBIDs().iter(); iter... | [
"protected",
"void",
"linearScanBatchKNN",
"(",
"List",
"<",
"O",
">",
"objs",
",",
"List",
"<",
"KNNHeap",
">",
"heaps",
")",
"{",
"final",
"PrimitiveDistanceFunction",
"<",
"?",
"super",
"O",
">",
"rawdist",
"=",
"this",
".",
"rawdist",
";",
"final",
"... | Perform a linear scan batch kNN for primitive distance functions.
@param objs Objects list
@param heaps Heaps array | [
"Perform",
"a",
"linear",
"scan",
"batch",
"kNN",
"for",
"primitive",
"distance",
"functions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanPrimitiveDistanceKNNQuery.java#L124-L139 |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/io/channel/BitEncoderChannel.java | BitEncoderChannel.encodeNBitUnsignedInteger | public void encodeNBitUnsignedInteger(int b, int n) throws IOException {
"""
Encode n-bit unsigned integer. The n least significant bits of parameter
b starting with the most significant, i.e. from left to right.
"""
if (b < 0 || n < 0) {
throw new IllegalArgumentException(
"Encode negative value as... | java | public void encodeNBitUnsignedInteger(int b, int n) throws IOException {
if (b < 0 || n < 0) {
throw new IllegalArgumentException(
"Encode negative value as unsigned integer is invalid!");
}
assert (b >= 0);
assert (n >= 0);
ostream.writeBits(b, n);
} | [
"public",
"void",
"encodeNBitUnsignedInteger",
"(",
"int",
"b",
",",
"int",
"n",
")",
"throws",
"IOException",
"{",
"if",
"(",
"b",
"<",
"0",
"||",
"n",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Encode negative value as unsigned i... | Encode n-bit unsigned integer. The n least significant bits of parameter
b starting with the most significant, i.e. from left to right. | [
"Encode",
"n",
"-",
"bit",
"unsigned",
"integer",
".",
"The",
"n",
"least",
"significant",
"bits",
"of",
"parameter",
"b",
"starting",
"with",
"the",
"most",
"significant",
"i",
".",
"e",
".",
"from",
"left",
"to",
"right",
"."
] | train | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/io/channel/BitEncoderChannel.java#L90-L99 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.foldLeftMapToType | public final static <R,T> R foldLeftMapToType(final Stream<T> stream, final Reducer<R,T> reducer) {
"""
Attempt to transform this Monad to the same type as the supplied Monoid (using mapToType on the monoid interface)
Then use Monoid to reduce values
@param reducer Monoid to reduce values
@return Reduce resul... | java | public final static <R,T> R foldLeftMapToType(final Stream<T> stream, final Reducer<R,T> reducer) {
return reducer.foldMap(stream);
} | [
"public",
"final",
"static",
"<",
"R",
",",
"T",
">",
"R",
"foldLeftMapToType",
"(",
"final",
"Stream",
"<",
"T",
">",
"stream",
",",
"final",
"Reducer",
"<",
"R",
",",
"T",
">",
"reducer",
")",
"{",
"return",
"reducer",
".",
"foldMap",
"(",
"stream"... | Attempt to transform this Monad to the same type as the supplied Monoid (using mapToType on the monoid interface)
Then use Monoid to reduce values
@param reducer Monoid to reduce values
@return Reduce result | [
"Attempt",
"to",
"transform",
"this",
"Monad",
"to",
"the",
"same",
"type",
"as",
"the",
"supplied",
"Monoid",
"(",
"using",
"mapToType",
"on",
"the",
"monoid",
"interface",
")",
"Then",
"use",
"Monoid",
"to",
"reduce",
"values"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L1973-L1975 |
play2war/play2-war-plugin | samples/jboss-ebean/app/controllers/Application.java | Application.update | public static Result update(Long id) {
"""
Handle the 'edit form' submission
@param id Id of the computer to edit
"""
Form<Computer> computerForm = form(Computer.class).bindFromRequest();
if(computerForm.hasErrors()) {
return badRequest(editForm.render(id, computerForm));
... | java | public static Result update(Long id) {
Form<Computer> computerForm = form(Computer.class).bindFromRequest();
if(computerForm.hasErrors()) {
return badRequest(editForm.render(id, computerForm));
}
computerForm.get().update(id);
flash("success", "Computer " + computerFo... | [
"public",
"static",
"Result",
"update",
"(",
"Long",
"id",
")",
"{",
"Form",
"<",
"Computer",
">",
"computerForm",
"=",
"form",
"(",
"Computer",
".",
"class",
")",
".",
"bindFromRequest",
"(",
")",
";",
"if",
"(",
"computerForm",
".",
"hasErrors",
"(",
... | Handle the 'edit form' submission
@param id Id of the computer to edit | [
"Handle",
"the",
"edit",
"form",
"submission"
] | train | https://github.com/play2war/play2-war-plugin/blob/230f035eb1b51de021fad3aff18cc790af5ce28d/samples/jboss-ebean/app/controllers/Application.java#L69-L77 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/QueryRecorder.java | QueryRecorder.recordStackedInvocation | public static void recordStackedInvocation(Object on, String method, Object result, Object... params) {
"""
invocations on domainQuery (q)
but stacked within e.g. a SELECT_FROM(...).ELEMENTS(...) statement.
Must not be directly added to the root RecordedQuery
but must be encapsulated in a sub statement
@param ... | java | public static void recordStackedInvocation(Object on, String method, Object result, Object... params) {
if (blockRecording.get())
return;
recordInvocation(false, true, false, on, method, result, params);
} | [
"public",
"static",
"void",
"recordStackedInvocation",
"(",
"Object",
"on",
",",
"String",
"method",
",",
"Object",
"result",
",",
"Object",
"...",
"params",
")",
"{",
"if",
"(",
"blockRecording",
".",
"get",
"(",
")",
")",
"return",
";",
"recordInvocation",... | invocations on domainQuery (q)
but stacked within e.g. a SELECT_FROM(...).ELEMENTS(...) statement.
Must not be directly added to the root RecordedQuery
but must be encapsulated in a sub statement
@param on
@param method
@param result
@param params | [
"invocations",
"on",
"domainQuery",
"(",
"q",
")",
"but",
"stacked",
"within",
"e",
".",
"g",
".",
"a",
"SELECT_FROM",
"(",
"...",
")",
".",
"ELEMENTS",
"(",
"...",
")",
"statement",
".",
"Must",
"not",
"be",
"directly",
"added",
"to",
"the",
"root",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/QueryRecorder.java#L65-L69 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/component/PatchedJFormattedTextField.java | PatchedJFormattedTextField.processKeyBinding | public boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
"""
Overiding this method prevents the TextField from intercepting the Enter
Key when focus is not on it. This allows default buttons to function.
This should be removed when Swing fixes their bug.
@see javax.swing.JC... | java | public boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
if (ks == KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0) || ks == KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)) {
return false;
}
return super.processKeyBinding(ks, e, condition, pressed);
... | [
"public",
"boolean",
"processKeyBinding",
"(",
"KeyStroke",
"ks",
",",
"KeyEvent",
"e",
",",
"int",
"condition",
",",
"boolean",
"pressed",
")",
"{",
"if",
"(",
"ks",
"==",
"KeyStroke",
".",
"getKeyStroke",
"(",
"KeyEvent",
".",
"VK_ENTER",
",",
"0",
")",
... | Overiding this method prevents the TextField from intercepting the Enter
Key when focus is not on it. This allows default buttons to function.
This should be removed when Swing fixes their bug.
@see javax.swing.JComponent#processKeyBinding(javax.swing.KeyStroke,
java.awt.event.KeyEvent, int, boolean) | [
"Overiding",
"this",
"method",
"prevents",
"the",
"TextField",
"from",
"intercepting",
"the",
"Enter",
"Key",
"when",
"focus",
"is",
"not",
"on",
"it",
".",
"This",
"allows",
"default",
"buttons",
"to",
"function",
".",
"This",
"should",
"be",
"removed",
"wh... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/PatchedJFormattedTextField.java#L80-L85 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LoOP.java | LoOP.computePDists | protected void computePDists(Relation<O> relation, KNNQuery<O> knn, WritableDoubleDataStore pdists) {
"""
Compute the probabilistic distances used by LoOP.
@param relation Data relation
@param knn kNN query
@param pdists Storage for distances
"""
// computing PRDs
FiniteProgress prdsProgress = LOG... | java | protected void computePDists(Relation<O> relation, KNNQuery<O> knn, WritableDoubleDataStore pdists) {
// computing PRDs
FiniteProgress prdsProgress = LOG.isVerbose() ? new FiniteProgress("pdists", relation.size(), LOG) : null;
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {
... | [
"protected",
"void",
"computePDists",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"KNNQuery",
"<",
"O",
">",
"knn",
",",
"WritableDoubleDataStore",
"pdists",
")",
"{",
"// computing PRDs",
"FiniteProgress",
"prdsProgress",
"=",
"LOG",
".",
"isVerbose",
"(",... | Compute the probabilistic distances used by LoOP.
@param relation Data relation
@param knn kNN query
@param pdists Storage for distances | [
"Compute",
"the",
"probabilistic",
"distances",
"used",
"by",
"LoOP",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LoOP.java#L241-L264 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.addComboField | public <E> void addComboField(int tabIndex, String fieldLabel, ComboBoxModel<E> comboBoxModel, boolean editable) {
"""
Adds a combo box field, possibly editable, with the given label and model, to the tab with the given index.
<p>
Control of selection state (i.e. set/get selected item) is done through the combo ... | java | public <E> void addComboField(int tabIndex, String fieldLabel, ComboBoxModel<E> comboBoxModel, boolean editable) {
validateTabbed(tabIndex);
JComboBox<E> field = new JComboBox<>(comboBoxModel);
field.setEditable(editable);
this.addField(this.tabPanels.get(tabIndex), this.tabOffsets.get(tabIndex), fieldLabel, fi... | [
"public",
"<",
"E",
">",
"void",
"addComboField",
"(",
"int",
"tabIndex",
",",
"String",
"fieldLabel",
",",
"ComboBoxModel",
"<",
"E",
">",
"comboBoxModel",
",",
"boolean",
"editable",
")",
"{",
"validateTabbed",
"(",
"tabIndex",
")",
";",
"JComboBox",
"<",
... | Adds a combo box field, possibly editable, with the given label and model, to the tab with the given index.
<p>
Control of selection state (i.e. set/get selected item) is done through the combo box model.
@param <E> the type of the elements of the combo box model.
@param tabIndex the index of the tab where the combo b... | [
"Adds",
"a",
"combo",
"box",
"field",
"possibly",
"editable",
"with",
"the",
"given",
"label",
"and",
"model",
"to",
"the",
"tab",
"with",
"the",
"given",
"index",
".",
"<p",
">",
"Control",
"of",
"selection",
"state",
"(",
"i",
".",
"e",
".",
"set",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L830-L836 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/base/Device.java | Device.sendToArray | public JSONArray sendToArray(String method, Object params) throws CommandExecutionException {
"""
Send a command to a device. If no IP has been specified, this will try do discover a device on the network.
@param method The method to execute on the device.
@param params The command to execute on the device. Must... | java | public JSONArray sendToArray(String method, Object params) throws CommandExecutionException {
Response resp = send(method, params);
if (resp == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
if (resp.getParams() == null) throw new CommandExecutionExc... | [
"public",
"JSONArray",
"sendToArray",
"(",
"String",
"method",
",",
"Object",
"params",
")",
"throws",
"CommandExecutionException",
"{",
"Response",
"resp",
"=",
"send",
"(",
"method",
",",
"params",
")",
";",
"if",
"(",
"resp",
"==",
"null",
")",
"throw",
... | Send a command to a device. If no IP has been specified, this will try do discover a device on the network.
@param method The method to execute on the device.
@param params The command to execute on the device. Must be a JSONArray or JSONObject.
@return The response from the device as a JSONArray.
@throws CommandExecut... | [
"Send",
"a",
"command",
"to",
"a",
"device",
".",
"If",
"no",
"IP",
"has",
"been",
"specified",
"this",
"will",
"try",
"do",
"discover",
"a",
"device",
"on",
"the",
"network",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/base/Device.java#L377-L383 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java | HiveCopyEntityHelper.getCopyEntities | Iterator<FileSet<CopyEntity>> getCopyEntities(CopyConfiguration configuration) throws IOException {
"""
See {@link #getCopyEntities(CopyConfiguration, Comparator, PushDownRequestor)}. This method does not pushdown any prioritizer.
"""
return getCopyEntities(configuration, null, null);
} | java | Iterator<FileSet<CopyEntity>> getCopyEntities(CopyConfiguration configuration) throws IOException {
return getCopyEntities(configuration, null, null);
} | [
"Iterator",
"<",
"FileSet",
"<",
"CopyEntity",
">",
">",
"getCopyEntities",
"(",
"CopyConfiguration",
"configuration",
")",
"throws",
"IOException",
"{",
"return",
"getCopyEntities",
"(",
"configuration",
",",
"null",
",",
"null",
")",
";",
"}"
] | See {@link #getCopyEntities(CopyConfiguration, Comparator, PushDownRequestor)}. This method does not pushdown any prioritizer. | [
"See",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java#L392-L394 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.extractTargetNameFromType2Message | public static String extractTargetNameFromType2Message(byte[] msg,
Integer msgFlags) throws UnsupportedEncodingException {
"""
Extracts the target name from the type 2 message.
@param msg the type 2 message byte array
@param msgFlags the flags if null then flags are extracted from the
type 2 messa... | java | public static String extractTargetNameFromType2Message(byte[] msg,
Integer msgFlags) throws UnsupportedEncodingException {
// Read the security buffer to determine where the target name
// is stored and what it's length is
byte[] targetName = readSecurityBufferTarget(msg, 12);
... | [
"public",
"static",
"String",
"extractTargetNameFromType2Message",
"(",
"byte",
"[",
"]",
"msg",
",",
"Integer",
"msgFlags",
")",
"throws",
"UnsupportedEncodingException",
"{",
"// Read the security buffer to determine where the target name",
"// is stored and what it's length is",... | Extracts the target name from the type 2 message.
@param msg the type 2 message byte array
@param msgFlags the flags if null then flags are extracted from the
type 2 message
@return the target name
@throws UnsupportedEncodingException if unable to use the
needed UTF-16LE or ASCII charsets | [
"Extracts",
"the",
"target",
"name",
"from",
"the",
"type",
"2",
"message",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L306-L320 |
undertow-io/undertow | core/src/main/java/io/undertow/util/ETagUtils.java | ETagUtils.handleIfMatch | public static boolean handleIfMatch(final HttpServerExchange exchange, final List<ETag> etags, boolean allowWeak) {
"""
Handles the if-match header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param etags The etags
@return
"""
return handleIfMatch(e... | java | public static boolean handleIfMatch(final HttpServerExchange exchange, final List<ETag> etags, boolean allowWeak) {
return handleIfMatch(exchange.getRequestHeaders().getFirst(Headers.IF_MATCH), etags, allowWeak);
} | [
"public",
"static",
"boolean",
"handleIfMatch",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"List",
"<",
"ETag",
">",
"etags",
",",
"boolean",
"allowWeak",
")",
"{",
"return",
"handleIfMatch",
"(",
"exchange",
".",
"getRequestHeaders",
"(",
")"... | Handles the if-match header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param etags The etags
@return | [
"Handles",
"the",
"if",
"-",
"match",
"header",
".",
"returns",
"true",
"if",
"the",
"request",
"should",
"proceed",
"false",
"otherwise"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/ETagUtils.java#L55-L57 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java | GeoJsonToAssembler.fromTransferObject | public Polygon fromTransferObject(PolygonTo input, CrsId crsId) {
"""
Creates a polygon object starting from a transfer object.
@param input the polygon transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geometry
@throw... | java | public Polygon fromTransferObject(PolygonTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
return createPolygon(input.getCoordinates(), crsId);
} | [
"public",
"Polygon",
"fromTransferObject",
"(",
"PolygonTo",
"input",
",",
"CrsId",
"crsId",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"crsId",
"=",
"getCrsId",
"(",
"input",
",",
"crsId",
")",
";",
"isValid",
"(... | Creates a polygon object starting from a transfer object.
@param input the polygon transfer object
@param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input.
@return the corresponding geometry
@throws IllegalArgumentException If the geometry could not be constructed due to an in... | [
"Creates",
"a",
"polygon",
"object",
"starting",
"from",
"a",
"transfer",
"object",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java#L242-L249 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java | WatchMonitor.create | public static WatchMonitor create(URL url, int maxDepth, WatchEvent.Kind<?>... events) {
"""
创建并初始化监听
@param url URL
@param events 监听的事件列表
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@return 监听对象
"""
return create(URLUtil.toURI(url), maxDepth, events);
} | java | public static WatchMonitor create(URL url, int maxDepth, WatchEvent.Kind<?>... events){
return create(URLUtil.toURI(url), maxDepth, events);
} | [
"public",
"static",
"WatchMonitor",
"create",
"(",
"URL",
"url",
",",
"int",
"maxDepth",
",",
"WatchEvent",
".",
"Kind",
"<",
"?",
">",
"...",
"events",
")",
"{",
"return",
"create",
"(",
"URLUtil",
".",
"toURI",
"(",
"url",
")",
",",
"maxDepth",
",",
... | 创建并初始化监听
@param url URL
@param events 监听的事件列表
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@return 监听对象 | [
"创建并初始化监听"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java#L99-L101 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/effect/SeaGlassInternalShadowEffect.java | SeaGlassInternalShadowEffect.getTopShadowGradient | public Paint getTopShadowGradient(Shape s) {
"""
Create the gradient for the top of a rectangular shadow.
@param s the shape of the gradient. This is only used for its bounds.
@return the gradient.
"""
Rectangle2D bounds = s.getBounds2D();
float minY = (float) bounds.getMinY();
... | java | public Paint getTopShadowGradient(Shape s) {
Rectangle2D bounds = s.getBounds2D();
float minY = (float) bounds.getMinY();
float maxY = (float) bounds.getMaxY();
float midX = (float) bounds.getCenterX();
return new LinearGradientPaint(midX, minY, midX, max... | [
"public",
"Paint",
"getTopShadowGradient",
"(",
"Shape",
"s",
")",
"{",
"Rectangle2D",
"bounds",
"=",
"s",
".",
"getBounds2D",
"(",
")",
";",
"float",
"minY",
"=",
"(",
"float",
")",
"bounds",
".",
"getMinY",
"(",
")",
";",
"float",
"maxY",
"=",
"(",
... | Create the gradient for the top of a rectangular shadow.
@param s the shape of the gradient. This is only used for its bounds.
@return the gradient. | [
"Create",
"the",
"gradient",
"for",
"the",
"top",
"of",
"a",
"rectangular",
"shadow",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/effect/SeaGlassInternalShadowEffect.java#L140-L147 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java | Encoder.incUpdatePB | public void incUpdatePB(final MiniSatStyleSolver s, final LNGIntVector lits, final LNGIntVector coeffs, int rhs) {
"""
Manages the incremental update of pseudo-Boolean encodings.
@param s the solver
@param lits the literals of the constraint
@param coeffs the coefficients of the constraint
@param rhs ... | java | public void incUpdatePB(final MiniSatStyleSolver s, final LNGIntVector lits, final LNGIntVector coeffs, int rhs) {
assert this.incrementalStrategy == IncrementalStrategy.ITERATIVE;
switch (this.pbEncoding) {
case SWC:
this.swc.updateInc(s, rhs);
this.swc.join(s, lits, coeffs);
brea... | [
"public",
"void",
"incUpdatePB",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"final",
"LNGIntVector",
"lits",
",",
"final",
"LNGIntVector",
"coeffs",
",",
"int",
"rhs",
")",
"{",
"assert",
"this",
".",
"incrementalStrategy",
"==",
"IncrementalStrategy",
".",
"... | Manages the incremental update of pseudo-Boolean encodings.
@param s the solver
@param lits the literals of the constraint
@param coeffs the coefficients of the constraint
@param rhs the new right hand side of the constraint
@throws IllegalStateException if the pseudo-Boolean encoding is unknown | [
"Manages",
"the",
"incremental",
"update",
"of",
"pseudo",
"-",
"Boolean",
"encodings",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java#L308-L318 |
Alluxio/alluxio | core/base/src/main/java/alluxio/security/authorization/Mode.java | Mode.fromProto | public static Mode fromProto(PMode pMode) {
"""
Creates {@link Mode} from proto {@link PMode}.
@param pMode proto mode
@return created mode
"""
Bits ownerBits = pMode.hasOwnerBits() ? Bits.valueOf(pMode.getOwnerBits().name()) : Bits.NONE;
Bits groupBits = pMode.hasGroupBits() ? Bits.valueOf(pMode.g... | java | public static Mode fromProto(PMode pMode) {
Bits ownerBits = pMode.hasOwnerBits() ? Bits.valueOf(pMode.getOwnerBits().name()) : Bits.NONE;
Bits groupBits = pMode.hasGroupBits() ? Bits.valueOf(pMode.getGroupBits().name()) : Bits.NONE;
Bits otherBits = pMode.hasOtherBits() ? Bits.valueOf(pMode.getOtherBits().... | [
"public",
"static",
"Mode",
"fromProto",
"(",
"PMode",
"pMode",
")",
"{",
"Bits",
"ownerBits",
"=",
"pMode",
".",
"hasOwnerBits",
"(",
")",
"?",
"Bits",
".",
"valueOf",
"(",
"pMode",
".",
"getOwnerBits",
"(",
")",
".",
"name",
"(",
")",
")",
":",
"Bi... | Creates {@link Mode} from proto {@link PMode}.
@param pMode proto mode
@return created mode | [
"Creates",
"{",
"@link",
"Mode",
"}",
"from",
"proto",
"{",
"@link",
"PMode",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/Mode.java#L240-L245 |
xqbase/util | util/src/main/java/com/xqbase/util/Numbers.java | Numbers.parseInt | public static int parseInt(String s, int i, int min, int max) {
"""
Parse an <b>int</b> with a given default value <b>i</b> and
a given range between <b>min</b> and <b>max</b> (inclusive)
@return default value if null or not parsable
"""
return minMax(min, parseInt(s, i), max);
} | java | public static int parseInt(String s, int i, int min, int max) {
return minMax(min, parseInt(s, i), max);
} | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"s",
",",
"int",
"i",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"return",
"minMax",
"(",
"min",
",",
"parseInt",
"(",
"s",
",",
"i",
")",
",",
"max",
")",
";",
"}"
] | Parse an <b>int</b> with a given default value <b>i</b> and
a given range between <b>min</b> and <b>max</b> (inclusive)
@return default value if null or not parsable | [
"Parse",
"an",
"<b",
">",
"int<",
"/",
"b",
">",
"with",
"a",
"given",
"default",
"value",
"<b",
">",
"i<",
"/",
"b",
">",
"and",
"a",
"given",
"range",
"between",
"<b",
">",
"min<",
"/",
"b",
">",
"and",
"<b",
">",
"max<",
"/",
"b",
">",
"("... | train | https://github.com/xqbase/util/blob/e7b9167b6c701b9eec988a9d1e68446cef5ef420/util/src/main/java/com/xqbase/util/Numbers.java#L56-L58 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.matchString | protected int matchString(String text, int start, int field, String[] data, Calendar cal) {
"""
Attempt to match the text at a given position against an array of
strings. Since multiple strings in the array may match (for
example, if the array contains "a", "ab", and "abc", all will match
the input string "abc... | java | protected int matchString(String text, int start, int field, String[] data, Calendar cal)
{
return matchString(text, start, field, data, null, cal);
} | [
"protected",
"int",
"matchString",
"(",
"String",
"text",
",",
"int",
"start",
",",
"int",
"field",
",",
"String",
"[",
"]",
"data",
",",
"Calendar",
"cal",
")",
"{",
"return",
"matchString",
"(",
"text",
",",
"start",
",",
"field",
",",
"data",
",",
... | Attempt to match the text at a given position against an array of
strings. Since multiple strings in the array may match (for
example, if the array contains "a", "ab", and "abc", all will match
the input string "abcd") the longest match is returned. As a side
effect, the given field of <code>cal</code> is set to the ... | [
"Attempt",
"to",
"match",
"the",
"text",
"at",
"a",
"given",
"position",
"against",
"an",
"array",
"of",
"strings",
".",
"Since",
"multiple",
"strings",
"in",
"the",
"array",
"may",
"match",
"(",
"for",
"example",
"if",
"the",
"array",
"contains",
"a",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L2849-L2852 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java | EntityManagerFactory.createEntityManager | public EntityManager createEntityManager(String projectId, File jsonCredentialsFile,
String namespace) {
"""
Creates and return a new {@link EntityManager} using the provided JSON formatted credentials.
@param projectId
the project ID
@param jsonCredentialsFile
the JSON formatted credentials file for... | java | public EntityManager createEntityManager(String projectId, File jsonCredentialsFile,
String namespace) {
try {
return createEntityManager(projectId, new FileInputStream(jsonCredentialsFile), namespace);
} catch (Exception exp) {
throw new EntityManagerFactoryException(exp);
}
} | [
"public",
"EntityManager",
"createEntityManager",
"(",
"String",
"projectId",
",",
"File",
"jsonCredentialsFile",
",",
"String",
"namespace",
")",
"{",
"try",
"{",
"return",
"createEntityManager",
"(",
"projectId",
",",
"new",
"FileInputStream",
"(",
"jsonCredentialsF... | Creates and return a new {@link EntityManager} using the provided JSON formatted credentials.
@param projectId
the project ID
@param jsonCredentialsFile
the JSON formatted credentials file for the target Cloud project.
@param namespace
the namespace (for multi-tenant datastore) to use. If <code>null</code>, default
n... | [
"Creates",
"and",
"return",
"a",
"new",
"{",
"@link",
"EntityManager",
"}",
"using",
"the",
"provided",
"JSON",
"formatted",
"credentials",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java#L151-L158 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/Hasher.java | Hasher.fileHash | public static byte[] fileHash(File file, MessageDigest messageDigest)
throws IOException {
"""
Returns the hash value of the file for the specified messageDigest.
@param file
to compute the hash value for
@param messageDigest
the message digest algorithm
@return hash value of the file
@throws I... | java | public static byte[] fileHash(File file, MessageDigest messageDigest)
throws IOException {
return computeHash(file, messageDigest, 0L, file.length());
} | [
"public",
"static",
"byte",
"[",
"]",
"fileHash",
"(",
"File",
"file",
",",
"MessageDigest",
"messageDigest",
")",
"throws",
"IOException",
"{",
"return",
"computeHash",
"(",
"file",
",",
"messageDigest",
",",
"0L",
",",
"file",
".",
"length",
"(",
")",
")... | Returns the hash value of the file for the specified messageDigest.
@param file
to compute the hash value for
@param messageDigest
the message digest algorithm
@return hash value of the file
@throws IOException | [
"Returns",
"the",
"hash",
"value",
"of",
"the",
"file",
"for",
"the",
"specified",
"messageDigest",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/Hasher.java#L126-L129 |
gocd/gocd | base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java | DirectoryScanner.setBasedir | public DirectoryScanner setBasedir(String basedir) {
"""
Set the base directory to be scanned. This is the directory which is
scanned recursively. All '/' and '\' characters are replaced by
<code>File.separatorChar</code>, so the separator used need not match
<code>File.separatorChar</code>.
@param basedir T... | java | public DirectoryScanner setBasedir(String basedir) {
setBasedir(basedir == null ? null
: new File(basedir.replace('/', File.separatorChar).replace(
'\\', File.separatorChar)));
return this;
} | [
"public",
"DirectoryScanner",
"setBasedir",
"(",
"String",
"basedir",
")",
"{",
"setBasedir",
"(",
"basedir",
"==",
"null",
"?",
"null",
":",
"new",
"File",
"(",
"basedir",
".",
"replace",
"(",
"'",
"'",
",",
"File",
".",
"separatorChar",
")",
".",
"repl... | Set the base directory to be scanned. This is the directory which is
scanned recursively. All '/' and '\' characters are replaced by
<code>File.separatorChar</code>, so the separator used need not match
<code>File.separatorChar</code>.
@param basedir The base directory to scan. | [
"Set",
"the",
"base",
"directory",
"to",
"be",
"scanned",
".",
"This",
"is",
"the",
"directory",
"which",
"is",
"scanned",
"recursively",
".",
"All",
"/",
"and",
"\\",
"characters",
"are",
"replaced",
"by",
"<code",
">",
"File",
".",
"separatorChar<",
"/",... | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java#L557-L562 |
RestComm/Restcomm-Connect | restcomm/restcomm.core/src/main/java/org/restcomm/connect/core/service/number/NumberSelectorServiceImpl.java | NumberSelectorServiceImpl.findByRegex | private NumberSelectionResult findByRegex(List<String> numberQueries,
Sid sourceOrganizationSid, Sid destOrg) {
"""
This will take the regexes available in given organization, and evalute
them agsint the given list of numbers, returning the first match.
The list of regexes will be ordered by length... | java | private NumberSelectionResult findByRegex(List<String> numberQueries,
Sid sourceOrganizationSid, Sid destOrg) {
NumberSelectionResult numberFound = new NumberSelectionResult(null, false, null);
IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder();
... | [
"private",
"NumberSelectionResult",
"findByRegex",
"(",
"List",
"<",
"String",
">",
"numberQueries",
",",
"Sid",
"sourceOrganizationSid",
",",
"Sid",
"destOrg",
")",
"{",
"NumberSelectionResult",
"numberFound",
"=",
"new",
"NumberSelectionResult",
"(",
"null",
",",
... | This will take the regexes available in given organization, and evalute
them agsint the given list of numbers, returning the first match.
The list of regexes will be ordered by length to ensure the longest
regexes matching any number in the list is returned first.
In this case, organization details are required.
@pa... | [
"This",
"will",
"take",
"the",
"regexes",
"available",
"in",
"given",
"organization",
"and",
"evalute",
"them",
"agsint",
"the",
"given",
"list",
"of",
"numbers",
"returning",
"the",
"first",
"match",
"."
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.core/src/main/java/org/restcomm/connect/core/service/number/NumberSelectorServiceImpl.java#L361-L383 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.CopyHeader | protected void CopyHeader() {
"""
Function Copies the header from the original fileto the output list
"""
seek(0);
@SuppressWarnings("unused")
int major = getCard8();
@SuppressWarnings("unused")
int minor = getCard8();
int hdrSize = getCard8();
@SuppressWarnings("unused")
... | java | protected void CopyHeader()
{
seek(0);
@SuppressWarnings("unused")
int major = getCard8();
@SuppressWarnings("unused")
int minor = getCard8();
int hdrSize = getCard8();
@SuppressWarnings("unused")
int offSize = getCard8();
nextIndexOffset = hdrSize;
OutputList.ad... | [
"protected",
"void",
"CopyHeader",
"(",
")",
"{",
"seek",
"(",
"0",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"int",
"major",
"=",
"getCard8",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"int",
"minor",
"=",
"getCard8... | Function Copies the header from the original fileto the output list | [
"Function",
"Copies",
"the",
"header",
"from",
"the",
"original",
"fileto",
"the",
"output",
"list"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L1224-L1236 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java | PhotosInterface.setPerms | public void setPerms(String photoId, Permissions permissions) throws FlickrException {
"""
Set the permissions for the photo.
This method requires authentication with 'write' permission.
@param photoId
The photo ID
@param permissions
The permissions object
@throws FlickrException
"""
Map<Str... | java | public void setPerms(String photoId, Permissions permissions) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_SET_PERMS);
parameters.put("photo_id", photoId);
parameters.put("is_public", permissions.isPublicFl... | [
"public",
"void",
"setPerms",
"(",
"String",
"photoId",
",",
"Permissions",
"permissions",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";... | Set the permissions for the photo.
This method requires authentication with 'write' permission.
@param photoId
The photo ID
@param permissions
The permissions object
@throws FlickrException | [
"Set",
"the",
"permissions",
"for",
"the",
"photo",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/PhotosInterface.java#L1226-L1241 |
wcm-io-caravan/caravan-commons | httpclient/src/main/java/io/wcm/caravan/commons/httpclient/impl/helpers/CertificateLoader.java | CertificateLoader.getTrustManagerFactory | private static TrustManagerFactory getTrustManagerFactory(InputStream trustStoreStream, StoreProperties storeProperties)
throws IOException, GeneralSecurityException {
"""
Build TrustManagerFactory.
@param trustStoreStream Truststore input stream
@param storeProperties store properties
@return TrustManage... | java | private static TrustManagerFactory getTrustManagerFactory(InputStream trustStoreStream, StoreProperties storeProperties)
throws IOException, GeneralSecurityException {
// use provider if given, otherwise use the first matching security provider
final KeyStore ks;
if (StringUtils.isNotBlank(storePrope... | [
"private",
"static",
"TrustManagerFactory",
"getTrustManagerFactory",
"(",
"InputStream",
"trustStoreStream",
",",
"StoreProperties",
"storeProperties",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"// use provider if given, otherwise use the first matching sec... | Build TrustManagerFactory.
@param trustStoreStream Truststore input stream
@param storeProperties store properties
@return TrustManagerFactory
@throws IOException
@throws GeneralSecurityException | [
"Build",
"TrustManagerFactory",
"."
] | train | https://github.com/wcm-io-caravan/caravan-commons/blob/12e605bdfeb5a1ce7404e30d9f32274552cb8ce8/httpclient/src/main/java/io/wcm/caravan/commons/httpclient/impl/helpers/CertificateLoader.java#L191-L207 |
jhalterman/concurrentunit | src/main/java/net/jodah/concurrentunit/Waiter.java | Waiter.assertThat | public <T> void assertThat(T actual, org.hamcrest.Matcher<? super T> matcher) {
"""
Asserts that {@code actual} satisfies the condition specified by {@code matcher}.
@throws AssertionError when the assertion fails
"""
try {
org.hamcrest.MatcherAssert.assertThat(actual, matcher);
} catch (Asser... | java | public <T> void assertThat(T actual, org.hamcrest.Matcher<? super T> matcher) {
try {
org.hamcrest.MatcherAssert.assertThat(actual, matcher);
} catch (AssertionError e) {
fail(e);
}
} | [
"public",
"<",
"T",
">",
"void",
"assertThat",
"(",
"T",
"actual",
",",
"org",
".",
"hamcrest",
".",
"Matcher",
"<",
"?",
"super",
"T",
">",
"matcher",
")",
"{",
"try",
"{",
"org",
".",
"hamcrest",
".",
"MatcherAssert",
".",
"assertThat",
"(",
"actua... | Asserts that {@code actual} satisfies the condition specified by {@code matcher}.
@throws AssertionError when the assertion fails | [
"Asserts",
"that",
"{",
"@code",
"actual",
"}",
"satisfies",
"the",
"condition",
"specified",
"by",
"{",
"@code",
"matcher",
"}",
"."
] | train | https://github.com/jhalterman/concurrentunit/blob/403b82537866e5ba598017d874753e12fa7aab10/src/main/java/net/jodah/concurrentunit/Waiter.java#L100-L106 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.detectWithStreamAsync | public Observable<List<DetectedFace>> detectWithStreamAsync(byte[] image, DetectWithStreamOptionalParameter detectWithStreamOptionalParameter) {
"""
Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param image An image stream.
@param detectWith... | java | public Observable<List<DetectedFace>> detectWithStreamAsync(byte[] image, DetectWithStreamOptionalParameter detectWithStreamOptionalParameter) {
return detectWithStreamWithServiceResponseAsync(image, detectWithStreamOptionalParameter).map(new Func1<ServiceResponse<List<DetectedFace>>, List<DetectedFace>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"DetectedFace",
">",
">",
"detectWithStreamAsync",
"(",
"byte",
"[",
"]",
"image",
",",
"DetectWithStreamOptionalParameter",
"detectWithStreamOptionalParameter",
")",
"{",
"return",
"detectWithStreamWithServiceResponseAsync",
"(",
... | Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param image An image stream.
@param detectWithStreamOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if paramete... | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"and",
"returns",
"face",
"locations",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L950-L957 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/html/EarlToHtmlTransformation.java | EarlToHtmlTransformation.earlHtmlReport | public void earlHtmlReport( String outputDir ) {
"""
Transform EARL result into HTML report using XSLT.
@param outputDir
"""
ClassLoader cl = Thread.currentThread().getContextClassLoader();
String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath();
String earlXsl = ... | java | public void earlHtmlReport( String outputDir ) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath();
String earlXsl = cl.getResource( "com/occamlab/te/earl_html_report.xsl" ).toString();
File htmlOu... | [
"public",
"void",
"earlHtmlReport",
"(",
"String",
"outputDir",
")",
"{",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"String",
"resourceDir",
"=",
"cl",
".",
"getResource",
"(",
"\"com/occam... | Transform EARL result into HTML report using XSLT.
@param outputDir | [
"Transform",
"EARL",
"result",
"into",
"HTML",
"report",
"using",
"XSLT",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/html/EarlToHtmlTransformation.java#L29-L57 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.fromMap | public static ParameterTool fromMap(Map<String, String> map) {
"""
Returns {@link ParameterTool} for the given map.
@param map A map of arguments. Both Key and Value have to be Strings
@return A {@link ParameterTool}
"""
Preconditions.checkNotNull(map, "Unable to initialize from empty map");
return new... | java | public static ParameterTool fromMap(Map<String, String> map) {
Preconditions.checkNotNull(map, "Unable to initialize from empty map");
return new ParameterTool(map);
} | [
"public",
"static",
"ParameterTool",
"fromMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"map",
",",
"\"Unable to initialize from empty map\"",
")",
";",
"return",
"new",
"ParameterTool",
"(",
"ma... | Returns {@link ParameterTool} for the given map.
@param map A map of arguments. Both Key and Value have to be Strings
@return A {@link ParameterTool} | [
"Returns",
"{",
"@link",
"ParameterTool",
"}",
"for",
"the",
"given",
"map",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L162-L165 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.updateBatch | private boolean updateBatch(DBObjectBatch dbObjBatch, BatchResult batchResult) throws IOException {
"""
Update each object in the given batch, updating BatchResult accordingly.
"""
Map<String, Map<String, String>> objCurrScalarMap = getCurrentScalars(dbObjBatch);
Map<String, Map<String, Integ... | java | private boolean updateBatch(DBObjectBatch dbObjBatch, BatchResult batchResult) throws IOException {
Map<String, Map<String, String>> objCurrScalarMap = getCurrentScalars(dbObjBatch);
Map<String, Map<String, Integer>> targObjShardNos = getLinkTargetShardNumbers(dbObjBatch);
for (DBObject dbObj... | [
"private",
"boolean",
"updateBatch",
"(",
"DBObjectBatch",
"dbObjBatch",
",",
"BatchResult",
"batchResult",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"objCurrScalarMap",
"=",
"getCurrentScalars",
... | Update each object in the given batch, updating BatchResult accordingly. | [
"Update",
"each",
"object",
"in",
"the",
"given",
"batch",
"updating",
"BatchResult",
"accordingly",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L174-L185 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/dispatcher/DispatcherBase.java | DispatcherBase.obtainIntConfigParameter | protected static int obtainIntConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, int minValue, int maxValue) {
"""
Obtains the value of an integer configuration parameter given its name, the default value
and 'reasonable' minimum and maximum values.
@param msi The Message Store inst... | java | protected static int obtainIntConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, int minValue, int maxValue)
{
int value = Integer.parseInt(defaultValue);
if (msi != null)
{
String strValue = msi.getProperty(parameterName, defaultValue);
... | [
"protected",
"static",
"int",
"obtainIntConfigParameter",
"(",
"MessageStoreImpl",
"msi",
",",
"String",
"parameterName",
",",
"String",
"defaultValue",
",",
"int",
"minValue",
",",
"int",
"maxValue",
")",
"{",
"int",
"value",
"=",
"Integer",
".",
"parseInt",
"(... | Obtains the value of an integer configuration parameter given its name, the default value
and 'reasonable' minimum and maximum values.
@param msi The Message Store instance to obtain the parameters (may be null)
@param parameterName The parameter's name
@param defaultValue The default value
@param minValue A reasonable... | [
"Obtains",
"the",
"value",
"of",
"an",
"integer",
"configuration",
"parameter",
"given",
"its",
"name",
"the",
"default",
"value",
"and",
"reasonable",
"minimum",
"and",
"maximum",
"values",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/dispatcher/DispatcherBase.java#L38-L70 |
apache/fluo | modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java | FluoConfiguration.getAccumuloPassword | public String getAccumuloPassword() {
"""
Gets the Apache Accumulo password property value {@value #ACCUMULO_PASSWORD_PROP}
@throws NoSuchElementException if {@value #ACCUMULO_PASSWORD_PROP} is not set
"""
if (containsKey(ACCUMULO_PASSWORD_PROP)) {
return verifyNotNull(ACCUMULO_PASSWORD_PROP, getS... | java | public String getAccumuloPassword() {
if (containsKey(ACCUMULO_PASSWORD_PROP)) {
return verifyNotNull(ACCUMULO_PASSWORD_PROP, getString(ACCUMULO_PASSWORD_PROP));
} else if (containsKey(CLIENT_ACCUMULO_PASSWORD_PROP)) {
return verifyNotNull(CLIENT_ACCUMULO_PASSWORD_PROP, getString(CLIENT_ACCUMULO_PAS... | [
"public",
"String",
"getAccumuloPassword",
"(",
")",
"{",
"if",
"(",
"containsKey",
"(",
"ACCUMULO_PASSWORD_PROP",
")",
")",
"{",
"return",
"verifyNotNull",
"(",
"ACCUMULO_PASSWORD_PROP",
",",
"getString",
"(",
"ACCUMULO_PASSWORD_PROP",
")",
")",
";",
"}",
"else",... | Gets the Apache Accumulo password property value {@value #ACCUMULO_PASSWORD_PROP}
@throws NoSuchElementException if {@value #ACCUMULO_PASSWORD_PROP} is not set | [
"Gets",
"the",
"Apache",
"Accumulo",
"password",
"property",
"value",
"{",
"@value",
"#ACCUMULO_PASSWORD_PROP",
"}"
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L511-L518 |
VoltDB/voltdb | third_party/java/src/org/supercsv_voltpatches/tokenizer/Tokenizer.java | Tokenizer.appendSpaces | private static void appendSpaces(final StringBuilder sb, final int spaces) {
"""
Appends the required number of spaces to the StringBuilder.
@param sb
the StringBuilder
@param spaces
the required number of spaces to append
"""
for( int i = 0; i < spaces; i++ ) {
sb.append(SPACE);
}
} | java | private static void appendSpaces(final StringBuilder sb, final int spaces) {
for( int i = 0; i < spaces; i++ ) {
sb.append(SPACE);
}
} | [
"private",
"static",
"void",
"appendSpaces",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"int",
"spaces",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"spaces",
";",
"i",
"++",
")",
"{",
"sb",
".",
"append",
"(",
"SPACE",
")",
... | Appends the required number of spaces to the StringBuilder.
@param sb
the StringBuilder
@param spaces
the required number of spaces to append | [
"Appends",
"the",
"required",
"number",
"of",
"spaces",
"to",
"the",
"StringBuilder",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/supercsv_voltpatches/tokenizer/Tokenizer.java#L350-L354 |
esigate/esigate | esigate-core/src/main/java/org/esigate/DriverFactory.java | DriverFactory.stripMappingPath | static String stripMappingPath(String url, UriMapping mapping) {
"""
Get the relative url without the mapping url.
<p/>
Uses the url and remove the mapping path.
@param url
incoming relative url
@return the url, relative to the driver remote url.
"""
String relativeUrl = url;
// Uri mapp... | java | static String stripMappingPath(String url, UriMapping mapping) {
String relativeUrl = url;
// Uri mapping
String mappingPath;
if (mapping == null) {
mappingPath = null;
} else {
mappingPath = mapping.getPath();
}
// Remove mapping path
... | [
"static",
"String",
"stripMappingPath",
"(",
"String",
"url",
",",
"UriMapping",
"mapping",
")",
"{",
"String",
"relativeUrl",
"=",
"url",
";",
"// Uri mapping",
"String",
"mappingPath",
";",
"if",
"(",
"mapping",
"==",
"null",
")",
"{",
"mappingPath",
"=",
... | Get the relative url without the mapping url.
<p/>
Uses the url and remove the mapping path.
@param url
incoming relative url
@return the url, relative to the driver remote url. | [
"Get",
"the",
"relative",
"url",
"without",
"the",
"mapping",
"url",
".",
"<p",
"/",
">",
"Uses",
"the",
"url",
"and",
"remove",
"the",
"mapping",
"path",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/DriverFactory.java#L370-L385 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/DateRangeValidationMatcher.java | DateRangeValidationMatcher.toCalender | protected Calendar toCalender(String date, String datePattern) {
"""
Converts the supplied date to it's calendar representation. The {@code datePattern} is
used for parsing the date.
@param date the date to parse
@param datePattern the date format to use when parsing the date
@return the calendar repr... | java | protected Calendar toCalender(String date, String datePattern) {
SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern);
Calendar cal = Calendar.getInstance();
try {
cal.setTime(dateFormat.parse(date));
} catch (ParseException e) {
throw new CitrusRuntime... | [
"protected",
"Calendar",
"toCalender",
"(",
"String",
"date",
",",
"String",
"datePattern",
")",
"{",
"SimpleDateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"datePattern",
")",
";",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")"... | Converts the supplied date to it's calendar representation. The {@code datePattern} is
used for parsing the date.
@param date the date to parse
@param datePattern the date format to use when parsing the date
@return the calendar representation | [
"Converts",
"the",
"supplied",
"date",
"to",
"it",
"s",
"calendar",
"representation",
".",
"The",
"{",
"@code",
"datePattern",
"}",
"is",
"used",
"for",
"parsing",
"the",
"date",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/DateRangeValidationMatcher.java#L99-L108 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateNull | public static <T> T validateNull(T value, String errorMsgTemplate, Object... params) throws ValidateException {
"""
检查指定值是否为<code>null</code>
@param <T> 被检查的对象类型
@param value 值
@param errorMsgTemplate 错误消息内容模板(变量使用{}表示)
@param params 模板中变量替换后的值
@return 检查过后的值
@throws ValidateException 检查不满足条件抛出的异常
@since ... | java | public static <T> T validateNull(T value, String errorMsgTemplate, Object... params) throws ValidateException {
if (isNotNull(value)) {
throw new ValidateException(errorMsgTemplate, params);
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"validateNull",
"(",
"T",
"value",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"isNotNull",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"V... | 检查指定值是否为<code>null</code>
@param <T> 被检查的对象类型
@param value 值
@param errorMsgTemplate 错误消息内容模板(变量使用{}表示)
@param params 模板中变量替换后的值
@return 检查过后的值
@throws ValidateException 检查不满足条件抛出的异常
@since 4.4.5 | [
"检查指定值是否为<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L147-L152 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addIntTask | public UBench addIntTask(String name, IntSupplier task, IntPredicate check) {
"""
Include an int-specialized named task (and validator) in to the
benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@param check
The check of the results ... | java | public UBench addIntTask(String name, IntSupplier task, IntPredicate check) {
return putTask(name, () -> {
long start = System.nanoTime();
int result = task.getAsInt();
long time = System.nanoTime() - start;
if (check != null && !check.test(result)) {
... | [
"public",
"UBench",
"addIntTask",
"(",
"String",
"name",
",",
"IntSupplier",
"task",
",",
"IntPredicate",
"check",
")",
"{",
"return",
"putTask",
"(",
"name",
",",
"(",
")",
"->",
"{",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"in... | Include an int-specialized named task (and validator) in to the
benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@param check
The check of the results from the task.
@return The same object, for chaining calls. | [
"Include",
"an",
"int",
"-",
"specialized",
"named",
"task",
"(",
"and",
"validator",
")",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L170-L180 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractLongObjectMap.java | AbstractLongObjectMap.containsValue | public boolean containsValue(final Object value) {
"""
Returns <tt>true</tt> if the receiver contains the specified value.
Tests for identity.
@return <tt>true</tt> if the receiver contains the specified value.
"""
return ! forEachPair(
new LongObjectProcedure() {
public boolean apply(long iterKe... | java | public boolean containsValue(final Object value) {
return ! forEachPair(
new LongObjectProcedure() {
public boolean apply(long iterKey, Object iterValue) {
return (value != iterValue);
}
}
);
} | [
"public",
"boolean",
"containsValue",
"(",
"final",
"Object",
"value",
")",
"{",
"return",
"!",
"forEachPair",
"(",
"new",
"LongObjectProcedure",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"long",
"iterKey",
",",
"Object",
"iterValue",
")",
"{",
"retu... | Returns <tt>true</tt> if the receiver contains the specified value.
Tests for identity.
@return <tt>true</tt> if the receiver contains the specified value. | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"if",
"the",
"receiver",
"contains",
"the",
"specified",
"value",
".",
"Tests",
"for",
"identity",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractLongObjectMap.java#L54-L62 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java | ReadModifyWriteRow.increment | public ReadModifyWriteRow increment(
@Nonnull String familyName, @Nonnull String qualifier, long amount) {
"""
Adds `amount` be added to the existing value. If the targeted cell is unset, it will be treated
as containing a zero. Otherwise, the targeted cell must contain an 8-byte value (interpreted as
a 64... | java | public ReadModifyWriteRow increment(
@Nonnull String familyName, @Nonnull String qualifier, long amount) {
return increment(familyName, ByteString.copyFromUtf8(qualifier), amount);
} | [
"public",
"ReadModifyWriteRow",
"increment",
"(",
"@",
"Nonnull",
"String",
"familyName",
",",
"@",
"Nonnull",
"String",
"qualifier",
",",
"long",
"amount",
")",
"{",
"return",
"increment",
"(",
"familyName",
",",
"ByteString",
".",
"copyFromUtf8",
"(",
"qualifi... | Adds `amount` be added to the existing value. If the targeted cell is unset, it will be treated
as containing a zero. Otherwise, the targeted cell must contain an 8-byte value (interpreted as
a 64-bit big-endian signed integer), or the entire request will fail. | [
"Adds",
"amount",
"be",
"added",
"to",
"the",
"existing",
"value",
".",
"If",
"the",
"targeted",
"cell",
"is",
"unset",
"it",
"will",
"be",
"treated",
"as",
"containing",
"a",
"zero",
".",
"Otherwise",
"the",
"targeted",
"cell",
"must",
"contain",
"an",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java#L103-L106 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java | FactoryMotion2D.createMotion2D | public static <I extends ImageBase<I>, IT extends InvertibleTransform>
ImageMotion2D<I,IT> createMotion2D( int ransacIterations , double inlierThreshold,int outlierPrune,
int absoluteMinimumTracks, double respawnTrackFraction,
double respawnCoverageFraction,
boolean refineEstimate ,
... | java | public static <I extends ImageBase<I>, IT extends InvertibleTransform>
ImageMotion2D<I,IT> createMotion2D( int ransacIterations , double inlierThreshold,int outlierPrune,
int absoluteMinimumTracks, double respawnTrackFraction,
double respawnCoverageFraction,
boolean refineEstimate ,
... | [
"public",
"static",
"<",
"I",
"extends",
"ImageBase",
"<",
"I",
">",
",",
"IT",
"extends",
"InvertibleTransform",
">",
"ImageMotion2D",
"<",
"I",
",",
"IT",
">",
"createMotion2D",
"(",
"int",
"ransacIterations",
",",
"double",
"inlierThreshold",
",",
"int",
... | Estimates the 2D motion of an image using different models.
@param ransacIterations Number of RANSAC iterations
@param inlierThreshold Threshold which defines an inlier.
@param outlierPrune If a feature is an outlier for this many turns in a row it is dropped. Try 2
@param absoluteMinimumTracks New features will be re... | [
"Estimates",
"the",
"2D",
"motion",
"of",
"an",
"image",
"using",
"different",
"models",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/factory/sfm/FactoryMotion2D.java#L73-L121 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.updateProject | public Project updateProject(UUID projectId, Project updatedProject) {
"""
Update a specific project.
@param projectId The id of the project to update
@param updatedProject The updated project model
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the... | java | public Project updateProject(UUID projectId, Project updatedProject) {
return updateProjectWithServiceResponseAsync(projectId, updatedProject).toBlocking().single().body();
} | [
"public",
"Project",
"updateProject",
"(",
"UUID",
"projectId",
",",
"Project",
"updatedProject",
")",
"{",
"return",
"updateProjectWithServiceResponseAsync",
"(",
"projectId",
",",
"updatedProject",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
... | Update a specific project.
@param projectId The id of the project to update
@param updatedProject The updated project model
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exc... | [
"Update",
"a",
"specific",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L2123-L2125 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java | FileUtils.getParentDirPath | public static String getParentDirPath(final String path, final char separator) {
"""
Get the parent dir path.
@param path
the path
@param separator
the separator
@return the parent dir path
"""
final int lastSlashIdx = path.lastIndexOf(separator);
if (lastSlashIdx <= 0) {
ret... | java | public static String getParentDirPath(final String path, final char separator) {
final int lastSlashIdx = path.lastIndexOf(separator);
if (lastSlashIdx <= 0) {
return "";
}
return path.substring(0, lastSlashIdx);
} | [
"public",
"static",
"String",
"getParentDirPath",
"(",
"final",
"String",
"path",
",",
"final",
"char",
"separator",
")",
"{",
"final",
"int",
"lastSlashIdx",
"=",
"path",
".",
"lastIndexOf",
"(",
"separator",
")",
";",
"if",
"(",
"lastSlashIdx",
"<=",
"0",
... | Get the parent dir path.
@param path
the path
@param separator
the separator
@return the parent dir path | [
"Get",
"the",
"parent",
"dir",
"path",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/FileUtils.java#L431-L437 |
twitter/chill | chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java | KryoSerialization.resetOrUpdateFromCache | public static synchronized void resetOrUpdateFromCache(KryoSerialization instance, KryoInstantiator kryoInst) {
"""
Hadoop will re-initialize the KryoSerialization on every spill
This gets very expensive if you output a lot from a mapper to initialize the chill/kryo stack
The KryoInstantiator's already do some c... | java | public static synchronized void resetOrUpdateFromCache(KryoSerialization instance, KryoInstantiator kryoInst){
if(kryoInst != cachedKryoInst) {
cachedPool = KryoPool.withByteArrayOutputStream(MAX_CACHED_KRYO, kryoInst);
cachedKryoInst = kryoInst;
}
instance.kryoPool = cachedPool;
} | [
"public",
"static",
"synchronized",
"void",
"resetOrUpdateFromCache",
"(",
"KryoSerialization",
"instance",
",",
"KryoInstantiator",
"kryoInst",
")",
"{",
"if",
"(",
"kryoInst",
"!=",
"cachedKryoInst",
")",
"{",
"cachedPool",
"=",
"KryoPool",
".",
"withByteArrayOutput... | Hadoop will re-initialize the KryoSerialization on every spill
This gets very expensive if you output a lot from a mapper to initialize the chill/kryo stack
The KryoInstantiator's already do some caching, and figuring out if its safe to cache,
so here we piggy back on that to avoid generating new kryo's or kryo pools | [
"Hadoop",
"will",
"re",
"-",
"initialize",
"the",
"KryoSerialization",
"on",
"every",
"spill",
"This",
"gets",
"very",
"expensive",
"if",
"you",
"output",
"a",
"lot",
"from",
"a",
"mapper",
"to",
"initialize",
"the",
"chill",
"/",
"kryo",
"stack",
"The",
"... | train | https://github.com/twitter/chill/blob/0919984ec3aeb320ff522911c726425e9f18ea41/chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java#L50-L56 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.getBytes | public int getBytes(int index, GatheringByteChannel out, int length)
throws IOException {
"""
Transfers this buffer's data to the specified channel starting at the
specified absolute {@code index}.
@param length the maximum number of bytes to transfer
@return the actual number of bytes written out... | java | public int getBytes(int index, GatheringByteChannel out, int length)
throws IOException
{
checkPositionIndexes(index, index + length, this.length);
index += offset;
return out.write(ByteBuffer.wrap(data, index, length));
} | [
"public",
"int",
"getBytes",
"(",
"int",
"index",
",",
"GatheringByteChannel",
"out",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"length",
",",
"this",
".",
"length",
")",
";",
"index",
... | Transfers this buffer's data to the specified channel starting at the
specified absolute {@code index}.
@param length the maximum number of bytes to transfer
@return the actual number of bytes written out to the specified channel
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} o... | [
"Transfers",
"this",
"buffer",
"s",
"data",
"to",
"the",
"specified",
"channel",
"starting",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L278-L284 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/ArraySchema.java | ArraySchema.performValidation | @SuppressWarnings("unchecked")
@Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
"""
Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@par... | java | @SuppressWarnings("unchecked")
@Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
String name = path != null ? path : "value";
value = ObjectReader.getValue(value);
super.performValidation(path, value, results);
if (value == null)
return;
if (value ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"void",
"performValidation",
"(",
"String",
"path",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"String",
"name",
"=",
"path",
"!=",
... | Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validation results to add new results. | [
"Validates",
"a",
"given",
"value",
"against",
"the",
"schema",
"and",
"configured",
"validation",
"rules",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/ArraySchema.java#L66-L97 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATConsumer.java | CATConsumer.requestMsgs | public void requestMsgs(int requestNumber, int receivedBytes, int requestedBytes) {
"""
This method should be handled by the appropriate subclass
@param requestNumber
@param receivedBytes
@param requestedBytes
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,... | java | public void requestMsgs(int requestNumber, int receivedBytes, int requestedBytes)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "requestMsgs",
new Object[]{requestNumber, receivedBytes, requestedBytes});
SIErrorExcepti... | [
"public",
"void",
"requestMsgs",
"(",
"int",
"requestNumber",
",",
"int",
"receivedBytes",
",",
"int",
"requestedBytes",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
"... | This method should be handled by the appropriate subclass
@param requestNumber
@param receivedBytes
@param requestedBytes | [
"This",
"method",
"should",
"be",
"handled",
"by",
"the",
"appropriate",
"subclass"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATConsumer.java#L661-L680 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.writeToOutputStream | void writeToOutputStream(byte[] bytes, boolean useArray) throws IOException {
"""
Writes some bytes to the current output stream,
this method should be called from CmsFlexCacheEntry.service() only.<p>
@param bytes an array of bytes
@param useArray indicates that the byte array should be used directly
@thro... | java | void writeToOutputStream(byte[] bytes, boolean useArray) throws IOException {
if (isSuspended()) {
return;
}
if (m_writeOnlyToBuffer) {
if (useArray) {
// This cached entry has no sub-elements (it a "leaf") and so we can just use it's bytes
... | [
"void",
"writeToOutputStream",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"useArray",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isSuspended",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"m_writeOnlyToBuffer",
")",
"{",
"if",
"(",
"useArr... | Writes some bytes to the current output stream,
this method should be called from CmsFlexCacheEntry.service() only.<p>
@param bytes an array of bytes
@param useArray indicates that the byte array should be used directly
@throws IOException in case something goes wrong while writing to the stream | [
"Writes",
"some",
"bytes",
"to",
"the",
"current",
"output",
"stream",
"this",
"method",
"should",
"be",
"called",
"from",
"CmsFlexCacheEntry",
".",
"service",
"()",
"only",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L1034-L1058 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java | Decimal.divideToIntegralValue | public static Decimal divideToIntegralValue(Decimal value, Decimal divisor, int precision, int scale) {
"""
Returns a {@code Decimal} whose value is the integer part
of the quotient {@code (this / divisor)} rounded down.
@param value value by which this {@code Decimal} is to be divided.
@param divisor value... | java | public static Decimal divideToIntegralValue(Decimal value, Decimal divisor, int precision, int scale) {
BigDecimal bd = value.toBigDecimal().divideToIntegralValue(divisor.toBigDecimal());
return fromBigDecimal(bd, precision, scale);
} | [
"public",
"static",
"Decimal",
"divideToIntegralValue",
"(",
"Decimal",
"value",
",",
"Decimal",
"divisor",
",",
"int",
"precision",
",",
"int",
"scale",
")",
"{",
"BigDecimal",
"bd",
"=",
"value",
".",
"toBigDecimal",
"(",
")",
".",
"divideToIntegralValue",
"... | Returns a {@code Decimal} whose value is the integer part
of the quotient {@code (this / divisor)} rounded down.
@param value value by which this {@code Decimal} is to be divided.
@param divisor value by which this {@code Decimal} is to be divided.
@return The integer part of {@code this / divisor}.
@throws Arithmet... | [
"Returns",
"a",
"{",
"@code",
"Decimal",
"}",
"whose",
"value",
"is",
"the",
"integer",
"part",
"of",
"the",
"quotient",
"{",
"@code",
"(",
"this",
"/",
"divisor",
")",
"}",
"rounded",
"down",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java#L328-L331 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQProfileRepositoryImpl.java | BuiltInQProfileRepositoryImpl.ensureAtMostOneDeclaredDefault | private static boolean ensureAtMostOneDeclaredDefault(Map.Entry<String, List<BuiltInQProfile.Builder>> entry) {
"""
Fails if more than one {@link BuiltInQProfile.Builder#declaredDefault} is {@code true}, otherwise returns {@code true}.
"""
Set<String> declaredDefaultProfileNames = entry.getValue().stream()... | java | private static boolean ensureAtMostOneDeclaredDefault(Map.Entry<String, List<BuiltInQProfile.Builder>> entry) {
Set<String> declaredDefaultProfileNames = entry.getValue().stream()
.filter(BuiltInQProfile.Builder::isDeclaredDefault)
.map(BuiltInQProfile.Builder::getName)
.collect(MoreCollectors.toS... | [
"private",
"static",
"boolean",
"ensureAtMostOneDeclaredDefault",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"BuiltInQProfile",
".",
"Builder",
">",
">",
"entry",
")",
"{",
"Set",
"<",
"String",
">",
"declaredDefaultProfileNames",
"=",
"entry",
... | Fails if more than one {@link BuiltInQProfile.Builder#declaredDefault} is {@code true}, otherwise returns {@code true}. | [
"Fails",
"if",
"more",
"than",
"one",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInQProfileRepositoryImpl.java#L172-L179 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.toDateTime | public DateTime toDateTime(LocalTime time, DateTimeZone zone) {
"""
Converts this object to a DateTime using a LocalTime to fill in the
missing fields.
<p>
The resulting chronology is determined by the chronology of this
LocalDate plus the time zone. The chronology of the time must match.
<p>
If the time is ... | java | public DateTime toDateTime(LocalTime time, DateTimeZone zone) {
if (time == null) {
return toDateTimeAtCurrentTime(zone);
}
if (getChronology() != time.getChronology()) {
throw new IllegalArgumentException("The chronology of the time does not match");
}
Ch... | [
"public",
"DateTime",
"toDateTime",
"(",
"LocalTime",
"time",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"time",
"==",
"null",
")",
"{",
"return",
"toDateTimeAtCurrentTime",
"(",
"zone",
")",
";",
"}",
"if",
"(",
"getChronology",
"(",
")",
"!=",
"... | Converts this object to a DateTime using a LocalTime to fill in the
missing fields.
<p>
The resulting chronology is determined by the chronology of this
LocalDate plus the time zone. The chronology of the time must match.
<p>
If the time is null, this method delegates to {@link #toDateTimeAtCurrentTime(DateTimeZone)}
a... | [
"Converts",
"this",
"object",
"to",
"a",
"DateTime",
"using",
"a",
"LocalTime",
"to",
"fill",
"in",
"the",
"missing",
"fields",
".",
"<p",
">",
"The",
"resulting",
"chronology",
"is",
"determined",
"by",
"the",
"chronology",
"of",
"this",
"LocalDate",
"plus"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L950-L962 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/VoltCompiler.java | VoltCompiler.debugVerifyCatalog | private void debugVerifyCatalog(InMemoryJarfile origJarFile, Catalog origCatalog) {
"""
Internal method that takes the generated DDL from the catalog and builds a new catalog.
The generated catalog is diffed with the original catalog to verify compilation and
catalog generation consistency.
"""
final... | java | private void debugVerifyCatalog(InMemoryJarfile origJarFile, Catalog origCatalog)
{
final VoltCompiler autoGenCompiler = new VoltCompiler(m_isXDCR);
// Make the new compiler use the original jarfile's classloader so it can
// pull in the class files for procedures and imports
autoGen... | [
"private",
"void",
"debugVerifyCatalog",
"(",
"InMemoryJarfile",
"origJarFile",
",",
"Catalog",
"origCatalog",
")",
"{",
"final",
"VoltCompiler",
"autoGenCompiler",
"=",
"new",
"VoltCompiler",
"(",
"m_isXDCR",
")",
";",
"// Make the new compiler use the original jarfile's c... | Internal method that takes the generated DDL from the catalog and builds a new catalog.
The generated catalog is diffed with the original catalog to verify compilation and
catalog generation consistency. | [
"Internal",
"method",
"that",
"takes",
"the",
"generated",
"DDL",
"from",
"the",
"catalog",
"and",
"builds",
"a",
"new",
"catalog",
".",
"The",
"generated",
"catalog",
"is",
"diffed",
"with",
"the",
"original",
"catalog",
"to",
"verify",
"compilation",
"and",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/VoltCompiler.java#L647-L695 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createException | public static UnitResponse createException(String errCode, Throwable exception) {
"""
Create an exception unit response object.
@param errCode the error code for the unit response.
@param exception the exception object.
@return the newly created unit response.
"""
return UnitResponse.createExcep... | java | public static UnitResponse createException(String errCode, Throwable exception) {
return UnitResponse.createException(exception).setCode(errCode);
} | [
"public",
"static",
"UnitResponse",
"createException",
"(",
"String",
"errCode",
",",
"Throwable",
"exception",
")",
"{",
"return",
"UnitResponse",
".",
"createException",
"(",
"exception",
")",
".",
"setCode",
"(",
"errCode",
")",
";",
"}"
] | Create an exception unit response object.
@param errCode the error code for the unit response.
@param exception the exception object.
@return the newly created unit response. | [
"Create",
"an",
"exception",
"unit",
"response",
"object",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L139-L141 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java | HashUserRealm.isUserInRole | public synchronized boolean isUserInRole(Principal user, String roleName) {
"""
Check if a user is in a role.
@param user The user, which must be from this realm
@param roleName
@return True if the user can act in the role.
"""
if (user instanceof WrappedUser)
return ((WrappedUser)user).... | java | public synchronized boolean isUserInRole(Principal user, String roleName)
{
if (user instanceof WrappedUser)
return ((WrappedUser)user).isUserInRole(roleName);
if (user==null || ((User)user).getUserRealm()!=this)
return false;
HashSet userSet = (Has... | [
"public",
"synchronized",
"boolean",
"isUserInRole",
"(",
"Principal",
"user",
",",
"String",
"roleName",
")",
"{",
"if",
"(",
"user",
"instanceof",
"WrappedUser",
")",
"return",
"(",
"(",
"WrappedUser",
")",
"user",
")",
".",
"isUserInRole",
"(",
"roleName",
... | Check if a user is in a role.
@param user The user, which must be from this realm
@param roleName
@return True if the user can act in the role. | [
"Check",
"if",
"a",
"user",
"is",
"in",
"a",
"role",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L282-L292 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.decodeHtmlEntities | public static String decodeHtmlEntities(String input, String encoding) {
"""
Decodes HTML entity references like <code>&#8364;</code> that are contained in the
String to a regular character, but only if that character is contained in the given
encodings charset.<p>
@param input the input to decode the HTM... | java | public static String decodeHtmlEntities(String input, String encoding) {
Matcher matcher = ENTITIY_PATTERN.matcher(input);
StringBuffer result = new StringBuffer(input.length());
Charset charset = Charset.forName(encoding);
CharsetEncoder encoder = charset.newEncoder();
while (... | [
"public",
"static",
"String",
"decodeHtmlEntities",
"(",
"String",
"input",
",",
"String",
"encoding",
")",
"{",
"Matcher",
"matcher",
"=",
"ENTITIY_PATTERN",
".",
"matcher",
"(",
"input",
")",
";",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"i... | Decodes HTML entity references like <code>&#8364;</code> that are contained in the
String to a regular character, but only if that character is contained in the given
encodings charset.<p>
@param input the input to decode the HTML entities in
@param encoding the charset to decode the input for
@return the input wi... | [
"Decodes",
"HTML",
"entity",
"references",
"like",
"<code",
">",
"&",
";",
"#8364",
";",
"<",
"/",
"code",
">",
"that",
"are",
"contained",
"in",
"the",
"String",
"to",
"a",
"regular",
"character",
"but",
"only",
"if",
"that",
"character",
"is",
"cont... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L300-L324 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6AddressPool.java | IPv6AddressPool.doAllocate | private IPv6AddressPool doAllocate(final IPv6Network toAllocate, final IPv6AddressRange rangeToAllocateFrom) {
"""
Private helper method to perform the allocation of a subnet within one of the free ranges.
@param toAllocate subnet to allocate
@param rangeToAllocateFrom free range to allocate from
@re... | java | private IPv6AddressPool doAllocate(final IPv6Network toAllocate, final IPv6AddressRange rangeToAllocateFrom)
{
assert freeRanges.contains(rangeToAllocateFrom);
assert rangeToAllocateFrom.contains(toAllocate);
final TreeSet<IPv6AddressRange> newFreeRanges = new TreeSet<IPv6AddressRange>(this... | [
"private",
"IPv6AddressPool",
"doAllocate",
"(",
"final",
"IPv6Network",
"toAllocate",
",",
"final",
"IPv6AddressRange",
"rangeToAllocateFrom",
")",
"{",
"assert",
"freeRanges",
".",
"contains",
"(",
"rangeToAllocateFrom",
")",
";",
"assert",
"rangeToAllocateFrom",
".",... | Private helper method to perform the allocation of a subnet within one of the free ranges.
@param toAllocate subnet to allocate
@param rangeToAllocateFrom free range to allocate from
@return resulting pool | [
"Private",
"helper",
"method",
"to",
"perform",
"the",
"allocation",
"of",
"a",
"subnet",
"within",
"one",
"of",
"the",
"free",
"ranges",
"."
] | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6AddressPool.java#L206-L223 |
banq/jdonframework | src/main/java/com/jdon/util/RequestUtil.java | RequestUtil.encodeURL | public static String encodeURL(String url, String enc) {
"""
Use the new URLEncoder.encode() method from Java 1.4 if available, else
use the old deprecated version. This method uses reflection to find the
appropriate method; if the reflection operations throw exceptions, this
will return the url encoded with th... | java | public static String encodeURL(String url, String enc) {
try {
if (enc == null || enc.length() == 0) {
enc = "UTF-8";
}
return URLEncoder.encode(url, enc);
} catch (Exception e) {
System.err.print(e);
}
return null;
} | [
"public",
"static",
"String",
"encodeURL",
"(",
"String",
"url",
",",
"String",
"enc",
")",
"{",
"try",
"{",
"if",
"(",
"enc",
"==",
"null",
"||",
"enc",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"enc",
"=",
"\"UTF-8\"",
";",
"}",
"return",
"... | Use the new URLEncoder.encode() method from Java 1.4 if available, else
use the old deprecated version. This method uses reflection to find the
appropriate method; if the reflection operations throw exceptions, this
will return the url encoded with the old URLEncoder.encode() method.
@param enc
The character encoding ... | [
"Use",
"the",
"new",
"URLEncoder",
".",
"encode",
"()",
"method",
"from",
"Java",
"1",
".",
"4",
"if",
"available",
"else",
"use",
"the",
"old",
"deprecated",
"version",
".",
"This",
"method",
"uses",
"reflection",
"to",
"find",
"the",
"appropriate",
"meth... | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/RequestUtil.java#L280-L293 |
cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.checkFeatureType | private static void checkFeatureType(Feature feature, String expectedType)
throws AnalysisEngineProcessException {
"""
Checks if the given feature has the expected type otherwise
an exception is thrown.
@param feature
@param expectedType
@throws AnalysisEngineProcessException - if type does not match... | java | private static void checkFeatureType(Feature feature, String expectedType)
throws AnalysisEngineProcessException {
if (!feature.getRange().getName().equals(expectedType)) {
throw new OpenNlpAnnotatorProcessException(
ExceptionMessages.WRONG_FEATURE_TYPE,
new Object[] {feature.getName... | [
"private",
"static",
"void",
"checkFeatureType",
"(",
"Feature",
"feature",
",",
"String",
"expectedType",
")",
"throws",
"AnalysisEngineProcessException",
"{",
"if",
"(",
"!",
"feature",
".",
"getRange",
"(",
")",
".",
"getName",
"(",
")",
".",
"equals",
"(",... | Checks if the given feature has the expected type otherwise
an exception is thrown.
@param feature
@param expectedType
@throws AnalysisEngineProcessException - if type does not match | [
"Checks",
"if",
"the",
"given",
"feature",
"has",
"the",
"expected",
"type",
"otherwise",
"an",
"exception",
"is",
"thrown",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L72-L81 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listMetricDefintionsWithServiceResponseAsync | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Get metrics that can be queried for an App Service plan, and their definitions.
Get metrics that can be queried for an App Service plan, and... | java | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMetricDefintionsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<ResourceMetricDefini... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ResourceMetricDefinitionInner",
">",
">",
">",
"listMetricDefintionsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listMetric... | Get metrics that can be queried for an App Service plan, and their definitions.
Get metrics that can be queried for an App Service plan, and their definitions.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws IllegalArgumentException t... | [
"Get",
"metrics",
"that",
"can",
"be",
"queried",
"for",
"an",
"App",
"Service",
"plan",
"and",
"their",
"definitions",
".",
"Get",
"metrics",
"that",
"can",
"be",
"queried",
"for",
"an",
"App",
"Service",
"plan",
"and",
"their",
"definitions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1867-L1879 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/schemamanager/OracleNoSQLSchemaManager.java | OracleNoSQLSchemaManager.buildAlterDDLQuery | private String buildAlterDDLQuery(TableInfo tableInfo, Map<String, String> newColumns) {
"""
Builds the alter ddl query.
@param tableInfo
the table info
@param newColumns
the new columns
@return the string
"""
String statement;
StringBuilder builder = new StringBuilder();
builder... | java | private String buildAlterDDLQuery(TableInfo tableInfo, Map<String, String> newColumns)
{
String statement;
StringBuilder builder = new StringBuilder();
builder.append("ALTER TABLE ");
builder.append(tableInfo.getTableName());
builder.append(Constants.OPEN_ROUND_BRACKET);
... | [
"private",
"String",
"buildAlterDDLQuery",
"(",
"TableInfo",
"tableInfo",
",",
"Map",
"<",
"String",
",",
"String",
">",
"newColumns",
")",
"{",
"String",
"statement",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",... | Builds the alter ddl query.
@param tableInfo
the table info
@param newColumns
the new columns
@return the string | [
"Builds",
"the",
"alter",
"ddl",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/schemamanager/OracleNoSQLSchemaManager.java#L488-L510 |
getsentry/sentry-java | sentry-logback/src/main/java/io/sentry/logback/SentryAppender.java | SentryAppender.createSentryExceptionFrom | protected SentryException createSentryExceptionFrom(IThrowableProxy throwableProxy,
StackTraceInterface stackTrace) {
"""
Given a {@link IThrowableProxy} and a {@link StackTraceInterface} return
a {@link SentryException} to be reported to Sentry.
@param t... | java | protected SentryException createSentryExceptionFrom(IThrowableProxy throwableProxy,
StackTraceInterface stackTrace) {
String exceptionMessage = throwableProxy.getMessage();
String[] packageNameSimpleName = extractPackageSimpleClassName(throwablePro... | [
"protected",
"SentryException",
"createSentryExceptionFrom",
"(",
"IThrowableProxy",
"throwableProxy",
",",
"StackTraceInterface",
"stackTrace",
")",
"{",
"String",
"exceptionMessage",
"=",
"throwableProxy",
".",
"getMessage",
"(",
")",
";",
"String",
"[",
"]",
"package... | Given a {@link IThrowableProxy} and a {@link StackTraceInterface} return
a {@link SentryException} to be reported to Sentry.
@param throwableProxy Information detailing a Throwable
@param stackTrace The stacktrace associated with the Throwable.
@return A {@link SentryException} object ready to be sent to Sentry. | [
"Given",
"a",
"{",
"@link",
"IThrowableProxy",
"}",
"and",
"a",
"{",
"@link",
"StackTraceInterface",
"}",
"return",
"a",
"{",
"@link",
"SentryException",
"}",
"to",
"be",
"reported",
"to",
"Sentry",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry-logback/src/main/java/io/sentry/logback/SentryAppender.java#L204-L212 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/FilterMatcher.java | FilterMatcher.childrenMatch | private static boolean childrenMatch(AbstractExpression e1, AbstractExpression e2) {
"""
Check that getLeft() and getRight() of the two expressions match.
@param e1 first expression
@param e2 second expression
@return whether first's getLeft() matches with second's getLeft(), and first's getRight() matches seco... | java | private static boolean childrenMatch(AbstractExpression e1, AbstractExpression e2) {
return new FilterMatcher(e1.getLeft(), e2.getLeft()).match() &&
new FilterMatcher(e1.getRight(), e2.getRight()).match();
} | [
"private",
"static",
"boolean",
"childrenMatch",
"(",
"AbstractExpression",
"e1",
",",
"AbstractExpression",
"e2",
")",
"{",
"return",
"new",
"FilterMatcher",
"(",
"e1",
".",
"getLeft",
"(",
")",
",",
"e2",
".",
"getLeft",
"(",
")",
")",
".",
"match",
"(",... | Check that getLeft() and getRight() of the two expressions match.
@param e1 first expression
@param e2 second expression
@return whether first's getLeft() matches with second's getLeft(), and first's getRight() matches second's
getRight(). | [
"Check",
"that",
"getLeft",
"()",
"and",
"getRight",
"()",
"of",
"the",
"two",
"expressions",
"match",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/FilterMatcher.java#L113-L116 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebShellEx.java | CareWebShellEx.registerFromId | public ElementBase registerFromId(String path, String id, IPropertyProvider propertySource) throws Exception {
"""
Registers the plugin with the specified id and path. If a tree path is absent, the plugin is
associated with the tab itself.
@param path Format is <tab name>\<tree node path>
@param i... | java | public ElementBase registerFromId(String path, String id, IPropertyProvider propertySource) throws Exception {
return register(path, pluginById(id), propertySource);
} | [
"public",
"ElementBase",
"registerFromId",
"(",
"String",
"path",
",",
"String",
"id",
",",
"IPropertyProvider",
"propertySource",
")",
"throws",
"Exception",
"{",
"return",
"register",
"(",
"path",
",",
"pluginById",
"(",
"id",
")",
",",
"propertySource",
")",
... | Registers the plugin with the specified id and path. If a tree path is absent, the plugin is
associated with the tab itself.
@param path Format is <tab name>\<tree node path>
@param id Unique id of plugin
@param propertySource Optional source for retrieving property values.
@return Container created for th... | [
"Registers",
"the",
"plugin",
"with",
"the",
"specified",
"id",
"and",
"path",
".",
"If",
"a",
"tree",
"path",
"is",
"absent",
"the",
"plugin",
"is",
"associated",
"with",
"the",
"tab",
"itself",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebShellEx.java#L162-L164 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setLockConfigs | public Config setLockConfigs(Map<String, LockConfig> lockConfigs) {
"""
Sets the map of {@link com.hazelcast.core.ILock} configurations,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.
@param lockConfigs the ILock configuration map to set
@... | java | public Config setLockConfigs(Map<String, LockConfig> lockConfigs) {
this.lockConfigs.clear();
this.lockConfigs.putAll(lockConfigs);
for (Entry<String, LockConfig> entry : lockConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
return this;
} | [
"public",
"Config",
"setLockConfigs",
"(",
"Map",
"<",
"String",
",",
"LockConfig",
">",
"lockConfigs",
")",
"{",
"this",
".",
"lockConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"lockConfigs",
".",
"putAll",
"(",
"lockConfigs",
")",
";",
"for",
"("... | Sets the map of {@link com.hazelcast.core.ILock} configurations,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.
@param lockConfigs the ILock configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"core",
".",
"ILock",
"}",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"wi... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L804-L811 |
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.addEntityAsync | public Observable<UUID> addEntityAsync(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
"""
Adds an entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param addEntityOptionalParameter the object representing the optiona... | java | public Observable<UUID> addEntityAsync(UUID appId, String versionId, AddEntityOptionalParameter addEntityOptionalParameter) {
return addEntityWithServiceResponseAsync(appId, versionId, addEntityOptionalParameter).map(new Func1<ServiceResponse<UUID>, UUID>() {
@Override
public UUID call(S... | [
"public",
"Observable",
"<",
"UUID",
">",
"addEntityAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"AddEntityOptionalParameter",
"addEntityOptionalParameter",
")",
"{",
"return",
"addEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
... | Adds an entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param addEntityOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observ... | [
"Adds",
"an",
"entity",
"extractor",
"to",
"the",
"application",
"."
] | 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#L959-L966 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.metaClass | public static MetaClass metaClass (Object self, Closure closure) {
"""
Sets/updates the metaclass for a given object to a closure.
@param self the object whose metaclass we wish to update
@param closure the closure representing the new metaclass
@return the new metaclass value
@throws GroovyRuntimeException ... | java | public static MetaClass metaClass (Object self, Closure closure){
MetaClass emc = hasPerInstanceMetaClass(self);
if (emc == null) {
final ExpandoMetaClass metaClass = new ExpandoMetaClass(self.getClass(), false, true);
metaClass.initialize();
metaClass.define(closure)... | [
"public",
"static",
"MetaClass",
"metaClass",
"(",
"Object",
"self",
",",
"Closure",
"closure",
")",
"{",
"MetaClass",
"emc",
"=",
"hasPerInstanceMetaClass",
"(",
"self",
")",
";",
"if",
"(",
"emc",
"==",
"null",
")",
"{",
"final",
"ExpandoMetaClass",
"metaC... | Sets/updates the metaclass for a given object to a closure.
@param self the object whose metaclass we wish to update
@param closure the closure representing the new metaclass
@return the new metaclass value
@throws GroovyRuntimeException if the metaclass can't be set for this object
@since 1.6.0 | [
"Sets",
"/",
"updates",
"the",
"metaclass",
"for",
"a",
"given",
"object",
"to",
"a",
"closure",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17385-L17413 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java | ComplexImg.setValueI | public void setValueI(int x, int y, double value) {
"""
Sets the imaginary part at the specified position
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param x coordinate
@param y coordinate
@param value to be set
"""
int idx=y*width+x... | java | public void setValueI(int x, int y, double value) {
int idx=y*width+x;
setValueI_atIndex(idx, value);
} | [
"public",
"void",
"setValueI",
"(",
"int",
"x",
",",
"int",
"y",
",",
"double",
"value",
")",
"{",
"int",
"idx",
"=",
"y",
"*",
"width",
"+",
"x",
";",
"setValueI_atIndex",
"(",
"idx",
",",
"value",
")",
";",
"}"
] | Sets the imaginary part at the specified position
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param x coordinate
@param y coordinate
@param value to be set | [
"Sets",
"the",
"imaginary",
"part",
"at",
"the",
"specified",
"position",
"<br",
">",
"If",
"{"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java#L444-L447 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/cache/image/ImageLoaderHandler.java | ImageLoaderHandler.handleImageLoaded | protected boolean handleImageLoaded(Bitmap bitmap, Message msg) {
"""
Override this method if you need custom handler logic. Note that this method can actually be
called directly for performance reasons, in which case the message will be null
@param bitmap the bitmap returned from the image loader
@param msg ... | java | protected boolean handleImageLoaded(Bitmap bitmap, Message msg) {
// If this handler is used for loading images in a ListAdapter,
// the thread will set the image only if it's the right position,
// otherwise it won't do anything.
String forUrl = (String) imageView.getTag();
if (... | [
"protected",
"boolean",
"handleImageLoaded",
"(",
"Bitmap",
"bitmap",
",",
"Message",
"msg",
")",
"{",
"// If this handler is used for loading images in a ListAdapter,",
"// the thread will set the image only if it's the right position,",
"// otherwise it won't do anything.",
"String",
... | Override this method if you need custom handler logic. Note that this method can actually be
called directly for performance reasons, in which case the message will be null
@param bitmap the bitmap returned from the image loader
@param msg the handler message; can be null
@return true if the view was updated with t... | [
"Override",
"this",
"method",
"if",
"you",
"need",
"custom",
"handler",
"logic",
".",
"Note",
"that",
"this",
"method",
"can",
"actually",
"be",
"called",
"directly",
"for",
"performance",
"reasons",
"in",
"which",
"case",
"the",
"message",
"will",
"be",
"nu... | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/cache/image/ImageLoaderHandler.java#L62-L78 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/collections/MultimapUtils.java | MultimapUtils.composeToSetMultimapStrictly | public static <K1, K2, V1 extends K2, V2> ImmutableSetMultimap<K1, V2> composeToSetMultimapStrictly(
final Multimap<K1, V1> first, final Multimap<K2, V2> second) {
"""
Performs a (strict) composition of two multimaps to an {@link ImmutableSetMultimap}. This
returns a new {@link ImmutableSetMultimap} which w... | java | public static <K1, K2, V1 extends K2, V2> ImmutableSetMultimap<K1, V2> composeToSetMultimapStrictly(
final Multimap<K1, V1> first, final Multimap<K2, V2> second) {
checkArgument(second.keySet().containsAll(first.values()));
return composeToSetMultimap(first, second);
} | [
"public",
"static",
"<",
"K1",
",",
"K2",
",",
"V1",
"extends",
"K2",
",",
"V2",
">",
"ImmutableSetMultimap",
"<",
"K1",
",",
"V2",
">",
"composeToSetMultimapStrictly",
"(",
"final",
"Multimap",
"<",
"K1",
",",
"V1",
">",
"first",
",",
"final",
"Multimap... | Performs a (strict) composition of two multimaps to an {@link ImmutableSetMultimap}. This
returns a new {@link ImmutableSetMultimap} which will contain an entry {@code (k,v)} if and
only if there is some {@code i} such that {@code (k, i)} is in {@code first} and {@code (i, v)}
is in {@code second}. Neither {@code firs... | [
"Performs",
"a",
"(",
"strict",
")",
"composition",
"of",
"two",
"multimaps",
"to",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/collections/MultimapUtils.java#L117-L121 |
E7du/jfinal-ext3 | src/main/java/com/jfinal/ext/kit/Reflect.java | Reflect.similarMethod | private Method similarMethod(String name, Class<?>[] types) throws NoSuchMethodException {
"""
Searches a method with a similar signature as desired using
{@link #isSimilarSignature(java.lang.reflect.Method, String, Class[])}.
<p>
First public methods are searched in the class hierarchy, then private methods on... | java | private Method similarMethod(String name, Class<?>[] types) throws NoSuchMethodException {
final Class<?> type = type();
// first priority: find a public method with a "similar" signature in class hierarchy
// similar interpreted in when primitive argument types are converted to their wrappers
... | [
"private",
"Method",
"similarMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"throws",
"NoSuchMethodException",
"{",
"final",
"Class",
"<",
"?",
">",
"type",
"=",
"type",
"(",
")",
";",
"// first priority: find a public m... | Searches a method with a similar signature as desired using
{@link #isSimilarSignature(java.lang.reflect.Method, String, Class[])}.
<p>
First public methods are searched in the class hierarchy, then private methods on the declaring class. If a
method could be found, it is returned, otherwise a {@code NoSuchMethodExcept... | [
"Searches",
"a",
"method",
"with",
"a",
"similar",
"signature",
"as",
"desired",
"using",
"{"
] | train | https://github.com/E7du/jfinal-ext3/blob/8ffcbd150fd50c72852bb778bd427b5eb19254dc/src/main/java/com/jfinal/ext/kit/Reflect.java#L398-L418 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java | PatchOperationTarget.createHost | public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) {
"""
Create a host target.
@param hostName the host name
@param client the connected controller client to the master host.
@return the remote target
"""
final PathElement host = PathElem... | java | public static final PatchOperationTarget createHost(final String hostName, final ModelControllerClient client) {
final PathElement host = PathElement.pathElement(HOST, hostName);
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(host, CORE_SERVICES);
return new RemotePatchOperationTar... | [
"public",
"static",
"final",
"PatchOperationTarget",
"createHost",
"(",
"final",
"String",
"hostName",
",",
"final",
"ModelControllerClient",
"client",
")",
"{",
"final",
"PathElement",
"host",
"=",
"PathElement",
".",
"pathElement",
"(",
"HOST",
",",
"hostName",
... | Create a host target.
@param hostName the host name
@param client the connected controller client to the master host.
@return the remote target | [
"Create",
"a",
"host",
"target",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/tool/PatchOperationTarget.java#L99-L103 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/UrlTool.java | UrlTool.getRestUrl | public String getRestUrl(String urlKey, Boolean addClientId) throws UnsupportedEncodingException {
"""
Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@return Final REST url.
@throws UnsupportedEncodingException
"""
... | java | public String getRestUrl(String urlKey, Boolean addClientId) throws UnsupportedEncodingException {
return getRestUrl(urlKey, addClientId, null, null);
} | [
"public",
"String",
"getRestUrl",
"(",
"String",
"urlKey",
",",
"Boolean",
"addClientId",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"getRestUrl",
"(",
"urlKey",
",",
"addClientId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@return Final REST url.
@throws UnsupportedEncodingException | [
"Gets",
"REST",
"url",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L58-L60 |
andrehertwig/admintool | admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java | AdminToolLog4j2Util.getStringOutput | public String getStringOutput(String appenderName, String encoding) throws UnsupportedEncodingException {
"""
returns the log messages from custom appenders output stream
@param appenderName
@param encoding
@return
@throws UnsupportedEncodingException
@since 1.1.1
"""
AdminToolLog4j2OutputStream baos... | java | public String getStringOutput(String appenderName, String encoding) throws UnsupportedEncodingException {
AdminToolLog4j2OutputStream baos = outputStreams.get(appenderName);
String output = "";
if (null != baos) {
output = baos.getAndReset(encoding);
}
return output.trim().isEmpty() ? null : output;
... | [
"public",
"String",
"getStringOutput",
"(",
"String",
"appenderName",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"AdminToolLog4j2OutputStream",
"baos",
"=",
"outputStreams",
".",
"get",
"(",
"appenderName",
")",
";",
"String",
"outp... | returns the log messages from custom appenders output stream
@param appenderName
@param encoding
@return
@throws UnsupportedEncodingException
@since 1.1.1 | [
"returns",
"the",
"log",
"messages",
"from",
"custom",
"appenders",
"output",
"stream"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java#L500-L508 |
netplex/json-smart-v2 | json-smart-action/src/main/java/net/minidev/json/actions/traverse/RetainPathsJsonAction.java | RetainPathsJsonAction.discardPath | protected boolean discardPath(String pathToEntry, Entry<String, Object> entry) {
"""
if the full path to the entry is not contained in any of the paths to retain - remove it from the object
this step does not remove entries whose full path is contained in a path to retain but are not equal to an
entry to retain
... | java | protected boolean discardPath(String pathToEntry, Entry<String, Object> entry)
{
if (!foundAsPrefix(pathToEntry) || !delim.accept(entry.getKey()))
{
//skip traversal of subtree and remove from the traversal iterator
return true;
}
return false;
} | [
"protected",
"boolean",
"discardPath",
"(",
"String",
"pathToEntry",
",",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
")",
"{",
"if",
"(",
"!",
"foundAsPrefix",
"(",
"pathToEntry",
")",
"||",
"!",
"delim",
".",
"accept",
"(",
"entry",
".",
"getK... | if the full path to the entry is not contained in any of the paths to retain - remove it from the object
this step does not remove entries whose full path is contained in a path to retain but are not equal to an
entry to retain | [
"if",
"the",
"full",
"path",
"to",
"the",
"entry",
"is",
"not",
"contained",
"in",
"any",
"of",
"the",
"paths",
"to",
"retain",
"-",
"remove",
"it",
"from",
"the",
"object",
"this",
"step",
"does",
"not",
"remove",
"entries",
"whose",
"full",
"path",
"... | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart-action/src/main/java/net/minidev/json/actions/traverse/RetainPathsJsonAction.java#L100-L108 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/problems/GenericProblem.java | GenericProblem.setRandomSolutionGenerator | public void setRandomSolutionGenerator(RandomSolutionGenerator<? extends SolutionType, ? super DataType> randomSolutionGenerator) {
"""
Set random solution generator. It is allowed for the generator to produce subtypes of the
problem's solution type, requiring any supertype of the problem's data type. The generat... | java | public void setRandomSolutionGenerator(RandomSolutionGenerator<? extends SolutionType, ? super DataType> randomSolutionGenerator){
// check not null
if(randomSolutionGenerator == null){
throw new NullPointerException("Error while setting random solution generator: null is not allowed");
... | [
"public",
"void",
"setRandomSolutionGenerator",
"(",
"RandomSolutionGenerator",
"<",
"?",
"extends",
"SolutionType",
",",
"?",
"super",
"DataType",
">",
"randomSolutionGenerator",
")",
"{",
"// check not null",
"if",
"(",
"randomSolutionGenerator",
"==",
"null",
")",
... | Set random solution generator. It is allowed for the generator to produce subtypes of the
problem's solution type, requiring any supertype of the problem's data type. The generator
can not be <code>null</code>.
@param randomSolutionGenerator random solution generator
@throws NullPointerException if <code>randomSolutio... | [
"Set",
"random",
"solution",
"generator",
".",
"It",
"is",
"allowed",
"for",
"the",
"generator",
"to",
"produce",
"subtypes",
"of",
"the",
"problem",
"s",
"solution",
"type",
"requiring",
"any",
"supertype",
"of",
"the",
"problem",
"s",
"data",
"type",
".",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/problems/GenericProblem.java#L171-L177 |
pinterest/secor | src/main/java/com/pinterest/secor/message/Message.java | Message.bytesToString | private String bytesToString(byte[] bytes, boolean truncate) {
"""
Message key and payload may be arbitrary binary strings, so we should make sure we don't throw
when logging them by using a CharsetDecoder which replaces bad data. (While in practice `new String(bytes)`
does the same thing, the documentation for ... | java | private String bytesToString(byte[] bytes, boolean truncate) {
CharsetDecoder decoder = Charset.defaultCharset()
.newDecoder()
.onMalformedInput(CodingErrorAction.REPLACE)
.onUnmappableCharacter(CodingErrorAction.REPLACE);
ByteBuffer byteBuffer = ByteBuffe... | [
"private",
"String",
"bytesToString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"truncate",
")",
"{",
"CharsetDecoder",
"decoder",
"=",
"Charset",
".",
"defaultCharset",
"(",
")",
".",
"newDecoder",
"(",
")",
".",
"onMalformedInput",
"(",
"CodingErrorAct... | Message key and payload may be arbitrary binary strings, so we should make sure we don't throw
when logging them by using a CharsetDecoder which replaces bad data. (While in practice `new String(bytes)`
does the same thing, the documentation for that method leaves that behavior unspecified.)
Additionally, in contexts w... | [
"Message",
"key",
"and",
"payload",
"may",
"be",
"arbitrary",
"binary",
"strings",
"so",
"we",
"should",
"make",
"sure",
"we",
"don",
"t",
"throw",
"when",
"logging",
"them",
"by",
"using",
"a",
"CharsetDecoder",
"which",
"replaces",
"bad",
"data",
".",
"(... | train | https://github.com/pinterest/secor/blob/4099ff061db392f11044e57dedf46c1617895278/src/main/java/com/pinterest/secor/message/Message.java#L58-L77 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.concatInternal | public void concatInternal(String target, String [] srcs)
throws IOException {
"""
Concat all the blocks from srcs to trg and delete the srcs files
"""
// actual move
waitForReady();
long now = FSNamesystem.now();
unprotectedConcat(target, srcs, now);
fsImage.getEditLog().logConcat(ta... | java | public void concatInternal(String target, String [] srcs)
throws IOException {
// actual move
waitForReady();
long now = FSNamesystem.now();
unprotectedConcat(target, srcs, now);
fsImage.getEditLog().logConcat(target, srcs, now);
} | [
"public",
"void",
"concatInternal",
"(",
"String",
"target",
",",
"String",
"[",
"]",
"srcs",
")",
"throws",
"IOException",
"{",
"// actual move",
"waitForReady",
"(",
")",
";",
"long",
"now",
"=",
"FSNamesystem",
".",
"now",
"(",
")",
";",
"unprotectedConca... | Concat all the blocks from srcs to trg and delete the srcs files | [
"Concat",
"all",
"the",
"blocks",
"from",
"srcs",
"to",
"trg",
"and",
"delete",
"the",
"srcs",
"files"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1282-L1290 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ShortList.java | ShortList.allMatch | public <E extends Exception> boolean allMatch(Try.ShortPredicate<E> filter) throws E {
"""
Returns whether all elements of this List match the provided predicate.
@param filter
@return
"""
return allMatch(0, size(), filter);
} | java | public <E extends Exception> boolean allMatch(Try.ShortPredicate<E> filter) throws E {
return allMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"allMatch",
"(",
"Try",
".",
"ShortPredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"allMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether all elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"all",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ShortList.java#L921-L923 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java | AnnotationUtil.getAnnotation | public static <A extends Annotation> A getAnnotation(AnnotatedElement annotationEle, Class<A> annotationType) {
"""
获取指定注解
@param <A> 注解类型
@param annotationEle {@link AnnotatedElement},可以是Class、Method、Field、Constructor、ReflectPermission
@param annotationType 注解类型
@return 注解对象
"""
return (null == annot... | java | public static <A extends Annotation> A getAnnotation(AnnotatedElement annotationEle, Class<A> annotationType) {
return (null == annotationEle) ? null : toCombination(annotationEle).getAnnotation(annotationType);
} | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"AnnotatedElement",
"annotationEle",
",",
"Class",
"<",
"A",
">",
"annotationType",
")",
"{",
"return",
"(",
"null",
"==",
"annotationEle",
")",
"?",
"null",
":",
"toCombi... | 获取指定注解
@param <A> 注解类型
@param annotationEle {@link AnnotatedElement},可以是Class、Method、Field、Constructor、ReflectPermission
@param annotationType 注解类型
@return 注解对象 | [
"获取指定注解"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java#L61-L63 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java | BindMapHelper.parseMap | public static Map<String, Object> parseMap(AbstractContext context, ParserWrapper parserWrapper, Map<String, Object> map) {
"""
Parse a map.
@param context the context
@param parserWrapper the parser wrapper
@param map the map
@return map
"""
switch (context.getSupportedFormat()) {
case XML:
throw... | java | public static Map<String, Object> parseMap(AbstractContext context, ParserWrapper parserWrapper, Map<String, Object> map) {
switch (context.getSupportedFormat()) {
case XML:
throw (new KriptonRuntimeException(context.getSupportedFormat() + " context does not support parse direct map parsing"));
default:
Jac... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"parseMap",
"(",
"AbstractContext",
"context",
",",
"ParserWrapper",
"parserWrapper",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"switch",
"(",
"context",
".",
"getSupportedFo... | Parse a map.
@param context the context
@param parserWrapper the parser wrapper
@param map the map
@return map | [
"Parse",
"a",
"map",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapHelper.java#L47-L58 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.generatePublicKey | public static PublicKey generatePublicKey(String algorithm, KeySpec keySpec) {
"""
生成公钥,仅用于非对称加密<br>
算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory
@param algorithm 算法
@param keySpec {@link KeySpec}
@return 公钥 {@link PublicKey}
@since 3.1.1
"""
retur... | java | public static PublicKey generatePublicKey(String algorithm, KeySpec keySpec) {
return KeyUtil.generatePublicKey(algorithm, keySpec);
} | [
"public",
"static",
"PublicKey",
"generatePublicKey",
"(",
"String",
"algorithm",
",",
"KeySpec",
"keySpec",
")",
"{",
"return",
"KeyUtil",
".",
"generatePublicKey",
"(",
"algorithm",
",",
"keySpec",
")",
";",
"}"
] | 生成公钥,仅用于非对称加密<br>
算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory
@param algorithm 算法
@param keySpec {@link KeySpec}
@return 公钥 {@link PublicKey}
@since 3.1.1 | [
"生成公钥,仅用于非对称加密<br",
">",
"算法见:https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"technotes",
"/",
"guides",
"/",
"security",
"/",
"StandardNames",
".",
"html#KeyFactory"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L191-L193 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java | JobLauncherFactory.newJobLauncher | public static JobLauncher newJobLauncher(Properties sysProps, Properties jobProps,
String launcherTypeValue, SharedResourcesBroker<GobblinScopeTypes> instanceBroker, List<? extends Tag<?>> metadataTags) {
"""
Creates a new instance for a JobLauncher with a given type
@param sysProps the system/envi... | java | public static JobLauncher newJobLauncher(Properties sysProps, Properties jobProps,
String launcherTypeValue, SharedResourcesBroker<GobblinScopeTypes> instanceBroker, List<? extends Tag<?>> metadataTags) {
Optional<JobLauncherType> launcherType = Enums.getIfPresent(JobLauncherType.class, launcherTypeValue);
... | [
"public",
"static",
"JobLauncher",
"newJobLauncher",
"(",
"Properties",
"sysProps",
",",
"Properties",
"jobProps",
",",
"String",
"launcherTypeValue",
",",
"SharedResourcesBroker",
"<",
"GobblinScopeTypes",
">",
"instanceBroker",
",",
"List",
"<",
"?",
"extends",
"Tag... | Creates a new instance for a JobLauncher with a given type
@param sysProps the system/environment properties
@param jobProps the job properties
@param launcherTypeValue the type of the launcher; either a {@link JobLauncherType} value or
the name of the class that extends {@link AbstractJobLauncher} an... | [
"Creates",
"a",
"new",
"instance",
"for",
"a",
"JobLauncher",
"with",
"a",
"given",
"type"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java#L136-L160 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeVocabCache | public static void writeVocabCache(@NonNull VocabCache<VocabWord> vocabCache, @NonNull OutputStream stream)
throws IOException {
"""
This method saves vocab cache to provided OutputStream.
Please note: it saves only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param voc... | java | public static void writeVocabCache(@NonNull VocabCache<VocabWord> vocabCache, @NonNull OutputStream stream)
throws IOException {
try (PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream, StandardCharsets.UTF_8)))) {
// saving general vocab information
... | [
"public",
"static",
"void",
"writeVocabCache",
"(",
"@",
"NonNull",
"VocabCache",
"<",
"VocabWord",
">",
"vocabCache",
",",
"@",
"NonNull",
"OutputStream",
"stream",
")",
"throws",
"IOException",
"{",
"try",
"(",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter... | This method saves vocab cache to provided OutputStream.
Please note: it saves only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param vocabCache
@param stream
@throws UnsupportedEncodingException | [
"This",
"method",
"saves",
"vocab",
"cache",
"to",
"provided",
"OutputStream",
".",
"Please",
"note",
":",
"it",
"saves",
"only",
"vocab",
"content",
"so",
"it",
"s",
"suitable",
"mostly",
"for",
"BagOfWords",
"/",
"TF",
"-",
"IDF",
"vectorizers"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L2201-L2212 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java | ReadOnlyStyledDocumentBuilder.addParagraph | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, S style) {
"""
Adds to the list a paragraph that has only one segment that has the same given style throughout.
"""
return addParagraph(segment, style, null);
} | java | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, S style) {
return addParagraph(segment, style, null);
} | [
"public",
"ReadOnlyStyledDocumentBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"addParagraph",
"(",
"SEG",
"segment",
",",
"S",
"style",
")",
"{",
"return",
"addParagraph",
"(",
"segment",
",",
"style",
",",
"null",
")",
";",
"}"
] | Adds to the list a paragraph that has only one segment that has the same given style throughout. | [
"Adds",
"to",
"the",
"list",
"a",
"paragraph",
"that",
"has",
"only",
"one",
"segment",
"that",
"has",
"the",
"same",
"given",
"style",
"throughout",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java#L106-L108 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BaseFont.java | BaseFont.setCharAdvance | public boolean setCharAdvance(int c, int advance) {
"""
Sets the character advance.
@param c the character
@param advance the character advance normalized to 1000 units
@return <CODE>true</CODE> if the advance was set,
<CODE>false</CODE> otherwise
"""
byte b[] = convertToBytes(c);
if (b.len... | java | public boolean setCharAdvance(int c, int advance) {
byte b[] = convertToBytes(c);
if (b.length == 0)
return false;
widths[0xff & b[0]] = advance;
return true;
} | [
"public",
"boolean",
"setCharAdvance",
"(",
"int",
"c",
",",
"int",
"advance",
")",
"{",
"byte",
"b",
"[",
"]",
"=",
"convertToBytes",
"(",
"c",
")",
";",
"if",
"(",
"b",
".",
"length",
"==",
"0",
")",
"return",
"false",
";",
"widths",
"[",
"0xff",... | Sets the character advance.
@param c the character
@param advance the character advance normalized to 1000 units
@return <CODE>true</CODE> if the advance was set,
<CODE>false</CODE> otherwise | [
"Sets",
"the",
"character",
"advance",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BaseFont.java#L1416-L1422 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.getInternalDayFromLocation | protected int getInternalDayFromLocation(float x, float y) {
"""
Calculates the day that the given x position is in, accounting for week
number.
@param x The x position of the touch event
@return The day number
"""
int dayStart = mEdgePadding;
if (x < dayStart || x > mWidth - mEdgePadding)... | java | protected int getInternalDayFromLocation(float x, float y) {
int dayStart = mEdgePadding;
if (x < dayStart || x > mWidth - mEdgePadding) {
return -1;
}
// Selection is (x - start) / (pixels/day) == (x -s) * day / pixels
int row = (int) (y - getMonthHeaderSize()) / mRo... | [
"protected",
"int",
"getInternalDayFromLocation",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"int",
"dayStart",
"=",
"mEdgePadding",
";",
"if",
"(",
"x",
"<",
"dayStart",
"||",
"x",
">",
"mWidth",
"-",
"mEdgePadding",
")",
"{",
"return",
"-",
"1",
... | Calculates the day that the given x position is in, accounting for week
number.
@param x The x position of the touch event
@return The day number | [
"Calculates",
"the",
"day",
"that",
"the",
"given",
"x",
"position",
"is",
"in",
"accounting",
"for",
"week",
"number",
"."
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L518-L530 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java | TfIdf.idfFromTfs | public static <TERM> Map<TERM, Double> idfFromTfs(Iterable<Map<TERM, Double>> tfs, boolean smooth, boolean addOne) {
"""
从词频集合建立倒排频率
@param tfs 次品集合
@param smooth 平滑参数,视作额外有一个文档,该文档含有smooth个每个词语
@param addOne tf-idf加一平滑
@param <TERM> 词语类型
@return 一个词语->倒排文档的Map
"""
return idf(new KeySetIterab... | java | public static <TERM> Map<TERM, Double> idfFromTfs(Iterable<Map<TERM, Double>> tfs, boolean smooth, boolean addOne)
{
return idf(new KeySetIterable<TERM, Double>(tfs), smooth, addOne);
} | [
"public",
"static",
"<",
"TERM",
">",
"Map",
"<",
"TERM",
",",
"Double",
">",
"idfFromTfs",
"(",
"Iterable",
"<",
"Map",
"<",
"TERM",
",",
"Double",
">",
">",
"tfs",
",",
"boolean",
"smooth",
",",
"boolean",
"addOne",
")",
"{",
"return",
"idf",
"(",
... | 从词频集合建立倒排频率
@param tfs 次品集合
@param smooth 平滑参数,视作额外有一个文档,该文档含有smooth个每个词语
@param addOne tf-idf加一平滑
@param <TERM> 词语类型
@return 一个词语->倒排文档的Map | [
"从词频集合建立倒排频率"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java#L231-L234 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/FieldConverter.java | FieldConverter.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) // Add this view to the list {
"""
Set up the default control for this field.
@param itsLocation Location of this component on screen (ie., ... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) // Add this view to the list
{
ScreenComponent sField = null;
BaseField field = (BaseField)this.getField();
if (field != nu... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"// Add this view ... | Set up the default control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param iDisplayFieldDesc Display the label? (optional).
@return Return the component or Screen... | [
"Set",
"up",
"the",
"default",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/FieldConverter.java#L72-L85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.