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 |
|---|---|---|---|---|---|---|---|---|---|---|
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray._fromArray | private static JSONArray _fromArray( boolean[] array, JsonConfig jsonConfig ) {
"""
Construct a JSONArray from an boolean[].<br>
@param array An boolean[] array.
"""
if( !addInstance( array ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedRe... | java | private static JSONArray _fromArray( boolean[] array, JsonConfig jsonConfig ) {
if( !addInstance( array ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAsArray( array );
}catch( JSONException jsone ){
removeInstance( array... | [
"private",
"static",
"JSONArray",
"_fromArray",
"(",
"boolean",
"[",
"]",
"array",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"!",
"addInstance",
"(",
"array",
")",
")",
"{",
"try",
"{",
"return",
"jsonConfig",
".",
"getCycleDetectionStrategy",
"(... | Construct a JSONArray from an boolean[].<br>
@param array An boolean[] array. | [
"Construct",
"a",
"JSONArray",
"from",
"an",
"boolean",
"[]",
".",
"<br",
">"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L540-L568 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java | TableSession.set | public void set(Object data, int iOpenMode) throws DBException, RemoteException {
"""
Update the current record.
This method has some wierd code to emulate the way behaviors are called on a write.
@param The data to update.
@exception DBException File exception.
"""
Record record = this.getMainRecor... | java | public void set(Object data, int iOpenMode) throws DBException, RemoteException
{
Record record = this.getMainRecord();
int iOldOpenMode = record.getOpenMode();
try {
Utility.getLogger().info("EJB Set");
synchronized (this.getTask())
{
re... | [
"public",
"void",
"set",
"(",
"Object",
"data",
",",
"int",
"iOpenMode",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"Record",
"record",
"=",
"this",
".",
"getMainRecord",
"(",
")",
";",
"int",
"iOldOpenMode",
"=",
"record",
".",
"getOpenMode"... | Update the current record.
This method has some wierd code to emulate the way behaviors are called on a write.
@param The data to update.
@exception DBException File exception. | [
"Update",
"the",
"current",
"record",
".",
"This",
"method",
"has",
"some",
"wierd",
"code",
"to",
"emulate",
"the",
"way",
"behaviors",
"are",
"called",
"on",
"a",
"write",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java#L354-L383 |
alexruiz/fest-reflect | src/main/java/org/fest/reflect/util/Accessibles.java | Accessibles.setAccessibleIgnoringExceptions | public static void setAccessibleIgnoringExceptions(@NotNull AccessibleObject o, boolean accessible) {
"""
Sets the {@code accessible} flag of the given {@code AccessibleObject} to the given {@code boolean} value, ignoring
any thrown exception.
@param o the given {@code AccessibleObject}.
@param acces... | java | public static void setAccessibleIgnoringExceptions(@NotNull AccessibleObject o, boolean accessible) {
try {
setAccessible(o, accessible);
} catch (RuntimeException ignored) {
String format = "Failed to set 'accessible' flag of %s to %s";
logger.log(Level.SEVERE, String.format(format, o.toStrin... | [
"public",
"static",
"void",
"setAccessibleIgnoringExceptions",
"(",
"@",
"NotNull",
"AccessibleObject",
"o",
",",
"boolean",
"accessible",
")",
"{",
"try",
"{",
"setAccessible",
"(",
"o",
",",
"accessible",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"ignor... | Sets the {@code accessible} flag of the given {@code AccessibleObject} to the given {@code boolean} value, ignoring
any thrown exception.
@param o the given {@code AccessibleObject}.
@param accessible the value to set the {@code accessible} flag to. | [
"Sets",
"the",
"{",
"@code",
"accessible",
"}",
"flag",
"of",
"the",
"given",
"{",
"@code",
"AccessibleObject",
"}",
"to",
"the",
"given",
"{",
"@code",
"boolean",
"}",
"value",
"ignoring",
"any",
"thrown",
"exception",
"."
] | train | https://github.com/alexruiz/fest-reflect/blob/6db30716808633ef880e439b3dc6602ecb3f1b08/src/main/java/org/fest/reflect/util/Accessibles.java#L44-L51 |
kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java | AmqpTable.addInteger | public AmqpTable addInteger(String key, int value) {
"""
Adds an integer entry to the AmqpTable.
@param key name of an entry
@param value integer value of an entry
@return AmqpTable object that holds the table of entries
"""
this.add(key, value, AmqpType.INT);
return this;
} | java | public AmqpTable addInteger(String key, int value) {
this.add(key, value, AmqpType.INT);
return this;
} | [
"public",
"AmqpTable",
"addInteger",
"(",
"String",
"key",
",",
"int",
"value",
")",
"{",
"this",
".",
"add",
"(",
"key",
",",
"value",
",",
"AmqpType",
".",
"INT",
")",
";",
"return",
"this",
";",
"}"
] | Adds an integer entry to the AmqpTable.
@param key name of an entry
@param value integer value of an entry
@return AmqpTable object that holds the table of entries | [
"Adds",
"an",
"integer",
"entry",
"to",
"the",
"AmqpTable",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java#L130-L133 |
Scalified/fab | fab/src/main/java/com/scalified/fab/ActionButton.java | ActionButton.onMeasure | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
"""
Sets the measured dimension for the entire view
@param widthMeasureSpec horizontal space requirements as imposed by the parent.
The requirements are encoded with
{@link android.view.View.MeasureSpec}
@param heightMeasureSp... | java | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
LOGGER.trace("Called Action Button onMeasure");
setMeasuredDimension(calculateMeasuredWidth(), calculateMeasuredHeight());
LOGGER.trace("Measured the Action Button size: heigh... | [
"@",
"Override",
"protected",
"void",
"onMeasure",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"super",
".",
"onMeasure",
"(",
"widthMeasureSpec",
",",
"heightMeasureSpec",
")",
";",
"LOGGER",
".",
"trace",
"(",
"\"Called Action Butt... | Sets the measured dimension for the entire view
@param widthMeasureSpec horizontal space requirements as imposed by the parent.
The requirements are encoded with
{@link android.view.View.MeasureSpec}
@param heightMeasureSpec vertical space requirements as imposed by the parent.
The requirements are encoded with
{@link... | [
"Sets",
"the",
"measured",
"dimension",
"for",
"the",
"entire",
"view"
] | train | https://github.com/Scalified/fab/blob/0fc001e2f21223871d05d28b192a32ea70726884/fab/src/main/java/com/scalified/fab/ActionButton.java#L1613-L1619 |
saxsys/SynchronizeFX | synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/executors/lists/RemoveFromListRepairer.java | RemoveFromListRepairer.repairCommand | public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) {
"""
Repairs a {@link RemoveFromList} in relation to an {@link AddToList} command.
@param toRepair
The command to repair.
@param repairAgainst
The command to repair against.
@return The repaired command.... | java | public List<RemoveFromList> repairCommand(final RemoveFromList toRepair, final AddToList repairAgainst) {
return repairAddOrReplace(toRepair, repairAgainst.getPosition());
} | [
"public",
"List",
"<",
"RemoveFromList",
">",
"repairCommand",
"(",
"final",
"RemoveFromList",
"toRepair",
",",
"final",
"AddToList",
"repairAgainst",
")",
"{",
"return",
"repairAddOrReplace",
"(",
"toRepair",
",",
"repairAgainst",
".",
"getPosition",
"(",
")",
")... | Repairs a {@link RemoveFromList} in relation to an {@link AddToList} command.
@param toRepair
The command to repair.
@param repairAgainst
The command to repair against.
@return The repaired command. | [
"Repairs",
"a",
"{",
"@link",
"RemoveFromList",
"}",
"in",
"relation",
"to",
"an",
"{",
"@link",
"AddToList",
"}",
"command",
"."
] | train | https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/executors/lists/RemoveFromListRepairer.java#L56-L58 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/FailoverProxy.java | FailoverProxy.handleFailOver | private Object handleFailOver(SQLException qe, Method method, Object[] args, Protocol protocol)
throws Throwable {
"""
After a connection exception, launch failover.
@param qe the exception thrown
@param method the method to call if failover works well
@param args the arguments of the method
@ret... | java | private Object handleFailOver(SQLException qe, Method method, Object[] args, Protocol protocol)
throws Throwable {
HostAddress failHostAddress = null;
boolean failIsMaster = true;
if (protocol != null) {
failHostAddress = protocol.getHostAddress();
failIsMaster = protocol.isMasterConnectio... | [
"private",
"Object",
"handleFailOver",
"(",
"SQLException",
"qe",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
",",
"Protocol",
"protocol",
")",
"throws",
"Throwable",
"{",
"HostAddress",
"failHostAddress",
"=",
"null",
";",
"boolean",
"failIsMaster... | After a connection exception, launch failover.
@param qe the exception thrown
@param method the method to call if failover works well
@param args the arguments of the method
@return the object return from the method
@throws Throwable throwable | [
"After",
"a",
"connection",
"exception",
"launch",
"failover",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/FailoverProxy.java#L352-L367 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.rangeClosed | @NotNull
public static LongStream rangeClosed(final long startInclusive, final long endInclusive) {
"""
Returns a sequential ordered {@code LongStream} from {@code startInclusive}
(inclusive) to {@code endInclusive} (inclusive) by an incremental step of
{@code 1}.
@param startInclusive the (inclusive) ini... | java | @NotNull
public static LongStream rangeClosed(final long startInclusive, final long endInclusive) {
if (startInclusive > endInclusive) {
return empty();
} else if (startInclusive == endInclusive) {
return of(startInclusive);
} else return new LongStream(new LongRangeC... | [
"@",
"NotNull",
"public",
"static",
"LongStream",
"rangeClosed",
"(",
"final",
"long",
"startInclusive",
",",
"final",
"long",
"endInclusive",
")",
"{",
"if",
"(",
"startInclusive",
">",
"endInclusive",
")",
"{",
"return",
"empty",
"(",
")",
";",
"}",
"else"... | Returns a sequential ordered {@code LongStream} from {@code startInclusive}
(inclusive) to {@code endInclusive} (inclusive) by an incremental step of
{@code 1}.
@param startInclusive the (inclusive) initial value
@param endInclusive the inclusive upper bound
@return a sequential {@code LongStream} for the range of {@c... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"LongStream",
"}",
"from",
"{",
"@code",
"startInclusive",
"}",
"(",
"inclusive",
")",
"to",
"{",
"@code",
"endInclusive",
"}",
"(",
"inclusive",
")",
"by",
"an",
"incremental",
"step",
"of",
"{",
"@co... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L118-L125 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FaceListsImpl.java | FaceListsImpl.createAsync | public Observable<Void> createAsync(String faceListId, CreateFaceListsOptionalParameter createOptionalParameter) {
"""
Create an empty face list. Up to 64 face lists are allowed to exist in one subscription.
@param faceListId Id referencing a particular face list.
@param createOptionalParameter the object repr... | java | public Observable<Void> createAsync(String faceListId, CreateFaceListsOptionalParameter createOptionalParameter) {
return createWithServiceResponseAsync(faceListId, createOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> re... | [
"public",
"Observable",
"<",
"Void",
">",
"createAsync",
"(",
"String",
"faceListId",
",",
"CreateFaceListsOptionalParameter",
"createOptionalParameter",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"faceListId",
",",
"createOptionalParameter",
")",
".",
"ma... | Create an empty face list. Up to 64 face lists are allowed to exist in one subscription.
@param faceListId Id referencing a particular face list.
@param createOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail t... | [
"Create",
"an",
"empty",
"face",
"list",
".",
"Up",
"to",
"64",
"face",
"lists",
"are",
"allowed",
"to",
"exist",
"in",
"one",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FaceListsImpl.java#L144-L151 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/compat/SyncThread.java | SyncThread.getDistinctResultCount | public static <T> int getDistinctResultCount(int num, Callable<T> callable)
throws Throwable {
"""
Get the distinct result count for the given callable at the given
concurrency.
@param <T> the type of the callable
@param num the concurrency
@param callable the callable to invoke
@return the number of di... | java | public static <T> int getDistinctResultCount(int num, Callable<T> callable)
throws Throwable {
IdentityHashMap<T, Object> found = new IdentityHashMap<T, Object>();
Collection<SyncThread<T>> threads = getCompletedThreads(num, callable);
for (SyncThread<T> s : threads) {
found.put(s.getResult(), new... | [
"public",
"static",
"<",
"T",
">",
"int",
"getDistinctResultCount",
"(",
"int",
"num",
",",
"Callable",
"<",
"T",
">",
"callable",
")",
"throws",
"Throwable",
"{",
"IdentityHashMap",
"<",
"T",
",",
"Object",
">",
"found",
"=",
"new",
"IdentityHashMap",
"<"... | Get the distinct result count for the given callable at the given
concurrency.
@param <T> the type of the callable
@param num the concurrency
@param callable the callable to invoke
@return the number of distinct (by identity) results found
@throws Throwable if an exception occurred in one of the invocations | [
"Get",
"the",
"distinct",
"result",
"count",
"for",
"the",
"given",
"callable",
"at",
"the",
"given",
"concurrency",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/compat/SyncThread.java#L124-L132 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStore.java | SimpleHadoopFilesystemConfigStore.getOwnImports | public List<ConfigKeyPath> getOwnImports(ConfigKeyPath configKey, String version, Optional<Config> runtimeConfig)
throws VersionDoesNotExistException {
"""
Retrieves all the {@link ConfigKeyPath}s that are imported by the given {@link ConfigKeyPath}. This method does this
by reading the {@link #INCLUDES_CON... | java | public List<ConfigKeyPath> getOwnImports(ConfigKeyPath configKey, String version, Optional<Config> runtimeConfig)
throws VersionDoesNotExistException {
Preconditions.checkNotNull(configKey, "configKey cannot be null!");
Preconditions.checkArgument(!Strings.isNullOrEmpty(version), "version cannot be null o... | [
"public",
"List",
"<",
"ConfigKeyPath",
">",
"getOwnImports",
"(",
"ConfigKeyPath",
"configKey",
",",
"String",
"version",
",",
"Optional",
"<",
"Config",
">",
"runtimeConfig",
")",
"throws",
"VersionDoesNotExistException",
"{",
"Preconditions",
".",
"checkNotNull",
... | Retrieves all the {@link ConfigKeyPath}s that are imported by the given {@link ConfigKeyPath}. This method does this
by reading the {@link #INCLUDES_CONF_FILE_NAME} file associated with the dataset specified by the given
{@link ConfigKeyPath}. If the {@link Path} described by the {@link ConfigKeyPath} does not exist, t... | [
"Retrieves",
"all",
"the",
"{",
"@link",
"ConfigKeyPath",
"}",
"s",
"that",
"are",
"imported",
"by",
"the",
"given",
"{",
"@link",
"ConfigKeyPath",
"}",
".",
"This",
"method",
"does",
"this",
"by",
"reading",
"the",
"{",
"@link",
"#INCLUDES_CONF_FILE_NAME",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStore.java#L251-L276 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsIgnoreCase | public static boolean containsIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale) {
"""
Check if sSearch is contained within sText ignoring case.
@param sText
The tex... | java | public static boolean containsIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return getIndexOfIgnoreCase (sText, sSearch, aSortLocale) != STRING_NOT_FOUND;
} | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"getIndexOfIgnoreCase",
"(",
"sT... | Check if sSearch is contained within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return <code>true</code> if sSearch is contained in sText,
<code>false</c... | [
"Check",
"if",
"sSearch",
"is",
"contained",
"within",
"sText",
"ignoring",
"case",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3062-L3067 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.revokeImpersonationToken | public void revokeImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
"""
Revokes an impersonation token. Available only for admin users.
<pre><code>GitLab Endpoint: DELETE /users/:user_id/impersonation_tokens/:impersonation_token_id</code></pre>
@param userIdOrUsername t... | java | public void revokeImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
if (tokenId == null) {
throw new RuntimeException("tokenId cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.St... | [
"public",
"void",
"revokeImpersonationToken",
"(",
"Object",
"userIdOrUsername",
",",
"Integer",
"tokenId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"tokenId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"tokenId cannot be null\"",
... | Revokes an impersonation token. Available only for admin users.
<pre><code>GitLab Endpoint: DELETE /users/:user_id/impersonation_tokens/:impersonation_token_id</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param tokenId the impersonation token ID to r... | [
"Revokes",
"an",
"impersonation",
"token",
".",
"Available",
"only",
"for",
"admin",
"users",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L834-L842 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/resource/InterfaceDefinition.java | InterfaceDefinition.wrapAsList | @Deprecated
private static ListAttributeDefinition wrapAsList(final AttributeDefinition def) {
"""
Wrap a simple attribute def as list.
@param def the attribute definition
@return the list attribute def
"""
final ListAttributeDefinition list = new ListAttributeDefinition(new SimpleListAttribute... | java | @Deprecated
private static ListAttributeDefinition wrapAsList(final AttributeDefinition def) {
final ListAttributeDefinition list = new ListAttributeDefinition(new SimpleListAttributeDefinition.Builder(def.getName(), def)
.setElementValidator(def.getValidator())) {
@Override
... | [
"@",
"Deprecated",
"private",
"static",
"ListAttributeDefinition",
"wrapAsList",
"(",
"final",
"AttributeDefinition",
"def",
")",
"{",
"final",
"ListAttributeDefinition",
"list",
"=",
"new",
"ListAttributeDefinition",
"(",
"new",
"SimpleListAttributeDefinition",
".",
"Bui... | Wrap a simple attribute def as list.
@param def the attribute definition
@return the list attribute def | [
"Wrap",
"a",
"simple",
"attribute",
"def",
"as",
"list",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/resource/InterfaceDefinition.java#L309-L347 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java | AbstractWSelectList.getOptionIndex | protected int getOptionIndex(final Object option) {
"""
Retrieves the index of the given option. The index is not necessarily the index of the option in the options
list, as there may be options nested in OptionGroups.
@param option the option
@return the index of the given option, or -1 if there is no matchi... | java | protected int getOptionIndex(final Object option) {
int optionCount = 0;
List<?> options = getOptions();
if (options != null) {
for (Object obj : getOptions()) {
if (obj instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) obj).getOptions();
int groupIndex = groupOptions.indexOf(opti... | [
"protected",
"int",
"getOptionIndex",
"(",
"final",
"Object",
"option",
")",
"{",
"int",
"optionCount",
"=",
"0",
";",
"List",
"<",
"?",
">",
"options",
"=",
"getOptions",
"(",
")",
";",
"if",
"(",
"options",
"!=",
"null",
")",
"{",
"for",
"(",
"Obje... | Retrieves the index of the given option. The index is not necessarily the index of the option in the options
list, as there may be options nested in OptionGroups.
@param option the option
@return the index of the given option, or -1 if there is no matching option. | [
"Retrieves",
"the",
"index",
"of",
"the",
"given",
"option",
".",
"The",
"index",
"is",
"not",
"necessarily",
"the",
"index",
"of",
"the",
"option",
"in",
"the",
"options",
"list",
"as",
"there",
"may",
"be",
"options",
"nested",
"in",
"OptionGroups",
"."
... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java#L172-L197 |
nicoulaj/checksum-maven-plugin | src/main/java/net/nicoulaj/maven/plugins/checksum/mojo/DependenciesCheckMojo.java | DependenciesCheckMojo.readSummaryFile | private Map<String, Map<String, String>> readSummaryFile(File outputFile) throws ExecutionException {
"""
Read the summary file
@param outputFile the summary file
@return the summary content (<filename, <algo, checksum>>)
@throws ExecutionException if an error happens while running the execution.
"""
... | java | private Map<String, Map<String, String>> readSummaryFile(File outputFile) throws ExecutionException
{
List<String> algorithms = new ArrayList<String>();
Map<String, Map<String, String>> filesHashcodes = new HashMap<String, Map<String, String>>();
BufferedReader reader = null;
try
{
reader = ... | [
"private",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"readSummaryFile",
"(",
"File",
"outputFile",
")",
"throws",
"ExecutionException",
"{",
"List",
"<",
"String",
">",
"algorithms",
"=",
"new",
"ArrayList",
"<",
"String",
"... | Read the summary file
@param outputFile the summary file
@return the summary content (<filename, <algo, checksum>>)
@throws ExecutionException if an error happens while running the execution. | [
"Read",
"the",
"summary",
"file"
] | train | https://github.com/nicoulaj/checksum-maven-plugin/blob/8d8feab8a0a34e24ae41621e7372be6387e1fe55/src/main/java/net/nicoulaj/maven/plugins/checksum/mojo/DependenciesCheckMojo.java#L264-L297 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.loadPathConfiguration | private static PathConfiguration loadPathConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration clusterConf) {
"""
Loads the path level configuration from the get configuration response.
Only client scope properties will be loaded.
@param response the get configuration RPC response
@pa... | java | private static PathConfiguration loadPathConfiguration(GetConfigurationPResponse response,
AlluxioConfiguration clusterConf) {
String clientVersion = clusterConf.get(PropertyKey.VERSION);
LOG.info("Alluxio client (version {}) is trying to load path level configurations",
clientVersion);
Map<St... | [
"private",
"static",
"PathConfiguration",
"loadPathConfiguration",
"(",
"GetConfigurationPResponse",
"response",
",",
"AlluxioConfiguration",
"clusterConf",
")",
"{",
"String",
"clientVersion",
"=",
"clusterConf",
".",
"get",
"(",
"PropertyKey",
".",
"VERSION",
")",
";"... | Loads the path level configuration from the get configuration response.
Only client scope properties will be loaded.
@param response the get configuration RPC response
@param clusterConf cluster level configuration
@return the loaded path level configuration | [
"Loads",
"the",
"path",
"level",
"configuration",
"from",
"the",
"get",
"configuration",
"response",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L569-L585 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/Misc.java | Misc.deleteDirContents | public static void deleteDirContents(File dir) {
"""
Deletes the contents of a directory, including subdirectories.
@param dir
The directory to be emptied.
"""
if (!dir.isDirectory() || !dir.exists()) {
throw new IllegalArgumentException(dir.getAbsolutePath()
+ " ... | java | public static void deleteDirContents(File dir) {
if (!dir.isDirectory() || !dir.exists()) {
throw new IllegalArgumentException(dir.getAbsolutePath()
+ " is not a directory or does not exist.");
}
String[] children = dir.list();
for (int i = 0; i < ch... | [
"public",
"static",
"void",
"deleteDirContents",
"(",
"File",
"dir",
")",
"{",
"if",
"(",
"!",
"dir",
".",
"isDirectory",
"(",
")",
"||",
"!",
"dir",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"dir",
".",
"getAb... | Deletes the contents of a directory, including subdirectories.
@param dir
The directory to be emptied. | [
"Deletes",
"the",
"contents",
"of",
"a",
"directory",
"including",
"subdirectories",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L48-L61 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/SubscriptionsInner.java | SubscriptionsInner.listQuotasAsync | public ServiceFuture<SubscriptionQuotasListResultInner> listQuotasAsync(String location, final ServiceCallback<SubscriptionQuotasListResultInner> serviceCallback) {
"""
Retrieves the subscription's current quota information in a particular region.
@param location The region in which to retrieve the subscription... | java | public ServiceFuture<SubscriptionQuotasListResultInner> listQuotasAsync(String location, final ServiceCallback<SubscriptionQuotasListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listQuotasWithServiceResponseAsync(location), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"SubscriptionQuotasListResultInner",
">",
"listQuotasAsync",
"(",
"String",
"location",
",",
"final",
"ServiceCallback",
"<",
"SubscriptionQuotasListResultInner",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse... | Retrieves the subscription's current quota information in a particular region.
@param location The region in which to retrieve the subscription's quota information. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
@param serviceCallback the async Se... | [
"Retrieves",
"the",
"subscription",
"s",
"current",
"quota",
"information",
"in",
"a",
"particular",
"region",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/SubscriptionsInner.java#L81-L83 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java | PluralRules.nextToken | private static String nextToken(String[] tokens, int x, String context)
throws ParseException {
"""
/*
Returns the token at x if available, else throws a parse exception.
"""
if (x < tokens.length) {
return tokens[x];
}
throw new ParseException("missing token at... | java | private static String nextToken(String[] tokens, int x, String context)
throws ParseException {
if (x < tokens.length) {
return tokens[x];
}
throw new ParseException("missing token at end of '" + context + "'", -1);
} | [
"private",
"static",
"String",
"nextToken",
"(",
"String",
"[",
"]",
"tokens",
",",
"int",
"x",
",",
"String",
"context",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"x",
"<",
"tokens",
".",
"length",
")",
"{",
"return",
"tokens",
"[",
"x",
"]",
... | /*
Returns the token at x if available, else throws a parse exception. | [
"/",
"*",
"Returns",
"the",
"token",
"at",
"x",
"if",
"available",
"else",
"throws",
"a",
"parse",
"exception",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRules.java#L1388-L1394 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.firstNonNull | public static Expression firstNonNull(final Expression left, final Expression right) {
"""
Returns an expression that evaluates to {@code left} if left is non null, and evaluates to
{@code right} otherwise.
"""
checkArgument(left.resultType().getSort() == Type.OBJECT);
checkArgument(right.resultType()... | java | public static Expression firstNonNull(final Expression left, final Expression right) {
checkArgument(left.resultType().getSort() == Type.OBJECT);
checkArgument(right.resultType().getSort() == Type.OBJECT);
Features features = Features.of();
if (Expression.areAllCheap(left, right)) {
features = fea... | [
"public",
"static",
"Expression",
"firstNonNull",
"(",
"final",
"Expression",
"left",
",",
"final",
"Expression",
"right",
")",
"{",
"checkArgument",
"(",
"left",
".",
"resultType",
"(",
")",
".",
"getSort",
"(",
")",
"==",
"Type",
".",
"OBJECT",
")",
";",... | Returns an expression that evaluates to {@code left} if left is non null, and evaluates to
{@code right} otherwise. | [
"Returns",
"an",
"expression",
"that",
"evaluates",
"to",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L635-L658 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java | InputsInner.getAsync | public Observable<InputInner> getAsync(String resourceGroupName, String jobName, String inputName) {
"""
Gets details about the specified input.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@para... | java | public Observable<InputInner> getAsync(String resourceGroupName, String jobName, String inputName) {
return getWithServiceResponseAsync(resourceGroupName, jobName, inputName).map(new Func1<ServiceResponseWithHeaders<InputInner, InputsGetHeaders>, InputInner>() {
@Override
public InputInn... | [
"public",
"Observable",
"<",
"InputInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"inputName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
"inputName",
")",
... | Gets details about the specified input.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param inputName The name of the input.
@throws IllegalArgumentException... | [
"Gets",
"details",
"about",
"the",
"specified",
"input",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/InputsInner.java#L641-L648 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java | MsgDestEncodingUtilsImpl.encodeOtherProperties | private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException {
"""
encodeOtherProperties
Encode the more interesting JmsDestination properties, which may or may not be set:
Queue/Topic name
TopicSpace
ReadAhead
Cluster properties
@param baos ... | java | private static void encodeOtherProperties(ByteArrayOutputStream baos, Map<String,Object> destProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeOtherProperties", new Object[]{baos, destProps});
// Deal with each remaining property in turn.
I... | [
"private",
"static",
"void",
"encodeOtherProperties",
"(",
"ByteArrayOutputStream",
"baos",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"destProps",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"... | encodeOtherProperties
Encode the more interesting JmsDestination properties, which may or may not be set:
Queue/Topic name
TopicSpace
ReadAhead
Cluster properties
@param baos The ByteArrayOutputStream to encode into
@param destProps The Map of properties to be encoded
@exception JMSExceptio... | [
"encodeOtherProperties",
"Encode",
"the",
"more",
"interesting",
"JmsDestination",
"properties",
"which",
"may",
"or",
"may",
"not",
"be",
"set",
":",
"Queue",
"/",
"Topic",
"name",
"TopicSpace",
"ReadAhead",
"Cluster",
"properties"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MsgDestEncodingUtilsImpl.java#L657-L693 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java | DateContext.createDateWithValidation | public Date createDateWithValidation(String dateString, String inputFormat) {
"""
Creates a date object based on the format passed in. Exceptions are NOT
thrown by this method and instead <code>null</code> is returned.
Otherwise, this is identical to {@link #createDate(String, String)}.
@param dateString The... | java | public Date createDateWithValidation(String dateString, String inputFormat) {
try { return createDate(dateString, inputFormat); }
catch (Exception exception) {
Syslog.debug("DateContextImpl.createDateWithValidation: Error " +
"creating date with " + dateString + "/" +
... | [
"public",
"Date",
"createDateWithValidation",
"(",
"String",
"dateString",
",",
"String",
"inputFormat",
")",
"{",
"try",
"{",
"return",
"createDate",
"(",
"dateString",
",",
"inputFormat",
")",
";",
"}",
"catch",
"(",
"Exception",
"exception",
")",
"{",
"Sysl... | Creates a date object based on the format passed in. Exceptions are NOT
thrown by this method and instead <code>null</code> is returned.
Otherwise, this is identical to {@link #createDate(String, String)}.
@param dateString The string from which to create a date
@param inputFormat The format of the date string
@retu... | [
"Creates",
"a",
"date",
"object",
"based",
"on",
"the",
"format",
"passed",
"in",
".",
"Exceptions",
"are",
"NOT",
"thrown",
"by",
"this",
"method",
"and",
"instead",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
".",
"Otherwise",
"this",
"i... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java#L210-L219 |
demidenko05/beigesoft-orm | src/main/java/org/beigesoft/orm/service/ASrvOrm.java | ASrvOrm.evalRowCountWhere | @Override
public final <T> Integer evalRowCountWhere(
final Map<String, Object> pAddParam,
final Class<T> pEntityClass, final String pWhere) throws Exception {
"""
<p>Calculate total rows for pagination.</p>
@param <T> - type of business object,
@param pAddParam additional param
@param pEntityClass ... | java | @Override
public final <T> Integer evalRowCountWhere(
final Map<String, Object> pAddParam,
final Class<T> pEntityClass, final String pWhere) throws Exception {
if (pWhere == null) {
throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
"param_null_not_accepted");
}
String ... | [
"@",
"Override",
"public",
"final",
"<",
"T",
">",
"Integer",
"evalRowCountWhere",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"Class",
"<",
"T",
">",
"pEntityClass",
",",
"final",
"String",
"pWhere",
")",
"throws",
... | <p>Calculate total rows for pagination.</p>
@param <T> - type of business object,
@param pAddParam additional param
@param pEntityClass entity class
@param pWhere not null e.g. "ITSID > 33"
@return Integer row count
@throws Exception - an exception | [
"<p",
">",
"Calculate",
"total",
"rows",
"for",
"pagination",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/service/ASrvOrm.java#L537-L548 |
BoltsFramework/Bolts-Android | bolts-tasks/src/main/java/bolts/Task.java | Task.onSuccessTask | public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
final Continuation<TResult, Task<TContinuationResult>> continuation, Executor executor,
final CancellationToken ct) {
"""
Runs a continuation when a task completes successfully, forwarding along
{@link java.lang.Exception}s or cance... | java | public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
final Continuation<TResult, Task<TContinuationResult>> continuation, Executor executor,
final CancellationToken ct) {
return continueWithTask(new Continuation<TResult, Task<TContinuationResult>>() {
@Override
public Task<T... | [
"public",
"<",
"TContinuationResult",
">",
"Task",
"<",
"TContinuationResult",
">",
"onSuccessTask",
"(",
"final",
"Continuation",
"<",
"TResult",
",",
"Task",
"<",
"TContinuationResult",
">",
">",
"continuation",
",",
"Executor",
"executor",
",",
"final",
"Cancel... | Runs a continuation when a task completes successfully, forwarding along
{@link java.lang.Exception}s or cancellation. | [
"Runs",
"a",
"continuation",
"when",
"a",
"task",
"completes",
"successfully",
"forwarding",
"along",
"{"
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-tasks/src/main/java/bolts/Task.java#L800-L819 |
RestComm/media-core | stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java | StunAttributeFactory.createMessageIntegrityAttribute | public static MessageIntegrityAttribute createMessageIntegrityAttribute(String username, byte[] key) {
"""
Creates an empty <tt>MessageIntegrityAttribute</tt>. When included in a
message the stack would set the body of this attribute so that the the
HMAC-SHA1 (RFC 2104) would correspond to the actual message tha... | java | public static MessageIntegrityAttribute createMessageIntegrityAttribute(String username, byte[] key) {
MessageIntegrityAttribute attribute = new MessageIntegrityAttribute();
attribute.setKey(key);
attribute.setUsername(username);
return attribute;
} | [
"public",
"static",
"MessageIntegrityAttribute",
"createMessageIntegrityAttribute",
"(",
"String",
"username",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"MessageIntegrityAttribute",
"attribute",
"=",
"new",
"MessageIntegrityAttribute",
"(",
")",
";",
"attribute",
".",
"... | Creates an empty <tt>MessageIntegrityAttribute</tt>. When included in a
message the stack would set the body of this attribute so that the the
HMAC-SHA1 (RFC 2104) would correspond to the actual message that's
transporting the attribute.
@param username
the username that we should use to obtain an encryption key
(pass... | [
"Creates",
"an",
"empty",
"<tt",
">",
"MessageIntegrityAttribute<",
"/",
"tt",
">",
".",
"When",
"included",
"in",
"a",
"message",
"the",
"stack",
"would",
"set",
"the",
"body",
"of",
"this",
"attribute",
"so",
"that",
"the",
"the",
"HMAC",
"-",
"SHA1",
... | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/StunAttributeFactory.java#L374-L379 |
zxing/zxing | core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java | HighLevelEncoder.randomize253State | private static char randomize253State(char ch, int codewordPosition) {
"""
/*
public static byte[] getBytesForMessage(String msg) {
return msg.getBytes(Charset.forName("cp437")); //See 4.4.3 and annex B of ISO/IEC 15438:2001(E)
}
"""
int pseudoRandom = ((149 * codewordPosition) % 253) + 1;
int tempV... | java | private static char randomize253State(char ch, int codewordPosition) {
int pseudoRandom = ((149 * codewordPosition) % 253) + 1;
int tempVariable = ch + pseudoRandom;
return (char) (tempVariable <= 254 ? tempVariable : tempVariable - 254);
} | [
"private",
"static",
"char",
"randomize253State",
"(",
"char",
"ch",
",",
"int",
"codewordPosition",
")",
"{",
"int",
"pseudoRandom",
"=",
"(",
"(",
"149",
"*",
"codewordPosition",
")",
"%",
"253",
")",
"+",
"1",
";",
"int",
"tempVariable",
"=",
"ch",
"+... | /*
public static byte[] getBytesForMessage(String msg) {
return msg.getBytes(Charset.forName("cp437")); //See 4.4.3 and annex B of ISO/IEC 15438:2001(E)
} | [
"/",
"*",
"public",
"static",
"byte",
"[]",
"getBytesForMessage",
"(",
"String",
"msg",
")",
"{",
"return",
"msg",
".",
"getBytes",
"(",
"Charset",
".",
"forName",
"(",
"cp437",
"))",
";",
"//",
"See",
"4",
".",
"4",
".",
"3",
"and",
"annex",
"B",
... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java#L128-L132 |
infinispan/infinispan | cdi/common/src/main/java/org/infinispan/cdi/common/util/Annotateds.java | Annotateds.createFieldId | public static <X> String createFieldId(Field field, Collection<Annotation> annotations) {
"""
Creates a deterministic signature for a {@link Field}.
@param field The field to generate the signature for
@param annotations The annotations to include in the signature
"""
StringBuilder builder = ... | java | public static <X> String createFieldId(Field field, Collection<Annotation> annotations) {
StringBuilder builder = new StringBuilder();
builder.append(field.getDeclaringClass().getName());
builder.append('.');
builder.append(field.getName());
builder.append(createAnnotationCollect... | [
"public",
"static",
"<",
"X",
">",
"String",
"createFieldId",
"(",
"Field",
"field",
",",
"Collection",
"<",
"Annotation",
">",
"annotations",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
... | Creates a deterministic signature for a {@link Field}.
@param field The field to generate the signature for
@param annotations The annotations to include in the signature | [
"Creates",
"a",
"deterministic",
"signature",
"for",
"a",
"{",
"@link",
"Field",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/Annotateds.java#L236-L243 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/UnsavedRevision.java | UnsavedRevision.setUserProperties | @InterfaceAudience.Public
public void setUserProperties(Map<String, Object> userProperties) {
"""
Sets the userProperties of the Revision.
Set replaces all properties except for those with keys prefixed with '_'.
"""
Map<String, Object> newProps = new HashMap<String, Object>();
newProps.pu... | java | @InterfaceAudience.Public
public void setUserProperties(Map<String, Object> userProperties) {
Map<String, Object> newProps = new HashMap<String, Object>();
newProps.putAll(userProperties);
for (String key : properties.keySet()) {
if (key.startsWith("_")) {
newProp... | [
"@",
"InterfaceAudience",
".",
"Public",
"public",
"void",
"setUserProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"userProperties",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"newProps",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Obj... | Sets the userProperties of the Revision.
Set replaces all properties except for those with keys prefixed with '_'. | [
"Sets",
"the",
"userProperties",
"of",
"the",
"Revision",
".",
"Set",
"replaces",
"all",
"properties",
"except",
"for",
"those",
"with",
"keys",
"prefixed",
"with",
"_",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/UnsavedRevision.java#L148-L158 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java | ExcelFunctions.randbetween | public static int randbetween(EvaluationContext ctx, Object bottom, Object top) {
"""
Returns a random integer number between the numbers you specify
"""
int _bottom = Conversions.toInteger(bottom, ctx);
int _top = Conversions.toInteger(top, ctx);
return (int)(Math.random() * (_top + 1... | java | public static int randbetween(EvaluationContext ctx, Object bottom, Object top) {
int _bottom = Conversions.toInteger(bottom, ctx);
int _top = Conversions.toInteger(top, ctx);
return (int)(Math.random() * (_top + 1 - _bottom)) + _bottom;
} | [
"public",
"static",
"int",
"randbetween",
"(",
"EvaluationContext",
"ctx",
",",
"Object",
"bottom",
",",
"Object",
"top",
")",
"{",
"int",
"_bottom",
"=",
"Conversions",
".",
"toInteger",
"(",
"bottom",
",",
"ctx",
")",
";",
"int",
"_top",
"=",
"Conversion... | Returns a random integer number between the numbers you specify | [
"Returns",
"a",
"random",
"integer",
"number",
"between",
"the",
"numbers",
"you",
"specify"
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/ExcelFunctions.java#L442-L447 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/EmbeddedNeo4jDialect.java | EmbeddedNeo4jDialect.createRelationship | private Relationship createRelationship(AssociationKey associationKey, Tuple associationRow, AssociatedEntityKeyMetadata associatedEntityKeyMetadata, AssociationContext associationContext) {
"""
When dealing with some scenarios like, for example, a bidirectional association, OGM calls this method twice:
<p>
the ... | java | private Relationship createRelationship(AssociationKey associationKey, Tuple associationRow, AssociatedEntityKeyMetadata associatedEntityKeyMetadata, AssociationContext associationContext) {
switch ( associationKey.getMetadata().getAssociationKind() ) {
case EMBEDDED_COLLECTION:
return createRelationshipWithEm... | [
"private",
"Relationship",
"createRelationship",
"(",
"AssociationKey",
"associationKey",
",",
"Tuple",
"associationRow",
",",
"AssociatedEntityKeyMetadata",
"associatedEntityKeyMetadata",
",",
"AssociationContext",
"associationContext",
")",
"{",
"switch",
"(",
"associationKey... | When dealing with some scenarios like, for example, a bidirectional association, OGM calls this method twice:
<p>
the first time with the information related to the owner of the association and the {@link RowKey},
the second time using the same {@link RowKey} but with the {@link AssociationKey} referring to the other s... | [
"When",
"dealing",
"with",
"some",
"scenarios",
"like",
"for",
"example",
"a",
"bidirectional",
"association",
"OGM",
"calls",
"this",
"method",
"twice",
":",
"<p",
">",
"the",
"first",
"time",
"with",
"the",
"information",
"related",
"to",
"the",
"owner",
"... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/EmbeddedNeo4jDialect.java#L241-L250 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/LoggedOutTokenCacheImpl.java | LoggedOutTokenCacheImpl.putDistributedObjectLoggedOutToken | @Override
public Object putDistributedObjectLoggedOutToken(Object key, Object value, int timeToLive) {
"""
/*
Add the token to the DistributedMap
key is the token string
value is the subject
timeToLive is the about of time left before the token expires, to become the expiring time of the distributed map ... | java | @Override
public Object putDistributedObjectLoggedOutToken(Object key, Object value, int timeToLive) {
DistributedMap map = getDMLoggedOutTokenMap();
if (map != null)
{
Object dist_object = map.put(key, value, 1, timeToLive, EntryInfo.SHARED_PUSH, null);
return dist... | [
"@",
"Override",
"public",
"Object",
"putDistributedObjectLoggedOutToken",
"(",
"Object",
"key",
",",
"Object",
"value",
",",
"int",
"timeToLive",
")",
"{",
"DistributedMap",
"map",
"=",
"getDMLoggedOutTokenMap",
"(",
")",
";",
"if",
"(",
"map",
"!=",
"null",
... | /*
Add the token to the DistributedMap
key is the token string
value is the subject
timeToLive is the about of time left before the token expires, to become the expiring time of the distributed map entry | [
"/",
"*",
"Add",
"the",
"token",
"to",
"the",
"DistributedMap"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/LoggedOutTokenCacheImpl.java#L94-L105 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java | StorageDirView.createTempBlockMeta | public TempBlockMeta createTempBlockMeta(long sessionId, long blockId, long initialBlockSize) {
"""
Creates a {@link TempBlockMeta} given sessionId, blockId, and initialBlockSize.
@param sessionId of the owning session
@param blockId of the new block
@param initialBlockSize of the new block
@return a new {@l... | java | public TempBlockMeta createTempBlockMeta(long sessionId, long blockId, long initialBlockSize) {
return new TempBlockMeta(sessionId, blockId, initialBlockSize, mDir);
} | [
"public",
"TempBlockMeta",
"createTempBlockMeta",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
",",
"long",
"initialBlockSize",
")",
"{",
"return",
"new",
"TempBlockMeta",
"(",
"sessionId",
",",
"blockId",
",",
"initialBlockSize",
",",
"mDir",
")",
";",
"}"... | Creates a {@link TempBlockMeta} given sessionId, blockId, and initialBlockSize.
@param sessionId of the owning session
@param blockId of the new block
@param initialBlockSize of the new block
@return a new {@link TempBlockMeta} under the underlying directory | [
"Creates",
"a",
"{",
"@link",
"TempBlockMeta",
"}",
"given",
"sessionId",
"blockId",
"and",
"initialBlockSize",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDirView.java#L148-L150 |
kiswanij/jk-util | src/main/java/com/jk/util/JKHttpUtil.java | JKHttpUtil.downloadFile | public static void downloadFile(final String fileUrl, final String localFile) throws IOException {
"""
Download file.
@param fileUrl the file url
@param localFile the local file
@throws IOException Signals that an I/O exception has occurred.
"""
final URL url = new URL(fileUrl);
final HttpURLConnect... | java | public static void downloadFile(final String fileUrl, final String localFile) throws IOException {
final URL url = new URL(fileUrl);
final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
final byte[] data = JKIOUtil.readStream(connection.getInputStream());
JKIOUtil.writeBytesToFile(data... | [
"public",
"static",
"void",
"downloadFile",
"(",
"final",
"String",
"fileUrl",
",",
"final",
"String",
"localFile",
")",
"throws",
"IOException",
"{",
"final",
"URL",
"url",
"=",
"new",
"URL",
"(",
"fileUrl",
")",
";",
"final",
"HttpURLConnection",
"connection... | Download file.
@param fileUrl the file url
@param localFile the local file
@throws IOException Signals that an I/O exception has occurred. | [
"Download",
"file",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKHttpUtil.java#L68-L73 |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.consolidateIfNeeded | private void consolidateIfNeeded() {
"""
This should only be called as last operation from a method as this may adjust the underlying
array of components and so affect the index etc.
"""
// Consolidate if the number of components will exceed the allowed maximum by the current
// operation.
... | java | private void consolidateIfNeeded() {
// Consolidate if the number of components will exceed the allowed maximum by the current
// operation.
int size = componentCount;
if (size > maxNumComponents) {
final int capacity = components[size - 1].endOffset;
ByteBuf con... | [
"private",
"void",
"consolidateIfNeeded",
"(",
")",
"{",
"// Consolidate if the number of components will exceed the allowed maximum by the current",
"// operation.",
"int",
"size",
"=",
"componentCount",
";",
"if",
"(",
"size",
">",
"maxNumComponents",
")",
"{",
"final",
"... | This should only be called as last operation from a method as this may adjust the underlying
array of components and so affect the index etc. | [
"This",
"should",
"only",
"be",
"called",
"as",
"last",
"operation",
"from",
"a",
"method",
"as",
"this",
"may",
"adjust",
"the",
"underlying",
"array",
"of",
"components",
"and",
"so",
"affect",
"the",
"index",
"etc",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L520-L538 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.getBeginValue | public static int getBeginValue(Calendar calendar, int dateField) {
"""
获取指定日期字段的最小值,例如分钟的最小值是0
@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最小值
@since 4.5.7
@see Calendar#getActualMinimum(int)
"""
if(Calendar.DAY_OF_WEEK == dateField) {
return calendar.getFirstDa... | java | public static int getBeginValue(Calendar calendar, int dateField) {
if(Calendar.DAY_OF_WEEK == dateField) {
return calendar.getFirstDayOfWeek();
}
return calendar.getActualMinimum(dateField);
} | [
"public",
"static",
"int",
"getBeginValue",
"(",
"Calendar",
"calendar",
",",
"int",
"dateField",
")",
"{",
"if",
"(",
"Calendar",
".",
"DAY_OF_WEEK",
"==",
"dateField",
")",
"{",
"return",
"calendar",
".",
"getFirstDayOfWeek",
"(",
")",
";",
"}",
"return",
... | 获取指定日期字段的最小值,例如分钟的最小值是0
@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最小值
@since 4.5.7
@see Calendar#getActualMinimum(int) | [
"获取指定日期字段的最小值,例如分钟的最小值是0"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1680-L1685 |
mikepenz/FastAdapter | library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java | AdapterUtil.findSubItemSelections | public static <Item extends IItem> void findSubItemSelections(Item item, List<String> selections) {
"""
internal method to find all selections from subItems and sub sub items so we can save those inside our savedInstanceState
@param item the parent item
@param selections the ArrayList which will be store... | java | public static <Item extends IItem> void findSubItemSelections(Item item, List<String> selections) {
if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) {
List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems();
... | [
"public",
"static",
"<",
"Item",
"extends",
"IItem",
">",
"void",
"findSubItemSelections",
"(",
"Item",
"item",
",",
"List",
"<",
"String",
">",
"selections",
")",
"{",
"if",
"(",
"item",
"instanceof",
"IExpandable",
"&&",
"!",
"(",
"(",
"IExpandable",
")"... | internal method to find all selections from subItems and sub sub items so we can save those inside our savedInstanceState
@param item the parent item
@param selections the ArrayList which will be stored in the savedInstanceState | [
"internal",
"method",
"to",
"find",
"all",
"selections",
"from",
"subItems",
"and",
"sub",
"sub",
"items",
"so",
"we",
"can",
"save",
"those",
"inside",
"our",
"savedInstanceState"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions-expandable/src/main/java/com/mikepenz/fastadapter/utils/AdapterUtil.java#L40-L52 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.getMediaStatistic | public GetMediaStatisticResponse getMediaStatistic(GetMediaStatisticRequest request) {
"""
get media statistic info.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all options.
@return The media statistic info
... | java | public GetMediaStatisticResponse getMediaStatistic(GetMediaStatisticRequest request) {
checkIsTrue(request.getMediaId() != null, "mediaId is null!");
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, MEDIA_STATISTIC, request.getMediaId());
if (request.... | [
"public",
"GetMediaStatisticResponse",
"getMediaStatistic",
"(",
"GetMediaStatisticRequest",
"request",
")",
"{",
"checkIsTrue",
"(",
"request",
".",
"getMediaId",
"(",
")",
"!=",
"null",
",",
"\"mediaId is null!\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
... | get media statistic info.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all options.
@return The media statistic info | [
"get",
"media",
"statistic",
"info",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L853-L868 |
litsec/swedish-eid-shibboleth-base | shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java | AbstractExternalAuthenticationController.preventAttributeReuse | private void preventAttributeReuse(HttpServletRequest httpRequest, String principal) {
"""
By default, Shibboleth will try to avoid doing attribute resolving if there is a previous active session for the
current user. We never want that since we are an external authentication method that want to tell <b>exactly</... | java | private void preventAttributeReuse(HttpServletRequest httpRequest, String principal) {
try {
SessionContext sessionCtx = sessionContextLookupStrategy.apply(this.getProfileRequestContext(httpRequest));
if (sessionCtx == null || sessionCtx.getIdPSession() == null) {
return;
}
if (princ... | [
"private",
"void",
"preventAttributeReuse",
"(",
"HttpServletRequest",
"httpRequest",
",",
"String",
"principal",
")",
"{",
"try",
"{",
"SessionContext",
"sessionCtx",
"=",
"sessionContextLookupStrategy",
".",
"apply",
"(",
"this",
".",
"getProfileRequestContext",
"(",
... | By default, Shibboleth will try to avoid doing attribute resolving if there is a previous active session for the
current user. We never want that since we are an external authentication method that want to tell <b>exactly</b>
which attributes that are to be released each time. This method will take care of this.
@para... | [
"By",
"default",
"Shibboleth",
"will",
"try",
"to",
"avoid",
"doing",
"attribute",
"resolving",
"if",
"there",
"is",
"a",
"previous",
"active",
"session",
"for",
"the",
"current",
"user",
".",
"We",
"never",
"want",
"that",
"since",
"we",
"are",
"an",
"ext... | train | https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java#L392-L418 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/Vertigo.java | Vertigo.deployNetwork | public Vertigo deployNetwork(String cluster, NetworkConfig network) {
"""
Deploys a network to a specific cluster.<p>
If the given network configuration's name matches the name of a network
that is already running in the cluster then the given configuration will
be <b>merged</b> with the running network's con... | java | public Vertigo deployNetwork(String cluster, NetworkConfig network) {
return deployNetwork(cluster, network, null);
} | [
"public",
"Vertigo",
"deployNetwork",
"(",
"String",
"cluster",
",",
"NetworkConfig",
"network",
")",
"{",
"return",
"deployNetwork",
"(",
"cluster",
",",
"network",
",",
"null",
")",
";",
"}"
] | Deploys a network to a specific cluster.<p>
If the given network configuration's name matches the name of a network
that is already running in the cluster then the given configuration will
be <b>merged</b> with the running network's configuration. This allows networks
to be dynamically updated with partial configurati... | [
"Deploys",
"a",
"network",
"to",
"a",
"specific",
"cluster",
".",
"<p",
">"
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L549-L551 |
cycorp/api-suite | core-api/src/main/java/com/cyc/session/exception/SessionServiceException.java | SessionServiceException.fromThrowable | public static SessionServiceException fromThrowable(Class interfaceClass, Throwable cause) {
"""
Converts a Throwable to a SessionServiceException. If the Throwable is a
SessionServiceException, it will be passed through unmodified; otherwise, it will be wrapped
in a new SessionServiceException.
@param cause ... | java | public static SessionServiceException fromThrowable(Class interfaceClass, Throwable cause) {
return (cause instanceof SessionServiceException
&& Objects.equals(interfaceClass, ((SessionServiceException) cause).getInterfaceClass()))
? (SessionServiceException) cause
... | [
"public",
"static",
"SessionServiceException",
"fromThrowable",
"(",
"Class",
"interfaceClass",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"SessionServiceException",
"&&",
"Objects",
".",
"equals",
"(",
"interfaceClass",
",",
"(",
"("... | Converts a Throwable to a SessionServiceException. If the Throwable is a
SessionServiceException, it will be passed through unmodified; otherwise, it will be wrapped
in a new SessionServiceException.
@param cause the Throwable to convert
@param interfaceClass
@return a SessionServiceException | [
"Converts",
"a",
"Throwable",
"to",
"a",
"SessionServiceException",
".",
"If",
"the",
"Throwable",
"is",
"a",
"SessionServiceException",
"it",
"will",
"be",
"passed",
"through",
"unmodified",
";",
"otherwise",
"it",
"will",
"be",
"wrapped",
"in",
"a",
"new",
"... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionServiceException.java#L45-L50 |
icode/ameba | src/main/java/ameba/lib/Strands.java | Strands.printStackTrace | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintWriter out) {
"""
This utility method prints a stack-trace into a {@link java.io.PrintWriter}
@param trace a stack trace (such as returned from {@link Strand#getStackTrace()}.
@param out the {@link java.io.PrintWriter} into which the ... | java | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintWriter out) {
Strand.printStackTrace(trace, out);
} | [
"public",
"static",
"void",
"printStackTrace",
"(",
"StackTraceElement",
"[",
"]",
"trace",
",",
"java",
".",
"io",
".",
"PrintWriter",
"out",
")",
"{",
"Strand",
".",
"printStackTrace",
"(",
"trace",
",",
"out",
")",
";",
"}"
] | This utility method prints a stack-trace into a {@link java.io.PrintWriter}
@param trace a stack trace (such as returned from {@link Strand#getStackTrace()}.
@param out the {@link java.io.PrintWriter} into which the stack trace will be printed. | [
"This",
"utility",
"method",
"prints",
"a",
"stack",
"-",
"trace",
"into",
"a",
"{",
"@link",
"java",
".",
"io",
".",
"PrintWriter",
"}"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Strands.java#L537-L539 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listByDomainTopic | public List<EventSubscriptionInner> listByDomainTopic(String resourceGroupName, String domainName, String topicName) {
"""
List all event subscriptions for a specific domain topic.
List all event subscriptions that have been created for a specific domain topic.
@param resourceGroupName The name of the resource... | java | public List<EventSubscriptionInner> listByDomainTopic(String resourceGroupName, String domainName, String topicName) {
return listByDomainTopicWithServiceResponseAsync(resourceGroupName, domainName, topicName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"EventSubscriptionInner",
">",
"listByDomainTopic",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"topicName",
")",
"{",
"return",
"listByDomainTopicWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainN... | List all event subscriptions for a specific domain topic.
List all event subscriptions that have been created for a specific domain topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the top level domain
@param topicName Name of the domain topic
@th... | [
"List",
"all",
"event",
"subscriptions",
"for",
"a",
"specific",
"domain",
"topic",
".",
"List",
"all",
"event",
"subscriptions",
"that",
"have",
"been",
"created",
"for",
"a",
"specific",
"domain",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/EventSubscriptionsInner.java#L1678-L1680 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setParameter | private void setParameter(String key, Object value) {
"""
Set a stored parameter.
@param key the parameter's key
@param value the parameter's value. Removes the parameter if null
"""
if (value == null){
parameters.remove(key);
}
else{
parameters.put(key, ... | java | private void setParameter(String key, Object value){
if (value == null){
parameters.remove(key);
}
else{
parameters.put(key, value);
}
} | [
"private",
"void",
"setParameter",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"parameters",
".",
"remove",
"(",
"key",
")",
";",
"}",
"else",
"{",
"parameters",
".",
"put",
"(",
"key",
",",
"... | Set a stored parameter.
@param key the parameter's key
@param value the parameter's value. Removes the parameter if null | [
"Set",
"a",
"stored",
"parameter",
"."
] | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1757-L1764 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxApiAuthentication.java | BoxApiAuthentication.createOAuth | BoxCreateAuthRequest createOAuth(String code, String clientId, String clientSecret) {
"""
Create OAuth, to be called the first time session tries to authenticate.
"""
BoxCreateAuthRequest request = new BoxCreateAuthRequest(mSession, getTokenUrl(), code, clientId, clientSecret);
return request;
... | java | BoxCreateAuthRequest createOAuth(String code, String clientId, String clientSecret) {
BoxCreateAuthRequest request = new BoxCreateAuthRequest(mSession, getTokenUrl(), code, clientId, clientSecret);
return request;
} | [
"BoxCreateAuthRequest",
"createOAuth",
"(",
"String",
"code",
",",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"{",
"BoxCreateAuthRequest",
"request",
"=",
"new",
"BoxCreateAuthRequest",
"(",
"mSession",
",",
"getTokenUrl",
"(",
")",
",",
"code",
","... | Create OAuth, to be called the first time session tries to authenticate. | [
"Create",
"OAuth",
"to",
"be",
"called",
"the",
"first",
"time",
"session",
"tries",
"to",
"authenticate",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxApiAuthentication.java#L58-L61 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/util/Templates.java | Templates.hasExpression | private static boolean hasExpression(final Template template, final String expression, final TemplateElement templateElement) {
"""
Determines whether the specified expression exists in the specified
element (includes its children) of the specified template.
@param template the specified template
@para... | java | private static boolean hasExpression(final Template template, final String expression, final TemplateElement templateElement) {
final String canonicalForm = templateElement.getCanonicalForm();
if (canonicalForm.startsWith(expression)) {
LOGGER.log(Level.TRACE, "Template has expression[nodeN... | [
"private",
"static",
"boolean",
"hasExpression",
"(",
"final",
"Template",
"template",
",",
"final",
"String",
"expression",
",",
"final",
"TemplateElement",
"templateElement",
")",
"{",
"final",
"String",
"canonicalForm",
"=",
"templateElement",
".",
"getCanonicalFor... | Determines whether the specified expression exists in the specified
element (includes its children) of the specified template.
@param template the specified template
@param expression the specified expression
@param templateElement the specified element
@return {@code true} if it exists, returns {@code fal... | [
"Determines",
"whether",
"the",
"specified",
"expression",
"exists",
"in",
"the",
"specified",
"element",
"(",
"includes",
"its",
"children",
")",
"of",
"the",
"specified",
"template",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/Templates.java#L68-L88 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.hosting_web_cdn_cdnName_GET | public OvhPrice hosting_web_cdn_cdnName_GET(net.minidev.ovh.api.price.hosting.web.OvhCdnEnum cdnName) throws IOException {
"""
Get the price for cdn option
REST: GET /price/hosting/web/cdn/{cdnName}
@param cdnName [required] Cdn
"""
String qPath = "/price/hosting/web/cdn/{cdnName}";
StringBuilder sb = ... | java | public OvhPrice hosting_web_cdn_cdnName_GET(net.minidev.ovh.api.price.hosting.web.OvhCdnEnum cdnName) throws IOException {
String qPath = "/price/hosting/web/cdn/{cdnName}";
StringBuilder sb = path(qPath, cdnName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice.class);
} | [
"public",
"OvhPrice",
"hosting_web_cdn_cdnName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"hosting",
".",
"web",
".",
"OvhCdnEnum",
"cdnName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/hosting/web/cdn/... | Get the price for cdn option
REST: GET /price/hosting/web/cdn/{cdnName}
@param cdnName [required] Cdn | [
"Get",
"the",
"price",
"for",
"cdn",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L232-L237 |
Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreaker.java | CircuitBreaker.getServiceStatus | public ServiceStatus getServiceStatus() {
"""
Get the current {@link ServiceStatus} of the
{@link CircuitBreaker}, including the name,
{@link org.fishwife.jrugged.Status}, and reason.
@return the {@link ServiceStatus}.
"""
boolean canSendProbeRequest = !isHardTrip && lastFailure.get() > 0
... | java | public ServiceStatus getServiceStatus() {
boolean canSendProbeRequest = !isHardTrip && lastFailure.get() > 0
&& allowRequest();
if (byPass) {
return new ServiceStatus(name, Status.DEGRADED, "Bypassed");
}
switch(state) {
case OPEN:
re... | [
"public",
"ServiceStatus",
"getServiceStatus",
"(",
")",
"{",
"boolean",
"canSendProbeRequest",
"=",
"!",
"isHardTrip",
"&&",
"lastFailure",
".",
"get",
"(",
")",
">",
"0",
"&&",
"allowRequest",
"(",
")",
";",
"if",
"(",
"byPass",
")",
"{",
"return",
"new"... | Get the current {@link ServiceStatus} of the
{@link CircuitBreaker}, including the name,
{@link org.fishwife.jrugged.Status}, and reason.
@return the {@link ServiceStatus}. | [
"Get",
"the",
"current",
"{"
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreaker.java#L432-L450 |
Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/uniqueness/MultiRowUniquenessConstraint.java | MultiRowUniquenessConstraint.withRow | public MultiRowUniquenessConstraint withRow(ColumnFamily<String, String> columnFamily, String rowKey) {
"""
Add a row to the set of rows being tested for uniqueness
@param columnFamily
@param rowKey
"""
locks.add(new ColumnPrefixDistributedRowLock<String>(keyspace, columnFamily, rowKey));
r... | java | public MultiRowUniquenessConstraint withRow(ColumnFamily<String, String> columnFamily, String rowKey) {
locks.add(new ColumnPrefixDistributedRowLock<String>(keyspace, columnFamily, rowKey));
return this;
} | [
"public",
"MultiRowUniquenessConstraint",
"withRow",
"(",
"ColumnFamily",
"<",
"String",
",",
"String",
">",
"columnFamily",
",",
"String",
"rowKey",
")",
"{",
"locks",
".",
"add",
"(",
"new",
"ColumnPrefixDistributedRowLock",
"<",
"String",
">",
"(",
"keyspace",
... | Add a row to the set of rows being tested for uniqueness
@param columnFamily
@param rowKey | [
"Add",
"a",
"row",
"to",
"the",
"set",
"of",
"rows",
"being",
"tested",
"for",
"uniqueness"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/uniqueness/MultiRowUniquenessConstraint.java#L103-L106 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onCandlesticksEvent | public Closeable onCandlesticksEvent(final BiConsumer<BitfinexCandlestickSymbol, Collection<BitfinexCandle>> listener) {
"""
registers listener for candlesticks info updates
@param listener of event
@return hook of this listener
"""
candlesConsumers.offer(listener);
return () -> candlesConsum... | java | public Closeable onCandlesticksEvent(final BiConsumer<BitfinexCandlestickSymbol, Collection<BitfinexCandle>> listener) {
candlesConsumers.offer(listener);
return () -> candlesConsumers.remove(listener);
} | [
"public",
"Closeable",
"onCandlesticksEvent",
"(",
"final",
"BiConsumer",
"<",
"BitfinexCandlestickSymbol",
",",
"Collection",
"<",
"BitfinexCandle",
">",
">",
"listener",
")",
"{",
"candlesConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"(",
")",
... | registers listener for candlesticks info updates
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"candlesticks",
"info",
"updates"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L148-L151 |
plaid/plaid-java | src/main/java/com/plaid/client/PlaidClient.java | PlaidClient.parseError | public ErrorResponse parseError(Response response) {
"""
A helper to assist with decoding unsuccessful responses.
This is not done automatically, because an unsuccessful result may have many causes
such as network issues, intervening HTTP proxies, load balancers, partial responses, etc,
which means that a res... | java | public ErrorResponse parseError(Response response) {
if (response.isSuccessful()) {
throw new IllegalArgumentException("Response must be unsuccessful.");
}
Converter<ResponseBody, ErrorResponse> responseBodyObjectConverter =
retrofit.responseBodyConverter(ErrorResponse.class, new Annotation[0])... | [
"public",
"ErrorResponse",
"parseError",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
".",
"isSuccessful",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Response must be unsuccessful.\"",
")",
";",
"}",
"Converter",
"<",
... | A helper to assist with decoding unsuccessful responses.
This is not done automatically, because an unsuccessful result may have many causes
such as network issues, intervening HTTP proxies, load balancers, partial responses, etc,
which means that a response can easily be incomplete, or not even the expected well-form... | [
"A",
"helper",
"to",
"assist",
"with",
"decoding",
"unsuccessful",
"responses",
"."
] | train | https://github.com/plaid/plaid-java/blob/360f1f8a5178fa0c3c2c2e07a58f8ccec5f33117/src/main/java/com/plaid/client/PlaidClient.java#L80-L93 |
ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java | JcrManagedConnectionFactory.createConnectionFactory | @Override
public Object createConnectionFactory( ConnectionManager cxManager ) throws ResourceException {
"""
Creates a Connection Factory instance.
@param cxManager ConnectionManager to be associated with created EIS connection factory instance
@return EIS-specific Connection Factory instance or javax.res... | java | @Override
public Object createConnectionFactory( ConnectionManager cxManager ) throws ResourceException {
JcrRepositoryHandle handle = new JcrRepositoryHandle(this, cxManager);
return handle;
} | [
"@",
"Override",
"public",
"Object",
"createConnectionFactory",
"(",
"ConnectionManager",
"cxManager",
")",
"throws",
"ResourceException",
"{",
"JcrRepositoryHandle",
"handle",
"=",
"new",
"JcrRepositoryHandle",
"(",
"this",
",",
"cxManager",
")",
";",
"return",
"hand... | Creates a Connection Factory instance.
@param cxManager ConnectionManager to be associated with created EIS connection factory instance
@return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
@throws ResourceException Generic exception | [
"Creates",
"a",
"Connection",
"Factory",
"instance",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java#L153-L157 |
threerings/narya | core/src/main/java/com/threerings/presents/peer/server/PeerManager.java | PeerManager.proxyRemoteObject | public <T extends DObject> void proxyRemoteObject (
String nodeName, final int remoteOid, final ResultListener<Integer> listener) {
"""
Initiates a proxy on an object that is managed by the specified peer. The object will be
proxied into this server's distributed object space and its local oid reported ba... | java | public <T extends DObject> void proxyRemoteObject (
String nodeName, final int remoteOid, final ResultListener<Integer> listener)
{
proxyRemoteObject(new DObjectAddress(nodeName, remoteOid), listener);
} | [
"public",
"<",
"T",
"extends",
"DObject",
">",
"void",
"proxyRemoteObject",
"(",
"String",
"nodeName",
",",
"final",
"int",
"remoteOid",
",",
"final",
"ResultListener",
"<",
"Integer",
">",
"listener",
")",
"{",
"proxyRemoteObject",
"(",
"new",
"DObjectAddress",... | Initiates a proxy on an object that is managed by the specified peer. The object will be
proxied into this server's distributed object space and its local oid reported back to the
supplied result listener.
<p> Note that proxy requests <em>do not</em> stack like subscription requests. Only one
entity must issue a reque... | [
"Initiates",
"a",
"proxy",
"on",
"an",
"object",
"that",
"is",
"managed",
"by",
"the",
"specified",
"peer",
".",
"The",
"object",
"will",
"be",
"proxied",
"into",
"this",
"server",
"s",
"distributed",
"object",
"space",
"and",
"its",
"local",
"oid",
"repor... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L631-L635 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/xml/JodaBeanXmlWriter.java | JodaBeanXmlWriter.writeToBuilder | @Deprecated
public StringBuilder writeToBuilder(Bean bean, boolean rootType) {
"""
Writes the bean to the {@code StringBuilder}.
@param bean the bean to output, not null
@param rootType true to output the root type
@return the builder, not null
@deprecated Use {@link #write(Bean, boolean, Appendable)}
... | java | @Deprecated
public StringBuilder writeToBuilder(Bean bean, boolean rootType) {
try {
write(bean, rootType, this.builder);
} catch (IOException ex) {
throw new IllegalStateException(ex);
}
return builder;
} | [
"@",
"Deprecated",
"public",
"StringBuilder",
"writeToBuilder",
"(",
"Bean",
"bean",
",",
"boolean",
"rootType",
")",
"{",
"try",
"{",
"write",
"(",
"bean",
",",
"rootType",
",",
"this",
".",
"builder",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
"... | Writes the bean to the {@code StringBuilder}.
@param bean the bean to output, not null
@param rootType true to output the root type
@return the builder, not null
@deprecated Use {@link #write(Bean, boolean, Appendable)} | [
"Writes",
"the",
"bean",
"to",
"the",
"{",
"@code",
"StringBuilder",
"}",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/xml/JodaBeanXmlWriter.java#L160-L168 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/utils/JVMUtils.java | JVMUtils.findField | public static Field findField(Class<?> type, String fieldName ) {
"""
Find the field with the given name in the class. Will inspect all fields, independent
of access level.
@param type Class in which to search for the given field.
@param fieldName Name of the field for which to search.
@return The field, or n... | java | public static Field findField(Class<?> type, String fieldName ) {
while( type != null ) {
Field[] fields = type.getDeclaredFields();
for( Field field: fields ) {
if( field.getName().equals(fieldName) )
return field;
}
type = typ... | [
"public",
"static",
"Field",
"findField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"fieldName",
")",
"{",
"while",
"(",
"type",
"!=",
"null",
")",
"{",
"Field",
"[",
"]",
"fields",
"=",
"type",
".",
"getDeclaredFields",
"(",
")",
";",
"for... | Find the field with the given name in the class. Will inspect all fields, independent
of access level.
@param type Class in which to search for the given field.
@param fieldName Name of the field for which to search.
@return The field, or null if no such field exists. | [
"Find",
"the",
"field",
"with",
"the",
"given",
"name",
"in",
"the",
"class",
".",
"Will",
"inspect",
"all",
"fields",
"independent",
"of",
"access",
"level",
"."
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/utils/JVMUtils.java#L27-L37 |
fuinorg/event-store-commons | spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java | EscSpiUtils.createEscMeta | public static EscMeta createEscMeta(@NotNull final SerializerRegistry registry, @NotNull final EnhancedMimeType targetContentType,
@Nullable final CommonEvent commonEvent) {
"""
Create meta information for a given a {@link CommonEvent}.
@param registry
Registry with serializers.
@param targetConte... | java | public static EscMeta createEscMeta(@NotNull final SerializerRegistry registry, @NotNull final EnhancedMimeType targetContentType,
@Nullable final CommonEvent commonEvent) {
Contract.requireArgNotNull("registry", registry);
Contract.requireArgNotNull("targetContentType", targetContentType);... | [
"public",
"static",
"EscMeta",
"createEscMeta",
"(",
"@",
"NotNull",
"final",
"SerializerRegistry",
"registry",
",",
"@",
"NotNull",
"final",
"EnhancedMimeType",
"targetContentType",
",",
"@",
"Nullable",
"final",
"CommonEvent",
"commonEvent",
")",
"{",
"Contract",
... | Create meta information for a given a {@link CommonEvent}.
@param registry
Registry with serializers.
@param targetContentType
Content type that will later be used to serialize the created result.
@param commonEvent
Event to create meta information for.
@return New meta instance. | [
"Create",
"meta",
"information",
"for",
"a",
"given",
"a",
"{",
"@link",
"CommonEvent",
"}",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java#L197-L226 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/util/URLUtil.java | URLUtil.throwIOException | private static void throwIOException(Exception mex, String sysId)
throws IOException {
"""
Helper method that tries to fully convert strange URL-specific exception
to more general IO exception. Also, to try to use JDK 1.4 feature without
creating requirement, uses reflection to try to set the root cause,... | java | private static void throwIOException(Exception mex, String sysId)
throws IOException
{
String msg = "[resolving systemId '"+sysId+"']: "+mex.toString();
throw ExceptionUtil.constructIOException(msg, mex);
} | [
"private",
"static",
"void",
"throwIOException",
"(",
"Exception",
"mex",
",",
"String",
"sysId",
")",
"throws",
"IOException",
"{",
"String",
"msg",
"=",
"\"[resolving systemId '\"",
"+",
"sysId",
"+",
"\"']: \"",
"+",
"mex",
".",
"toString",
"(",
")",
";",
... | Helper method that tries to fully convert strange URL-specific exception
to more general IO exception. Also, to try to use JDK 1.4 feature without
creating requirement, uses reflection to try to set the root cause, if
we are running on JDK1.4 | [
"Helper",
"method",
"that",
"tries",
"to",
"fully",
"convert",
"strange",
"URL",
"-",
"specific",
"exception",
"to",
"more",
"general",
"IO",
"exception",
".",
"Also",
"to",
"try",
"to",
"use",
"JDK",
"1",
".",
"4",
"feature",
"without",
"creating",
"requi... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/URLUtil.java#L215-L220 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.setRow | public Matrix4x3d setRow(int row, Vector4dc src) throws IndexOutOfBoundsException {
"""
Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..2]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code... | java | public Matrix4x3d setRow(int row, Vector4dc src) throws IndexOutOfBoundsException {
switch (row) {
case 0:
this.m00 = src.x();
this.m10 = src.y();
this.m20 = src.z();
this.m30 = src.w();
break;
case 1:
this.m01 = src.x();
... | [
"public",
"Matrix4x3d",
"setRow",
"(",
"int",
"row",
",",
"Vector4dc",
"src",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"switch",
"(",
"row",
")",
"{",
"case",
"0",
":",
"this",
".",
"m00",
"=",
"src",
".",
"x",
"(",
")",
";",
"this",
".",
"m1... | Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..2]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>row</code> is not in <code>[0..2]</code> | [
"Set",
"the",
"row",
"at",
"the",
"given",
"<code",
">",
"row<",
"/",
"code",
">",
"index",
"starting",
"with",
"<code",
">",
"0<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L6018-L6043 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/utils/ScreenshotUtils.java | ScreenshotUtils.isSimilarToScreenshot | public static boolean isSimilarToScreenshot(IElement element, File controlPicture, File
toSaveAs, double threshold) throws IOException, WidgetException {
"""
*
Prereq: The page on which you are taking the screenshot is fully loaded
Take a screenshot of the element identified by element and save the file as ... | java | public static boolean isSimilarToScreenshot(IElement element, File controlPicture, File
toSaveAs, double threshold) throws IOException, WidgetException {
takeScreenshotOfElement(element, toSaveAs);
log.info("Screenshot was successful. Comparing against control...");
BufferedImage var = ImageIO.read(toSa... | [
"public",
"static",
"boolean",
"isSimilarToScreenshot",
"(",
"IElement",
"element",
",",
"File",
"controlPicture",
",",
"File",
"toSaveAs",
",",
"double",
"threshold",
")",
"throws",
"IOException",
",",
"WidgetException",
"{",
"takeScreenshotOfElement",
"(",
"element"... | *
Prereq: The page on which you are taking the screenshot is fully loaded
Take a screenshot of the element identified by element and save the file as toSaveAs
(Note that this file should be saved as a png).
Test that the control picture, controlPicture, is both the same size as,
and, has a similarity value greater tha... | [
"*",
"Prereq",
":",
"The",
"page",
"on",
"which",
"you",
"are",
"taking",
"the",
"screenshot",
"is",
"fully",
"loaded"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/utils/ScreenshotUtils.java#L147-L158 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java | GaliosFieldTableOps.polyScale | public void polyScale(GrowQueue_I8 input , int scale , GrowQueue_I8 output) {
"""
Scales the polynomial.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param input Input polynomial.
@param scale scale
@param output Output polynomial.
"""
output.resize(input.siz... | java | public void polyScale(GrowQueue_I8 input , int scale , GrowQueue_I8 output) {
output.resize(input.size);
for (int i = 0; i < input.size; i++) {
output.data[i] = (byte)multiply(input.data[i]&0xFF, scale);
}
} | [
"public",
"void",
"polyScale",
"(",
"GrowQueue_I8",
"input",
",",
"int",
"scale",
",",
"GrowQueue_I8",
"output",
")",
"{",
"output",
".",
"resize",
"(",
"input",
".",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"input",
".",
... | Scales the polynomial.
<p>Coefficients for largest powers are first, e.g. 2*x**3 + 8*x**2+1 = [2,8,0,1]</p>
@param input Input polynomial.
@param scale scale
@param output Output polynomial. | [
"Scales",
"the",
"polynomial",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldTableOps.java#L129-L136 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java | NonCollectionMethodUse.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
implements the visitor to look for method calls that are one of the old pre-collections1.2 set of methods
@param seen
the currently parsed opcode
"""
if (seen == Const.INVOKEVIRTUAL) {
String className = getClassConstantOperand();
... | java | @Override
public void sawOpcode(int seen) {
if (seen == Const.INVOKEVIRTUAL) {
String className = getClassConstantOperand();
String methodName = getNameConstantOperand();
String methodSig = getSigConstantOperand();
FQMethod methodInfo = new FQMethod(className... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"if",
"(",
"seen",
"==",
"Const",
".",
"INVOKEVIRTUAL",
")",
"{",
"String",
"className",
"=",
"getClassConstantOperand",
"(",
")",
";",
"String",
"methodName",
"=",
"getNameConstan... | implements the visitor to look for method calls that are one of the old pre-collections1.2 set of methods
@param seen
the currently parsed opcode | [
"implements",
"the",
"visitor",
"to",
"look",
"for",
"method",
"calls",
"that",
"are",
"one",
"of",
"the",
"old",
"pre",
"-",
"collections1",
".",
"2",
"set",
"of",
"methods"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java#L70-L83 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static File generate(String content, QrConfig config, File targetFile) {
"""
生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件
@since 4.1.2
"""
final BufferedImage image = generate(content, config);
ImgUtil.write(ima... | java | public static File generate(String content, QrConfig config, File targetFile) {
final BufferedImage image = generate(content, config);
ImgUtil.write(image, targetFile);
return targetFile;
} | [
"public",
"static",
"File",
"generate",
"(",
"String",
"content",
",",
"QrConfig",
"config",
",",
"File",
"targetFile",
")",
"{",
"final",
"BufferedImage",
"image",
"=",
"generate",
"(",
"content",
",",
"config",
")",
";",
"ImgUtil",
".",
"write",
"(",
"im... | 生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件
@since 4.1.2 | [
"生成二维码到文件,二维码图片格式取决于文件的扩展名"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L91-L95 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java | DialogFragmentUtils.dismissOnLoaderCallback | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void dismissOnLoaderCallback(Handler handler, final android.app.FragmentManager manager, final String tag) {
"""
Dismiss {@link android.app.DialogFragment} for the tag on the loader callbacks with the specified {@link android.os.Handler}.
@param handler ... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void dismissOnLoaderCallback(Handler handler, final android.app.FragmentManager manager, final String tag) {
handler.post(new Runnable() {
@Override
public void run() {
android.app.DialogFragment fragment = (andr... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"dismissOnLoaderCallback",
"(",
"Handler",
"handler",
",",
"final",
"android",
".",
"app",
".",
"FragmentManager",
"manager",
",",
"final",
"String",
"tag",
... | Dismiss {@link android.app.DialogFragment} for the tag on the loader callbacks with the specified {@link android.os.Handler}.
@param handler the handler, in most case, this handler is the main handler.
@param manager the manager.
@param tag the tag string that is related to the {@link android.app.DialogFragment}. | [
"Dismiss",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L75-L86 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java | JobStepsInner.getByVersion | public JobStepInner getByVersion(String resourceGroupName, String serverName, String jobAgentName, String jobName, int jobVersion, String stepName) {
"""
Gets the specified version of a job step.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from t... | java | public JobStepInner getByVersion(String resourceGroupName, String serverName, String jobAgentName, String jobName, int jobVersion, String stepName) {
return getByVersionWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, stepName).toBlocking().single().body();
} | [
"public",
"JobStepInner",
"getByVersion",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"String",
"jobName",
",",
"int",
"jobVersion",
",",
"String",
"stepName",
")",
"{",
"return",
"getByVersionWithServiceRespons... | Gets the specified version of a job step.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The name of ... | [
"Gets",
"the",
"specified",
"version",
"of",
"a",
"job",
"step",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java#L256-L258 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParserWpt.java | GpxParserWpt.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
"""
Fires whenever an XML start markup is encountered. It saves informations
about <link> in currentPoint.
@param uri URI of the local element
@param localName Name of the local elem... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
super.startElement(uri, localName, qName, attributes);
if (localName.equalsIgnoreCase(GPXTags.LINK)) {
getCurrentPoint().setLink(attributes);
}
} | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"super",
".",
"startElement",
"(",
"uri",
",",
"localName",
",",
... | Fires whenever an XML start markup is encountered. It saves informations
about <link> in currentPoint.
@param uri URI of the local element
@param localName Name of the local element (without prefix)
@param qName qName of the local element (with prefix)
@param attributes Attributes of the local element (contained in th... | [
"Fires",
"whenever",
"an",
"XML",
"start",
"markup",
"is",
"encountered",
".",
"It",
"saves",
"informations",
"about",
"<link",
">",
"in",
"currentPoint",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GpxParserWpt.java#L58-L64 |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java | JsonRenderer.addSerializer | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
"""
This method gives the opportunity to add a custom serializer to serializer
one of the highchart option classes. It may be neccessary to serialize
certain option classes differently for different web frameworks.
@para... | java | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
this.jacksonModule.addSerializer(clazz, serializer);
} | [
"public",
"<",
"T",
">",
"void",
"addSerializer",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"JsonSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"this",
".",
"jacksonModule",
".",
"addSerializer",
"(",
"clazz",
",",
"serializer",
"... | This method gives the opportunity to add a custom serializer to serializer
one of the highchart option classes. It may be neccessary to serialize
certain option classes differently for different web frameworks.
@param clazz the option class
@param serializer the serializer responsible for serializing objects of t... | [
"This",
"method",
"gives",
"the",
"opportunity",
"to",
"add",
"a",
"custom",
"serializer",
"to",
"serializer",
"one",
"of",
"the",
"highchart",
"option",
"classes",
".",
"It",
"may",
"be",
"neccessary",
"to",
"serialize",
"certain",
"option",
"classes",
"diffe... | train | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java#L65-L67 |
matthewhorridge/mdock | src/main/java/org/coode/mdock/SplitterNode.java | SplitterNode.insertNodeAfter | public void insertNodeAfter(Node insert, Node after, int direction) {
"""
Inserts a node after (right of or bottom of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param after The node that the inserted node will be split with.
@param direction ... | java | public void insertNodeAfter(Node insert, Node after, int direction) {
if (isSplitterDirection(direction)) {
double split = getSplit(after) / 2;
setSplit(after, split);
addChild(insert, children.indexOf(after) + 1, split);
}
else {
pushDown(after, a... | [
"public",
"void",
"insertNodeAfter",
"(",
"Node",
"insert",
",",
"Node",
"after",
",",
"int",
"direction",
")",
"{",
"if",
"(",
"isSplitterDirection",
"(",
"direction",
")",
")",
"{",
"double",
"split",
"=",
"getSplit",
"(",
"after",
")",
"/",
"2",
";",
... | Inserts a node after (right of or bottom of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param after The node that the inserted node will be split with.
@param direction The direction of the split | [
"Inserts",
"a",
"node",
"after",
"(",
"right",
"of",
"or",
"bottom",
"of",
")",
"a",
"given",
"node",
"by",
"splitting",
"the",
"inserted",
"node",
"with",
"the",
"given",
"node",
"."
] | train | https://github.com/matthewhorridge/mdock/blob/37839a56f30bdb73d56d82c4d1afe548d66b404b/src/main/java/org/coode/mdock/SplitterNode.java#L272-L282 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java | ProxyUtil.createClientProxy | @SuppressWarnings( {
"""
Creates a {@link Proxy} of the given {@code proxyInterface}
that uses the given {@link JsonRpcClient}.
@param <T> the proxy type
@param classLoader the {@link ClassLoader}
@param proxyInterface the interface to proxy
@param client the {@link JsonRpcClient}
@pa... | java | @SuppressWarnings({"unchecked", "WeakerAccess"})
public static <T> T createClientProxy(ClassLoader classLoader, Class<T> proxyInterface, final JsonRpcClient client, final InputStream input, final OutputStream output) {
// create and return the proxy
return (T) Proxy.newProxyInstance(classLoader, new Class<?>[]{... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"createClientProxy",
"(",
"ClassLoader",
"classLoader",
",",
"Class",
"<",
"T",
">",
"proxyInterface",
",",
"final",
"JsonRpcClient",
... | Creates a {@link Proxy} of the given {@code proxyInterface}
that uses the given {@link JsonRpcClient}.
@param <T> the proxy type
@param classLoader the {@link ClassLoader}
@param proxyInterface the interface to proxy
@param client the {@link JsonRpcClient}
@param input the {@link InputSt... | [
"Creates",
"a",
"{",
"@link",
"Proxy",
"}",
"of",
"the",
"given",
"{",
"@code",
"proxyInterface",
"}",
"that",
"uses",
"the",
"given",
"{",
"@link",
"JsonRpcClient",
"}",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java#L146-L160 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.createOrUpdate | public WorkflowInner createOrUpdate(String resourceGroupName, String workflowName, WorkflowInner workflow) {
"""
Creates or updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentException thrown if par... | java | public WorkflowInner createOrUpdate(String resourceGroupName, String workflowName, WorkflowInner workflow) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, workflowName, workflow).toBlocking().single().body();
} | [
"public",
"WorkflowInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"WorkflowInner",
"workflow",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
",",
"workflow",
... | Creates or updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all... | [
"Creates",
"or",
"updates",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L694-L696 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.loadImageIcon | public ImageIcon loadImageIcon(String filename, String description) {
"""
Get this image.
@param filename The filename of this image (if no path, assumes images/buttons; if not ext assumes .gif).
@param description The image description.
@return The image.
"""
filename = Util.getImageFilename(filena... | java | public ImageIcon loadImageIcon(String filename, String description)
{
filename = Util.getImageFilename(filename, "buttons");
URL url = null;
if (this.getApplication() != null)
url = this.getApplication().getResourceURL(filename, this);
if (url == null)
{ // Not a ... | [
"public",
"ImageIcon",
"loadImageIcon",
"(",
"String",
"filename",
",",
"String",
"description",
")",
"{",
"filename",
"=",
"Util",
".",
"getImageFilename",
"(",
"filename",
",",
"\"buttons\"",
")",
";",
"URL",
"url",
"=",
"null",
";",
"if",
"(",
"this",
"... | Get this image.
@param filename The filename of this image (if no path, assumes images/buttons; if not ext assumes .gif).
@param description The image description.
@return The image. | [
"Get",
"this",
"image",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L655-L671 |
find-sec-bugs/find-sec-bugs | findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java | BasicInjectionDetector.loadSink | protected void loadSink(String line, String bugType) {
"""
Loads a single taint sink (like a line of configuration)
@param line specification of the sink
@param bugType type of an injection bug
"""
SINKS_LOADER.loadSink(line, bugType, new SinksLoader.InjectionPointReceiver() {
@Override... | java | protected void loadSink(String line, String bugType) {
SINKS_LOADER.loadSink(line, bugType, new SinksLoader.InjectionPointReceiver() {
@Override
public void receiveInjectionPoint(String fullMethodName, InjectionPoint injectionPoint) {
addParsedInjectionPoint(fullMethodNam... | [
"protected",
"void",
"loadSink",
"(",
"String",
"line",
",",
"String",
"bugType",
")",
"{",
"SINKS_LOADER",
".",
"loadSink",
"(",
"line",
",",
"bugType",
",",
"new",
"SinksLoader",
".",
"InjectionPointReceiver",
"(",
")",
"{",
"@",
"Override",
"public",
"voi... | Loads a single taint sink (like a line of configuration)
@param line specification of the sink
@param bugType type of an injection bug | [
"Loads",
"a",
"single",
"taint",
"sink",
"(",
"like",
"a",
"line",
"of",
"configuration",
")"
] | train | https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java#L176-L183 |
cdk/cdk | storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java | InChIGeneratorFactory.getInChIGenerator | public InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException {
"""
Gets InChI generator for CDK IAtomContainer.
@param container AtomContainer to generate InChI for.
@param options String of options for InChI generation.
@return the InChI generator object
@t... | java | public InChIGenerator getInChIGenerator(IAtomContainer container, String options) throws CDKException {
return (new InChIGenerator(container, options, ignoreAromaticBonds));
} | [
"public",
"InChIGenerator",
"getInChIGenerator",
"(",
"IAtomContainer",
"container",
",",
"String",
"options",
")",
"throws",
"CDKException",
"{",
"return",
"(",
"new",
"InChIGenerator",
"(",
"container",
",",
"options",
",",
"ignoreAromaticBonds",
")",
")",
";",
... | Gets InChI generator for CDK IAtomContainer.
@param container AtomContainer to generate InChI for.
@param options String of options for InChI generation.
@return the InChI generator object
@throws CDKException if the generator cannot be instantiated | [
"Gets",
"InChI",
"generator",
"for",
"CDK",
"IAtomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java#L158-L160 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br_broker/br_app_by_wan_volume.java | br_app_by_wan_volume.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
br_app_by_wan_volume_responses result = (br_app_by_wan_volume_responses... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_app_by_wan_volume_responses result = (br_app_by_wan_volume_responses) service.get_payload_formatter().string_to_resource(br_app_by_wan_volume_responses.class, response);
if(result.errorcode != 0)
{... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_app_by_wan_volume_responses",
"result",
"=",
"(",
"br_app_by_wan_volume_responses",
")",
"service",
".",
"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br_broker/br_app_by_wan_volume.java#L262-L279 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/util/TypeUtils.java | TypeUtils.getAnnotation | public static <T extends Annotation> T getAnnotation(Object context, Class<T> annotation) {
"""
<p>Takes the target {@link IckleActivity} and finds the given
annotation (if any).</p>
@param injectorActivity
the {@link IckleActivity} whose metadata is searched
<br><br>
@param annotation
the {@link Class} of... | java | public static <T extends Annotation> T getAnnotation(Object context, Class<T> annotation) {
Class<?> contextClass = context.getClass();
if(contextClass.isAnnotationPresent(annotation)) {
return contextClass.getAnnotation(annotation);
}
else {
return null;
}
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Object",
"context",
",",
"Class",
"<",
"T",
">",
"annotation",
")",
"{",
"Class",
"<",
"?",
">",
"contextClass",
"=",
"context",
".",
"getClass",
"(",
")",
";",
"if... | <p>Takes the target {@link IckleActivity} and finds the given
annotation (if any).</p>
@param injectorActivity
the {@link IckleActivity} whose metadata is searched
<br><br>
@param annotation
the {@link Class} of the {@link Annotation} to look for
<br><br>
@since 1.0.0 | [
"<p",
">",
"Takes",
"the",
"target",
"{",
"@link",
"IckleActivity",
"}",
"and",
"finds",
"the",
"given",
"annotation",
"(",
"if",
"any",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/util/TypeUtils.java#L58-L70 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.headerFragment | public T headerFragment(Object model, ObjectMapper objectMapper) {
"""
Expect this message header data as model object which is mapped to a character sequence
using the default object to json mapper before validation is performed.
@param model
@param objectMapper
@return
"""
try {
retur... | java | public T headerFragment(Object model, ObjectMapper objectMapper) {
try {
return header(objectMapper.writer().writeValueAsString(model));
} catch (JsonProcessingException e) {
throw new CitrusRuntimeException("Failed to map object graph for message header data", e);
}
... | [
"public",
"T",
"headerFragment",
"(",
"Object",
"model",
",",
"ObjectMapper",
"objectMapper",
")",
"{",
"try",
"{",
"return",
"header",
"(",
"objectMapper",
".",
"writer",
"(",
")",
".",
"writeValueAsString",
"(",
"model",
")",
")",
";",
"}",
"catch",
"(",... | Expect this message header data as model object which is mapped to a character sequence
using the default object to json mapper before validation is performed.
@param model
@param objectMapper
@return | [
"Expect",
"this",
"message",
"header",
"data",
"as",
"model",
"object",
"which",
"is",
"mapped",
"to",
"a",
"character",
"sequence",
"using",
"the",
"default",
"object",
"to",
"json",
"mapper",
"before",
"validation",
"is",
"performed",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L406-L412 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/StochasticGradientApproximation.java | StochasticGradientApproximation.getEpsilon | private static double getEpsilon(IntDoubleVector x, IntDoubleVector d) {
"""
Gets an epsilon constant as advised by Andrei (2009).
See also, http://timvieira.github.io/blog/post/2014/02/10/gradient-vector-product/.
"""
double machineEpsilon = 2.2204460492503131e-16;
double xInfNorm = DoubleArr... | java | private static double getEpsilon(IntDoubleVector x, IntDoubleVector d) {
double machineEpsilon = 2.2204460492503131e-16;
double xInfNorm = DoubleArrays.infinityNorm(x.toNativeArray());
double dInfNorm = DoubleArrays.infinityNorm(d.toNativeArray());
return machineEpsilon * (1.0 + xInfNorm... | [
"private",
"static",
"double",
"getEpsilon",
"(",
"IntDoubleVector",
"x",
",",
"IntDoubleVector",
"d",
")",
"{",
"double",
"machineEpsilon",
"=",
"2.2204460492503131e-16",
";",
"double",
"xInfNorm",
"=",
"DoubleArrays",
".",
"infinityNorm",
"(",
"x",
".",
"toNativ... | Gets an epsilon constant as advised by Andrei (2009).
See also, http://timvieira.github.io/blog/post/2014/02/10/gradient-vector-product/. | [
"Gets",
"an",
"epsilon",
"constant",
"as",
"advised",
"by",
"Andrei",
"(",
"2009",
")",
".",
"See",
"also",
"http",
":",
"//",
"timvieira",
".",
"github",
".",
"io",
"/",
"blog",
"/",
"post",
"/",
"2014",
"/",
"02",
"/",
"10",
"/",
"gradient",
"-",... | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/StochasticGradientApproximation.java#L94-L99 |
VoltDB/voltdb | src/frontend/org/voltdb/importclient/kafka10/KafkaLoader.java | KafkaLoader.getVoltClient | private static Client getVoltClient(ClientConfig config, List<String> hosts) throws Exception {
"""
/*
Create a Volt client from the supplied configuration and list of servers.
"""
config.setTopologyChangeAware(true);
final Client client = ClientFactory.createClient(config);
for (Strin... | java | private static Client getVoltClient(ClientConfig config, List<String> hosts) throws Exception {
config.setTopologyChangeAware(true);
final Client client = ClientFactory.createClient(config);
for (String host : hosts) {
try {
client.createConnection(host);
... | [
"private",
"static",
"Client",
"getVoltClient",
"(",
"ClientConfig",
"config",
",",
"List",
"<",
"String",
">",
"hosts",
")",
"throws",
"Exception",
"{",
"config",
".",
"setTopologyChangeAware",
"(",
"true",
")",
";",
"final",
"Client",
"client",
"=",
"ClientF... | /*
Create a Volt client from the supplied configuration and list of servers. | [
"/",
"*",
"Create",
"a",
"Volt",
"client",
"from",
"the",
"supplied",
"configuration",
"and",
"list",
"of",
"servers",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kafka10/KafkaLoader.java#L282-L300 |
m-m-m/util | pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java | AbstractPojoPathNavigator.getFromList | protected Object getFromList(CachingPojoPath currentPath, PojoPathContext context, PojoPathState state, int index) {
"""
This method {@link CollectionReflectionUtil#get(Object, int) gets} the single {@link CachingPojoPath#getIndex()
segment} of the given {@code currentPath} from the array or {@link java.util.List... | java | protected Object getFromList(CachingPojoPath currentPath, PojoPathContext context, PojoPathState state, int index) {
// handle indexed segment for collection/list or array...
currentPath.pojoType = currentPath.parent.pojoType.getComponentType();
if (currentPath.pojoType == null) {
currentPath.pojoTyp... | [
"protected",
"Object",
"getFromList",
"(",
"CachingPojoPath",
"currentPath",
",",
"PojoPathContext",
"context",
",",
"PojoPathState",
"state",
",",
"int",
"index",
")",
"{",
"// handle indexed segment for collection/list or array...",
"currentPath",
".",
"pojoType",
"=",
... | This method {@link CollectionReflectionUtil#get(Object, int) gets} the single {@link CachingPojoPath#getIndex()
segment} of the given {@code currentPath} from the array or {@link java.util.List} given by {@code parentPojo}. If
the result is {@code null} and {@link PojoPathState#getMode() mode} is {@link PojoPathMode#CR... | [
"This",
"method",
"{",
"@link",
"CollectionReflectionUtil#get",
"(",
"Object",
"int",
")",
"gets",
"}",
"the",
"single",
"{",
"@link",
"CachingPojoPath#getIndex",
"()",
"segment",
"}",
"of",
"the",
"given",
"{",
"@code",
"currentPath",
"}",
"from",
"the",
"arr... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java#L532-L552 |
restfb/restfb | src/main/lombok/com/restfb/BinaryAttachment.java | BinaryAttachment.with | public static BinaryAttachment with(String fieldName, String filename, byte[] data) {
"""
Creates a binary attachment.
@param filename
The attachment's filename.
@param data
The attachment's data.
@param fieldName
The field name the binary belongs to
@return A binary attachment.
@throws IllegalArgumentEx... | java | public static BinaryAttachment with(String fieldName, String filename, byte[] data) {
return new BinaryAttachment(fieldName, filename, data);
} | [
"public",
"static",
"BinaryAttachment",
"with",
"(",
"String",
"fieldName",
",",
"String",
"filename",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"return",
"new",
"BinaryAttachment",
"(",
"fieldName",
",",
"filename",
",",
"data",
")",
";",
"}"
] | Creates a binary attachment.
@param filename
The attachment's filename.
@param data
The attachment's data.
@param fieldName
The field name the binary belongs to
@return A binary attachment.
@throws IllegalArgumentException
If {@code data} is {@code null} or {@code filename} is {@code null} or blank.
@since 1.6.17 | [
"Creates",
"a",
"binary",
"attachment",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/lombok/com/restfb/BinaryAttachment.java#L336-L338 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.setView | public void setView(int which , boolean fixed , Se3_F64 worldToView ) {
"""
Specifies the spacial transform for a view.
@param which Which view is being specified/
@param fixed If these parameters are fixed or not
@param worldToView The transform from world to view reference frames
"""
views[which].known ... | java | public void setView(int which , boolean fixed , Se3_F64 worldToView ) {
views[which].known = fixed;
views[which].worldToView.set(worldToView);
} | [
"public",
"void",
"setView",
"(",
"int",
"which",
",",
"boolean",
"fixed",
",",
"Se3_F64",
"worldToView",
")",
"{",
"views",
"[",
"which",
"]",
".",
"known",
"=",
"fixed",
";",
"views",
"[",
"which",
"]",
".",
"worldToView",
".",
"set",
"(",
"worldToVi... | Specifies the spacial transform for a view.
@param which Which view is being specified/
@param fixed If these parameters are fixed or not
@param worldToView The transform from world to view reference frames | [
"Specifies",
"the",
"spacial",
"transform",
"for",
"a",
"view",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L154-L157 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/ObjectCacheTwoLevelImpl.java | ObjectCacheTwoLevelImpl.beforeClose | public void beforeClose(PBStateEvent event) {
"""
Before closing the PersistenceBroker ensure that the session
cache is cleared
"""
/*
arminw:
this is a workaround for use in managed environments. When a PB instance is used
within a container a PB.close call is done when le... | java | public void beforeClose(PBStateEvent event)
{
/*
arminw:
this is a workaround for use in managed environments. When a PB instance is used
within a container a PB.close call is done when leave the container method. This close
the PB handle (but the real instance is still... | [
"public",
"void",
"beforeClose",
"(",
"PBStateEvent",
"event",
")",
"{",
"/*\r\n arminw:\r\n this is a workaround for use in managed environments. When a PB instance is used\r\n within a container a PB.close call is done when leave the container method. This close\r\n the... | Before closing the PersistenceBroker ensure that the session
cache is cleared | [
"Before",
"closing",
"the",
"PersistenceBroker",
"ensure",
"that",
"the",
"session",
"cache",
"is",
"cleared"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/ObjectCacheTwoLevelImpl.java#L518-L536 |
99soft/sameas4j | src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java | AbstractEquivalenceDeserializer.getEquivalence | public Equivalence getEquivalence(JsonElement json) {
"""
Deserialize a single {@link org.nnsoft.sameas4j.Equivalence}
from its Json serialization.
@param json object to be deserialized
@return a not null {@link org.nnsoft.sameas4j.Equivalence} instance
"""
Equivalence equivalence;
String ... | java | public Equivalence getEquivalence(JsonElement json) {
Equivalence equivalence;
String uriString = json.getAsJsonObject().getAsJsonPrimitive(URI).getAsString();
URI uri;
try {
uri = new URI(urlEncode(uriString));
} catch (Exception e) {
throw new JsonParseE... | [
"public",
"Equivalence",
"getEquivalence",
"(",
"JsonElement",
"json",
")",
"{",
"Equivalence",
"equivalence",
";",
"String",
"uriString",
"=",
"json",
".",
"getAsJsonObject",
"(",
")",
".",
"getAsJsonPrimitive",
"(",
"URI",
")",
".",
"getAsString",
"(",
")",
... | Deserialize a single {@link org.nnsoft.sameas4j.Equivalence}
from its Json serialization.
@param json object to be deserialized
@return a not null {@link org.nnsoft.sameas4j.Equivalence} instance | [
"Deserialize",
"a",
"single",
"{",
"@link",
"org",
".",
"nnsoft",
".",
"sameas4j",
".",
"Equivalence",
"}",
"from",
"its",
"Json",
"serialization",
"."
] | train | https://github.com/99soft/sameas4j/blob/d6fcb6a137c5a80278001a6d11ee917be4f5ea41/src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java#L144-L164 |
RuedigerMoeller/kontraktor | src/main/java/org/nustaq/kontraktor/asyncio/AsyncFile.java | AsyncFile.asOutputStream | public OutputStream asOutputStream() {
"""
return a pseudo-blocking output stream. Note: due to limitations of the current await implementation (stack based),
when writing many files concurrently from a single actor thread don't mix high latency file locations (e.g. remote file systems vs. local)
with low latenc... | java | public OutputStream asOutputStream() {
if ( tmp != null )
throw new RuntimeException("can create Input/OutputStream only once");
tmp = new byte[1];
return new OutputStream() {
@Override
public void write(int b) throws IOException {
tmp[0] = (b... | [
"public",
"OutputStream",
"asOutputStream",
"(",
")",
"{",
"if",
"(",
"tmp",
"!=",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"can create Input/OutputStream only once\"",
")",
";",
"tmp",
"=",
"new",
"byte",
"[",
"1",
"]",
";",
"return",
"new",
... | return a pseudo-blocking output stream. Note: due to limitations of the current await implementation (stack based),
when writing many files concurrently from a single actor thread don't mix high latency file locations (e.g. remote file systems vs. local)
with low latency ones. If this is required, fall back to the more... | [
"return",
"a",
"pseudo",
"-",
"blocking",
"output",
"stream",
".",
"Note",
":",
"due",
"to",
"limitations",
"of",
"the",
"current",
"await",
"implementation",
"(",
"stack",
"based",
")",
"when",
"writing",
"many",
"files",
"concurrently",
"from",
"a",
"singl... | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/src/main/java/org/nustaq/kontraktor/asyncio/AsyncFile.java#L107-L142 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java | FlowLoaderUtils.setPropsInYamlFile | public static void setPropsInYamlFile(final String path, final File flowFile, final Props prop) {
"""
Sets props in flow yaml file.
@param path the flow or job path delimited by ":", e.g. "flow:subflow1:subflow2:job3"
@param flowFile the flow yaml file
@param prop the props to set
"""
final DumperOpti... | java | public static void setPropsInYamlFile(final String path, final File flowFile, final Props prop) {
final DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(FlowStyle.BLOCK);
final NodeBean nodeBean = FlowLoaderUtils.setPropsInNodeBean(path, flowFile, prop);
try (final BufferedWriter... | [
"public",
"static",
"void",
"setPropsInYamlFile",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"flowFile",
",",
"final",
"Props",
"prop",
")",
"{",
"final",
"DumperOptions",
"options",
"=",
"new",
"DumperOptions",
"(",
")",
";",
"options",
".",
"set... | Sets props in flow yaml file.
@param path the flow or job path delimited by ":", e.g. "flow:subflow1:subflow2:job3"
@param flowFile the flow yaml file
@param prop the props to set | [
"Sets",
"props",
"in",
"flow",
"yaml",
"file",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/FlowLoaderUtils.java#L61-L72 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base64.java | Base64.decodeToFile | public static File decodeToFile(String base64, File destFile) {
"""
base64解码
@param base64 被解码的base64字符串
@param destFile 目标文件
@return 目标文件
@since 4.0.9
"""
return FileUtil.writeBytes(Base64Decoder.decode(base64), destFile);
} | java | public static File decodeToFile(String base64, File destFile) {
return FileUtil.writeBytes(Base64Decoder.decode(base64), destFile);
} | [
"public",
"static",
"File",
"decodeToFile",
"(",
"String",
"base64",
",",
"File",
"destFile",
")",
"{",
"return",
"FileUtil",
".",
"writeBytes",
"(",
"Base64Decoder",
".",
"decode",
"(",
"base64",
")",
",",
"destFile",
")",
";",
"}"
] | base64解码
@param base64 被解码的base64字符串
@param destFile 目标文件
@return 目标文件
@since 4.0.9 | [
"base64解码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java#L289-L291 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java | ImageLoaderCurrent.processLocalNameINodes | private void processLocalNameINodes(DataInputStream in, ImageVisitor v,
long numInodes, boolean skipBlocks) throws IOException {
"""
Process image with full path name
@param in image stream
@param v visitor
@param numInodes number of indoes to read
@param skipBlocks skip blocks or not
@throws IOExcept... | java | private void processLocalNameINodes(DataInputStream in, ImageVisitor v,
long numInodes, boolean skipBlocks) throws IOException {
// process root
processINode(in, v, skipBlocks, "");
numInodes--;
while (numInodes > 0) {
numInodes -= processDirectory(in, v, skipBlocks);
}
} | [
"private",
"void",
"processLocalNameINodes",
"(",
"DataInputStream",
"in",
",",
"ImageVisitor",
"v",
",",
"long",
"numInodes",
",",
"boolean",
"skipBlocks",
")",
"throws",
"IOException",
"{",
"// process root",
"processINode",
"(",
"in",
",",
"v",
",",
"skipBlocks... | Process image with full path name
@param in image stream
@param v visitor
@param numInodes number of indoes to read
@param skipBlocks skip blocks or not
@throws IOException if there is any error occurs | [
"Process",
"image",
"with",
"full",
"path",
"name"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java#L346-L354 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/QueryRow.java | QueryRow.put | protected void put(String name, String val) {
"""
This method was created in VisualAge.
@param name java.lang.String
@param val java.lang.String
"""
if (val == null) {
row.put(name, "");
}
else {
row.put(name, val);
}
} | java | protected void put(String name, String val) {
if (val == null) {
row.put(name, "");
}
else {
row.put(name, val);
}
} | [
"protected",
"void",
"put",
"(",
"String",
"name",
",",
"String",
"val",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"row",
".",
"put",
"(",
"name",
",",
"\"\"",
")",
";",
"}",
"else",
"{",
"row",
".",
"put",
"(",
"name",
",",
"val",
... | This method was created in VisualAge.
@param name java.lang.String
@param val java.lang.String | [
"This",
"method",
"was",
"created",
"in",
"VisualAge",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/QueryRow.java#L54-L61 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/util/Preconditions.java | Preconditions.checkArgument | public static void checkArgument(boolean expression, String errorMessage, String... args) {
"""
Ensures the truth of an expression involving one or more parameters to the
calling method.
@param expression a boolean expression
@param errorMessage the error message that can be a formattable string
@param arg... | java | public static void checkArgument(boolean expression, String errorMessage, String... args) {
if (!expression) {
if (args != null && args.length > 0) {
String message = String.format(errorMessage, args);
throw new IllegalArgumentException(message);
} else {
throw new IllegalArgumen... | [
"public",
"static",
"void",
"checkArgument",
"(",
"boolean",
"expression",
",",
"String",
"errorMessage",
",",
"String",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
">",
... | Ensures the truth of an expression involving one or more parameters to the
calling method.
@param expression a boolean expression
@param errorMessage the error message that can be a formattable string
@param args arguments if using a formatted string
@throws IllegalArgumentException if {@code expression} is false | [
"Ensures",
"the",
"truth",
"of",
"an",
"expression",
"involving",
"one",
"or",
"more",
"parameters",
"to",
"the",
"calling",
"method",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/util/Preconditions.java#L59-L68 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.checkPatternMatching | private void checkPatternMatching(Map<String, PatternCacheControl> patterns, String specificPattern, String generalPattern) {
"""
Checks if the first pattern can be included in the second one and resolves directive conflicts if needed
@param patterns
@param specificPattern
@param generalPattern
"""
... | java | private void checkPatternMatching(Map<String, PatternCacheControl> patterns, String specificPattern, String generalPattern) {
if (PatternMatcherUtils.caseInsensitiveMatch(specificPattern, generalPattern)) {
PatternCacheControl specificPatternDirective = patterns.get(specificPattern);
Pat... | [
"private",
"void",
"checkPatternMatching",
"(",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"patterns",
",",
"String",
"specificPattern",
",",
"String",
"generalPattern",
")",
"{",
"if",
"(",
"PatternMatcherUtils",
".",
"caseInsensitiveMatch",
"(",
"speci... | Checks if the first pattern can be included in the second one and resolves directive conflicts if needed
@param patterns
@param specificPattern
@param generalPattern | [
"Checks",
"if",
"the",
"first",
"pattern",
"can",
"be",
"included",
"in",
"the",
"second",
"one",
"and",
"resolves",
"directive",
"conflicts",
"if",
"needed"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L177-L184 |
apollographql/apollo-android | apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/CodegenGenerationTaskCommandArgsBuilder.java | CodegenGenerationTaskCommandArgsBuilder.codeGenArgs | private List<ApolloCodegenIRArgs> codeGenArgs(Set<File> files) {
"""
Extracts schema files from the task inputs and sorts them in a way similar to the Gradle lookup priority. That is,
build variant source set, build type source set, product flavor source set and finally main source set.
The schema file under t... | java | private List<ApolloCodegenIRArgs> codeGenArgs(Set<File> files) {
final List<File> schemaFiles = getSchemaFilesFrom(files);
if (schemaFiles.isEmpty()) {
throw new GradleException("Couldn't find schema files for the variant " + Utils.capitalize(variant) + ". Please" +
" ensure a valid schema.json... | [
"private",
"List",
"<",
"ApolloCodegenIRArgs",
">",
"codeGenArgs",
"(",
"Set",
"<",
"File",
">",
"files",
")",
"{",
"final",
"List",
"<",
"File",
">",
"schemaFiles",
"=",
"getSchemaFilesFrom",
"(",
"files",
")",
";",
"if",
"(",
"schemaFiles",
".",
"isEmpty... | Extracts schema files from the task inputs and sorts them in a way similar to the Gradle lookup priority. That is,
build variant source set, build type source set, product flavor source set and finally main source set.
The schema file under the source set with the highest priority is used and all the graphql query fil... | [
"Extracts",
"schema",
"files",
"from",
"the",
"task",
"inputs",
"and",
"sorts",
"them",
"in",
"a",
"way",
"similar",
"to",
"the",
"Gradle",
"lookup",
"priority",
".",
"That",
"is",
"build",
"variant",
"source",
"set",
"build",
"type",
"source",
"set",
"pro... | train | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/CodegenGenerationTaskCommandArgsBuilder.java#L116-L148 |
WhereIsMyTransport/TransportApiSdk.Java | transportapisdk/src/main/java/transportapisdk/TransportApiClient.java | TransportApiClient.getStopsNearby | public TransportApiResult<List<Stop>> getStopsNearby(StopQueryOptions options, double latitude, double longitude, int radiusInMeters) {
"""
Gets a list of stops nearby ordered by distance from the point specified.
@param options Options to limit the results by. Default: StopQueryOptions.defaultQueryOptions(... | java | public TransportApiResult<List<Stop>> getStopsNearby(StopQueryOptions options, double latitude, double longitude, int radiusInMeters)
{
if (options == null)
{
options = StopQueryOptions.defaultQueryOptions();
}
if (radiusInMeters < 0)
{
throw new IllegalArgumentEx... | [
"public",
"TransportApiResult",
"<",
"List",
"<",
"Stop",
">",
">",
"getStopsNearby",
"(",
"StopQueryOptions",
"options",
",",
"double",
"latitude",
",",
"double",
"longitude",
",",
"int",
"radiusInMeters",
")",
"{",
"if",
"(",
"options",
"==",
"null",
")",
... | Gets a list of stops nearby ordered by distance from the point specified.
@param options Options to limit the results by. Default: StopQueryOptions.defaultQueryOptions()
@param latitude Latitude in decimal degrees.
@param longitude Longitude in decimal degrees.
@param radiusInMeters Radius in meters to filte... | [
"Gets",
"a",
"list",
"of",
"stops",
"nearby",
"ordered",
"by",
"distance",
"from",
"the",
"point",
"specified",
"."
] | train | https://github.com/WhereIsMyTransport/TransportApiSdk.Java/blob/f4ade7046c8dadfcb2976ee354f85f67a6e930a2/transportapisdk/src/main/java/transportapisdk/TransportApiClient.java#L300-L313 |
virgo47/javasimon | core/src/main/java/org/javasimon/utils/SLF4JLoggingCallback.java | SLF4JLoggingCallback.onStopwatchStop | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
"""
Logs Simon stop on a specified log marker.
@param split stopped split
@param sample stopwatch sample
"""
logger.debug(marker, "SIMON STOP: {} ({})", sample.toString(), split.runningFor());
} | java | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
logger.debug(marker, "SIMON STOP: {} ({})", sample.toString(), split.runningFor());
} | [
"@",
"Override",
"public",
"void",
"onStopwatchStop",
"(",
"Split",
"split",
",",
"StopwatchSample",
"sample",
")",
"{",
"logger",
".",
"debug",
"(",
"marker",
",",
"\"SIMON STOP: {} ({})\"",
",",
"sample",
".",
"toString",
"(",
")",
",",
"split",
".",
"runn... | Logs Simon stop on a specified log marker.
@param split stopped split
@param sample stopwatch sample | [
"Logs",
"Simon",
"stop",
"on",
"a",
"specified",
"log",
"marker",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/SLF4JLoggingCallback.java#L40-L43 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIData.java | UIData.setValueBinding | public void setValueBinding(String name, ValueBinding binding) {
"""
<p>If "name" is something other than "value", "var", or "rowIndex", rely
on the superclass conversion from <code>ValueBinding</code> to
<code>ValueExpression</code>.</p>
@param name Name of the attribute or property for which to set a
{@... | java | public void setValueBinding(String name, ValueBinding binding) {
if ("value".equals(name)) {
setDataModel(null);
} else if ("var".equals(name) || "rowIndex".equals(name)) {
throw new IllegalArgumentException();
}
super.setValueBinding(name, binding);
} | [
"public",
"void",
"setValueBinding",
"(",
"String",
"name",
",",
"ValueBinding",
"binding",
")",
"{",
"if",
"(",
"\"value\"",
".",
"equals",
"(",
"name",
")",
")",
"{",
"setDataModel",
"(",
"null",
")",
";",
"}",
"else",
"if",
"(",
"\"var\"",
".",
"equ... | <p>If "name" is something other than "value", "var", or "rowIndex", rely
on the superclass conversion from <code>ValueBinding</code> to
<code>ValueExpression</code>.</p>
@param name Name of the attribute or property for which to set a
{@link ValueBinding}
@param binding The {@link ValueBinding} to set, or <code>nul... | [
"<p",
">",
"If",
"name",
"is",
"something",
"other",
"than",
"value",
"var",
"or",
"rowIndex",
"rely",
"on",
"the",
"superclass",
"conversion",
"from",
"<code",
">",
"ValueBinding<",
"/",
"code",
">",
"to",
"<code",
">",
"ValueExpression<",
"/",
"code",
">... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIData.java#L770-L779 |
schallee/alib4j | jvm/src/main/java/net/darkmist/alib/jvm/JVMLauncher.java | JVMLauncher.getProcessBuilder | @Deprecated
public static ProcessBuilder getProcessBuilder(String mainClass, String...args) throws LauncherException {
"""
Get a process loader for a JVM. The class path for the JVM
is computed based on the class loaders for the main class.
@param mainClass Fully qualified class name of the main class
@param a... | java | @Deprecated
public static ProcessBuilder getProcessBuilder(String mainClass, String...args) throws LauncherException
{
return getProcessBuilder(findClass(mainClass), Arrays.asList(args));
} | [
"@",
"Deprecated",
"public",
"static",
"ProcessBuilder",
"getProcessBuilder",
"(",
"String",
"mainClass",
",",
"String",
"...",
"args",
")",
"throws",
"LauncherException",
"{",
"return",
"getProcessBuilder",
"(",
"findClass",
"(",
"mainClass",
")",
",",
"Arrays",
... | Get a process loader for a JVM. The class path for the JVM
is computed based on the class loaders for the main class.
@param mainClass Fully qualified class name of the main class
@param args Additional command line parameters
@return ProcessBuilder that has not been started.
@deprecated This acquires the mainClass cla... | [
"Get",
"a",
"process",
"loader",
"for",
"a",
"JVM",
".",
"The",
"class",
"path",
"for",
"the",
"JVM",
"is",
"computed",
"based",
"on",
"the",
"class",
"loaders",
"for",
"the",
"main",
"class",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/jvm/src/main/java/net/darkmist/alib/jvm/JVMLauncher.java#L169-L173 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java | ServerBlobAuditingPoliciesInner.beginCreateOrUpdateAsync | public Observable<ServerBlobAuditingPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerBlobAuditingPolicyInner parameters) {
"""
Creates or updates a server's blob auditing policy.
@param resourceGroupName The name of the resource group that contains the resource. You can o... | java | public Observable<ServerBlobAuditingPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerBlobAuditingPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerBlobAuditingPolicyI... | [
"public",
"Observable",
"<",
"ServerBlobAuditingPolicyInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerBlobAuditingPolicyInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
... | Creates or updates a server's blob auditing policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters Properties of blob auditing policy
@throws Ill... | [
"Creates",
"or",
"updates",
"a",
"server",
"s",
"blob",
"auditing",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java#L274-L281 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java | DOMHelper.locateAttrParent | private static Node locateAttrParent(Element elem, Node attr) {
"""
Support for getParentOfNode; walks a DOM tree until it finds
the Element which owns the Attr. This is hugely expensive, and
if at all possible you should use the DOM Level 2 Attr.ownerElement()
method instead.
<p>
The DOM Level 1 developers e... | java | private static Node locateAttrParent(Element elem, Node attr)
{
Node parent = null;
// This should only be called for Level 1 DOMs, so we don't have to
// worry about namespace issues. In later levels, it's possible
// for a DOM to have two Attrs with the same NodeName but
// dif... | [
"private",
"static",
"Node",
"locateAttrParent",
"(",
"Element",
"elem",
",",
"Node",
"attr",
")",
"{",
"Node",
"parent",
"=",
"null",
";",
"// This should only be called for Level 1 DOMs, so we don't have to",
"// worry about namespace issues. In later levels, it's possible",
... | Support for getParentOfNode; walks a DOM tree until it finds
the Element which owns the Attr. This is hugely expensive, and
if at all possible you should use the DOM Level 2 Attr.ownerElement()
method instead.
<p>
The DOM Level 1 developers expected that folks would keep track
of the last Element they'd seen and could ... | [
"Support",
"for",
"getParentOfNode",
";",
"walks",
"a",
"DOM",
"tree",
"until",
"it",
"finds",
"the",
"Element",
"which",
"owns",
"the",
"Attr",
".",
"This",
"is",
"hugely",
"expensive",
"and",
"if",
"at",
"all",
"possible",
"you",
"should",
"use",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java#L1194-L1224 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/CellFinder.java | CellFinder.startPosition | public CellFinder startPosition(final int column, final int row) {
"""
起点なる位置を指定する。
@param column 列番号(0から始まる)
@param row 行番号(0から始まる)
@return 自身のインスタンス。メソッドチェーンとして続ける。
@throws IllegalArgumentException {@literal column < 0 or row < 0}
"""
ArgUtils.notMin(column, 0, "column");
ArgUtils.notMi... | java | public CellFinder startPosition(final int column, final int row) {
ArgUtils.notMin(column, 0, "column");
ArgUtils.notMin(row, 0, "row");
this.startColumn = column;
this.startRow = row;
return this;
} | [
"public",
"CellFinder",
"startPosition",
"(",
"final",
"int",
"column",
",",
"final",
"int",
"row",
")",
"{",
"ArgUtils",
".",
"notMin",
"(",
"column",
",",
"0",
",",
"\"column\"",
")",
";",
"ArgUtils",
".",
"notMin",
"(",
"row",
",",
"0",
",",
"\"row\... | 起点なる位置を指定する。
@param column 列番号(0から始まる)
@param row 行番号(0から始まる)
@return 自身のインスタンス。メソッドチェーンとして続ける。
@throws IllegalArgumentException {@literal column < 0 or row < 0} | [
"起点なる位置を指定する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/CellFinder.java#L85-L93 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/dashboards/action/ShowDashboardAction.java | ShowDashboardAction.getDashboardRestApiUrl | private String getDashboardRestApiUrl(final HttpServletRequest request, final String dashboardName) {
"""
Creates Dashboard REST API url for given dashboard.
Used at UI.
@param request {@link HttpServletRequest}
@param dashboardName dashboard name
@return Dashboard REST API url, including context path
... | java | private String getDashboardRestApiUrl(final HttpServletRequest request, final String dashboardName) {
String contextPath = request.getContextPath();
if (contextPath == null) {
contextPath = "";
}
if (!contextPath.endsWith("/")) {
contextPath += "/";
}
return contextPath + "moskito-inspect-rest/dash... | [
"private",
"String",
"getDashboardRestApiUrl",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"String",
"dashboardName",
")",
"{",
"String",
"contextPath",
"=",
"request",
".",
"getContextPath",
"(",
")",
";",
"if",
"(",
"contextPath",
"==",
"null",
... | Creates Dashboard REST API url for given dashboard.
Used at UI.
@param request {@link HttpServletRequest}
@param dashboardName dashboard name
@return Dashboard REST API url, including context path | [
"Creates",
"Dashboard",
"REST",
"API",
"url",
"for",
"given",
"dashboard",
".",
"Used",
"at",
"UI",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/dashboards/action/ShowDashboardAction.java#L228-L240 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract1.java | Tesseract1.getSegmentedRegions | @Override
public List<Rectangle> getSegmentedRegions(BufferedImage bi, int pageIteratorLevel) throws TesseractException {
"""
Gets segmented regions at specified page iterator level.
@param bi input image
@param pageIteratorLevel TessPageIteratorLevel enum
@return list of <code>Rectangle</code>
@throws T... | java | @Override
public List<Rectangle> getSegmentedRegions(BufferedImage bi, int pageIteratorLevel) throws TesseractException {
init();
setTessVariables();
try {
List<Rectangle> list = new ArrayList<Rectangle>();
setImage(bi, null);
Boxa boxes = TessBaseAPIGet... | [
"@",
"Override",
"public",
"List",
"<",
"Rectangle",
">",
"getSegmentedRegions",
"(",
"BufferedImage",
"bi",
",",
"int",
"pageIteratorLevel",
")",
"throws",
"TesseractException",
"{",
"init",
"(",
")",
";",
"setTessVariables",
"(",
")",
";",
"try",
"{",
"List"... | Gets segmented regions at specified page iterator level.
@param bi input image
@param pageIteratorLevel TessPageIteratorLevel enum
@return list of <code>Rectangle</code>
@throws TesseractException | [
"Gets",
"segmented",
"regions",
"at",
"specified",
"page",
"iterator",
"level",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L654-L688 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.