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 |
|---|---|---|---|---|---|---|---|---|---|---|
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java | SQLiteUpdateTaskHelper.dropTablesWithPrefix | public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) {
"""
Drop all table with specific prefix.
@param db
the db
@param prefix
the prefix
"""
Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX "));
drop(db, QueryType.TABLE, prefix);
... | java | public static void dropTablesWithPrefix(SQLiteDatabase db, String prefix) {
Logger.info("MASSIVE TABLE DROP OPERATION%s", StringUtils.ifNotEmptyAppend(prefix, " WITH PREFIX "));
drop(db, QueryType.TABLE, prefix);
} | [
"public",
"static",
"void",
"dropTablesWithPrefix",
"(",
"SQLiteDatabase",
"db",
",",
"String",
"prefix",
")",
"{",
"Logger",
".",
"info",
"(",
"\"MASSIVE TABLE DROP OPERATION%s\"",
",",
"StringUtils",
".",
"ifNotEmptyAppend",
"(",
"prefix",
",",
"\" WITH PREFIX \"",
... | Drop all table with specific prefix.
@param db
the db
@param prefix
the prefix | [
"Drop",
"all",
"table",
"with",
"specific",
"prefix",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L183-L186 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java | Attachment.fromTextFile | public static Attachment fromTextFile( File file, MediaType mediaType ) throws IOException {
"""
Creates a non-binary attachment from the given file.
@throws IOException if an I/O error occurs
@throws java.lang.IllegalArgumentException if mediaType is either binary or has no specified charset
"""
ret... | java | public static Attachment fromTextFile( File file, MediaType mediaType ) throws IOException {
return fromText( Files.toString( file, mediaType.getCharset() ), mediaType );
} | [
"public",
"static",
"Attachment",
"fromTextFile",
"(",
"File",
"file",
",",
"MediaType",
"mediaType",
")",
"throws",
"IOException",
"{",
"return",
"fromText",
"(",
"Files",
".",
"toString",
"(",
"file",
",",
"mediaType",
".",
"getCharset",
"(",
")",
")",
","... | Creates a non-binary attachment from the given file.
@throws IOException if an I/O error occurs
@throws java.lang.IllegalArgumentException if mediaType is either binary or has no specified charset | [
"Creates",
"a",
"non",
"-",
"binary",
"attachment",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L211-L213 |
apache/spark | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java | OneForOneBlockFetcher.failRemainingBlocks | private void failRemainingBlocks(String[] failedBlockIds, Throwable e) {
"""
Invokes the "onBlockFetchFailure" callback for every listed block id.
"""
for (String blockId : failedBlockIds) {
try {
listener.onBlockFetchFailure(blockId, e);
} catch (Exception e2) {
logger.error("E... | java | private void failRemainingBlocks(String[] failedBlockIds, Throwable e) {
for (String blockId : failedBlockIds) {
try {
listener.onBlockFetchFailure(blockId, e);
} catch (Exception e2) {
logger.error("Error in block fetch failure callback", e2);
}
}
} | [
"private",
"void",
"failRemainingBlocks",
"(",
"String",
"[",
"]",
"failedBlockIds",
",",
"Throwable",
"e",
")",
"{",
"for",
"(",
"String",
"blockId",
":",
"failedBlockIds",
")",
"{",
"try",
"{",
"listener",
".",
"onBlockFetchFailure",
"(",
"blockId",
",",
"... | Invokes the "onBlockFetchFailure" callback for every listed block id. | [
"Invokes",
"the",
"onBlockFetchFailure",
"callback",
"for",
"every",
"listed",
"block",
"id",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java#L145-L153 |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsAddressResolverGroup.java | DnsAddressResolverGroup.newAddressResolver | protected AddressResolver<InetSocketAddress> newAddressResolver(EventLoop eventLoop,
NameResolver<InetAddress> resolver)
throws Exception {
"""
Creates a new {@link AddressResolver}. Override this method to create an alternative {@link... | java | protected AddressResolver<InetSocketAddress> newAddressResolver(EventLoop eventLoop,
NameResolver<InetAddress> resolver)
throws Exception {
return new InetSocketAddressResolver(eventLoop, resolver);
} | [
"protected",
"AddressResolver",
"<",
"InetSocketAddress",
">",
"newAddressResolver",
"(",
"EventLoop",
"eventLoop",
",",
"NameResolver",
"<",
"InetAddress",
">",
"resolver",
")",
"throws",
"Exception",
"{",
"return",
"new",
"InetSocketAddressResolver",
"(",
"eventLoop",... | Creates a new {@link AddressResolver}. Override this method to create an alternative {@link AddressResolver}
implementation or override the default configuration. | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsAddressResolverGroup.java#L121-L125 |
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.addMillis | public final Timestamp addMillis(long amount) {
"""
Returns a timestamp relative to this one by the given number of
milliseconds.
<p>
This method always returns a Timestamp with SECOND precision and a seconds
value precise at least to the millisecond. For example, adding one millisecond
to {@code 2011T} resul... | java | public final Timestamp addMillis(long amount)
{
if (amount == 0 && _precision.includes(Precision.SECOND) && _fraction != null && _fraction.scale() >= 3) {
// Zero milliseconds are to be added, and the precision does not need to be increased.
return this;
}
return addM... | [
"public",
"final",
"Timestamp",
"addMillis",
"(",
"long",
"amount",
")",
"{",
"if",
"(",
"amount",
"==",
"0",
"&&",
"_precision",
".",
"includes",
"(",
"Precision",
".",
"SECOND",
")",
"&&",
"_fraction",
"!=",
"null",
"&&",
"_fraction",
".",
"scale",
"("... | Returns a timestamp relative to this one by the given number of
milliseconds.
<p>
This method always returns a Timestamp with SECOND precision and a seconds
value precise at least to the millisecond. For example, adding one millisecond
to {@code 2011T} results in {@code 2011-01-01T00:00:00.001-00:00}. To receive
a Time... | [
"Returns",
"a",
"timestamp",
"relative",
"to",
"this",
"one",
"by",
"the",
"given",
"number",
"of",
"milliseconds",
".",
"<p",
">",
"This",
"method",
"always",
"returns",
"a",
"Timestamp",
"with",
"SECOND",
"precision",
"and",
"a",
"seconds",
"value",
"preci... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2250-L2257 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicy.java | BoxRetentionPolicy.createRetentionPolicy | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action) {
"""
Used to create a new retention policy.
@param api the API connection to be used by the created user.
@para... | java | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action) {
return createRetentionPolicy(api, name, type, length, action, null);
} | [
"private",
"static",
"BoxRetentionPolicy",
".",
"Info",
"createRetentionPolicy",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"String",
"type",
",",
"int",
"length",
",",
"String",
"action",
")",
"{",
"return",
"createRetentionPolicy",
"(",
"api",
... | Used to create a new retention policy.
@param api the API connection to be used by the created user.
@param name the name of the retention policy.
@param type the type of the retention policy. Can be "finite" or "indefinite".
@param length the duration in days that the retention policy will be active for after being as... | [
"Used",
"to",
"create",
"a",
"new",
"retention",
"policy",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicy.java#L145-L148 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLClassAssertionAxiomImpl_CustomFieldSerializer.java | OWLClassAssertionAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLClassAssertionAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goo... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLClassAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLClassAssertionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLClassAssertionAxiomImpl_CustomFieldSerializer.java#L98-L101 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java | Actors.setAlpha | public static void setAlpha(final Actor actor, final float alpha) {
"""
Null-safe alpha setting method.
@param actor its {@link Color}'s alpha will be modified. Can be null.
@param alpha will become actor's alpha.
"""
if (actor != null) {
actor.getColor().a = alpha;
}
} | java | public static void setAlpha(final Actor actor, final float alpha) {
if (actor != null) {
actor.getColor().a = alpha;
}
} | [
"public",
"static",
"void",
"setAlpha",
"(",
"final",
"Actor",
"actor",
",",
"final",
"float",
"alpha",
")",
"{",
"if",
"(",
"actor",
"!=",
"null",
")",
"{",
"actor",
".",
"getColor",
"(",
")",
".",
"a",
"=",
"alpha",
";",
"}",
"}"
] | Null-safe alpha setting method.
@param actor its {@link Color}'s alpha will be modified. Can be null.
@param alpha will become actor's alpha. | [
"Null",
"-",
"safe",
"alpha",
"setting",
"method",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java#L196-L200 |
Netflix/Nicobar | nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/ArchiveRepositoryPoller.java | ArchiveRepositoryPoller.addRepository | public boolean addRepository(final ArchiveRepository archiveRepository, final int pollInterval, TimeUnit timeUnit, boolean waitForInitialPoll) {
"""
Add a repository and schedule polling
@param archiveRepository repository to scan
@param pollInterval how often this repository should be scanned
@param timeUnit u... | java | public boolean addRepository(final ArchiveRepository archiveRepository, final int pollInterval, TimeUnit timeUnit, boolean waitForInitialPoll) {
if (pollInterval <= 0) {
throw new IllegalArgumentException("invalid pollInterval " + pollInterval);
}
Objects.requireNonNull(timeUnit, "ti... | [
"public",
"boolean",
"addRepository",
"(",
"final",
"ArchiveRepository",
"archiveRepository",
",",
"final",
"int",
"pollInterval",
",",
"TimeUnit",
"timeUnit",
",",
"boolean",
"waitForInitialPoll",
")",
"{",
"if",
"(",
"pollInterval",
"<=",
"0",
")",
"{",
"throw",... | Add a repository and schedule polling
@param archiveRepository repository to scan
@param pollInterval how often this repository should be scanned
@param timeUnit unit of the pollInterval param
@param waitForInitialPoll whether or not to block until the initial poll is complete
@return true if the repository was added. ... | [
"Add",
"a",
"repository",
"and",
"schedule",
"polling"
] | train | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/ArchiveRepositoryPoller.java#L118-L150 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/PathImpl.java | PathImpl.createTempFile | public PathImpl createTempFile(String prefix, String suffix) throws IOException {
"""
Creates a unique temporary file as a child of this directory.
@param prefix filename prefix
@param suffix filename suffix, defaults to .tmp
@return Path to the new file.
"""
if (prefix == null || prefix.length () == ... | java | public PathImpl createTempFile(String prefix, String suffix) throws IOException
{
if (prefix == null || prefix.length () == 0)
prefix = "t";
if (suffix == null)
suffix = ".tmp";
synchronized (LOCK) {
for (int i = 0; i < 32768; i++) {
int r = Math.abs((int) RandomUtil.getRandomL... | [
"public",
"PathImpl",
"createTempFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"prefix",
".",
"length",
"(",
")",
"==",
"0",
")",
"prefix",
"=",
"\"t\"",
";",
"if",
... | Creates a unique temporary file as a child of this directory.
@param prefix filename prefix
@param suffix filename suffix, defaults to .tmp
@return Path to the new file. | [
"Creates",
"a",
"unique",
"temporary",
"file",
"as",
"a",
"child",
"of",
"this",
"directory",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1350-L1369 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/FileInfo.java | FileInfo.fromItemInfo | public static FileInfo fromItemInfo(PathCodec pathCodec, GoogleCloudStorageItemInfo itemInfo) {
"""
Handy factory method for constructing a FileInfo from a GoogleCloudStorageItemInfo while
potentially returning a singleton instead of really constructing an object for cases like ROOT.
"""
if (itemInfo.isRo... | java | public static FileInfo fromItemInfo(PathCodec pathCodec, GoogleCloudStorageItemInfo itemInfo) {
if (itemInfo.isRoot()) {
return ROOT_INFO;
}
URI path = pathCodec.getPath(itemInfo.getBucketName(), itemInfo.getObjectName(), true);
return new FileInfo(path, itemInfo);
} | [
"public",
"static",
"FileInfo",
"fromItemInfo",
"(",
"PathCodec",
"pathCodec",
",",
"GoogleCloudStorageItemInfo",
"itemInfo",
")",
"{",
"if",
"(",
"itemInfo",
".",
"isRoot",
"(",
")",
")",
"{",
"return",
"ROOT_INFO",
";",
"}",
"URI",
"path",
"=",
"pathCodec",
... | Handy factory method for constructing a FileInfo from a GoogleCloudStorageItemInfo while
potentially returning a singleton instead of really constructing an object for cases like ROOT. | [
"Handy",
"factory",
"method",
"for",
"constructing",
"a",
"FileInfo",
"from",
"a",
"GoogleCloudStorageItemInfo",
"while",
"potentially",
"returning",
"a",
"singleton",
"instead",
"of",
"really",
"constructing",
"an",
"object",
"for",
"cases",
"like",
"ROOT",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/FileInfo.java#L244-L250 |
foundation-runtime/configuration | configuration-api/src/main/java/com/cisco/oss/foundation/configuration/validation/params/ParamValidators.java | ParamValidators.getValidator | public static<E, T extends ParamValidator<E>> T getValidator(Class<T> clazz, Param<Boolean> param) {
"""
wrap a validator for the given class type and according to the configured value og the given parameter.
Meaning, the relevant validator will be created according to the the current value of <param>.
"""
... | java | public static<E, T extends ParamValidator<E>> T getValidator(Class<T> clazz, Param<Boolean> param) {
// get if such validator was already initialized
List<ParamValidator> validators = validatorsMap.get(clazz);
if (validators == null) {
addValidators(validatorsMap, clazz, null, null)... | [
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"ParamValidator",
"<",
"E",
">",
">",
"T",
"getValidator",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Param",
"<",
"Boolean",
">",
"param",
")",
"{",
"// get if such validator was already initialized",
"Lis... | wrap a validator for the given class type and according to the configured value og the given parameter.
Meaning, the relevant validator will be created according to the the current value of <param>. | [
"wrap",
"a",
"validator",
"for",
"the",
"given",
"class",
"type",
"and",
"according",
"to",
"the",
"configured",
"value",
"og",
"the",
"given",
"parameter",
".",
"Meaning",
"the",
"relevant",
"validator",
"will",
"be",
"created",
"according",
"to",
"the",
"t... | train | https://github.com/foundation-runtime/configuration/blob/c5bd171a2cca0dc1c8d568f987843ca47c6d1eed/configuration-api/src/main/java/com/cisco/oss/foundation/configuration/validation/params/ParamValidators.java#L428-L452 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java | AVIMConversation.set | public void set(String key, Object value) {
"""
Add a key-value pair to this conversation
@param key Keys must be alphanumerical plus underscore, and start with a letter.
@param value Values may be numerical, String, JSONObject, JSONArray, JSONObject.NULL, or other
AVObjects. value may not be null.
"""
... | java | public void set(String key, Object value) {
if (!StringUtil.isEmpty(key) && null != value) {
pendingInstanceData.put(key, value);
}
} | [
"public",
"void",
"set",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"key",
")",
"&&",
"null",
"!=",
"value",
")",
"{",
"pendingInstanceData",
".",
"put",
"(",
"key",
",",
"value",
")",
... | Add a key-value pair to this conversation
@param key Keys must be alphanumerical plus underscore, and start with a letter.
@param value Values may be numerical, String, JSONObject, JSONArray, JSONObject.NULL, or other
AVObjects. value may not be null. | [
"Add",
"a",
"key",
"-",
"value",
"pair",
"to",
"this",
"conversation"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L318-L322 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getToAddress | public Address getToAddress(NetworkParameters params, boolean forcePayToPubKey) throws ScriptException {
"""
Gets the destination address from this script, if it's in the required form.
@param forcePayToPubKey
If true, allow payToPubKey to be casted to the corresponding address. This is useful if you prefer
s... | java | public Address getToAddress(NetworkParameters params, boolean forcePayToPubKey) throws ScriptException {
if (ScriptPattern.isP2PKH(this))
return LegacyAddress.fromPubKeyHash(params, ScriptPattern.extractHashFromP2PKH(this));
else if (ScriptPattern.isP2SH(this))
return LegacyAddre... | [
"public",
"Address",
"getToAddress",
"(",
"NetworkParameters",
"params",
",",
"boolean",
"forcePayToPubKey",
")",
"throws",
"ScriptException",
"{",
"if",
"(",
"ScriptPattern",
".",
"isP2PKH",
"(",
"this",
")",
")",
"return",
"LegacyAddress",
".",
"fromPubKeyHash",
... | Gets the destination address from this script, if it's in the required form.
@param forcePayToPubKey
If true, allow payToPubKey to be casted to the corresponding address. This is useful if you prefer
showing addresses rather than pubkeys. | [
"Gets",
"the",
"destination",
"address",
"from",
"this",
"script",
"if",
"it",
"s",
"in",
"the",
"required",
"form",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L301-L312 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacter | public void getCharacter(String API, String name, Callback<Character> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on character overview API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters">here</a><br/>
Get character information for the given character name that is... | java | public void getCharacter(String API, String name, Callback<Character> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacter(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacter",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"Character",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",... | For more info on character overview API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters">here</a><br/>
Get character information for the given character name that is linked to given API key
@param API API key
@param name name of character
@param callback callback that is going to be used for {@l... | [
"For",
"more",
"info",
"on",
"character",
"overview",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L690-L693 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java | AWSOpsWorksWaiters.appExists | public Waiter<DescribeAppsRequest> appExists() {
"""
Builds a AppExists waiter by using custom parameters waiterParameters and other parameters defined in the waiters
specification, and then polls until it determines whether the resource entered the desired state or not, where
polling criteria is bound by either... | java | public Waiter<DescribeAppsRequest> appExists() {
return new WaiterBuilder<DescribeAppsRequest, DescribeAppsResult>().withSdkFunction(new DescribeAppsFunction(client))
.withAcceptors(new HttpSuccessStatusAcceptor(WaiterState.SUCCESS), new HttpFailureStatusAcceptor(400, WaiterState.FAILURE))
... | [
"public",
"Waiter",
"<",
"DescribeAppsRequest",
">",
"appExists",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeAppsRequest",
",",
"DescribeAppsResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeAppsFunction",
"(",
"client",
")",... | Builds a AppExists waiter by using custom parameters waiterParameters and other parameters defined in the waiters
specification, and then polls until it determines whether the resource entered the desired state or not, where
polling criteria is bound by either default polling strategy or custom polling strategy. | [
"Builds",
"a",
"AppExists",
"waiter",
"by",
"using",
"custom",
"parameters",
"waiterParameters",
"and",
"other",
"parameters",
"defined",
"in",
"the",
"waiters",
"specification",
"and",
"then",
"polls",
"until",
"it",
"determines",
"whether",
"the",
"resource",
"e... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java#L69-L75 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSorted | public static <K, V> Map<K, V> toSorted(Map<K, V> self) {
"""
Sorts the elements from the given map into a new ordered map using
a {@link NumberAwareComparator} on map entry values to determine the resulting order.
{@code NumberAwareComparator} has special treatment for numbers but otherwise uses the
natural or... | java | public static <K, V> Map<K, V> toSorted(Map<K, V> self) {
return toSorted(self, new NumberAwareValueComparator<K, V>());
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toSorted",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"self",
")",
"{",
"return",
"toSorted",
"(",
"self",
",",
"new",
"NumberAwareValueComparator",
"<",
"K",
",",
"V",
">",
... | Sorts the elements from the given map into a new ordered map using
a {@link NumberAwareComparator} on map entry values to determine the resulting order.
{@code NumberAwareComparator} has special treatment for numbers but otherwise uses the
natural ordering of the Iterator elements. The original map is unchanged.
<pre c... | [
"Sorts",
"the",
"elements",
"from",
"the",
"given",
"map",
"into",
"a",
"new",
"ordered",
"map",
"using",
"a",
"{",
"@link",
"NumberAwareComparator",
"}",
"on",
"map",
"entry",
"values",
"to",
"determine",
"the",
"resulting",
"order",
".",
"{",
"@code",
"N... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L9563-L9565 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java | LottieCompositionFactory.fromZipStreamSync | @WorkerThread
public static LottieResult<LottieComposition> fromZipStreamSync(ZipInputStream inputStream, @Nullable String cacheKey) {
"""
Parses a zip input stream into a Lottie composition.
Your zip file should just be a folder with your json file and images zipped together.
It will automatically store and c... | java | @WorkerThread
public static LottieResult<LottieComposition> fromZipStreamSync(ZipInputStream inputStream, @Nullable String cacheKey) {
try {
return fromZipStreamSyncInternal(inputStream, cacheKey);
} finally {
closeQuietly(inputStream);
}
} | [
"@",
"WorkerThread",
"public",
"static",
"LottieResult",
"<",
"LottieComposition",
">",
"fromZipStreamSync",
"(",
"ZipInputStream",
"inputStream",
",",
"@",
"Nullable",
"String",
"cacheKey",
")",
"{",
"try",
"{",
"return",
"fromZipStreamSyncInternal",
"(",
"inputStrea... | Parses a zip input stream into a Lottie composition.
Your zip file should just be a folder with your json file and images zipped together.
It will automatically store and configure any images inside the animation if they exist. | [
"Parses",
"a",
"zip",
"input",
"stream",
"into",
"a",
"Lottie",
"composition",
".",
"Your",
"zip",
"file",
"should",
"just",
"be",
"a",
"folder",
"with",
"your",
"json",
"file",
"and",
"images",
"zipped",
"together",
".",
"It",
"will",
"automatically",
"st... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java#L272-L279 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java | VpnGatewaysInner.getByResourceGroup | public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) {
"""
Retrieves the details of a virtual wan vpn gateway.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameter... | java | public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayName).toBlocking().single().body();
} | [
"public",
"VpnGatewayInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
")",
".",
"toBlocking",
"(",
")",
".",
"s... | Retrieves the details of a virtual wan vpn gateway.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the request is rejected by server
@throws Runtim... | [
"Retrieves",
"the",
"details",
"of",
"a",
"virtual",
"wan",
"vpn",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnGatewaysInner.java#L126-L128 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java | OnDiskArrayPageFile.pageToByteArray | private byte[] pageToByteArray(P page) {
"""
Serializes an object into a byte array.
@param page the object to be serialized
@return the byte array
"""
try {
if (page == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStre... | java | private byte[] pageToByteArray(P page) {
try {
if (page == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeInt(EMPTY_PAGE);
oos.close();
baos.close();
byte[] array = baos.toByteArr... | [
"private",
"byte",
"[",
"]",
"pageToByteArray",
"(",
"P",
"page",
")",
"{",
"try",
"{",
"if",
"(",
"page",
"==",
"null",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"new",... | Serializes an object into a byte array.
@param page the object to be serialized
@return the byte array | [
"Serializes",
"an",
"object",
"into",
"a",
"byte",
"array",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java#L213-L248 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/core/N1qlQueryExecutor.java | N1qlQueryExecutor.extractPreparedPayloadFromResponse | protected PreparedPayload extractPreparedPayloadFromResponse(PrepareStatement prepared, JsonObject response) {
"""
Extracts the {@link PreparedPayload} from the server's response during a PREPARE.
"""
return new PreparedPayload(
prepared.originalStatement(),
response.get... | java | protected PreparedPayload extractPreparedPayloadFromResponse(PrepareStatement prepared, JsonObject response) {
return new PreparedPayload(
prepared.originalStatement(),
response.getString("name"),
response.getString("encoded_plan")
);
} | [
"protected",
"PreparedPayload",
"extractPreparedPayloadFromResponse",
"(",
"PrepareStatement",
"prepared",
",",
"JsonObject",
"response",
")",
"{",
"return",
"new",
"PreparedPayload",
"(",
"prepared",
".",
"originalStatement",
"(",
")",
",",
"response",
".",
"getString"... | Extracts the {@link PreparedPayload} from the server's response during a PREPARE. | [
"Extracts",
"the",
"{"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/core/N1qlQueryExecutor.java#L593-L599 |
bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/api/Coordinate.java | Coordinate.fromJson | public static Coordinate fromJson(Map<String, ?> json) {
"""
Creates a coordinate from a Json map with with "~table" and "~id". This is the inverse of {@link #asJson()}.
"""
return Coordinate.of(Intrinsic.getTable(json), Intrinsic.getId(json));
} | java | public static Coordinate fromJson(Map<String, ?> json) {
return Coordinate.of(Intrinsic.getTable(json), Intrinsic.getId(json));
} | [
"public",
"static",
"Coordinate",
"fromJson",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"json",
")",
"{",
"return",
"Coordinate",
".",
"of",
"(",
"Intrinsic",
".",
"getTable",
"(",
"json",
")",
",",
"Intrinsic",
".",
"getId",
"(",
"json",
")",
")",
"... | Creates a coordinate from a Json map with with "~table" and "~id". This is the inverse of {@link #asJson()}. | [
"Creates",
"a",
"coordinate",
"from",
"a",
"Json",
"map",
"with",
"with",
"~table",
"and",
"~id",
".",
"This",
"is",
"the",
"inverse",
"of",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/api/Coordinate.java#L24-L26 |
line/armeria | it/spring/boot-tomcat/src/main/java/com/linecorp/armeria/spring/tomcat/demo/GreetingController.java | GreetingController.greetingSync | @GetMapping
public ResponseEntity<Greeting> greetingSync(
@RequestParam(value = "name", defaultValue = "World") String name) {
"""
Greeting endpoint.
@param name name to greet.
@return response the ResponseEntity.
"""
return ResponseEntity.ok(new Greeting(String.format(template, name)... | java | @GetMapping
public ResponseEntity<Greeting> greetingSync(
@RequestParam(value = "name", defaultValue = "World") String name) {
return ResponseEntity.ok(new Greeting(String.format(template, name)));
} | [
"@",
"GetMapping",
"public",
"ResponseEntity",
"<",
"Greeting",
">",
"greetingSync",
"(",
"@",
"RequestParam",
"(",
"value",
"=",
"\"name\"",
",",
"defaultValue",
"=",
"\"World\"",
")",
"String",
"name",
")",
"{",
"return",
"ResponseEntity",
".",
"ok",
"(",
... | Greeting endpoint.
@param name name to greet.
@return response the ResponseEntity. | [
"Greeting",
"endpoint",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/it/spring/boot-tomcat/src/main/java/com/linecorp/armeria/spring/tomcat/demo/GreetingController.java#L35-L39 |
WASdev/ci.maven | liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/SpringBootUtil.java | SpringBootUtil.getSpringBootUberJAR | public static File getSpringBootUberJAR(MavenProject project, Log log) {
"""
Get the Spring Boot Uber JAR in its expected location, validating the JAR
contents and handling spring-boot-maven-plugin classifier configuration as
well. If the JAR was not found in its expected location, then return null.
@param ou... | java | public static File getSpringBootUberJAR(MavenProject project, Log log) {
File fatArchive = getSpringBootUberJARLocation(project, log);
if (net.wasdev.wlp.common.plugins.util.SpringBootUtil.isSpringBootUberJar(fatArchive)) {
log.info("Found Spring Boot Uber JAR: " + fatArchive.getAbsolutePa... | [
"public",
"static",
"File",
"getSpringBootUberJAR",
"(",
"MavenProject",
"project",
",",
"Log",
"log",
")",
"{",
"File",
"fatArchive",
"=",
"getSpringBootUberJARLocation",
"(",
"project",
",",
"log",
")",
";",
"if",
"(",
"net",
".",
"wasdev",
".",
"wlp",
"."... | Get the Spring Boot Uber JAR in its expected location, validating the JAR
contents and handling spring-boot-maven-plugin classifier configuration as
well. If the JAR was not found in its expected location, then return null.
@param outputDirectory
@param project
@param log
@return the JAR File if it was found, false ot... | [
"Get",
"the",
"Spring",
"Boot",
"Uber",
"JAR",
"in",
"its",
"expected",
"location",
"validating",
"the",
"JAR",
"contents",
"and",
"handling",
"spring",
"-",
"boot",
"-",
"maven",
"-",
"plugin",
"classifier",
"configuration",
"as",
"well",
".",
"If",
"the",
... | train | https://github.com/WASdev/ci.maven/blob/4fcf2d314299a4c02e2c740e4fc99a4f6aba6918/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/SpringBootUtil.java#L56-L67 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/util/IOHelper.java | IOHelper.addRequestProperties | private static void addRequestProperties(final Map<String, String> requestProperties, final HttpURLConnection connection) {
"""
Copies request properties to a connection.
@param requestProperties
(if null, connection will not be changed)
@param connection
"""
if (requestProperties != null) {
... | java | private static void addRequestProperties(final Map<String, String> requestProperties, final HttpURLConnection connection) {
if (requestProperties != null) {
for (Entry<String, String> entry : requestProperties.entrySet()) {
connection.addRequestProperty(entry.getKey(), entry.getValue... | [
"private",
"static",
"void",
"addRequestProperties",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"requestProperties",
",",
"final",
"HttpURLConnection",
"connection",
")",
"{",
"if",
"(",
"requestProperties",
"!=",
"null",
")",
"{",
"for",
"(",
"En... | Copies request properties to a connection.
@param requestProperties
(if null, connection will not be changed)
@param connection | [
"Copies",
"request",
"properties",
"to",
"a",
"connection",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/util/IOHelper.java#L59-L65 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArray | public static <T> Level0ArrayOperator<Integer[],Integer> onArray(final int[] target) {
"""
<p>
Creates an <i>operation expression</i> on the specified target object.
</p>
@param target the target object on which the expression will execute
@return an operator, ready for chaining
"""
return onArr... | java | public static <T> Level0ArrayOperator<Integer[],Integer> onArray(final int[] target) {
return onArrayOf(Types.INTEGER, ArrayUtils.toObject(target));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"Integer",
"[",
"]",
",",
"Integer",
">",
"onArray",
"(",
"final",
"int",
"[",
"]",
"target",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"INTEGER",
",",
"ArrayUtils",
".",
"toObject"... | <p>
Creates an <i>operation expression</i> on the specified target object.
</p>
@param target the target object on which the expression will execute
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"the",
"specified",
"target",
"object",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L585-L587 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Functions.java | Functions.limitInts | public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> limitInts(long maxSize) {
"""
/*
Fluent limit operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.limitInts;
ReactiveSeq.ofInts(1,2,3)
.to(limitInts(1));
//[1]
}
</pre>
"""
... | java | public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> limitInts(long maxSize){
return a->a.ints(i->i,s->s.limit(maxSize));
} | [
"public",
"static",
"Function",
"<",
"?",
"super",
"ReactiveSeq",
"<",
"Integer",
">",
",",
"?",
"extends",
"ReactiveSeq",
"<",
"Integer",
">",
">",
"limitInts",
"(",
"long",
"maxSize",
")",
"{",
"return",
"a",
"->",
"a",
".",
"ints",
"(",
"i",
"->",
... | /*
Fluent limit operation using primitive types
e.g.
<pre>
{@code
import static cyclops.ReactiveSeq.limitInts;
ReactiveSeq.ofInts(1,2,3)
.to(limitInts(1));
//[1]
}
</pre> | [
"/",
"*",
"Fluent",
"limit",
"operation",
"using",
"primitive",
"types",
"e",
".",
"g",
".",
"<pre",
">",
"{",
"@code",
"import",
"static",
"cyclops",
".",
"ReactiveSeq",
".",
"limitInts",
";"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Functions.java#L221-L224 |
DJCordhose/jmte | src/com/floreysoft/jmte/util/Util.java | Util.fileToString | public static String fileToString(File file, String charsetName) {
"""
Transforms a file into a string.
@param file
the file to be transformed
@param charsetName
encoding of the file
@return the string containing the content of the file
"""
FileInputStream fileInputStream = null;
try {
try {
... | java | public static String fileToString(File file, String charsetName) {
FileInputStream fileInputStream = null;
try {
try {
fileInputStream = new FileInputStream(file);
return streamToString(fileInputStream, charsetName);
} finally {
if (fileInputStream != null) {
fileInputStream.close();
... | [
"public",
"static",
"String",
"fileToString",
"(",
"File",
"file",
",",
"String",
"charsetName",
")",
"{",
"FileInputStream",
"fileInputStream",
"=",
"null",
";",
"try",
"{",
"try",
"{",
"fileInputStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
... | Transforms a file into a string.
@param file
the file to be transformed
@param charsetName
encoding of the file
@return the string containing the content of the file | [
"Transforms",
"a",
"file",
"into",
"a",
"string",
"."
] | train | https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L85-L100 |
kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.printExample | public String printExample(OptionHandlerFilter mode, ResourceBundle rb) {
"""
Formats a command line example into a string.
<p>
This method produces a string like <code> -d <dir> -v -b</code>.
This is useful for printing a command line example (perhaps
as a part of the usage screen).
@param mode
... | java | public String printExample(OptionHandlerFilter mode, ResourceBundle rb) {
StringBuilder buf = new StringBuilder();
checkNonNull(mode, "mode");
for (OptionHandler h : options) {
OptionDef option = h.option;
if(option.usage().length()==0) continue; // ignore
... | [
"public",
"String",
"printExample",
"(",
"OptionHandlerFilter",
"mode",
",",
"ResourceBundle",
"rb",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"checkNonNull",
"(",
"mode",
",",
"\"mode\"",
")",
";",
"for",
"(",
"OptionHandle... | Formats a command line example into a string.
<p>
This method produces a string like <code> -d <dir> -v -b</code>.
This is useful for printing a command line example (perhaps
as a part of the usage screen).
@param mode
Determines which options will be a part of the returned string.
Must not be {@code null}.
@p... | [
"Formats",
"a",
"command",
"line",
"example",
"into",
"a",
"string",
"."
] | train | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L230-L245 |
haraldk/TwelveMonkeys | contrib/src/main/java/com/twelvemonkeys/contrib/tiff/TIFFUtilities.java | TIFFUtilities.rotatePage | public static void rotatePage(ImageInputStream imageInput, ImageOutputStream imageOutput, int degree, int pageIndex)
throws IOException {
"""
Rotates a page of a TIFF file by changing TIFF.TAG_ORIENTATION.
<p>
NOTICE: TIFF.TAG_ORIENTATION is an advice how the image is meant do be
displayed. Other me... | java | public static void rotatePage(ImageInputStream imageInput, ImageOutputStream imageOutput, int degree, int pageIndex)
throws IOException {
ImageInputStream input = null;
try {
List<TIFFPage> pages = getPages(imageInput);
if (pageIndex != -1) {
pages.get... | [
"public",
"static",
"void",
"rotatePage",
"(",
"ImageInputStream",
"imageInput",
",",
"ImageOutputStream",
"imageOutput",
",",
"int",
"degree",
",",
"int",
"pageIndex",
")",
"throws",
"IOException",
"{",
"ImageInputStream",
"input",
"=",
"null",
";",
"try",
"{",
... | Rotates a page of a TIFF file by changing TIFF.TAG_ORIENTATION.
<p>
NOTICE: TIFF.TAG_ORIENTATION is an advice how the image is meant do be
displayed. Other metadata, such as width and height, relate to the image
as how it is stored. The ImageIO TIFF plugin does not handle orientation.
Use {@link TIFFUtilities#applyOrie... | [
"Rotates",
"a",
"page",
"of",
"a",
"TIFF",
"file",
"by",
"changing",
"TIFF",
".",
"TAG_ORIENTATION",
".",
"<p",
">",
"NOTICE",
":",
"TIFF",
".",
"TAG_ORIENTATION",
"is",
"an",
"advice",
"how",
"the",
"image",
"is",
"meant",
"do",
"be",
"displayed",
".",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/contrib/src/main/java/com/twelvemonkeys/contrib/tiff/TIFFUtilities.java#L180-L200 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.3/src/com/ibm/ws/microprofile/config13/sources/OSGiConfigUtils.java | OSGiConfigUtils.getApplicationServiceRef | public static ServiceReference<Application> getApplicationServiceRef(BundleContext bundleContext, String applicationName) {
"""
Get the Application ServiceReferences which has the given name, or null if not found
@param bundleContext The context to use to find the application service references
@param applicat... | java | public static ServiceReference<Application> getApplicationServiceRef(BundleContext bundleContext, String applicationName) {
ServiceReference<Application> appRef = null;
if (FrameworkState.isValid()) {
Collection<ServiceReference<Application>> appRefs;
try {
appRe... | [
"public",
"static",
"ServiceReference",
"<",
"Application",
">",
"getApplicationServiceRef",
"(",
"BundleContext",
"bundleContext",
",",
"String",
"applicationName",
")",
"{",
"ServiceReference",
"<",
"Application",
">",
"appRef",
"=",
"null",
";",
"if",
"(",
"Frame... | Get the Application ServiceReferences which has the given name, or null if not found
@param bundleContext The context to use to find the application service references
@param applicationName The application name to look for
@return A ServiceReference for the given application | [
"Get",
"the",
"Application",
"ServiceReferences",
"which",
"has",
"the",
"given",
"name",
"or",
"null",
"if",
"not",
"found"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.3/src/com/ibm/ws/microprofile/config13/sources/OSGiConfigUtils.java#L162-L183 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java | JsonTextSequences.fromPublisher | public static HttpResponse fromPublisher(HttpHeaders headers, Publisher<?> contentPublisher) {
"""
Creates a new JSON Text Sequences from the specified {@link Publisher}.
@param headers the HTTP headers supposed to send
@param contentPublisher the {@link Publisher} which publishes the objects supposed to send ... | java | public static HttpResponse fromPublisher(HttpHeaders headers, Publisher<?> contentPublisher) {
return fromPublisher(headers, contentPublisher, HttpHeaders.EMPTY_HEADERS, defaultMapper);
} | [
"public",
"static",
"HttpResponse",
"fromPublisher",
"(",
"HttpHeaders",
"headers",
",",
"Publisher",
"<",
"?",
">",
"contentPublisher",
")",
"{",
"return",
"fromPublisher",
"(",
"headers",
",",
"contentPublisher",
",",
"HttpHeaders",
".",
"EMPTY_HEADERS",
",",
"d... | Creates a new JSON Text Sequences from the specified {@link Publisher}.
@param headers the HTTP headers supposed to send
@param contentPublisher the {@link Publisher} which publishes the objects supposed to send as contents | [
"Creates",
"a",
"new",
"JSON",
"Text",
"Sequences",
"from",
"the",
"specified",
"{",
"@link",
"Publisher",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java#L118-L120 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StreamUtil.java | StreamUtil.copy | public static void copy(final InputStream in, final OutputStream out, final int bufferSize)
throws IOException {
"""
Copies information from the input stream to the output stream using a specified buffer size.
@param in the source stream.
@param out the destination stream.
@param bufferSize the buffer size... | java | public static void copy(final InputStream in, final OutputStream out, final int bufferSize)
throws IOException {
final byte[] buf = new byte[bufferSize];
int bytesRead = in.read(buf);
while (bytesRead != -1) {
out.write(buf, 0, bytesRead);
bytesRead = in.read(buf);
}
out.flush();
} | [
"public",
"static",
"void",
"copy",
"(",
"final",
"InputStream",
"in",
",",
"final",
"OutputStream",
"out",
",",
"final",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"bufferSize",
"]",
... | Copies information from the input stream to the output stream using a specified buffer size.
@param in the source stream.
@param out the destination stream.
@param bufferSize the buffer size.
@throws IOException if there is an error reading or writing to the streams. | [
"Copies",
"information",
"from",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
"using",
"a",
"specified",
"buffer",
"size",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StreamUtil.java#L54-L65 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/MasterUtils.java | MasterUtils.createMasters | public static void createMasters(MasterRegistry registry, MasterContext context) {
"""
Creates all the masters and registers them to the master registry.
@param registry the master registry
@param context master context
"""
List<Callable<Void>> callables = new ArrayList<>();
for (final MasterFactor... | java | public static void createMasters(MasterRegistry registry, MasterContext context) {
List<Callable<Void>> callables = new ArrayList<>();
for (final MasterFactory factory : alluxio.master.ServiceUtils.getMasterServiceLoader()) {
callables.add(() -> {
if (factory.isEnabled()) {
factory.creat... | [
"public",
"static",
"void",
"createMasters",
"(",
"MasterRegistry",
"registry",
",",
"MasterContext",
"context",
")",
"{",
"List",
"<",
"Callable",
"<",
"Void",
">>",
"callables",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"MasterFact... | Creates all the masters and registers them to the master registry.
@param registry the master registry
@param context master context | [
"Creates",
"all",
"the",
"masters",
"and",
"registers",
"them",
"to",
"the",
"master",
"registry",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/MasterUtils.java#L44-L59 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.setCrossNoDisturb | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
"""
Set cross app no disturb
https://docs.jiguang.cn/jmessage/server/rest_api_im/#api_1
@param username Necessary
@param array CrossNoDisturb array
@return No conte... | java | public ResponseWrapper setCrossNoDisturb(String username, CrossNoDisturb[] array)
throws APIConnectionException, APIRequestException {
return _crossAppClient.setCrossNoDisturb(username, array);
} | [
"public",
"ResponseWrapper",
"setCrossNoDisturb",
"(",
"String",
"username",
",",
"CrossNoDisturb",
"[",
"]",
"array",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_crossAppClient",
".",
"setCrossNoDisturb",
"(",
"username",
",",
... | Set cross app no disturb
https://docs.jiguang.cn/jmessage/server/rest_api_im/#api_1
@param username Necessary
@param array CrossNoDisturb array
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Set",
"cross",
"app",
"no",
"disturb",
"https",
":",
"//",
"docs",
".",
"jiguang",
".",
"cn",
"/",
"jmessage",
"/",
"server",
"/",
"rest_api_im",
"/",
"#api_1"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L658-L661 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_hunting_customStatus_POST | public OvhOvhPabxCustomStatus billingAccount_ovhPabx_serviceName_hunting_customStatus_POST(String billingAccount, String serviceName, String color, String description, String name) throws IOException {
"""
Create a new custom status
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/customStat... | java | public OvhOvhPabxCustomStatus billingAccount_ovhPabx_serviceName_hunting_customStatus_POST(String billingAccount, String serviceName, String color, String description, String name) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/customStatus";
StringBuilder sb = path(q... | [
"public",
"OvhOvhPabxCustomStatus",
"billingAccount_ovhPabx_serviceName_hunting_customStatus_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"color",
",",
"String",
"description",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",... | Create a new custom status
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/customStatus
@param name [required] The name of the status (Pause, Mission, etc...)
@param color [required] The color (in hexadecimal) of the status that will be displayed on agent banner web application
@param description ... | [
"Create",
"a",
"new",
"custom",
"status"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L6542-L6551 |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SortableIdAndNameRadioButton.java | SortableIdAndNameRadioButton.fillEntries | private void fillEntries(final Collection<T> pids) {
"""
fill entries of the radio buttons.
@param pids list of entries
"""
this.entries.clear();
final Stream<IdAndNameBean<T>> stream =
pids.stream().map(proEnum -> new IdAndNameBean<>(proEnum, this.messages.name(proEnum)));
final Stream<... | java | private void fillEntries(final Collection<T> pids) {
this.entries.clear();
final Stream<IdAndNameBean<T>> stream =
pids.stream().map(proEnum -> new IdAndNameBean<>(proEnum, this.messages.name(proEnum)));
final Stream<IdAndNameBean<T>> sortedStream;
if (this.sortOrder == null) {
sortedStre... | [
"private",
"void",
"fillEntries",
"(",
"final",
"Collection",
"<",
"T",
">",
"pids",
")",
"{",
"this",
".",
"entries",
".",
"clear",
"(",
")",
";",
"final",
"Stream",
"<",
"IdAndNameBean",
"<",
"T",
">",
">",
"stream",
"=",
"pids",
".",
"stream",
"("... | fill entries of the radio buttons.
@param pids list of entries | [
"fill",
"entries",
"of",
"the",
"radio",
"buttons",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SortableIdAndNameRadioButton.java#L131-L169 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/PublishingListener.java | PublishingListener.onNDArrayPartial | @Override
public void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
"""
Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on for the ten... | java | @Override
public void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
try (AeronNDArrayPublisher publisher = AeronNDArrayPublisher.builder().streamId(streamId).ctx(aeronContext)
.channel(masterUrl).build()) {
publisher.publish(NDArrayMessage.builder().arr(ar... | [
"@",
"Override",
"public",
"void",
"onNDArrayPartial",
"(",
"INDArray",
"arr",
",",
"long",
"idx",
",",
"int",
"...",
"dimensions",
")",
"{",
"try",
"(",
"AeronNDArrayPublisher",
"publisher",
"=",
"AeronNDArrayPublisher",
".",
"builder",
"(",
")",
".",
"stream... | Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on for the tensor along dimension | [
"Used",
"for",
"partial",
"updates",
"using",
"tensor",
"along",
"dimension"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/PublishingListener.java#L67-L76 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/metainfo/StateMetaInfoSnapshotReadersWriters.java | StateMetaInfoSnapshotReadersWriters.getReader | @Nonnull
public static StateMetaInfoReader getReader(int readVersion, @Nonnull StateTypeHint stateTypeHint) {
"""
Returns a reader for {@link StateMetaInfoSnapshot} with the requested state type and version number.
@param readVersion the format version to read.
@param stateTypeHint a hint about the expected t... | java | @Nonnull
public static StateMetaInfoReader getReader(int readVersion, @Nonnull StateTypeHint stateTypeHint) {
if (readVersion < 5) {
// versions before 5 still had different state meta info formats between keyed / operator state
switch (stateTypeHint) {
case KEYED_STATE:
return getLegacyKeyedStateMet... | [
"@",
"Nonnull",
"public",
"static",
"StateMetaInfoReader",
"getReader",
"(",
"int",
"readVersion",
",",
"@",
"Nonnull",
"StateTypeHint",
"stateTypeHint",
")",
"{",
"if",
"(",
"readVersion",
"<",
"5",
")",
"{",
"// versions before 5 still had different state meta info fo... | Returns a reader for {@link StateMetaInfoSnapshot} with the requested state type and version number.
@param readVersion the format version to read.
@param stateTypeHint a hint about the expected type to read.
@return the requested reader. | [
"Returns",
"a",
"reader",
"for",
"{",
"@link",
"StateMetaInfoSnapshot",
"}",
"with",
"the",
"requested",
"state",
"type",
"and",
"version",
"number",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/metainfo/StateMetaInfoSnapshotReadersWriters.java#L76-L93 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java | Sleep.sleepFor | @WillCloseWhenClosed
public static void sleepFor(long timeout, TimeUnit unit) {
"""
Interruptible sleep of the current thread
<b>Will interrupt the thread if InterruptedException occurs</b>
@param timeout with unit, the maximum length of time that callers are willing to wait
@param unit with timeout, th... | java | @WillCloseWhenClosed
public static void sleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} | [
"@",
"WillCloseWhenClosed",
"public",
"static",
"void",
"sleepFor",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"try",
"{",
"unit",
".",
"sleep",
"(",
"timeout",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
... | Interruptible sleep of the current thread
<b>Will interrupt the thread if InterruptedException occurs</b>
@param timeout with unit, the maximum length of time that callers are willing to wait
@param unit with timeout, the maximum length of time that callers are willing to wait
@see TimeUnit#sleep(long) | [
"Interruptible",
"sleep",
"of",
"the",
"current",
"thread"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java#L30-L37 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java | GVRJassimpAdapter.makeSkeleton | private void makeSkeleton(GVRSceneObject root) {
"""
/*
if there was a skinned mesh the bone map acts as a lookup
table that maps bone names to their corresponding AiBone objects.
The BoneCollector constructs the skeleton from the bone names in
the map and the scene nodes, attempting to connect bones
where th... | java | private void makeSkeleton(GVRSceneObject root)
{
if (!mBoneMap.isEmpty())
{
BoneCollector nodeProcessor = new BoneCollector();
root.forAllDescendants(nodeProcessor);
mSkeleton = new GVRSkeleton(root, nodeProcessor.getBoneNames());
GVRPose bindPose = n... | [
"private",
"void",
"makeSkeleton",
"(",
"GVRSceneObject",
"root",
")",
"{",
"if",
"(",
"!",
"mBoneMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"BoneCollector",
"nodeProcessor",
"=",
"new",
"BoneCollector",
"(",
")",
";",
"root",
".",
"forAllDescendants",
"(",
... | /*
if there was a skinned mesh the bone map acts as a lookup
table that maps bone names to their corresponding AiBone objects.
The BoneCollector constructs the skeleton from the bone names in
the map and the scene nodes, attempting to connect bones
where there are gaps to produce a complete skeleton. | [
"/",
"*",
"if",
"there",
"was",
"a",
"skinned",
"mesh",
"the",
"bone",
"map",
"acts",
"as",
"a",
"lookup",
"table",
"that",
"maps",
"bone",
"names",
"to",
"their",
"corresponding",
"AiBone",
"objects",
".",
"The",
"BoneCollector",
"constructs",
"the",
"ske... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java#L550-L591 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.indexAny | public static int indexAny(String target, String... indexWith) {
"""
Search target string to find the first index of any string in the given string array
@param target
@param indexWith
@return
"""
return indexAny(target, 0, Arrays.asList(indexWith));
} | java | public static int indexAny(String target, String... indexWith) {
return indexAny(target, 0, Arrays.asList(indexWith));
} | [
"public",
"static",
"int",
"indexAny",
"(",
"String",
"target",
",",
"String",
"...",
"indexWith",
")",
"{",
"return",
"indexAny",
"(",
"target",
",",
"0",
",",
"Arrays",
".",
"asList",
"(",
"indexWith",
")",
")",
";",
"}"
] | Search target string to find the first index of any string in the given string array
@param target
@param indexWith
@return | [
"Search",
"target",
"string",
"to",
"find",
"the",
"first",
"index",
"of",
"any",
"string",
"in",
"the",
"given",
"string",
"array"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L264-L266 |
igniterealtime/Smack | smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java | RosterEntry.toRosterItem | static RosterPacket.Item toRosterItem(RosterEntry entry, String name) {
"""
Convert the RosterEntry to a Roster stanza <item/> element.
@param entry the roster entry
@param name the name of the roster item.
@return the roster item.
"""
return toRosterItem(entry, name, false);
} | java | static RosterPacket.Item toRosterItem(RosterEntry entry, String name) {
return toRosterItem(entry, name, false);
} | [
"static",
"RosterPacket",
".",
"Item",
"toRosterItem",
"(",
"RosterEntry",
"entry",
",",
"String",
"name",
")",
"{",
"return",
"toRosterItem",
"(",
"entry",
",",
"name",
",",
"false",
")",
";",
"}"
] | Convert the RosterEntry to a Roster stanza <item/> element.
@param entry the roster entry
@param name the name of the roster item.
@return the roster item. | [
"Convert",
"the",
"RosterEntry",
"to",
"a",
"Roster",
"stanza",
"<",
";",
"item",
"/",
">",
";",
"element",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java#L302-L304 |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java | CommerceNotificationTemplateWrapper.getSubject | @Override
public String getSubject(String languageId, boolean useDefault) {
"""
Returns the localized subject of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useD... | java | @Override
public String getSubject(String languageId, boolean useDefault) {
return _commerceNotificationTemplate.getSubject(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getSubject",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceNotificationTemplate",
".",
"getSubject",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized subject of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested la... | [
"Returns",
"the",
"localized",
"subject",
"of",
"this",
"commerce",
"notification",
"template",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java#L554-L557 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java | Instance.allocateSimpleSlot | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
"""
Allocates a simple slot on this TaskManager instance. This method returns {@code null}, if no slot
is available at the moment.
@return A simple slot that represents a task slot on this TaskManager instance, or null, if the
TaskManager i... | java | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
synchronized (instanceLock) {
if (isDead) {
throw new InstanceDiedException(this);
}
Integer nextSlot = availableSlots.poll();
if (nextSlot == null) {
return null;
}
else {
SimpleSlot slot = new SimpleSlot(this, locat... | [
"public",
"SimpleSlot",
"allocateSimpleSlot",
"(",
")",
"throws",
"InstanceDiedException",
"{",
"synchronized",
"(",
"instanceLock",
")",
"{",
"if",
"(",
"isDead",
")",
"{",
"throw",
"new",
"InstanceDiedException",
"(",
"this",
")",
";",
"}",
"Integer",
"nextSlo... | Allocates a simple slot on this TaskManager instance. This method returns {@code null}, if no slot
is available at the moment.
@return A simple slot that represents a task slot on this TaskManager instance, or null, if the
TaskManager instance has no more slots available.
@throws InstanceDiedException Thrown if the i... | [
"Allocates",
"a",
"simple",
"slot",
"on",
"this",
"TaskManager",
"instance",
".",
"This",
"method",
"returns",
"{",
"@code",
"null",
"}",
"if",
"no",
"slot",
"is",
"available",
"at",
"the",
"moment",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java#L220-L236 |
Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.getScopeService | protected static Object getScopeService(IScope scope, String name) {
"""
Returns scope service by bean name. See overloaded method for details.
@param scope
scope
@param name
name
@return object
"""
return getScopeService(scope, name, null);
} | java | protected static Object getScopeService(IScope scope, String name) {
return getScopeService(scope, name, null);
} | [
"protected",
"static",
"Object",
"getScopeService",
"(",
"IScope",
"scope",
",",
"String",
"name",
")",
"{",
"return",
"getScopeService",
"(",
"scope",
",",
"name",
",",
"null",
")",
";",
"}"
] | Returns scope service by bean name. See overloaded method for details.
@param scope
scope
@param name
name
@return object | [
"Returns",
"scope",
"service",
"by",
"bean",
"name",
".",
"See",
"overloaded",
"method",
"for",
"details",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L257-L259 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/executors/MavenExecutor.java | MavenExecutor.convertJdkPath | private void convertJdkPath(Launcher launcher, EnvVars extendedEnv) {
"""
The Maven3Builder class is looking for the PATH+JDK environment variable due to legacy code.
In The pipeline flow we need to convert the JAVA_HOME to PATH+JDK in order to reuse the code.
"""
String separator = launcher.isUnix() ... | java | private void convertJdkPath(Launcher launcher, EnvVars extendedEnv) {
String separator = launcher.isUnix() ? "/" : "\\";
String java_home = extendedEnv.get("JAVA_HOME");
if (StringUtils.isNotEmpty(java_home)) {
if (!StringUtils.endsWith(java_home, separator)) {
java_h... | [
"private",
"void",
"convertJdkPath",
"(",
"Launcher",
"launcher",
",",
"EnvVars",
"extendedEnv",
")",
"{",
"String",
"separator",
"=",
"launcher",
".",
"isUnix",
"(",
")",
"?",
"\"/\"",
":",
"\"\\\\\"",
";",
"String",
"java_home",
"=",
"extendedEnv",
".",
"g... | The Maven3Builder class is looking for the PATH+JDK environment variable due to legacy code.
In The pipeline flow we need to convert the JAVA_HOME to PATH+JDK in order to reuse the code. | [
"The",
"Maven3Builder",
"class",
"is",
"looking",
"for",
"the",
"PATH",
"+",
"JDK",
"environment",
"variable",
"due",
"to",
"legacy",
"code",
".",
"In",
"The",
"pipeline",
"flow",
"we",
"need",
"to",
"convert",
"the",
"JAVA_HOME",
"to",
"PATH",
"+",
"JDK",... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/executors/MavenExecutor.java#L84-L93 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasDocument.java | BaasDocument.refreshSync | public BaasResult<BaasDocument> refreshSync(boolean withAcl) {
"""
Synchronously refresh the content of this document
@param withAcl if true will fetch acl
@return the result of the request
@throws java.lang.IllegalStateException if this document has no id
"""
BaasBox box = BaasBox.getDefaultCheck... | java | public BaasResult<BaasDocument> refreshSync(boolean withAcl) {
BaasBox box = BaasBox.getDefaultChecked();
if (id == null)
throw new IllegalStateException("this document is not bound to any remote entity");
Refresh refresh = new Refresh(box, this,withAcl, RequestOptions.DEFAULT, null)... | [
"public",
"BaasResult",
"<",
"BaasDocument",
">",
"refreshSync",
"(",
"boolean",
"withAcl",
")",
"{",
"BaasBox",
"box",
"=",
"BaasBox",
".",
"getDefaultChecked",
"(",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",... | Synchronously refresh the content of this document
@param withAcl if true will fetch acl
@return the result of the request
@throws java.lang.IllegalStateException if this document has no id | [
"Synchronously",
"refresh",
"the",
"content",
"of",
"this",
"document"
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L481-L487 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/StreamUtils.java | StreamUtils.copyToFileAndClose | public static long copyToFileAndClose(InputStream is, File file) throws IOException {
"""
Copy from an input stream to a file (and buffer it) and close the input stream.
<p>
It is highly recommended to use FileUtils.retryCopy whenever possible, and not use a raw `InputStream`
@param is The input stream to c... | java | public static long copyToFileAndClose(InputStream is, File file) throws IOException
{
file.getParentFile().mkdirs();
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
final long result = ByteStreams.copy(is, os);
// Workarround for http://hg.openjdk.java.net/jdk8/jdk8/... | [
"public",
"static",
"long",
"copyToFileAndClose",
"(",
"InputStream",
"is",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"file",
".",
"getParentFile",
"(",
")",
".",
"mkdirs",
"(",
")",
";",
"try",
"(",
"OutputStream",
"os",
"=",
"new",
"Buffere... | Copy from an input stream to a file (and buffer it) and close the input stream.
<p>
It is highly recommended to use FileUtils.retryCopy whenever possible, and not use a raw `InputStream`
@param is The input stream to copy bytes from. `is` is closed regardless of the copy result.
@param file The file to copy bytes to... | [
"Copy",
"from",
"an",
"input",
"stream",
"to",
"a",
"file",
"(",
"and",
"buffer",
"it",
")",
"and",
"close",
"the",
"input",
"stream",
".",
"<p",
">",
"It",
"is",
"highly",
"recommended",
"to",
"use",
"FileUtils",
".",
"retryCopy",
"whenever",
"possible"... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/StreamUtils.java#L50-L62 |
finnyb/javampd | src/main/java/org/bff/javampd/monitor/MPDPlayerMonitor.java | MPDPlayerMonitor.firePlayerChangeEvent | protected synchronized void firePlayerChangeEvent(PlayerBasicChangeEvent.Status status) {
"""
Sends the appropriate {@link org.bff.javampd.player.PlayerBasicChangeEvent.Status} to all registered
{@link PlayerBasicChangeListener}s.
@param status the {@link org.bff.javampd.player.PlayerBasicChangeEvent.Status}
... | java | protected synchronized void firePlayerChangeEvent(PlayerBasicChangeEvent.Status status) {
PlayerBasicChangeEvent pce = new PlayerBasicChangeEvent(this, status);
for (PlayerBasicChangeListener pcl : playerListeners) {
pcl.playerBasicChange(pce);
}
} | [
"protected",
"synchronized",
"void",
"firePlayerChangeEvent",
"(",
"PlayerBasicChangeEvent",
".",
"Status",
"status",
")",
"{",
"PlayerBasicChangeEvent",
"pce",
"=",
"new",
"PlayerBasicChangeEvent",
"(",
"this",
",",
"status",
")",
";",
"for",
"(",
"PlayerBasicChangeL... | Sends the appropriate {@link org.bff.javampd.player.PlayerBasicChangeEvent.Status} to all registered
{@link PlayerBasicChangeListener}s.
@param status the {@link org.bff.javampd.player.PlayerBasicChangeEvent.Status} | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"org",
".",
"bff",
".",
"javampd",
".",
"player",
".",
"PlayerBasicChangeEvent",
".",
"Status",
"}",
"to",
"all",
"registered",
"{",
"@link",
"PlayerBasicChangeListener",
"}",
"s",
"."
] | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/monitor/MPDPlayerMonitor.java#L92-L98 |
redkale/redkale | src/org/redkale/convert/json/JsonReader.java | JsonReader.readMapB | @Override
public final int readMapB(DeMember member, byte[] typevals, Decodeable keyDecoder, Decodeable valuedecoder) {
"""
判断下一个非空白字符是否为{
@param member DeMember
@param typevals byte[]
@param keyDecoder Decodeable
@param valuedecoder Decodeable
@return SIGN_NOLENGTH 或 SIGN_NULL
"""
... | java | @Override
public final int readMapB(DeMember member, byte[] typevals, Decodeable keyDecoder, Decodeable valuedecoder) {
return readArrayB(member, typevals, keyDecoder);
} | [
"@",
"Override",
"public",
"final",
"int",
"readMapB",
"(",
"DeMember",
"member",
",",
"byte",
"[",
"]",
"typevals",
",",
"Decodeable",
"keyDecoder",
",",
"Decodeable",
"valuedecoder",
")",
"{",
"return",
"readArrayB",
"(",
"member",
",",
"typevals",
",",
"k... | 判断下一个非空白字符是否为{
@param member DeMember
@param typevals byte[]
@param keyDecoder Decodeable
@param valuedecoder Decodeable
@return SIGN_NOLENGTH 或 SIGN_NULL | [
"判断下一个非空白字符是否为",
"{"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/convert/json/JsonReader.java#L215-L218 |
cketti/ckChangeLog | ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java | ChangeLog.parseReleaseTag | private boolean parseReleaseTag(XmlPullParser xml, boolean full,
SparseArray<ReleaseItem> changelog) throws XmlPullParserException, IOException {
"""
Parse the {@code release} tag of a change log XML file.
@param xml
The {@code XmlPullParser} instance used to read the change log.
@param full
If {... | java | private boolean parseReleaseTag(XmlPullParser xml, boolean full,
SparseArray<ReleaseItem> changelog) throws XmlPullParserException, IOException {
String version = xml.getAttributeValue(null, ReleaseTag.ATTRIBUTE_VERSION);
int versionCode;
try {
String versionCodeStr = x... | [
"private",
"boolean",
"parseReleaseTag",
"(",
"XmlPullParser",
"xml",
",",
"boolean",
"full",
",",
"SparseArray",
"<",
"ReleaseItem",
">",
"changelog",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"String",
"version",
"=",
"xml",
".",
"getAttr... | Parse the {@code release} tag of a change log XML file.
@param xml
The {@code XmlPullParser} instance used to read the change log.
@param full
If {@code true} the contents of the {@code release} tag are always added to
{@code changelog}. Otherwise only if the item's {@code versioncode} attribute is
higher than the las... | [
"Parse",
"the",
"{",
"@code",
"release",
"}",
"tag",
"of",
"a",
"change",
"log",
"XML",
"file",
"."
] | train | https://github.com/cketti/ckChangeLog/blob/e9a81ad3e043357e80922aa7c149241af73223d3/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java#L519-L551 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java | DatePickerDialog.newInstance | public static DatePickerDialog newInstance(OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
"""
Create a new DatePickerDialog instance with a specific initial selection.
@param callBack How the parent is notified that the date is set.
@param year The initial year of the dialog.
... | java | public static DatePickerDialog newInstance(OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
DatePickerDialog ret = new DatePickerDialog();
ret.initialize(callBack, year, monthOfYear, dayOfMonth);
return ret;
} | [
"public",
"static",
"DatePickerDialog",
"newInstance",
"(",
"OnDateSetListener",
"callBack",
",",
"int",
"year",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
")",
"{",
"DatePickerDialog",
"ret",
"=",
"new",
"DatePickerDialog",
"(",
")",
";",
"ret",
".",
... | Create a new DatePickerDialog instance with a specific initial selection.
@param callBack How the parent is notified that the date is set.
@param year The initial year of the dialog.
@param monthOfYear The initial month of the dialog.
@param dayOfMonth The initial day of the dialog.
@return a new DatePickerD... | [
"Create",
"a",
"new",
"DatePickerDialog",
"instance",
"with",
"a",
"specific",
"initial",
"selection",
"."
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/DatePickerDialog.java#L203-L207 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/server/ZKDatabase.java | ZKDatabase.processTxn | public ProcessTxnResult processTxn(TxnHeader hdr, Record txn) {
"""
the process txn on the data
@param hdr the txnheader for the txn
@param txn the transaction that needs to be processed
@return the result of processing the transaction on this
datatree/zkdatabase
"""
return dataTree.processTxn(hdr,... | java | public ProcessTxnResult processTxn(TxnHeader hdr, Record txn) {
return dataTree.processTxn(hdr, txn);
} | [
"public",
"ProcessTxnResult",
"processTxn",
"(",
"TxnHeader",
"hdr",
",",
"Record",
"txn",
")",
"{",
"return",
"dataTree",
".",
"processTxn",
"(",
"hdr",
",",
"txn",
")",
";",
"}"
] | the process txn on the data
@param hdr the txnheader for the txn
@param txn the transaction that needs to be processed
@return the result of processing the transaction on this
datatree/zkdatabase | [
"the",
"process",
"txn",
"on",
"the",
"data"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/server/ZKDatabase.java#L176-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2/src/com/ibm/ws/security/csiv2/server/config/tss/ServerConfigHelper.java | ServerConfigHelper.getTSSConfig | public TSSConfig getTSSConfig(Map<String, Object> properties, Map<String, List<TransportAddress>> addrMap) throws Exception {
"""
/*
The TSSConfig object is the modal representation of <iiopServerPolicy> configuration, the user specify
in server.xml. An example of <iiopServerPolicy> entry is shown here for quick... | java | public TSSConfig getTSSConfig(Map<String, Object> properties, Map<String, List<TransportAddress>> addrMap) throws Exception {
TSSConfig tssConfig = new TSSConfig();
printTrace("IIOP Server Policy", null, 0);
PolicyData policyData = extractPolicyData(properties, KEY_POLICY, TYPE);
if (p... | [
"public",
"TSSConfig",
"getTSSConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"TransportAddress",
">",
">",
"addrMap",
")",
"throws",
"Exception",
"{",
"TSSConfig",
"tssConfig",
"=",
"new",
... | /*
The TSSConfig object is the modal representation of <iiopServerPolicy> configuration, the user specify
in server.xml. An example of <iiopServerPolicy> entry is shown here for quick reference.
<iiopServerPolicy id="jaykay">
--<csiv2 stateful="false">
----<layers>
------<attributeLayer identityAssertionEnabled="true" ... | [
"/",
"*",
"The",
"TSSConfig",
"object",
"is",
"the",
"modal",
"representation",
"of",
"<iiopServerPolicy",
">",
"configuration",
"the",
"user",
"specify",
"in",
"server",
".",
"xml",
".",
"An",
"example",
"of",
"<iiopServerPolicy",
">",
"entry",
"is",
"shown",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2/src/com/ibm/ws/security/csiv2/server/config/tss/ServerConfigHelper.java#L98-L114 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADESessionCache.java | CmsADESessionCache.setDynamicValue | public void setDynamicValue(String attribute, String value) {
"""
Set cached value for the attribute. Used for dynamically loaded values in the Acacia content editor.
@param attribute the attribute for which the value should be cached
@param value the value to cache
"""
if (null == m_dynamicValues... | java | public void setDynamicValue(String attribute, String value) {
if (null == m_dynamicValues) {
m_dynamicValues = new ConcurrentHashMap<String, String>();
}
m_dynamicValues.put(attribute, value);
} | [
"public",
"void",
"setDynamicValue",
"(",
"String",
"attribute",
",",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"m_dynamicValues",
")",
"{",
"m_dynamicValues",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"... | Set cached value for the attribute. Used for dynamically loaded values in the Acacia content editor.
@param attribute the attribute for which the value should be cached
@param value the value to cache | [
"Set",
"cached",
"value",
"for",
"the",
"attribute",
".",
"Used",
"for",
"dynamically",
"loaded",
"values",
"in",
"the",
"Acacia",
"content",
"editor",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADESessionCache.java#L429-L435 |
hawkular/hawkular-apm | server/rest/src/main/java/org/hawkular/apm/server/rest/RESTServiceUtil.java | RESTServiceUtil.decodeCorrelationIdentifiers | public static void decodeCorrelationIdentifiers(Set<CorrelationIdentifier> correlations, String encoded) {
"""
This method processes a comma separated list of correlation identifiers, defined as a scope|value pair.
@param correlations The correlation identifier set
@param encoded The string containing the enco... | java | public static void decodeCorrelationIdentifiers(Set<CorrelationIdentifier> correlations, String encoded) {
if (encoded != null && !encoded.trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(encoded, ",");
while (st.hasMoreTokens()) {
String token = st.nextToken(... | [
"public",
"static",
"void",
"decodeCorrelationIdentifiers",
"(",
"Set",
"<",
"CorrelationIdentifier",
">",
"correlations",
",",
"String",
"encoded",
")",
"{",
"if",
"(",
"encoded",
"!=",
"null",
"&&",
"!",
"encoded",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(... | This method processes a comma separated list of correlation identifiers, defined as a scope|value pair.
@param correlations The correlation identifier set
@param encoded The string containing the encoded correlation identifiers | [
"This",
"method",
"processes",
"a",
"comma",
"separated",
"list",
"of",
"correlation",
"identifiers",
"defined",
"as",
"a",
"scope|value",
"pair",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/server/rest/src/main/java/org/hawkular/apm/server/rest/RESTServiceUtil.java#L73-L93 |
nmdp-bioinformatics/ngs | fca/src/main/java/org/nmdp/ngs/fca/Context.java | Context.asConceptLattice | public ConceptLattice asConceptLattice(final Graph graph) {
"""
Get the concept lattice for this context.
@param graph backend
@return concept lattice
"""
ConceptLattice lattice = new ConceptLattice(graph, attributes.size());
Iterator it = this.asCrossTable().iterator();
whil... | java | public ConceptLattice asConceptLattice(final Graph graph) {
ConceptLattice lattice = new ConceptLattice(graph, attributes.size());
Iterator it = this.asCrossTable().iterator();
while(it.hasNext()) {
CrossTable.Row row = (CrossTable.Row) it.next();
lattice.insert(... | [
"public",
"ConceptLattice",
"asConceptLattice",
"(",
"final",
"Graph",
"graph",
")",
"{",
"ConceptLattice",
"lattice",
"=",
"new",
"ConceptLattice",
"(",
"graph",
",",
"attributes",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"it",
"=",
"this",
".",
"asCros... | Get the concept lattice for this context.
@param graph backend
@return concept lattice | [
"Get",
"the",
"concept",
"lattice",
"for",
"this",
"context",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/fca/src/main/java/org/nmdp/ngs/fca/Context.java#L159-L169 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_listAssociablePhones_GET | public ArrayList<OvhLinePhoneAssociable> billingAccount_line_serviceName_listAssociablePhones_GET(String billingAccount, String serviceName) throws IOException {
"""
List phones with available slots where this line can be attached
REST: GET /telephony/{billingAccount}/line/{serviceName}/listAssociablePhones
@p... | java | public ArrayList<OvhLinePhoneAssociable> billingAccount_line_serviceName_listAssociablePhones_GET(String billingAccount, String serviceName) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/listAssociablePhones";
StringBuilder sb = path(qPath, billingAccount, serviceName);
Strin... | [
"public",
"ArrayList",
"<",
"OvhLinePhoneAssociable",
">",
"billingAccount_line_serviceName_listAssociablePhones_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{... | List phones with available slots where this line can be attached
REST: GET /telephony/{billingAccount}/line/{serviceName}/listAssociablePhones
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"List",
"phones",
"with",
"available",
"slots",
"where",
"this",
"line",
"can",
"be",
"attached"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L739-L744 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeConvert | private RValue executeConvert(Expr.Cast expr, CallStack frame) {
"""
Execute a type conversion at a given point in the function or method body
@param expr
--- The expression to execute
@param frame
--- The current stack frame
@return
"""
RValue operand = executeExpression(ANY_T, expr.getOperand(), fra... | java | private RValue executeConvert(Expr.Cast expr, CallStack frame) {
RValue operand = executeExpression(ANY_T, expr.getOperand(), frame);
return operand.convert(expr.getType());
} | [
"private",
"RValue",
"executeConvert",
"(",
"Expr",
".",
"Cast",
"expr",
",",
"CallStack",
"frame",
")",
"{",
"RValue",
"operand",
"=",
"executeExpression",
"(",
"ANY_T",
",",
"expr",
".",
"getOperand",
"(",
")",
",",
"frame",
")",
";",
"return",
"operand"... | Execute a type conversion at a given point in the function or method body
@param expr
--- The expression to execute
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"type",
"conversion",
"at",
"a",
"given",
"point",
"in",
"the",
"function",
"or",
"method",
"body"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L739-L742 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java | MithraManager.executeTransactionalCommandInSeparateThread | public Object executeTransactionalCommandInSeparateThread(final TransactionalCommand command, final int retries)
throws MithraBusinessException {
"""
Use this method very carefully. It can easily lead to a deadlock.
executes the transactional command in a separate thread with a custom number of retri... | java | public Object executeTransactionalCommandInSeparateThread(final TransactionalCommand command, final int retries)
throws MithraBusinessException
{
return executeTransactionalCommandInSeparateThread(command, new TransactionStyle(this.transactionTimeout, retries));
} | [
"public",
"Object",
"executeTransactionalCommandInSeparateThread",
"(",
"final",
"TransactionalCommand",
"command",
",",
"final",
"int",
"retries",
")",
"throws",
"MithraBusinessException",
"{",
"return",
"executeTransactionalCommandInSeparateThread",
"(",
"command",
",",
"ne... | Use this method very carefully. It can easily lead to a deadlock.
executes the transactional command in a separate thread with a custom number of retries. Using a separate thread
creates a brand new transactional context and therefore this transaction will not join
the context of any outer transactions. For example, if... | [
"Use",
"this",
"method",
"very",
"carefully",
".",
"It",
"can",
"easily",
"lead",
"to",
"a",
"deadlock",
".",
"executes",
"the",
"transactional",
"command",
"in",
"a",
"separate",
"thread",
"with",
"a",
"custom",
"number",
"of",
"retries",
".",
"Using",
"a... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/MithraManager.java#L470-L474 |
m-m-m/util | xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java | XmlBeanMapper.saveXml | public void saveXml(T jaxbBean, DataResource resource) {
"""
This method saves the given {@code jaxbBean} as XML to the given {@code outputStream}. <br>
<b>ATTENTION:</b><br>
The caller of this method has to {@link OutputStream#close() close} the {@code outputStream}.
@param jaxbBean is the JAXB-bean to save ... | java | public void saveXml(T jaxbBean, DataResource resource) {
OutputStream outputStream = resource.openOutputStream();
saveXml(jaxbBean, outputStream);
} | [
"public",
"void",
"saveXml",
"(",
"T",
"jaxbBean",
",",
"DataResource",
"resource",
")",
"{",
"OutputStream",
"outputStream",
"=",
"resource",
".",
"openOutputStream",
"(",
")",
";",
"saveXml",
"(",
"jaxbBean",
",",
"outputStream",
")",
";",
"}"
] | This method saves the given {@code jaxbBean} as XML to the given {@code outputStream}. <br>
<b>ATTENTION:</b><br>
The caller of this method has to {@link OutputStream#close() close} the {@code outputStream}.
@param jaxbBean is the JAXB-bean to save as XML.
@param resource is the {@link DataResource} where to {@link Da... | [
"This",
"method",
"saves",
"the",
"given",
"{",
"@code",
"jaxbBean",
"}",
"as",
"XML",
"to",
"the",
"given",
"{",
"@code",
"outputStream",
"}",
".",
"<br",
">",
"<b",
">",
"ATTENTION",
":",
"<",
"/",
"b",
">",
"<br",
">",
"The",
"caller",
"of",
"th... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java#L316-L320 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java | MetricsCommand.printMetric | private void printMetric(String metricName, String nickName, boolean valueIsBytes) {
"""
Prints the metrics information.
@param metricName the metric name to get a metric value
@param nickName the metric name to print
@param valueIsBytes whether the metric value is bytes
"""
if (mMetricsMap == null ||... | java | private void printMetric(String metricName, String nickName, boolean valueIsBytes) {
if (mMetricsMap == null || !mMetricsMap.containsKey(metricName)) {
return;
}
MetricValue metricValue = mMetricsMap.get(metricName);
String formattedValue = valueIsBytes ? FormatUtils.getSizeFromBytes(metricValue.g... | [
"private",
"void",
"printMetric",
"(",
"String",
"metricName",
",",
"String",
"nickName",
",",
"boolean",
"valueIsBytes",
")",
"{",
"if",
"(",
"mMetricsMap",
"==",
"null",
"||",
"!",
"mMetricsMap",
".",
"containsKey",
"(",
"metricName",
")",
")",
"{",
"retur... | Prints the metrics information.
@param metricName the metric name to get a metric value
@param nickName the metric name to print
@param valueIsBytes whether the metric value is bytes | [
"Prints",
"the",
"metrics",
"information",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/MetricsCommand.java#L160-L170 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkFail | private Environment checkFail(Stmt.Fail stmt, Environment environment, EnclosingScope scope) {
"""
Type check a fail statement. The environment after a fail statement is
"bottom" because that represents an unreachable program point.
@param stmt
Statement to type check
@param environment
Determines the type ... | java | private Environment checkFail(Stmt.Fail stmt, Environment environment, EnclosingScope scope) {
return FlowTypeUtils.BOTTOM;
} | [
"private",
"Environment",
"checkFail",
"(",
"Stmt",
".",
"Fail",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"return",
"FlowTypeUtils",
".",
"BOTTOM",
";",
"}"
] | Type check a fail statement. The environment after a fail statement is
"bottom" because that represents an unreachable program point.
@param stmt
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return | [
"Type",
"check",
"a",
"fail",
"statement",
".",
"The",
"environment",
"after",
"a",
"fail",
"statement",
"is",
"bottom",
"because",
"that",
"represents",
"an",
"unreachable",
"program",
"point",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L386-L388 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Add | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
"""
Adds two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the sum of specified complex numbers.
"""
return new ComplexNumber(z1.real + z2.real, z1.im... | java | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real + z2.real, z1.imaginary + z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Add",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"+",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"+",
"z2",
".",
"imaginary",
")",... | Adds two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the sum of specified complex numbers. | [
"Adds",
"two",
"complex",
"numbers",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L241-L243 |
prestodb/presto | presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java | SemiTransactionalHiveMetastore.deleteIfExists | private static boolean deleteIfExists(FileSystem fileSystem, Path path, boolean recursive) {
"""
Attempts to remove the file or empty directory.
@return true if the location no longer exists
"""
try {
// attempt to delete the path
if (fileSystem.delete(path, recursive)) {
... | java | private static boolean deleteIfExists(FileSystem fileSystem, Path path, boolean recursive)
{
try {
// attempt to delete the path
if (fileSystem.delete(path, recursive)) {
return true;
}
// delete failed
// check if path still exist... | [
"private",
"static",
"boolean",
"deleteIfExists",
"(",
"FileSystem",
"fileSystem",
",",
"Path",
"path",
",",
"boolean",
"recursive",
")",
"{",
"try",
"{",
"// attempt to delete the path",
"if",
"(",
"fileSystem",
".",
"delete",
"(",
"path",
",",
"recursive",
")"... | Attempts to remove the file or empty directory.
@return true if the location no longer exists | [
"Attempts",
"to",
"remove",
"the",
"file",
"or",
"empty",
"directory",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java#L1837-L1856 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/SpecNodeWithRelationships.java | SpecNodeWithRelationships.addRelationshipToTarget | public void addRelationshipToTarget(final Level level, final RelationshipType type) {
"""
Add a relationship to the target level.
@param level The target level that is to be related to.
@param type The type of the relationship.
"""
final TargetRelationship relationship = new TargetRelationship(thi... | java | public void addRelationshipToTarget(final Level level, final RelationshipType type) {
final TargetRelationship relationship = new TargetRelationship(this, level, type);
levelRelationships.add(relationship);
relationships.add(relationship);
} | [
"public",
"void",
"addRelationshipToTarget",
"(",
"final",
"Level",
"level",
",",
"final",
"RelationshipType",
"type",
")",
"{",
"final",
"TargetRelationship",
"relationship",
"=",
"new",
"TargetRelationship",
"(",
"this",
",",
"level",
",",
"type",
")",
";",
"l... | Add a relationship to the target level.
@param level The target level that is to be related to.
@param type The type of the relationship. | [
"Add",
"a",
"relationship",
"to",
"the",
"target",
"level",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/SpecNodeWithRelationships.java#L107-L111 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/quasinewton/LineSearchMore94.java | LineSearchMore94.setConvergence | public LineSearchMore94 setConvergence(double ftol, double gtol, double xtol) {
"""
Configures the line search.
@param ftol Tolerance for sufficient decrease. ftol {@code >} 0. Smaller value for loose tolerance. Try 1e-4
@param gtol Tolerance for curvature condition. gtol ≥ 0. Larger value for loose tolera... | java | public LineSearchMore94 setConvergence(double ftol, double gtol, double xtol) {
if( ftol < 0 )
throw new IllegalArgumentException("ftol must be >= 0 ");
if( gtol < 0 )
throw new IllegalArgumentException("gtol must be >= 0 ");
if( xtol < 0 )
throw new IllegalArgumentException("xtol must be >= 0 ");
thi... | [
"public",
"LineSearchMore94",
"setConvergence",
"(",
"double",
"ftol",
",",
"double",
"gtol",
",",
"double",
"xtol",
")",
"{",
"if",
"(",
"ftol",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"ftol must be >= 0 \"",
")",
";",
"if",
"(",
"... | Configures the line search.
@param ftol Tolerance for sufficient decrease. ftol {@code >} 0. Smaller value for loose tolerance. Try 1e-4
@param gtol Tolerance for curvature condition. gtol ≥ 0. Larger value for loose tolerance. Try 0.9
@param xtol Relative tolerance for acceptable step. xtol ≥ 0. Larger value ... | [
"Configures",
"the",
"line",
"search",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/quasinewton/LineSearchMore94.java#L124-L136 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.shiftRows | public static int shiftRows(Sheet sheet, List<?> list, int templateRowNum) {
"""
插入新的行(向下移动表格中的行),方便写入数据。
@param sheet 表单页。
@param list 写入JavaBean列表。
@param templateRowNum 模板行号。
@return JavaBean列表大小。
"""
val itemSize = list == null ? 0 : list.size();
return shiftRows(sh... | java | public static int shiftRows(Sheet sheet, List<?> list, int templateRowNum) {
val itemSize = list == null ? 0 : list.size();
return shiftRows(sheet, itemSize, templateRowNum);
} | [
"public",
"static",
"int",
"shiftRows",
"(",
"Sheet",
"sheet",
",",
"List",
"<",
"?",
">",
"list",
",",
"int",
"templateRowNum",
")",
"{",
"val",
"itemSize",
"=",
"list",
"==",
"null",
"?",
"0",
":",
"list",
".",
"size",
"(",
")",
";",
"return",
"s... | 插入新的行(向下移动表格中的行),方便写入数据。
@param sheet 表单页。
@param list 写入JavaBean列表。
@param templateRowNum 模板行号。
@return JavaBean列表大小。 | [
"插入新的行(向下移动表格中的行),方便写入数据。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L116-L119 |
elibom/jogger | src/main/java/com/elibom/jogger/http/servlet/multipart/Streams.java | Streams.checkFileName | public static String checkFileName(String pFileName) {
"""
Checks, whether the given file name is valid in the sense, that it doesn't contain any NUL characters. If the
file name is valid, it will be returned without any modifications. Otherwise, an {@link InvalidFileNameException}
is raised.
@param pFileName... | java | public static String checkFileName(String pFileName) {
if (pFileName != null && pFileName.indexOf('\u0000') != -1) {
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < pFileName.length(); i++) {
char c = pFileName.charAt(i);
switch (c) {
case 0:
sb.append("\\0");
break;
d... | [
"public",
"static",
"String",
"checkFileName",
"(",
"String",
"pFileName",
")",
"{",
"if",
"(",
"pFileName",
"!=",
"null",
"&&",
"pFileName",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"final",
"StringBuffer",
"sb",
"=",
"new",
"Stri... | Checks, whether the given file name is valid in the sense, that it doesn't contain any NUL characters. If the
file name is valid, it will be returned without any modifications. Otherwise, an {@link InvalidFileNameException}
is raised.
@param pFileName The file name to check
@return Unmodified file name, if valid.
@th... | [
"Checks",
"whether",
"the",
"given",
"file",
"name",
"is",
"valid",
"in",
"the",
"sense",
"that",
"it",
"doesn",
"t",
"contain",
"any",
"NUL",
"characters",
".",
"If",
"the",
"file",
"name",
"is",
"valid",
"it",
"will",
"be",
"returned",
"without",
"any"... | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/http/servlet/multipart/Streams.java#L159-L178 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/Setting.java | Setting.set | public Setting set(String group, String key, String value) {
"""
将键值对加入到对应分组中
@param group 分组
@param key 键
@param value 值
@return 此key之前存在的值,如果没有返回null
"""
this.put(group, key, value);
return this;
} | java | public Setting set(String group, String key, String value) {
this.put(group, key, value);
return this;
} | [
"public",
"Setting",
"set",
"(",
"String",
"group",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"put",
"(",
"group",
",",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | 将键值对加入到对应分组中
@param group 分组
@param key 键
@param value 值
@return 此key之前存在的值,如果没有返回null | [
"将键值对加入到对应分组中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/Setting.java#L510-L513 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/CoreAdapterFactory.java | CoreAdapterFactory.getAdapter | protected static <AdapterType> AdapterType getAdapter(ResourceHandle resourceHandle, Class<AdapterType> type) {
"""
Handles <code>resourceHandle.adaptTo(ResourceHandle.class)</code>.
@param resourceHandle Object to adapt
@param type target type
@return original Object
"""
if (type == ResourceHandl... | java | protected static <AdapterType> AdapterType getAdapter(ResourceHandle resourceHandle, Class<AdapterType> type) {
if (type == ResourceHandle.class) {
return type.cast(resourceHandle);
}
log.info("Unable to adapt resource on {} to type {}", resourceHandle.getPath(), type.getName());
... | [
"protected",
"static",
"<",
"AdapterType",
">",
"AdapterType",
"getAdapter",
"(",
"ResourceHandle",
"resourceHandle",
",",
"Class",
"<",
"AdapterType",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"ResourceHandle",
".",
"class",
")",
"{",
"return",
"type",
... | Handles <code>resourceHandle.adaptTo(ResourceHandle.class)</code>.
@param resourceHandle Object to adapt
@param type target type
@return original Object | [
"Handles",
"<code",
">",
"resourceHandle",
".",
"adaptTo",
"(",
"ResourceHandle",
".",
"class",
")",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/CoreAdapterFactory.java#L56-L62 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/exceptions/DataStoreAdapterException.java | DataStoreAdapterException.formatMessage | private static final String formatMessage(String resourceKey, Throwable exception, Object... formatArguments) {
"""
Utility method that preserves existing behavior of appending SQL State/error code to a translated message.
"""
String message = Tr.formatMessage(tc, resourceKey, formatArguments);
... | java | private static final String formatMessage(String resourceKey, Throwable exception, Object... formatArguments) {
String message = Tr.formatMessage(tc, resourceKey, formatArguments);
if (exception instanceof SQLException) {
SQLException sqlX = (SQLException) exception;
StringBuilde... | [
"private",
"static",
"final",
"String",
"formatMessage",
"(",
"String",
"resourceKey",
",",
"Throwable",
"exception",
",",
"Object",
"...",
"formatArguments",
")",
"{",
"String",
"message",
"=",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"resourceKey",
",",
"... | Utility method that preserves existing behavior of appending SQL State/error code to a translated message. | [
"Utility",
"method",
"that",
"preserves",
"existing",
"behavior",
"of",
"appending",
"SQL",
"State",
"/",
"error",
"code",
"to",
"a",
"translated",
"message",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/exceptions/DataStoreAdapterException.java#L171-L180 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.getErrorAndRequiredClass | public String getErrorAndRequiredClass(UIInput input, String clientId) {
"""
Yields the value of the required and error level CSS class.
@param input
must not be null
@param clientId
must not be null
@return can never be null
"""
String styleClass = "";
if (BsfUtils.isLegacyFeedbackClassesEnabled(... | java | public String getErrorAndRequiredClass(UIInput input, String clientId) {
String styleClass = "";
if (BsfUtils.isLegacyFeedbackClassesEnabled()) {
styleClass = FacesMessages.getErrorSeverityClass(clientId);
}
if (input.isRequired()) {
styleClass += " bf-required";
} else {
Annotation[] readAnn... | [
"public",
"String",
"getErrorAndRequiredClass",
"(",
"UIInput",
"input",
",",
"String",
"clientId",
")",
"{",
"String",
"styleClass",
"=",
"\"\"",
";",
"if",
"(",
"BsfUtils",
".",
"isLegacyFeedbackClassesEnabled",
"(",
")",
")",
"{",
"styleClass",
"=",
"FacesMes... | Yields the value of the required and error level CSS class.
@param input
must not be null
@param clientId
must not be null
@return can never be null | [
"Yields",
"the",
"value",
"of",
"the",
"required",
"and",
"error",
"level",
"CSS",
"class",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L180-L201 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getArgumentType | public HeadedSyntacticCategory getArgumentType() {
"""
Gets the syntactic type and semantic variable assignments to the
argument type of this category.
@return
"""
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables,... | java | public HeadedSyntacticCategory getArgumentType() {
SyntacticCategory argumentSyntax = syntacticCategory.getArgument();
int[] argumentSemantics = ArrayUtils.copyOfRange(semanticVariables, rootIndex + 1, semanticVariables.length);
int argumentRoot = argumentSyntax.getNumReturnSubcategories();
return new H... | [
"public",
"HeadedSyntacticCategory",
"getArgumentType",
"(",
")",
"{",
"SyntacticCategory",
"argumentSyntax",
"=",
"syntacticCategory",
".",
"getArgument",
"(",
")",
";",
"int",
"[",
"]",
"argumentSemantics",
"=",
"ArrayUtils",
".",
"copyOfRange",
"(",
"semanticVariab... | Gets the syntactic type and semantic variable assignments to the
argument type of this category.
@return | [
"Gets",
"the",
"syntactic",
"type",
"and",
"semantic",
"variable",
"assignments",
"to",
"the",
"argument",
"type",
"of",
"this",
"category",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L247-L252 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getPersistedItemData | protected ItemData getPersistedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException {
"""
Get persisted ItemData.
@param parentData
parent
@param name
Item name
@param itemType
item type
@return ItemData
@throws RepositoryException
error
"""
ItemDa... | java | protected ItemData getPersistedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
ItemData data = super.getItemData(parentData, name, itemType);
if (cache.isEnabled())
{
if (data == null)
{
if (itemType == ItemType.NODE... | [
"protected",
"ItemData",
"getPersistedItemData",
"(",
"NodeData",
"parentData",
",",
"QPathEntry",
"name",
",",
"ItemType",
"itemType",
")",
"throws",
"RepositoryException",
"{",
"ItemData",
"data",
"=",
"super",
".",
"getItemData",
"(",
"parentData",
",",
"name",
... | Get persisted ItemData.
@param parentData
parent
@param name
Item name
@param itemType
item type
@return ItemData
@throws RepositoryException
error | [
"Get",
"persisted",
"ItemData",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1975-L1998 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java | WisdomExecutor.executeInBackground | public void executeInBackground(AbstractWisdomMojo mojo) throws MojoExecutionException {
"""
Launches the Wisdom server in background using the {@literal chameleon.sh} scripts.
This method works only on Linux and Mac OS X.
@param mojo the mojo
@throws MojoExecutionException if the Wisdom instance cannot be st... | java | public void executeInBackground(AbstractWisdomMojo mojo) throws MojoExecutionException {
File script = new File(mojo.getWisdomRootDirectory(), "chameleon.sh");
if (!script.isFile()) {
throw new MojoExecutionException("The 'chameleon.sh' file does not exist in " + mojo
.ge... | [
"public",
"void",
"executeInBackground",
"(",
"AbstractWisdomMojo",
"mojo",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"script",
"=",
"new",
"File",
"(",
"mojo",
".",
"getWisdomRootDirectory",
"(",
")",
",",
"\"chameleon.sh\"",
")",
";",
"if",
"(",
"!... | Launches the Wisdom server in background using the {@literal chameleon.sh} scripts.
This method works only on Linux and Mac OS X.
@param mojo the mojo
@throws MojoExecutionException if the Wisdom instance cannot be started. | [
"Launches",
"the",
"Wisdom",
"server",
"in",
"background",
"using",
"the",
"{",
"@literal",
"chameleon",
".",
"sh",
"}",
"scripts",
".",
"This",
"method",
"works",
"only",
"on",
"Linux",
"and",
"Mac",
"OS",
"X",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java#L56-L81 |
samskivert/samskivert | src/main/java/com/samskivert/util/RandomUtil.java | RandomUtil.pickRandom | public static <T> T pickRandom (T[] values, T skip) {
"""
Picks a random object from the supplied array of values, not including the specified skip
object as a possible selection (equality with the skipped object is referential rather than
via {@link Object#equals}). The element to be skipped must exist in the a... | java | public static <T> T pickRandom (T[] values, T skip)
{
if (values == null || values.length < 2) {
return null;
}
int index = getInt(values.length-1);
for (int ii = 0; ii <= index; ii++) {
if (values[ii] == skip) {
index++;
}
... | [
"public",
"static",
"<",
"T",
">",
"T",
"pickRandom",
"(",
"T",
"[",
"]",
"values",
",",
"T",
"skip",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"length",
"<",
"2",
")",
"{",
"return",
"null",
";",
"}",
"int",
"index",
"=... | Picks a random object from the supplied array of values, not including the specified skip
object as a possible selection (equality with the skipped object is referential rather than
via {@link Object#equals}). The element to be skipped must exist in the array exactly
once. Even weight is given to all elements of the ar... | [
"Picks",
"a",
"random",
"object",
"from",
"the",
"supplied",
"array",
"of",
"values",
"not",
"including",
"the",
"specified",
"skip",
"object",
"as",
"a",
"possible",
"selection",
"(",
"equality",
"with",
"the",
"skipped",
"object",
"is",
"referential",
"rathe... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/RandomUtil.java#L297-L309 |
belaban/JGroups | src/org/jgroups/protocols/pbcast/Merger.java | Merger.handleMergeView | public void handleMergeView(final MergeData data, final MergeId merge_id) {
"""
If merge_id is not equal to this.merge_id then discard. Else cast the view/digest to all members of this group.
"""
if(!matchMergeId(merge_id)) {
log.trace("%s: merge_ids (mine: %s, received: %s) don't match; me... | java | public void handleMergeView(final MergeData data, final MergeId merge_id) {
if(!matchMergeId(merge_id)) {
log.trace("%s: merge_ids (mine: %s, received: %s) don't match; merge view %s is discarded",
gms.local_addr, this.merge_id, merge_id, data.view.getViewId());
ret... | [
"public",
"void",
"handleMergeView",
"(",
"final",
"MergeData",
"data",
",",
"final",
"MergeId",
"merge_id",
")",
"{",
"if",
"(",
"!",
"matchMergeId",
"(",
"merge_id",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"%s: merge_ids (mine: %s, received: %s) don't match; ... | If merge_id is not equal to this.merge_id then discard. Else cast the view/digest to all members of this group. | [
"If",
"merge_id",
"is",
"not",
"equal",
"to",
"this",
".",
"merge_id",
"then",
"discard",
".",
"Else",
"cast",
"the",
"view",
"/",
"digest",
"to",
"all",
"members",
"of",
"this",
"group",
"."
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/pbcast/Merger.java#L135-L157 |
walkmod/walkmod-core | src/main/java/org/walkmod/AsciiTableWidth.java | AsciiTableWidth.add | public AsciiTableWidth add(final int minWidth, final int maxWidth) {
"""
Creates a new width object.
@param minWidth minimum column width as number of characters
@param maxWidth maximum column width as number of characters
@return self to allow for chaining
"""
this.minWidths = ArrayUtils.add(this.minWidt... | java | public AsciiTableWidth add(final int minWidth, final int maxWidth) {
this.minWidths = ArrayUtils.add(this.minWidths, minWidth);
this.maxWidths = ArrayUtils.add(this.maxWidths, maxWidth);
return this;
} | [
"public",
"AsciiTableWidth",
"add",
"(",
"final",
"int",
"minWidth",
",",
"final",
"int",
"maxWidth",
")",
"{",
"this",
".",
"minWidths",
"=",
"ArrayUtils",
".",
"add",
"(",
"this",
".",
"minWidths",
",",
"minWidth",
")",
";",
"this",
".",
"maxWidths",
"... | Creates a new width object.
@param minWidth minimum column width as number of characters
@param maxWidth maximum column width as number of characters
@return self to allow for chaining | [
"Creates",
"a",
"new",
"width",
"object",
"."
] | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/AsciiTableWidth.java#L43-L47 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_availableVersions_GET | public ArrayList<OvhAvailableVersionEnum> serviceName_availableVersions_GET(String serviceName) throws IOException {
"""
Get the availables versions for this private database
REST: GET /hosting/privateDatabase/{serviceName}/availableVersions
@param serviceName [required] The internal name of your private datab... | java | public ArrayList<OvhAvailableVersionEnum> serviceName_availableVersions_GET(String serviceName) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/availableVersions";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(res... | [
"public",
"ArrayList",
"<",
"OvhAvailableVersionEnum",
">",
"serviceName_availableVersions_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{serviceName}/availableVersions\"",
";",
"StringBuilder",
"sb",
... | Get the availables versions for this private database
REST: GET /hosting/privateDatabase/{serviceName}/availableVersions
@param serviceName [required] The internal name of your private database | [
"Get",
"the",
"availables",
"versions",
"for",
"this",
"private",
"database"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L886-L891 |
stackify/stackify-metrics | src/main/java/com/stackify/metric/impl/MetricMonitorService.java | MetricMonitorService.getMetricInfo | private int getMetricInfo(final MetricIdentity identity, final AppIdentity appIdentity) throws IOException, HttpException {
"""
Gets the monitor id for this metric
@param identity The metric identity
@return The monitor id (optional)
@throws IOException
@throws HttpException
"""
Preconditions.checkNotNul... | java | private int getMetricInfo(final MetricIdentity identity, final AppIdentity appIdentity) throws IOException, HttpException {
Preconditions.checkNotNull(identity);
Preconditions.checkNotNull(appIdentity);
// build the json objects
JsonGetMetricInfoRequest.Builder requestBuilder = JsonGetMetricInfoRequest.ne... | [
"private",
"int",
"getMetricInfo",
"(",
"final",
"MetricIdentity",
"identity",
",",
"final",
"AppIdentity",
"appIdentity",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"identity",
")",
";",
"Preconditions",
".",... | Gets the monitor id for this metric
@param identity The metric identity
@return The monitor id (optional)
@throws IOException
@throws HttpException | [
"Gets",
"the",
"monitor",
"id",
"for",
"this",
"metric"
] | train | https://github.com/stackify/stackify-metrics/blob/6827d516085e4b29a3e54da963eebb2955822a5c/src/main/java/com/stackify/metric/impl/MetricMonitorService.java#L161-L203 |
EdwardRaff/JSAT | JSAT/src/jsat/math/optimization/NelderMead.java | NelderMead.setReflection | public void setReflection(double reflection) {
"""
Sets the reflection constant, which must be greater than 0
@param reflection the reflection constant
"""
if(reflection <=0 || Double.isNaN(reflection) || Double.isInfinite(reflection) )
throw new ArithmeticException("Reflection constant mu... | java | public void setReflection(double reflection)
{
if(reflection <=0 || Double.isNaN(reflection) || Double.isInfinite(reflection) )
throw new ArithmeticException("Reflection constant must be > 0, not " + reflection);
this.reflection = reflection;
} | [
"public",
"void",
"setReflection",
"(",
"double",
"reflection",
")",
"{",
"if",
"(",
"reflection",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"reflection",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"reflection",
")",
")",
"throw",
"new",
"ArithmeticE... | Sets the reflection constant, which must be greater than 0
@param reflection the reflection constant | [
"Sets",
"the",
"reflection",
"constant",
"which",
"must",
"be",
"greater",
"than",
"0"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/NelderMead.java#L61-L66 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogramLogReader.java | AbstractHistogramLogReader.nextIntervalHistogram | public EncodableHistogram nextIntervalHistogram(final Double startTimeSec,
final Double endTimeSec) {
"""
Read the next interval histogram from the log, if interval falls within a time range.
<p>
Returns a histogram object if an interval line was found with an
associat... | java | public EncodableHistogram nextIntervalHistogram(final Double startTimeSec,
final Double endTimeSec) {
return nextIntervalHistogram(startTimeSec, endTimeSec, false);
} | [
"public",
"EncodableHistogram",
"nextIntervalHistogram",
"(",
"final",
"Double",
"startTimeSec",
",",
"final",
"Double",
"endTimeSec",
")",
"{",
"return",
"nextIntervalHistogram",
"(",
"startTimeSec",
",",
"endTimeSec",
",",
"false",
")",
";",
"}"
] | Read the next interval histogram from the log, if interval falls within a time range.
<p>
Returns a histogram object if an interval line was found with an
associated start timestamp value that falls between startTimeSec and
endTimeSec, or null if no such interval line is found. Note that
the range is assumed to be in s... | [
"Read",
"the",
"next",
"interval",
"histogram",
"from",
"the",
"log",
"if",
"interval",
"falls",
"within",
"a",
"time",
"range",
".",
"<p",
">",
"Returns",
"a",
"histogram",
"object",
"if",
"an",
"interval",
"line",
"was",
"found",
"with",
"an",
"associate... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogramLogReader.java#L101-L104 |
aws/aws-sdk-java | aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/PropertyGroup.java | PropertyGroup.withPropertyMap | public PropertyGroup withPropertyMap(java.util.Map<String, String> propertyMap) {
"""
<p>
Describes the value of an application execution property key-value pair.
</p>
@param propertyMap
Describes the value of an application execution property key-value pair.
@return Returns a reference to this object so th... | java | public PropertyGroup withPropertyMap(java.util.Map<String, String> propertyMap) {
setPropertyMap(propertyMap);
return this;
} | [
"public",
"PropertyGroup",
"withPropertyMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"propertyMap",
")",
"{",
"setPropertyMap",
"(",
"propertyMap",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Describes the value of an application execution property key-value pair.
</p>
@param propertyMap
Describes the value of an application execution property key-value pair.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Describes",
"the",
"value",
"of",
"an",
"application",
"execution",
"property",
"key",
"-",
"value",
"pair",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisanalyticsv2/src/main/java/com/amazonaws/services/kinesisanalyticsv2/model/PropertyGroup.java#L119-L122 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java | DefaultApplicationObjectConfigurer.configureColor | protected void configureColor(ColorConfigurable configurable, String objectName) {
"""
Sets the foreground and background colours of the given object.
Use the following message codes:
<pre>
<objectName>.foreground
<objectName>.background
</pre>
@param configurable The object to be configured.... | java | protected void configureColor(ColorConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
Color color = loadColor(objectName + ".foreground");
if (color != null)
configurable.setForeground(color);
color = loadColor(objectNam... | [
"protected",
"void",
"configureColor",
"(",
"ColorConfigurable",
"configurable",
",",
"String",
"objectName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"configurable",
",",
"\"configurable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"objectName",
",",
"\"objectNam... | Sets the foreground and background colours of the given object.
Use the following message codes:
<pre>
<objectName>.foreground
<objectName>.background
</pre>
@param configurable The object to be configured. Must not be null.
@param objectName The name of the configurable object, unique within the
applicat... | [
"Sets",
"the",
"foreground",
"and",
"background",
"colours",
"of",
"the",
"given",
"object",
".",
"Use",
"the",
"following",
"message",
"codes",
":"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L399-L410 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeDoubleObjDesc | public static Double decodeDoubleObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a Double object from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Double object or null
"""
long bits = DataDecoder.d... | java | public static Double decodeDoubleObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
long bits = DataDecoder.decodeDoubleBits(src, srcOffset);
if (bits >= 0) {
bits ^= 0x7fffffffffffffffL;
}
return bits == 0x7fffffffffffffffL ? null : Doubl... | [
"public",
"static",
"Double",
"decodeDoubleObjDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"long",
"bits",
"=",
"DataDecoder",
".",
"decodeDoubleBits",
"(",
"src",
",",
"srcOffset",
")",
";",
"if... | Decodes a Double object from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Double object or null | [
"Decodes",
"a",
"Double",
"object",
"from",
"exactly",
"8",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L327-L335 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java | PreConditionException.validateNull | public static void validateNull( Object object, String identifier )
throws PreConditionException {
"""
Validates that the object is null.
@param object The object to be validated.
@param identifier The name of the object.
@throws PreConditionException if the object is not null.
"""
i... | java | public static void validateNull( Object object, String identifier )
throws PreConditionException
{
if( object == null )
{
return;
}
throw new PreConditionException( identifier + " was NOT NULL." );
} | [
"public",
"static",
"void",
"validateNull",
"(",
"Object",
"object",
",",
"String",
"identifier",
")",
"throws",
"PreConditionException",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"PreConditionException",
"(",
"ident... | Validates that the object is null.
@param object The object to be validated.
@param identifier The name of the object.
@throws PreConditionException if the object is not null. | [
"Validates",
"that",
"the",
"object",
"is",
"null",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java#L64-L72 |
jenkinsci/jenkins | core/src/main/java/hudson/model/queue/QueueTaskDispatcher.java | QueueTaskDispatcher.canTake | public @CheckForNull CauseOfBlockage canTake(Node node, BuildableItem item) {
"""
Called when {@link Queue} is deciding where to execute the given task.
<p>
Implementations can return null to indicate that the assignment is fine, or it can return
a non-null instance to block the execution of the task on the g... | java | public @CheckForNull CauseOfBlockage canTake(Node node, BuildableItem item) {
return canTake(node,item.task); // backward compatible behaviour
} | [
"public",
"@",
"CheckForNull",
"CauseOfBlockage",
"canTake",
"(",
"Node",
"node",
",",
"BuildableItem",
"item",
")",
"{",
"return",
"canTake",
"(",
"node",
",",
"item",
".",
"task",
")",
";",
"// backward compatible behaviour",
"}"
] | Called when {@link Queue} is deciding where to execute the given task.
<p>
Implementations can return null to indicate that the assignment is fine, or it can return
a non-null instance to block the execution of the task on the given node.
<p>
Queue doesn't remember/cache the response from dispatchers, and instead it'... | [
"Called",
"when",
"{",
"@link",
"Queue",
"}",
"is",
"deciding",
"where",
"to",
"execute",
"the",
"given",
"task",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/QueueTaskDispatcher.java#L101-L103 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java | JaxWsUtils.getAnnotationInfoFromClass | private static AnnotationInfo getAnnotationInfoFromClass(ClassInfo classInfo, String attribute) {
"""
Get the annotation info from current class info,
First get @webservice, second get from @webserviceprovider
@param classInfo
@param attribute
@return
"""
AnnotationInfo annotationInfo = classInfo... | java | private static AnnotationInfo getAnnotationInfoFromClass(ClassInfo classInfo, String attribute) {
AnnotationInfo annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME);
if (annotationInfo == null) {
annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SER... | [
"private",
"static",
"AnnotationInfo",
"getAnnotationInfoFromClass",
"(",
"ClassInfo",
"classInfo",
",",
"String",
"attribute",
")",
"{",
"AnnotationInfo",
"annotationInfo",
"=",
"classInfo",
".",
"getAnnotation",
"(",
"JaxWsConstants",
".",
"WEB_SERVICE_ANNOTATION_NAME",
... | Get the annotation info from current class info,
First get @webservice, second get from @webserviceprovider
@param classInfo
@param attribute
@return | [
"Get",
"the",
"annotation",
"info",
"from",
"current",
"class",
"info",
"First",
"get",
"@webservice",
"second",
"get",
"from",
"@webserviceprovider"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L112-L123 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.concatMapMaybeDelayError | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd, int prefetch) {
"""
Maps the upstream items into {@link MaybeS... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Flowable",
"<",
"R",
">",
"concatMapMaybeDelayError",
"(",
"Fun... | Maps the upstream items into {@link MaybeSource}s and subscribes to them one after the
other terminates, emits their success value if available and optionally delaying all errors
till both this {@code Flowable} and all inner {@code MaybeSource}s terminate.
<p>
<img width="640" height="305" src="https://raw.github.com/w... | [
"Maps",
"the",
"upstream",
"items",
"into",
"{"
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L7725-L7732 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/DocumentTranslator.java | DocumentTranslator.isLocked | protected boolean isLocked( EditableDocument doc ) {
"""
Checks if the given document is already locked
@param doc the document
@return true if the change was made successfully, or false otherwise
"""
return hasProperty(doc, JcrLexicon.LOCK_OWNER) || hasProperty(doc, JcrLexicon.LOCK_IS_DEEP);
} | java | protected boolean isLocked( EditableDocument doc ) {
return hasProperty(doc, JcrLexicon.LOCK_OWNER) || hasProperty(doc, JcrLexicon.LOCK_IS_DEEP);
} | [
"protected",
"boolean",
"isLocked",
"(",
"EditableDocument",
"doc",
")",
"{",
"return",
"hasProperty",
"(",
"doc",
",",
"JcrLexicon",
".",
"LOCK_OWNER",
")",
"||",
"hasProperty",
"(",
"doc",
",",
"JcrLexicon",
".",
"LOCK_IS_DEEP",
")",
";",
"}"
] | Checks if the given document is already locked
@param doc the document
@return true if the change was made successfully, or false otherwise | [
"Checks",
"if",
"the",
"given",
"document",
"is",
"already",
"locked"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/DocumentTranslator.java#L1449-L1451 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DBAssert.java | DBAssert.assertTableExistence | static void assertTableExistence(CallInfo callInfo, DB db, String tableName, boolean expected) {
"""
Assert if table exists or not.
@param callInfo Call info.
@param db Database.
@param tableName Table.
@param expected Expect if table exists or not.
"""
boolean actual = tableExists(callInfo, db, tabl... | java | static void assertTableExistence(CallInfo callInfo, DB db, String tableName, boolean expected) {
boolean actual = tableExists(callInfo, db, tableName);
SimpleAssertion assertion = new SimpleAssertion(null, expected, actual);
db.log(callInfo, assertion);
if (!assertion.passed()) {
throw new DBAsser... | [
"static",
"void",
"assertTableExistence",
"(",
"CallInfo",
"callInfo",
",",
"DB",
"db",
",",
"String",
"tableName",
",",
"boolean",
"expected",
")",
"{",
"boolean",
"actual",
"=",
"tableExists",
"(",
"callInfo",
",",
"db",
",",
"tableName",
")",
";",
"Simple... | Assert if table exists or not.
@param callInfo Call info.
@param db Database.
@param tableName Table.
@param expected Expect if table exists or not. | [
"Assert",
"if",
"table",
"exists",
"or",
"not",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBAssert.java#L147-L154 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java | GroupPermissionDao.deleteByRootComponentIdAndGroupId | public int deleteByRootComponentIdAndGroupId(DbSession dbSession, long rootComponentId, @Nullable Integer groupId) {
"""
Delete all permissions of the specified group (group "AnyOne" if {@code groupId} is {@code null}) for the specified
component.
"""
return mapper(dbSession).deleteByRootComponentIdAndGro... | java | public int deleteByRootComponentIdAndGroupId(DbSession dbSession, long rootComponentId, @Nullable Integer groupId) {
return mapper(dbSession).deleteByRootComponentIdAndGroupId(rootComponentId, groupId);
} | [
"public",
"int",
"deleteByRootComponentIdAndGroupId",
"(",
"DbSession",
"dbSession",
",",
"long",
"rootComponentId",
",",
"@",
"Nullable",
"Integer",
"groupId",
")",
"{",
"return",
"mapper",
"(",
"dbSession",
")",
".",
"deleteByRootComponentIdAndGroupId",
"(",
"rootCo... | Delete all permissions of the specified group (group "AnyOne" if {@code groupId} is {@code null}) for the specified
component. | [
"Delete",
"all",
"permissions",
"of",
"the",
"specified",
"group",
"(",
"group",
"AnyOne",
"if",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java#L155-L157 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java | DeferredAttr.attribSpeculative | JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
"""
Routine that performs speculative type-checking; the input AST node is
cloned (to avoid side-effects cause by Attr) and compiler state is
restored after type-checking. All diagnostics (but critical ones) are
disabled during... | java | JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
return attribSpeculative(tree, env, resultInfo, treeCopier,
(newTree)->new DeferredAttrDiagHandler(log, newTree), null);
} | [
"JCTree",
"attribSpeculative",
"(",
"JCTree",
"tree",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"ResultInfo",
"resultInfo",
")",
"{",
"return",
"attribSpeculative",
"(",
"tree",
",",
"env",
",",
"resultInfo",
",",
"treeCopier",
",",
"(",
"newTree",
")... | Routine that performs speculative type-checking; the input AST node is
cloned (to avoid side-effects cause by Attr) and compiler state is
restored after type-checking. All diagnostics (but critical ones) are
disabled during speculative type-checking. | [
"Routine",
"that",
"performs",
"speculative",
"type",
"-",
"checking",
";",
"the",
"input",
"AST",
"node",
"is",
"cloned",
"(",
"to",
"avoid",
"side",
"-",
"effects",
"cause",
"by",
"Attr",
")",
"and",
"compiler",
"state",
"is",
"restored",
"after",
"type"... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java#L471-L474 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/DMinMax.java | DMinMax.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or can't be parsed as a Double
@throws SuperCsvConstraintViolationException
if value doesn't lie between min and max (inclusive)
"""
validateInputNotNull(value... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final Double result;
if( value instanceof Double ) {
result = (Double) value;
} else {
try {
result = Double.parseDouble(value.toString());
}
catch(final NumberFormatException e) {
... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"final",
"Double",
"result",
";",
"if",
"(",
"value",
"instanceof",
"Double",
")"... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or can't be parsed as a Double
@throws SuperCsvConstraintViolationException
if value doesn't lie between min and max (inclusive) | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/DMinMax.java#L133-L156 |
jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java | TCollectorUDPWriter.sendOutput | @Override
protected void sendOutput(String metricLine) throws IOException {
"""
Send a single metric to TCollector.
@param metricLine - the line containing the metric name, value, and tags for a single metric; excludes the
"put" keyword expected by OpenTSDB and the trailing newline character.
"""
Datagr... | java | @Override
protected void sendOutput(String metricLine) throws IOException {
DatagramPacket packet;
byte[] data;
data = metricLine.getBytes("UTF-8");
packet = new DatagramPacket(data, 0, data.length, this.address);
this.dgSocket.send(packet);
} | [
"@",
"Override",
"protected",
"void",
"sendOutput",
"(",
"String",
"metricLine",
")",
"throws",
"IOException",
"{",
"DatagramPacket",
"packet",
";",
"byte",
"[",
"]",
"data",
";",
"data",
"=",
"metricLine",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
";",
"packe... | Send a single metric to TCollector.
@param metricLine - the line containing the metric name, value, and tags for a single metric; excludes the
"put" keyword expected by OpenTSDB and the trailing newline character. | [
"Send",
"a",
"single",
"metric",
"to",
"TCollector",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/TCollectorUDPWriter.java#L128-L137 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/io/DataIO.java | DataIO.getInt | public static int getInt(CSProperties p, String key) throws ParseException {
"""
Get a value as integer.
@param p
@param key
@return a property value as integer.
@throws java.text.ParseException
"""
String val = p.get(key).toString();
if (val == null) {
throw new IllegalArgument... | java | public static int getInt(CSProperties p, String key) throws ParseException {
String val = p.get(key).toString();
if (val == null) {
throw new IllegalArgumentException(key);
}
return Integer.parseInt(val);
} | [
"public",
"static",
"int",
"getInt",
"(",
"CSProperties",
"p",
",",
"String",
"key",
")",
"throws",
"ParseException",
"{",
"String",
"val",
"=",
"p",
".",
"get",
"(",
"key",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
... | Get a value as integer.
@param p
@param key
@return a property value as integer.
@throws java.text.ParseException | [
"Get",
"a",
"value",
"as",
"integer",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L978-L984 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java | BufferUtil.copy | public static ByteBuffer copy(ByteBuffer src, ByteBuffer dest, int length) {
"""
拷贝ByteBuffer
@param src 源ByteBuffer
@param dest 目标ByteBuffer
@param length 长度
@return 目标ByteBuffer
"""
return copy(src, src.position(), dest, dest.position(), length);
} | java | public static ByteBuffer copy(ByteBuffer src, ByteBuffer dest, int length) {
return copy(src, src.position(), dest, dest.position(), length);
} | [
"public",
"static",
"ByteBuffer",
"copy",
"(",
"ByteBuffer",
"src",
",",
"ByteBuffer",
"dest",
",",
"int",
"length",
")",
"{",
"return",
"copy",
"(",
"src",
",",
"src",
".",
"position",
"(",
")",
",",
"dest",
",",
"dest",
".",
"position",
"(",
")",
"... | 拷贝ByteBuffer
@param src 源ByteBuffer
@param dest 目标ByteBuffer
@param length 长度
@return 目标ByteBuffer | [
"拷贝ByteBuffer"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java#L51-L53 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam/src/main/java/org/ops4j/pax/exam/MavenUtils.java | MavenUtils.asInProject | public static MavenArtifactUrlReference.VersionResolver asInProject() {
"""
Utility method for creating an artifact version resolver that will get the version out of
maven project.
@return version resolver
"""
return new MavenArtifactUrlReference.VersionResolver() {
@Override
... | java | public static MavenArtifactUrlReference.VersionResolver asInProject() {
return new MavenArtifactUrlReference.VersionResolver() {
@Override
public String getVersion(final String groupId, final String artifactId) {
return getArtifactVersion(groupId, artifactId);
... | [
"public",
"static",
"MavenArtifactUrlReference",
".",
"VersionResolver",
"asInProject",
"(",
")",
"{",
"return",
"new",
"MavenArtifactUrlReference",
".",
"VersionResolver",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"getVersion",
"(",
"final",
"String",
"gr... | Utility method for creating an artifact version resolver that will get the version out of
maven project.
@return version resolver | [
"Utility",
"method",
"for",
"creating",
"an",
"artifact",
"version",
"resolver",
"that",
"will",
"get",
"the",
"version",
"out",
"of",
"maven",
"project",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam/src/main/java/org/ops4j/pax/exam/MavenUtils.java#L104-L113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.