repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/BeanPropertyReaderUtil.java | BeanPropertyReaderUtil.getNullSaveProperty | public static Object getNullSaveProperty(final Object pbean, final String pname)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Object property;
try {
property = PropertyUtils.getProperty(pbean, pname);
} catch (final NestedNullException pexception) {
pro... | java | public static Object getNullSaveProperty(final Object pbean, final String pname)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Object property;
try {
property = PropertyUtils.getProperty(pbean, pname);
} catch (final NestedNullException pexception) {
pro... | [
"public",
"static",
"Object",
"getNullSaveProperty",
"(",
"final",
"Object",
"pbean",
",",
"final",
"String",
"pname",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"NoSuchMethodException",
"{",
"Object",
"property",
";",
"try",
"{",
... | <p>
Return the value of the specified property of the specified bean, no matter which property
reference format is used, as a String.
</p>
<p>
If there is a null value in path hierarchy, exception is cached and null returned.
</p>
@param pbean Bean whose property is to be extracted
@param pname Possibly indexed and/or... | [
"<p",
">",
"Return",
"the",
"value",
"of",
"the",
"specified",
"property",
"of",
"the",
"specified",
"bean",
"no",
"matter",
"which",
"property",
"reference",
"format",
"is",
"used",
"as",
"a",
"String",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"there... | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/BeanPropertyReaderUtil.java#L89-L98 |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/anim/PendingItemAnimator.java | PendingItemAnimator.animateMoveImpl | protected ViewPropertyAnimatorCompat animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
final View view = holder.itemView;
final int deltaX = toX - fromX;
final int deltaY = toY - fromY;
ViewCompat.animate(view).cancel();
if (deltaX != 0) {
... | java | protected ViewPropertyAnimatorCompat animateMoveImpl(final ViewHolder holder, int fromX, int fromY, int toX, int toY) {
final View view = holder.itemView;
final int deltaX = toX - fromX;
final int deltaY = toY - fromY;
ViewCompat.animate(view).cancel();
if (deltaX != 0) {
... | [
"protected",
"ViewPropertyAnimatorCompat",
"animateMoveImpl",
"(",
"final",
"ViewHolder",
"holder",
",",
"int",
"fromX",
",",
"int",
"fromY",
",",
"int",
"toX",
",",
"int",
"toY",
")",
"{",
"final",
"View",
"view",
"=",
"holder",
".",
"itemView",
";",
"final... | Preform your animation. You do not need to override this in most cases cause the default is pretty good.
Listeners will be overridden * | [
"Preform",
"your",
"animation",
".",
"You",
"do",
"not",
"need",
"to",
"override",
"this",
"in",
"most",
"cases",
"cause",
"the",
"default",
"is",
"pretty",
"good",
".",
"Listeners",
"will",
"be",
"overridden",
"*"
] | train | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/anim/PendingItemAnimator.java#L276-L291 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/SimpleFormatterImpl.java | SimpleFormatterImpl.formatRawPattern | public static String formatRawPattern(String pattern, int min, int max, CharSequence... values) {
StringBuilder sb = new StringBuilder();
String compiledPattern = compileToStringMinMaxArguments(pattern, sb, min, max);
sb.setLength(0);
return formatAndAppend(compiledPattern, sb, null, val... | java | public static String formatRawPattern(String pattern, int min, int max, CharSequence... values) {
StringBuilder sb = new StringBuilder();
String compiledPattern = compileToStringMinMaxArguments(pattern, sb, min, max);
sb.setLength(0);
return formatAndAppend(compiledPattern, sb, null, val... | [
"public",
"static",
"String",
"formatRawPattern",
"(",
"String",
"pattern",
",",
"int",
"min",
",",
"int",
"max",
",",
"CharSequence",
"...",
"values",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"compiledPattern",
... | Formats the not-compiled pattern with the given values.
Equivalent to compileToStringMinMaxArguments() followed by formatCompiledPattern().
The number of arguments checked against the given limits is the
highest argument number plus one, not the number of occurrences of arguments.
@param pattern Not-compiled form of a... | [
"Formats",
"the",
"not",
"-",
"compiled",
"pattern",
"with",
"the",
"given",
"values",
".",
"Equivalent",
"to",
"compileToStringMinMaxArguments",
"()",
"followed",
"by",
"formatCompiledPattern",
"()",
".",
"The",
"number",
"of",
"arguments",
"checked",
"against",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/SimpleFormatterImpl.java#L205-L210 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.registerApplePush | @ObjectiveCName("registerApplePushWithApnsId:withToken:")
public void registerApplePush(int apnsId, String token) {
modules.getPushesModule().registerApplePush(apnsId, token);
} | java | @ObjectiveCName("registerApplePushWithApnsId:withToken:")
public void registerApplePush(int apnsId, String token) {
modules.getPushesModule().registerApplePush(apnsId, token);
} | [
"@",
"ObjectiveCName",
"(",
"\"registerApplePushWithApnsId:withToken:\"",
")",
"public",
"void",
"registerApplePush",
"(",
"int",
"apnsId",
",",
"String",
"token",
")",
"{",
"modules",
".",
"getPushesModule",
"(",
")",
".",
"registerApplePush",
"(",
"apnsId",
",",
... | Register apple push
@param apnsId internal APNS cert key
@param token APNS token | [
"Register",
"apple",
"push"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L2688-L2691 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_network_POST | public OvhTask serviceName_network_POST(String serviceName, String description, String ipNet, Long vlanTag) throws IOException {
String qPath = "/router/{serviceName}/network";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", descri... | java | public OvhTask serviceName_network_POST(String serviceName, String description, String ipNet, Long vlanTag) throws IOException {
String qPath = "/router/{serviceName}/network";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", descri... | [
"public",
"OvhTask",
"serviceName_network_POST",
"(",
"String",
"serviceName",
",",
"String",
"description",
",",
"String",
"ipNet",
",",
"Long",
"vlanTag",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/network\"",
";",
"StringBui... | Add a network to your router
REST: POST /router/{serviceName}/network
@param ipNet [required] Gateway IP / CIDR Netmask, (e.g. 192.168.1.254/24)
@param description [required]
@param vlanTag [required] Vlan tag from range 1 to 4094 or NULL for untagged traffic
@param serviceName [required] The internal name of your Rou... | [
"Add",
"a",
"network",
"to",
"your",
"router"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L256-L265 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/NodeReportsInner.java | NodeReportsInner.listByNodeAsync | public Observable<Page<DscNodeReportInner>> listByNodeAsync(final String resourceGroupName, final String automationAccountName, final String nodeId) {
return listByNodeWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId)
.map(new Func1<ServiceResponse<Page<DscNodeReportInner>>,... | java | public Observable<Page<DscNodeReportInner>> listByNodeAsync(final String resourceGroupName, final String automationAccountName, final String nodeId) {
return listByNodeWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId)
.map(new Func1<ServiceResponse<Page<DscNodeReportInner>>,... | [
"public",
"Observable",
"<",
"Page",
"<",
"DscNodeReportInner",
">",
">",
"listByNodeAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
",",
"final",
"String",
"nodeId",
")",
"{",
"return",
"listByNodeWithServiceRespo... | Retrieve the Dsc node report list by node id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeId The parameters supplied to the list operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obs... | [
"Retrieve",
"the",
"Dsc",
"node",
"report",
"list",
"by",
"node",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/NodeReportsInner.java#L130-L138 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.subtractExact | public static long subtractExact(long a, long b) {
long result = a - b;
checkNoOverflow((a ^ b) >= 0 | (a ^ result) >= 0);
return result;
} | java | public static long subtractExact(long a, long b) {
long result = a - b;
checkNoOverflow((a ^ b) >= 0 | (a ^ result) >= 0);
return result;
} | [
"public",
"static",
"long",
"subtractExact",
"(",
"long",
"a",
",",
"long",
"b",
")",
"{",
"long",
"result",
"=",
"a",
"-",
"b",
";",
"checkNoOverflow",
"(",
"(",
"a",
"^",
"b",
")",
">=",
"0",
"|",
"(",
"a",
"^",
"result",
")",
">=",
"0",
")",... | Returns the difference of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a - b} overflows in signed {@code long} arithmetic | [
"Returns",
"the",
"difference",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"provided",
"it",
"does",
"not",
"overflow",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L1404-L1408 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_dedicated_serviceName_backend_duration_GET | public OvhOrder cdn_dedicated_serviceName_backend_duration_GET(String serviceName, String duration, Long backend) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/backend/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "backend", backend);
String resp = exec(... | java | public OvhOrder cdn_dedicated_serviceName_backend_duration_GET(String serviceName, String duration, Long backend) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/backend/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "backend", backend);
String resp = exec(... | [
"public",
"OvhOrder",
"cdn_dedicated_serviceName_backend_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"Long",
"backend",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/dedicated/{serviceName}/backend/{duration}\"",
";"... | Get prices and contracts information
REST: GET /order/cdn/dedicated/{serviceName}/backend/{duration}
@param backend [required] Backend number that will be ordered
@param serviceName [required] The internal name of your CDN offer
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5229-L5235 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Convert.java | Convert.toLong | public static Long toLong(Object value) {
if (value == null) {
return null;
} else if (value instanceof Long) {
return (Long) value;
} else if (value instanceof Number) {
return ((Number) value).longValue();
} else if (value instanceof java.util.Date) ... | java | public static Long toLong(Object value) {
if (value == null) {
return null;
} else if (value instanceof Long) {
return (Long) value;
} else if (value instanceof Number) {
return ((Number) value).longValue();
} else if (value instanceof java.util.Date) ... | [
"public",
"static",
"Long",
"toLong",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"Long",
")",
"{",
"return",
"(",
"Long",
")",
"value",
";",
"}... | Converts value to <code>Long</code> if it can. If value is a <code>Long</code>, it is returned, if it is a <code>Number</code>, it is
promoted to <code>Long</code> and then returned, if it is a <code>Date</code>, returns its getTime() value, in all other cases, it converts the value to String,
then tries to parse Long ... | [
"Converts",
"value",
"to",
"<code",
">",
"Long<",
"/",
"code",
">",
"if",
"it",
"can",
".",
"If",
"value",
"is",
"a",
"<code",
">",
"Long<",
"/",
"code",
">",
"it",
"is",
"returned",
"if",
"it",
"is",
"a",
"<code",
">",
"Number<",
"/",
"code",
">... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Convert.java#L347-L363 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java | CudaZeroHandler.copyforward | @Override
@Deprecated
public void copyforward(AllocationPoint point, AllocationShape shape) {
/*
Technically that's just a case for relocate, with source as HOST and target point.getAllocationStatus()
*/
log.info("copyforward() called on tp[" + point.getObjectId() + "], shap... | java | @Override
@Deprecated
public void copyforward(AllocationPoint point, AllocationShape shape) {
/*
Technically that's just a case for relocate, with source as HOST and target point.getAllocationStatus()
*/
log.info("copyforward() called on tp[" + point.getObjectId() + "], shap... | [
"@",
"Override",
"@",
"Deprecated",
"public",
"void",
"copyforward",
"(",
"AllocationPoint",
"point",
",",
"AllocationShape",
"shape",
")",
"{",
"/*\n Technically that's just a case for relocate, with source as HOST and target point.getAllocationStatus()\n */",
"lo... | Copies memory from host buffer to device.
Host copy is preserved as is.
@param point | [
"Copies",
"memory",
"from",
"host",
"buffer",
"to",
"device",
".",
"Host",
"copy",
"is",
"preserved",
"as",
"is",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java#L470-L479 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java | PebbleDictionary.addInt8 | public void addInt8(final int key, final byte b) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.INT, PebbleTuple.Width.BYTE, b);
addTuple(t);
} | java | public void addInt8(final int key, final byte b) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.INT, PebbleTuple.Width.BYTE, b);
addTuple(t);
} | [
"public",
"void",
"addInt8",
"(",
"final",
"int",
"key",
",",
"final",
"byte",
"b",
")",
"{",
"PebbleTuple",
"t",
"=",
"PebbleTuple",
".",
"create",
"(",
"key",
",",
"PebbleTuple",
".",
"TupleType",
".",
"INT",
",",
"PebbleTuple",
".",
"Width",
".",
"B... | Associate the specified signed byte with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param b
value to be associated with the specified key | [
"Associate",
"the",
"specified",
"signed",
"byte",
"with",
"the",
"provided",
"key",
"in",
"the",
"dictionary",
".",
"If",
"another",
"key",
"-",
"value",
"pair",
"with",
"the",
"same",
"key",
"is",
"already",
"present",
"in",
"the",
"dictionary",
"it",
"w... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java#L107-L110 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setValue | public Parameters setValue(@NonNull String name, Object value) {
if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
if (readonly) { throw new IllegalStateException("Parameters is readonly mode."); }
map.put(name, value);
return this;
} | java | public Parameters setValue(@NonNull String name, Object value) {
if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
if (readonly) { throw new IllegalStateException("Parameters is readonly mode."); }
map.put(name, value);
return this;
} | [
"public",
"Parameters",
"setValue",
"(",
"@",
"NonNull",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name cannot be null.\"",
")",
";",
"}",
"if",
"(",
"... | Set a value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The value.
@return The self object. | [
"Set",
"a",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L64-L69 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/TriggerDefinition.java | TriggerDefinition.deleteFromSchema | public void deleteFromSchema(Mutation mutation, String cfName, long timestamp)
{
ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
int ldt = (int) (System.currentTimeMillis() / 1000);
Composite prefix = CFMetaData.SchemaTriggersCf.comparator.make(cfName, name);
... | java | public void deleteFromSchema(Mutation mutation, String cfName, long timestamp)
{
ColumnFamily cf = mutation.addOrGet(SystemKeyspace.SCHEMA_TRIGGERS_CF);
int ldt = (int) (System.currentTimeMillis() / 1000);
Composite prefix = CFMetaData.SchemaTriggersCf.comparator.make(cfName, name);
... | [
"public",
"void",
"deleteFromSchema",
"(",
"Mutation",
"mutation",
",",
"String",
"cfName",
",",
"long",
"timestamp",
")",
"{",
"ColumnFamily",
"cf",
"=",
"mutation",
".",
"addOrGet",
"(",
"SystemKeyspace",
".",
"SCHEMA_TRIGGERS_CF",
")",
";",
"int",
"ldt",
"=... | Drop specified trigger from the schema using given mutation.
@param mutation The schema mutation
@param cfName The name of the parent ColumnFamily
@param timestamp The timestamp to use for the tombstone | [
"Drop",
"specified",
"trigger",
"from",
"the",
"schema",
"using",
"given",
"mutation",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/TriggerDefinition.java#L99-L106 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java | ExposeLinearLayoutManagerEx.recycleChildren | protected void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(TAG, "Recycling " + Math.abs(startIndex - endIndex) + " items");
}
if (endIndex > startIndex) {
... | java | protected void recycleChildren(RecyclerView.Recycler recycler, int startIndex, int endIndex) {
if (startIndex == endIndex) {
return;
}
if (DEBUG) {
Log.d(TAG, "Recycling " + Math.abs(startIndex - endIndex) + " items");
}
if (endIndex > startIndex) {
... | [
"protected",
"void",
"recycleChildren",
"(",
"RecyclerView",
".",
"Recycler",
"recycler",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"if",
"(",
"startIndex",
"==",
"endIndex",
")",
"{",
"return",
";",
"}",
"if",
"(",
"DEBUG",
")",
"{",
"... | Recycles children between given indices.
@param startIndex inclusive
@param endIndex exclusive | [
"Recycles",
"children",
"between",
"given",
"indices",
"."
] | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java#L1015-L1031 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.expint | static double expint(int p, final double result[]) {
//double x = M_E;
final double xs[] = new double[2];
final double as[] = new double[2];
final double ys[] = new double[2];
//split(x, xs);
//xs[1] = (double)(2.7182818284590452353602874713526625L - xs[0]);
//xs[... | java | static double expint(int p, final double result[]) {
//double x = M_E;
final double xs[] = new double[2];
final double as[] = new double[2];
final double ys[] = new double[2];
//split(x, xs);
//xs[1] = (double)(2.7182818284590452353602874713526625L - xs[0]);
//xs[... | [
"static",
"double",
"expint",
"(",
"int",
"p",
",",
"final",
"double",
"result",
"[",
"]",
")",
"{",
"//double x = M_E;",
"final",
"double",
"xs",
"[",
"]",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"final",
"double",
"as",
"[",
"]",
"=",
"new",
"d... | Compute exp(p) for a integer p in extended precision.
@param p integer whose exponential is requested
@param result placeholder where to put the result in extended precision
@return exp(p) in standard precision (equal to result[0] + result[1]) | [
"Compute",
"exp",
"(",
"p",
")",
"for",
"a",
"integer",
"p",
"in",
"extended",
"precision",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L490-L528 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.distanceSegmentPoint | public static double distanceSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY) {
Point nearest = nearestSegmentPoint(startX, startY, endX, endY, pointX, pointY);
return Math.hypot(nearest.x - pointX, nearest.y - pointY);
} | java | public static double distanceSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY) {
Point nearest = nearestSegmentPoint(startX, startY, endX, endY, pointX, pointY);
return Math.hypot(nearest.x - pointX, nearest.y - pointY);
} | [
"public",
"static",
"double",
"distanceSegmentPoint",
"(",
"double",
"startX",
",",
"double",
"startY",
",",
"double",
"endX",
",",
"double",
"endY",
",",
"double",
"pointX",
",",
"double",
"pointY",
")",
"{",
"Point",
"nearest",
"=",
"nearestSegmentPoint",
"(... | Returns the distance between the given segment and point.
<p>
libGDX (Apache 2.0) | [
"Returns",
"the",
"distance",
"between",
"the",
"given",
"segment",
"and",
"point",
".",
"<p",
">",
"libGDX",
"(",
"Apache",
"2",
".",
"0",
")"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L167-L170 |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java | ClassLocator.isSubclass | public static boolean isSubclass(String superclass, String otherclass) {
String key;
key = superclass + "-" + otherclass;
if (m_CheckSubClass.containsKey(key))
return m_CheckSubClass.get(key);
try {
return isSubclass(Class.forName(superclass), Class.forName(otherclass));
}
catch (T... | java | public static boolean isSubclass(String superclass, String otherclass) {
String key;
key = superclass + "-" + otherclass;
if (m_CheckSubClass.containsKey(key))
return m_CheckSubClass.get(key);
try {
return isSubclass(Class.forName(superclass), Class.forName(otherclass));
}
catch (T... | [
"public",
"static",
"boolean",
"isSubclass",
"(",
"String",
"superclass",
",",
"String",
"otherclass",
")",
"{",
"String",
"key",
";",
"key",
"=",
"superclass",
"+",
"\"-\"",
"+",
"otherclass",
";",
"if",
"(",
"m_CheckSubClass",
".",
"containsKey",
"(",
"key... | Checks whether the "otherclass" is a subclass of the given "superclass".
@param superclass the superclass to check against
@param otherclass this class is checked whether it is a subclass
of the the superclass
@return TRUE if "otherclass" is a true subclass | [
"Checks",
"whether",
"the",
"otherclass",
"is",
"a",
"subclass",
"of",
"the",
"given",
"superclass",
"."
] | train | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLocator.java#L588-L601 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/reflect/AbstractFixture.java | AbstractFixture.getField | protected Field getField(Class type, String name)
{
return introspector(type).getField( toJavaIdentifierForm(name));
} | java | protected Field getField(Class type, String name)
{
return introspector(type).getField( toJavaIdentifierForm(name));
} | [
"protected",
"Field",
"getField",
"(",
"Class",
"type",
",",
"String",
"name",
")",
"{",
"return",
"introspector",
"(",
"type",
")",
".",
"getField",
"(",
"toJavaIdentifierForm",
"(",
"name",
")",
")",
";",
"}"
] | <p>getField.</p>
@param type a {@link java.lang.Class} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.reflect.Field} object. | [
"<p",
">",
"getField",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/reflect/AbstractFixture.java#L106-L109 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/iterable/S3Objects.java | S3Objects.withPrefix | public static S3Objects withPrefix(AmazonS3 s3, String bucketName, String prefix) {
S3Objects objects = new S3Objects(s3, bucketName);
objects.prefix = prefix;
return objects;
} | java | public static S3Objects withPrefix(AmazonS3 s3, String bucketName, String prefix) {
S3Objects objects = new S3Objects(s3, bucketName);
objects.prefix = prefix;
return objects;
} | [
"public",
"static",
"S3Objects",
"withPrefix",
"(",
"AmazonS3",
"s3",
",",
"String",
"bucketName",
",",
"String",
"prefix",
")",
"{",
"S3Objects",
"objects",
"=",
"new",
"S3Objects",
"(",
"s3",
",",
"bucketName",
")",
";",
"objects",
".",
"prefix",
"=",
"p... | Constructs an iterable that covers the objects in an Amazon S3 bucket
where the key begins with the given prefix.
@param s3
The Amazon S3 client.
@param bucketName
The bucket name.
@param prefix
The prefix.
@return An iterator for object summaries. | [
"Constructs",
"an",
"iterable",
"that",
"covers",
"the",
"objects",
"in",
"an",
"Amazon",
"S3",
"bucket",
"where",
"the",
"key",
"begins",
"with",
"the",
"given",
"prefix",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/iterable/S3Objects.java#L76-L80 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/UserAPI.java | UserAPI.userInfoUpdateremark | public static BaseResult userInfoUpdateremark(String access_token,String openid,String remark){
String postJson = String.format("{\"openid\":\"%1$s\",\"remark\":\"%2$s\"}", openid,remark);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/use... | java | public static BaseResult userInfoUpdateremark(String access_token,String openid,String remark){
String postJson = String.format("{\"openid\":\"%1$s\",\"remark\":\"%2$s\"}", openid,remark);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/use... | [
"public",
"static",
"BaseResult",
"userInfoUpdateremark",
"(",
"String",
"access_token",
",",
"String",
"openid",
",",
"String",
"remark",
")",
"{",
"String",
"postJson",
"=",
"String",
".",
"format",
"(",
"\"{\\\"openid\\\":\\\"%1$s\\\",\\\"remark\\\":\\\"%2$s\\\"}\"",
... | 设置备注名
@param access_token access_token
@param openid openid
@param remark remark
@return BaseResult | [
"设置备注名"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/UserAPI.java#L144-L153 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.getSnapshot | public GetSnapshotResponse getSnapshot(GetSnapshotRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getSnapshotId(), "request snapshotId should no be empty.");
InternalRequest internalRequest =
this.createRequest(request, HttpMet... | java | public GetSnapshotResponse getSnapshot(GetSnapshotRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getSnapshotId(), "request snapshotId should no be empty.");
InternalRequest internalRequest =
this.createRequest(request, HttpMet... | [
"public",
"GetSnapshotResponse",
"getSnapshot",
"(",
"GetSnapshotRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getSnapshotId",
"(",
")",
",",
"\"request snaps... | Getting the detail information of specified snapshot.
@param request The request containing all options for getting the detail information of specified snapshot.
@return The response with the snapshot detail information. | [
"Getting",
"the",
"detail",
"information",
"of",
"specified",
"snapshot",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1456-L1462 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/groupschart/GroupsPieChart.java | GroupsPieChart.setChartState | public void setChartState(final List<Long> groupTargetCounts, final Long totalTargetsCount) {
getState().setGroupTargetCounts(groupTargetCounts);
getState().setTotalTargetCount(totalTargetsCount);
markAsDirty();
} | java | public void setChartState(final List<Long> groupTargetCounts, final Long totalTargetsCount) {
getState().setGroupTargetCounts(groupTargetCounts);
getState().setTotalTargetCount(totalTargetsCount);
markAsDirty();
} | [
"public",
"void",
"setChartState",
"(",
"final",
"List",
"<",
"Long",
">",
"groupTargetCounts",
",",
"final",
"Long",
"totalTargetsCount",
")",
"{",
"getState",
"(",
")",
".",
"setGroupTargetCounts",
"(",
"groupTargetCounts",
")",
";",
"getState",
"(",
")",
".... | Updates the state of the chart
@param groupTargetCounts
list of target counts
@param totalTargetsCount
total count of targets that are represented by the pie | [
"Updates",
"the",
"state",
"of",
"the",
"chart"
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/groupschart/GroupsPieChart.java#L32-L36 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java | ConfigClient.createExclusion | public final LogExclusion createExclusion(String parent, LogExclusion exclusion) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder().setParent(parent).setExclusion(exclusion).build();
return createExclusion(request);
} | java | public final LogExclusion createExclusion(String parent, LogExclusion exclusion) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder().setParent(parent).setExclusion(exclusion).build();
return createExclusion(request);
} | [
"public",
"final",
"LogExclusion",
"createExclusion",
"(",
"String",
"parent",
",",
"LogExclusion",
"exclusion",
")",
"{",
"CreateExclusionRequest",
"request",
"=",
"CreateExclusionRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"... | Creates a new exclusion in a specified parent resource. Only log entries belonging to that
resource can be excluded. You can have up to 10 exclusions in a resource.
<p>Sample code:
<pre><code>
try (ConfigClient configClient = ConfigClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
LogExclusion exclu... | [
"Creates",
"a",
"new",
"exclusion",
"in",
"a",
"specified",
"parent",
"resource",
".",
"Only",
"log",
"entries",
"belonging",
"to",
"that",
"resource",
"can",
"be",
"excluded",
".",
"You",
"can",
"have",
"up",
"to",
"10",
"exclusions",
"in",
"a",
"resource... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java#L1147-L1152 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/automata/fsa/DFAs.java | DFAs.isPrefixClosed | public static <S, I> boolean isPrefixClosed(DFA<S, I> dfa, Alphabet<I> alphabet) {
return dfa.getStates()
.parallelStream()
.allMatch(s -> dfa.isAccepting(s) ||
alphabet.parallelStream().noneMatch(i -> dfa.isAccepting(dfa.getSuccessors(s, i)))... | java | public static <S, I> boolean isPrefixClosed(DFA<S, I> dfa, Alphabet<I> alphabet) {
return dfa.getStates()
.parallelStream()
.allMatch(s -> dfa.isAccepting(s) ||
alphabet.parallelStream().noneMatch(i -> dfa.isAccepting(dfa.getSuccessors(s, i)))... | [
"public",
"static",
"<",
"S",
",",
"I",
">",
"boolean",
"isPrefixClosed",
"(",
"DFA",
"<",
"S",
",",
"I",
">",
"dfa",
",",
"Alphabet",
"<",
"I",
">",
"alphabet",
")",
"{",
"return",
"dfa",
".",
"getStates",
"(",
")",
".",
"parallelStream",
"(",
")"... | Computes whether the language of the given DFA is prefix-closed.
Assumes all states in the given {@link DFA} are reachable from the initial state.
@param dfa the DFA to check
@param alphabet the Alphabet
@param <S> the type of state
@param <I> the type of input
@return whether the DFA is prefix-closed. | [
"Computes",
"whether",
"the",
"language",
"of",
"the",
"given",
"DFA",
"is",
"prefix",
"-",
"closed",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/automata/fsa/DFAs.java#L384-L389 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java | LocaleFormatter.getFormatted | @Nonnull
public static String getFormatted (@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aValue, "Value");
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getInstance (aDisplayLocale).format (aValue);
} | java | @Nonnull
public static String getFormatted (@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aValue, "Value");
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getInstance (aDisplayLocale).format (aValue);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getFormatted",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aValue",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aValue",
",",
"\"Value\"",
")",
";",
... | Format the passed value according to the rules specified by the given
locale. All calls to {@link BigDecimal#toString()} that are displayed to
the user should instead use this method. By default a maximum of 3 fraction
digits are shown.
@param aValue
The value to be formatted. May not be <code>null</code>.
@param aDis... | [
"Format",
"the",
"passed",
"value",
"according",
"to",
"the",
"rules",
"specified",
"by",
"the",
"given",
"locale",
".",
"All",
"calls",
"to",
"{",
"@link",
"BigDecimal#toString",
"()",
"}",
"that",
"are",
"displayed",
"to",
"the",
"user",
"should",
"instead... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L134-L141 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.endAny | public static boolean endAny(String target, List<String> endWith) {
if (isNull(target)) {
return false;
}
return matcher(target).ends(endWith);
} | java | public static boolean endAny(String target, List<String> endWith) {
if (isNull(target)) {
return false;
}
return matcher(target).ends(endWith);
} | [
"public",
"static",
"boolean",
"endAny",
"(",
"String",
"target",
",",
"List",
"<",
"String",
">",
"endWith",
")",
"{",
"if",
"(",
"isNull",
"(",
"target",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"matcher",
"(",
"target",
")",
".",
"end... | Check if target string ends with any of a list of specified strings.
@param target
@param endWith
@return | [
"Check",
"if",
"target",
"string",
"ends",
"with",
"any",
"of",
"a",
"list",
"of",
"specified",
"strings",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L314-L320 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndex.java | RuleIndex.searchAll | public Iterator<Integer> searchAll(RuleQuery query) {
SearchRequestBuilder esSearch = client
.prepareSearch(TYPE_RULE)
.setScroll(TimeValue.timeValueMinutes(SCROLL_TIME_IN_MINUTES));
optimizeScrollRequest(esSearch);
QueryBuilder qb = buildQuery(query);
Map<String, QueryBuilder> filters = bu... | java | public Iterator<Integer> searchAll(RuleQuery query) {
SearchRequestBuilder esSearch = client
.prepareSearch(TYPE_RULE)
.setScroll(TimeValue.timeValueMinutes(SCROLL_TIME_IN_MINUTES));
optimizeScrollRequest(esSearch);
QueryBuilder qb = buildQuery(query);
Map<String, QueryBuilder> filters = bu... | [
"public",
"Iterator",
"<",
"Integer",
">",
"searchAll",
"(",
"RuleQuery",
"query",
")",
"{",
"SearchRequestBuilder",
"esSearch",
"=",
"client",
".",
"prepareSearch",
"(",
"TYPE_RULE",
")",
".",
"setScroll",
"(",
"TimeValue",
".",
"timeValueMinutes",
"(",
"SCROLL... | Return all rule ids matching the search query, without pagination nor facets | [
"Return",
"all",
"rule",
"ids",
"matching",
"the",
"search",
"query",
"without",
"pagination",
"nor",
"facets"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/rule/index/RuleIndex.java#L172-L189 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ThreadGroupTracker.java | ThreadGroupTracker.getThreadGroup | ThreadGroup getThreadGroup(String identifier, String threadFactoryName, ThreadGroup parentGroup) {
ConcurrentHashMap<String, ThreadGroup> threadFactoryToThreadGroup = metadataIdentifierToThreadGroups.get(identifier);
if (threadFactoryToThreadGroup == null)
if (metadataIdentifierService.isMet... | java | ThreadGroup getThreadGroup(String identifier, String threadFactoryName, ThreadGroup parentGroup) {
ConcurrentHashMap<String, ThreadGroup> threadFactoryToThreadGroup = metadataIdentifierToThreadGroups.get(identifier);
if (threadFactoryToThreadGroup == null)
if (metadataIdentifierService.isMet... | [
"ThreadGroup",
"getThreadGroup",
"(",
"String",
"identifier",
",",
"String",
"threadFactoryName",
",",
"ThreadGroup",
"parentGroup",
")",
"{",
"ConcurrentHashMap",
"<",
"String",
",",
"ThreadGroup",
">",
"threadFactoryToThreadGroup",
"=",
"metadataIdentifierToThreadGroups",... | Returns the thread group to use for the specified application component.
@param jeeName name of the application component
@param threadFactoryName unique identifier for the thread factory
@param parentGroup parent thread group
@return child thread group for the application component. Null if the application component ... | [
"Returns",
"the",
"thread",
"group",
"to",
"use",
"for",
"the",
"specified",
"application",
"component",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ThreadGroupTracker.java#L107-L123 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.toSeparatedString | public static String toSeparatedString(List<?> values, String separator) {
return toSeparatedString(values, separator, null);
} | java | public static String toSeparatedString(List<?> values, String separator) {
return toSeparatedString(values, separator, null);
} | [
"public",
"static",
"String",
"toSeparatedString",
"(",
"List",
"<",
"?",
">",
"values",
",",
"String",
"separator",
")",
"{",
"return",
"toSeparatedString",
"(",
"values",
",",
"separator",
",",
"null",
")",
";",
"}"
] | build a single String from a List of objects with a given separator
@param values
@param separator
@return | [
"build",
"a",
"single",
"String",
"from",
"a",
"List",
"of",
"objects",
"with",
"a",
"given",
"separator"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L285-L287 |
undertow-io/undertow | core/src/main/java/io/undertow/util/FlexBase64.java | FlexBase64.encodeString | public static String encodeString(byte[] source, boolean wrap) {
return Encoder.encodeString(source, 0, source.length, wrap, false);
} | java | public static String encodeString(byte[] source, boolean wrap) {
return Encoder.encodeString(source, 0, source.length, wrap, false);
} | [
"public",
"static",
"String",
"encodeString",
"(",
"byte",
"[",
"]",
"source",
",",
"boolean",
"wrap",
")",
"{",
"return",
"Encoder",
".",
"encodeString",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
",",
"wrap",
",",
"false",
")",
";",
"}"
] | Encodes a fixed and complete byte array into a Base64 String.
<p>This method is only useful for applications which require a String and have all data to be encoded up-front.
Note that byte arrays or buffers are almost always a better storage choice. They consume half the memory and
can be reused (modified). In other w... | [
"Encodes",
"a",
"fixed",
"and",
"complete",
"byte",
"array",
"into",
"a",
"Base64",
"String",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/FlexBase64.java#L148-L150 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java | DocumentHelpers.getColumnSharedPrefix | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
String prefix = null;
for ( String column : associationKeyColumns ) {
String newPrefix = getPrefix( column );
if ( prefix == null ) { // first iteration
prefix = newPrefix;
if ( prefix == null ) { // no prefix, quit
brea... | java | public static String getColumnSharedPrefix(String[] associationKeyColumns) {
String prefix = null;
for ( String column : associationKeyColumns ) {
String newPrefix = getPrefix( column );
if ( prefix == null ) { // first iteration
prefix = newPrefix;
if ( prefix == null ) { // no prefix, quit
brea... | [
"public",
"static",
"String",
"getColumnSharedPrefix",
"(",
"String",
"[",
"]",
"associationKeyColumns",
")",
"{",
"String",
"prefix",
"=",
"null",
";",
"for",
"(",
"String",
"column",
":",
"associationKeyColumns",
")",
"{",
"String",
"newPrefix",
"=",
"getPrefi... | Returns the shared prefix of these columns. Null otherwise.
@param associationKeyColumns the columns sharing a prefix
@return the shared prefix of these columns. {@code null} otherwise. | [
"Returns",
"the",
"shared",
"prefix",
"of",
"these",
"columns",
".",
"Null",
"otherwise",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/document/association/impl/DocumentHelpers.java#L36-L54 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java | CachedDAO.read | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);//.emptyList(ld.isEmpty());
// }
// // Result Result if exists
// if(getter.result==null) {
... | java | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);//.emptyList(ld.isEmpty());
// }
// // Result Result if exists
// if(getter.result==null) {
... | [
"public",
"Result",
"<",
"List",
"<",
"DATA",
">",
">",
"read",
"(",
"final",
"String",
"key",
",",
"final",
"TRANS",
"trans",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"DAOGetter",
"getter",
"=",
"new",
"DAOGetter",
"(",
"trans",
",",
"dao",
... | Slight Improved performance available when String and Obj versions are known. | [
"Slight",
"Improved",
"performance",
"available",
"when",
"String",
"and",
"Obj",
"versions",
"are",
"known",
"."
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java#L141-L152 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java | MessageTemplate.setQuickReply | public void setQuickReply(String content_type, String title, String payload, String image_url)
{
HashMap<String, String> quick_reply = new HashMap<String, String>();
quick_reply.put("content_type", content_type);
quick_reply.put("title", title);
quick_reply.put("payload", payload);
... | java | public void setQuickReply(String content_type, String title, String payload, String image_url)
{
HashMap<String, String> quick_reply = new HashMap<String, String>();
quick_reply.put("content_type", content_type);
quick_reply.put("title", title);
quick_reply.put("payload", payload);
... | [
"public",
"void",
"setQuickReply",
"(",
"String",
"content_type",
",",
"String",
"title",
",",
"String",
"payload",
",",
"String",
"image_url",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"quick_reply",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Set Quick Reply
@param content_type the content type
@param title the title
@param payload the payload flag
@param image_url the image URL | [
"Set",
"Quick",
"Reply"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java#L117-L125 |
digipost/signature-api-client-java | src/main/java/no/digipost/signature/client/direct/DirectJobStatusResponse.java | DirectJobStatusResponse.noUpdatedStatus | static DirectJobStatusResponse noUpdatedStatus(Instant nextPermittedPollTime) {
return new DirectJobStatusResponse(null, null, NO_CHANGES, null, null, null, null, nextPermittedPollTime) {
@Override public long getSignatureJobId() {
throw new IllegalStateException(
... | java | static DirectJobStatusResponse noUpdatedStatus(Instant nextPermittedPollTime) {
return new DirectJobStatusResponse(null, null, NO_CHANGES, null, null, null, null, nextPermittedPollTime) {
@Override public long getSignatureJobId() {
throw new IllegalStateException(
... | [
"static",
"DirectJobStatusResponse",
"noUpdatedStatus",
"(",
"Instant",
"nextPermittedPollTime",
")",
"{",
"return",
"new",
"DirectJobStatusResponse",
"(",
"null",
",",
"null",
",",
"NO_CHANGES",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"nextPermit... | This instance indicates that there has been no status updates since the last poll request for
{@link DirectJobStatusResponse}. Its status is {@link DirectJobStatus#NO_CHANGES NO_CHANGES}. | [
"This",
"instance",
"indicates",
"that",
"there",
"has",
"been",
"no",
"status",
"updates",
"since",
"the",
"last",
"poll",
"request",
"for",
"{"
] | train | https://github.com/digipost/signature-api-client-java/blob/246207571641fbac6beda5ffc585eec188825c45/src/main/java/no/digipost/signature/client/direct/DirectJobStatusResponse.java#L21-L35 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java | CustomVisionPredictionManager.authenticate | public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) {
return new PredictionEndpointImpl(baseUrl, credentials).withApiKey(apiKey);
} | java | public static PredictionEndpoint authenticate(String baseUrl, ServiceClientCredentials credentials, final String apiKey) {
return new PredictionEndpointImpl(baseUrl, credentials).withApiKey(apiKey);
} | [
"public",
"static",
"PredictionEndpoint",
"authenticate",
"(",
"String",
"baseUrl",
",",
"ServiceClientCredentials",
"credentials",
",",
"final",
"String",
"apiKey",
")",
"{",
"return",
"new",
"PredictionEndpointImpl",
"(",
"baseUrl",
",",
"credentials",
")",
".",
"... | Initializes an instance of Custom Vision Prediction API client.
@param baseUrl the base URL of the service
@param credentials the management credentials for Azure
@param apiKey the Custom Vision Prediction API key
@return the Custom Vision Prediction API client | [
"Initializes",
"an",
"instance",
"of",
"Custom",
"Vision",
"Prediction",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/CustomVisionPredictionManager.java#L63-L65 |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java | DefaultConfigurableOptionsFactory.setInternal | private void setInternal(String key, String value) {
Preconditions.checkArgument(value != null && !value.isEmpty(),
"The configuration value must not be empty.");
configuredOptions.put(key, value);
} | java | private void setInternal(String key, String value) {
Preconditions.checkArgument(value != null && !value.isEmpty(),
"The configuration value must not be empty.");
configuredOptions.put(key, value);
} | [
"private",
"void",
"setInternal",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"value",
"!=",
"null",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
",",
"\"The configuration value must not be empty.\"",
")",... | Sets the configuration with (key, value) if the key is predefined, otherwise throws IllegalArgumentException.
@param key The configuration key, if key is not predefined, throws IllegalArgumentException out.
@param value The configuration value. | [
"Sets",
"the",
"configuration",
"with",
"(",
"key",
"value",
")",
"if",
"the",
"key",
"is",
"predefined",
"otherwise",
"throws",
"IllegalArgumentException",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java#L407-L412 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java | UnsignedUtils.digit | public static int digit(char c, int radix) {
for (int i = 0; i < MAX_RADIX && i < radix; i++) {
if (digits[i] == c) {
return i;
}
}
return -1;
} | java | public static int digit(char c, int radix) {
for (int i = 0; i < MAX_RADIX && i < radix; i++) {
if (digits[i] == c) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"digit",
"(",
"char",
"c",
",",
"int",
"radix",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"MAX_RADIX",
"&&",
"i",
"<",
"radix",
";",
"i",
"++",
")",
"{",
"if",
"(",
"digits",
"[",
"i",
"]",
"==",
... | Returns the numeric value of the character {@code c} in the specified
radix.
@param c
@param radix
@return
@see #MAX_RADIX | [
"Returns",
"the",
"numeric",
"value",
"of",
"the",
"character",
"{",
"@code",
"c",
"}",
"in",
"the",
"specified",
"radix",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java#L55-L62 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.extractLinkValue | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
// Link column names always begin with '~'.
if (colName.length() == 0 || colName.charAt(0) != '~') {
return false;
}
// A '/' should separate the field name and object va... | java | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
// Link column names always begin with '~'.
if (colName.length() == 0 || colName.charAt(0) != '~') {
return false;
}
// A '/' should separate the field name and object va... | [
"public",
"boolean",
"extractLinkValue",
"(",
"String",
"colName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"mvLinkValueMap",
")",
"{",
"// Link column names always begin with '~'.\r",
"if",
"(",
"colName",
".",
"length",
"(",
")",
"==",
... | Examine the given column name and, if it represents an MV link value, add it to the
given MV link value map. If a link value is successfully extracted, true is returned.
If the column name is not in the format used for MV link values, false is returned.
@param colName Column name from an object record belonging... | [
"Examine",
"the",
"given",
"column",
"name",
"and",
"if",
"it",
"represents",
"an",
"MV",
"link",
"value",
"add",
"it",
"to",
"the",
"given",
"MV",
"link",
"value",
"map",
".",
"If",
"a",
"link",
"value",
"is",
"successfully",
"extracted",
"true",
"is",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L672-L697 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/Noun.java | Noun.addSingular | public static void addSingular(String match, String rule, boolean insensitive){
singulars.add(0, new Replacer(match, rule, insensitive));
} | java | public static void addSingular(String match, String rule, boolean insensitive){
singulars.add(0, new Replacer(match, rule, insensitive));
} | [
"public",
"static",
"void",
"addSingular",
"(",
"String",
"match",
",",
"String",
"rule",
",",
"boolean",
"insensitive",
")",
"{",
"singulars",
".",
"add",
"(",
"0",
",",
"new",
"Replacer",
"(",
"match",
",",
"rule",
",",
"insensitive",
")",
")",
";",
... | <p>Add a match pattern and replacement rule for converting addSingular
forms to addPlural forms.</p>
@param match Match pattern regular expression
@param rule Replacement rule
@param insensitive Flag indicating this match should be case insensitive | [
"<p",
">",
"Add",
"a",
"match",
"pattern",
"and",
"replacement",
"rule",
"for",
"converting",
"addSingular",
"forms",
"to",
"addPlural",
"forms",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Noun.java#L106-L108 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java | PoissonDistribution.rawProbability | public static double rawProbability(double x, double lambda) {
// Extreme lambda
if(lambda == 0) {
return ((x == 0) ? 1. : 0.);
}
// Extreme values
if(Double.isInfinite(lambda) || x < 0) {
return 0.;
}
if(x <= lambda * Double.MIN_NORMAL) {
return FastMath.exp(-lambda);
... | java | public static double rawProbability(double x, double lambda) {
// Extreme lambda
if(lambda == 0) {
return ((x == 0) ? 1. : 0.);
}
// Extreme values
if(Double.isInfinite(lambda) || x < 0) {
return 0.;
}
if(x <= lambda * Double.MIN_NORMAL) {
return FastMath.exp(-lambda);
... | [
"public",
"static",
"double",
"rawProbability",
"(",
"double",
"x",
",",
"double",
"lambda",
")",
"{",
"// Extreme lambda",
"if",
"(",
"lambda",
"==",
"0",
")",
"{",
"return",
"(",
"(",
"x",
"==",
"0",
")",
"?",
"1.",
":",
"0.",
")",
";",
"}",
"// ... | Poisson distribution probability, but also for non-integer arguments.
<p>
lb^x exp(-lb) / x!
@param x X
@param lambda lambda
@return Poisson distribution probability | [
"Poisson",
"distribution",
"probability",
"but",
"also",
"for",
"non",
"-",
"integer",
"arguments",
".",
"<p",
">",
"lb^x",
"exp",
"(",
"-",
"lb",
")",
"/",
"x!"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java#L434-L453 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/Discoverer.java | Discoverer.startSearch | public void startSearch(int localPort, NetworkInterface ni, int timeout, boolean wait)
throws KNXException
{
if (timeout < 0)
throw new KNXIllegalArgumentException("timeout has to be >= 0");
if (localPort < 0 || localPort > 65535)
throw new KNXIllegalArgumentException("port out of range [0..0xFFFF]")... | java | public void startSearch(int localPort, NetworkInterface ni, int timeout, boolean wait)
throws KNXException
{
if (timeout < 0)
throw new KNXIllegalArgumentException("timeout has to be >= 0");
if (localPort < 0 || localPort > 65535)
throw new KNXIllegalArgumentException("port out of range [0..0xFFFF]")... | [
"public",
"void",
"startSearch",
"(",
"int",
"localPort",
",",
"NetworkInterface",
"ni",
",",
"int",
"timeout",
",",
"boolean",
"wait",
")",
"throws",
"KNXException",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"throw",
"new",
"KNXIllegalArgumentException",
"(",... | Starts a new discovery, the <code>localPort</code> and network interface can be
specified.
<p>
The search will continue for <code>timeout</code> seconds, or infinite if timeout
value is zero. During this time, search responses will get collected asynchronous
in the background by this {@link Discoverer}.<br>
With <code>... | [
"Starts",
"a",
"new",
"discovery",
"the",
"<code",
">",
"localPort<",
"/",
"code",
">",
"and",
"network",
"interface",
"can",
"be",
"specified",
".",
"<p",
">",
"The",
"search",
"will",
"continue",
"for",
"<code",
">",
"timeout<",
"/",
"code",
">",
"seco... | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/knxnetip/Discoverer.java#L243-L253 |
apptik/jus | benchmark/src/perf/java/com/android/volley/Request.java | Request.getPostBody | @Deprecated
public byte[] getPostBody() throws AuthFailureError {
// Note: For compatibility with legacy clients of volley, this implementation must remain
// here instead of simply calling the getBody() function because this function must
// call getPostParams() and getPostParamsEncoding() ... | java | @Deprecated
public byte[] getPostBody() throws AuthFailureError {
// Note: For compatibility with legacy clients of volley, this implementation must remain
// here instead of simply calling the getBody() function because this function must
// call getPostParams() and getPostParamsEncoding() ... | [
"@",
"Deprecated",
"public",
"byte",
"[",
"]",
"getPostBody",
"(",
")",
"throws",
"AuthFailureError",
"{",
"// Note: For compatibility with legacy clients of volley, this implementation must remain",
"// here instead of simply calling the getBody() function because this function must",
"... | Returns the raw POST body to be sent.
@throws AuthFailureError In the event of auth failure
@deprecated Use {@link #getBody()} instead. | [
"Returns",
"the",
"raw",
"POST",
"body",
"to",
"be",
"sent",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/Request.java#L350-L361 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/DateTimePicker.java | DateTimePicker.setGapSize | public void setGapSize(int gapSize, ConstantSize.Unit units) {
ConstantSize gapSizeObject = new ConstantSize(gapSize, units);
ColumnSpec columnSpec = ColumnSpec.createGap(gapSizeObject);
FormLayout layout = (FormLayout) getLayout();
layout.setColumnSpec(2, columnSpec);
} | java | public void setGapSize(int gapSize, ConstantSize.Unit units) {
ConstantSize gapSizeObject = new ConstantSize(gapSize, units);
ColumnSpec columnSpec = ColumnSpec.createGap(gapSizeObject);
FormLayout layout = (FormLayout) getLayout();
layout.setColumnSpec(2, columnSpec);
} | [
"public",
"void",
"setGapSize",
"(",
"int",
"gapSize",
",",
"ConstantSize",
".",
"Unit",
"units",
")",
"{",
"ConstantSize",
"gapSizeObject",
"=",
"new",
"ConstantSize",
"(",
"gapSize",
",",
"units",
")",
";",
"ColumnSpec",
"columnSpec",
"=",
"ColumnSpec",
".",... | setGapSize, This sets the size of the gap between the date picker and the time picker. | [
"setGapSize",
"This",
"sets",
"the",
"size",
"of",
"the",
"gap",
"between",
"the",
"date",
"picker",
"and",
"the",
"time",
"picker",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/DateTimePicker.java#L315-L320 |
BradleyWood/Software-Quality-Test-Framework | sqtf-core/src/main/java/org/sqtf/assertions/Assert.java | Assert.assertEquals | public static void assertEquals(float expected, float actual, float delta, String message) {
if (expected + delta < actual || expected - delta > actual) {
fail(message);
}
} | java | public static void assertEquals(float expected, float actual, float delta, String message) {
if (expected + delta < actual || expected - delta > actual) {
fail(message);
}
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"float",
"expected",
",",
"float",
"actual",
",",
"float",
"delta",
",",
"String",
"message",
")",
"{",
"if",
"(",
"expected",
"+",
"delta",
"<",
"actual",
"||",
"expected",
"-",
"delta",
">",
"actual",
")... | Asserts that the two floats are equal. If they are not
the test will fail
@param expected The expected value
@param actual The actual value
@param delta The maximum amount that expected and actual values may deviate by
@param message The message to report on failure | [
"Asserts",
"that",
"the",
"two",
"floats",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"the",
"test",
"will",
"fail"
] | train | https://github.com/BradleyWood/Software-Quality-Test-Framework/blob/010dea3bfc8e025a4304ab9ef4a213c1adcb1aa0/sqtf-core/src/main/java/org/sqtf/assertions/Assert.java#L138-L142 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java | RequestProcessor.dontNotifyRequestListenersForRequest | public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
requestProgressManager.dontNotifyRequestListenersForRequest(request, listRequestListener);
} | java | public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
requestProgressManager.dontNotifyRequestListenersForRequest(request, listRequestListener);
} | [
"public",
"void",
"dontNotifyRequestListenersForRequest",
"(",
"final",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"final",
"Collection",
"<",
"RequestListener",
"<",
"?",
">",
">",
"listRequestListener",
")",
"{",
"requestProgressManager",
".",
"dontNotifyR... | Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified | [
"Disable",
"request",
"listeners",
"notifications",
"for",
"a",
"specific",
"request",
".",
"<br",
"/",
">",
"All",
"listeners",
"associated",
"to",
"this",
"request",
"won",
"t",
"be",
"called",
"when",
"request",
"will",
"finish",
".",
"<br",
"/",
">"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java#L145-L147 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/utils/ObjectUtils.java | ObjectUtils.getEnumConstantByName | public static Object getEnumConstantByName(Class klass, String name) {
name = name.toUpperCase();
Object c[] = klass.getEnumConstants();
for (int ix = 0; ix < c.length; ix++)
if (c[ix].toString().equals(name))
return c[ix];
throw new DukeConfigException("No such " + klass + ": '" + name + ... | java | public static Object getEnumConstantByName(Class klass, String name) {
name = name.toUpperCase();
Object c[] = klass.getEnumConstants();
for (int ix = 0; ix < c.length; ix++)
if (c[ix].toString().equals(name))
return c[ix];
throw new DukeConfigException("No such " + klass + ": '" + name + ... | [
"public",
"static",
"Object",
"getEnumConstantByName",
"(",
"Class",
"klass",
",",
"String",
"name",
")",
"{",
"name",
"=",
"name",
".",
"toUpperCase",
"(",
")",
";",
"Object",
"c",
"[",
"]",
"=",
"klass",
".",
"getEnumConstants",
"(",
")",
";",
"for",
... | Returns the enum constant from the given enum class representing
the constant with the given identifier/name. | [
"Returns",
"the",
"enum",
"constant",
"from",
"the",
"given",
"enum",
"class",
"representing",
"the",
"constant",
"with",
"the",
"given",
"identifier",
"/",
"name",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/utils/ObjectUtils.java#L19-L26 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/ClientOptions.java | ClientOptions.of | public static ClientOptions of(ClientOptions baseOptions, ClientOptions options) {
// TODO(trustin): Reduce the cost of creating a derived ClientOptions.
requireNonNull(baseOptions, "baseOptions");
requireNonNull(options, "options");
return new ClientOptions(baseOptions, options);
} | java | public static ClientOptions of(ClientOptions baseOptions, ClientOptions options) {
// TODO(trustin): Reduce the cost of creating a derived ClientOptions.
requireNonNull(baseOptions, "baseOptions");
requireNonNull(options, "options");
return new ClientOptions(baseOptions, options);
} | [
"public",
"static",
"ClientOptions",
"of",
"(",
"ClientOptions",
"baseOptions",
",",
"ClientOptions",
"options",
")",
"{",
"// TODO(trustin): Reduce the cost of creating a derived ClientOptions.",
"requireNonNull",
"(",
"baseOptions",
",",
"\"baseOptions\"",
")",
";",
"requir... | Merges the specified two {@link ClientOptions} into one.
@return the merged {@link ClientOptions} | [
"Merges",
"the",
"specified",
"two",
"{",
"@link",
"ClientOptions",
"}",
"into",
"one",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/ClientOptions.java#L137-L142 |
magro/memcached-session-manager | javolution-serializer/src/main/java/de/javakaffee/web/msm/serializer/javolution/JavolutionTranscoderFactory.java | JavolutionTranscoderFactory.getTranscoder | private JavolutionTranscoder getTranscoder( final SessionManager manager ) {
if ( _transcoder == null ) {
final CustomXMLFormat<?>[] customFormats = loadCustomFormats( manager );
_transcoder = new JavolutionTranscoder( manager, _copyCollectionsForSerialization, customFormats );
}... | java | private JavolutionTranscoder getTranscoder( final SessionManager manager ) {
if ( _transcoder == null ) {
final CustomXMLFormat<?>[] customFormats = loadCustomFormats( manager );
_transcoder = new JavolutionTranscoder( manager, _copyCollectionsForSerialization, customFormats );
}... | [
"private",
"JavolutionTranscoder",
"getTranscoder",
"(",
"final",
"SessionManager",
"manager",
")",
"{",
"if",
"(",
"_transcoder",
"==",
"null",
")",
"{",
"final",
"CustomXMLFormat",
"<",
"?",
">",
"[",
"]",
"customFormats",
"=",
"loadCustomFormats",
"(",
"manag... | Gets/creates a single instance of {@link JavolutionTranscoder}. We need to have a single
instance so that {@link XMLFormat}s are not created twice which would lead to errors.
@param manager the manager that will be passed to the transcoder.
@return for all invocations the same instance of {@link JavolutionTranscoder}. | [
"Gets",
"/",
"creates",
"a",
"single",
"instance",
"of",
"{",
"@link",
"JavolutionTranscoder",
"}",
".",
"We",
"need",
"to",
"have",
"a",
"single",
"instance",
"so",
"that",
"{",
"@link",
"XMLFormat",
"}",
"s",
"are",
"not",
"created",
"twice",
"which",
... | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/javolution-serializer/src/main/java/de/javakaffee/web/msm/serializer/javolution/JavolutionTranscoderFactory.java#L53-L59 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Counter.java | Counter.incrementAll | public void incrementAll(Collection<T> elements, double inc) {
for (T element: elements) {
incrementCount(element, inc);
}
} | java | public void incrementAll(Collection<T> elements, double inc) {
for (T element: elements) {
incrementCount(element, inc);
}
} | [
"public",
"void",
"incrementAll",
"(",
"Collection",
"<",
"T",
">",
"elements",
",",
"double",
"inc",
")",
"{",
"for",
"(",
"T",
"element",
":",
"elements",
")",
"{",
"incrementCount",
"(",
"element",
",",
"inc",
")",
";",
"}",
"}"
] | This method will increment all elements in collection
@param elements
@param inc | [
"This",
"method",
"will",
"increment",
"all",
"elements",
"in",
"collection"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/Counter.java#L64-L68 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.overrideEquivalent | public boolean overrideEquivalent(Type t, Type s) {
return hasSameArgs(t, s) ||
hasSameArgs(t, erasure(s)) || hasSameArgs(erasure(t), s);
} | java | public boolean overrideEquivalent(Type t, Type s) {
return hasSameArgs(t, s) ||
hasSameArgs(t, erasure(s)) || hasSameArgs(erasure(t), s);
} | [
"public",
"boolean",
"overrideEquivalent",
"(",
"Type",
"t",
",",
"Type",
"s",
")",
"{",
"return",
"hasSameArgs",
"(",
"t",
",",
"s",
")",
"||",
"hasSameArgs",
"(",
"t",
",",
"erasure",
"(",
"s",
")",
")",
"||",
"hasSameArgs",
"(",
"erasure",
"(",
"t... | Returns true iff these signatures are related by <em>override
equivalence</em>. This is the natural extension of
isSubSignature to an equivalence relation.
@jls section 8.4.2.
@see #isSubSignature(Type t, Type s)
@param t a signature (possible raw, could be subjected to
erasure).
@param s a signature (possible raw, c... | [
"Returns",
"true",
"iff",
"these",
"signatures",
"are",
"related",
"by",
"<em",
">",
"override",
"equivalence<",
"/",
"em",
">",
".",
"This",
"is",
"the",
"natural",
"extension",
"of",
"isSubSignature",
"to",
"an",
"equivalence",
"relation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L2515-L2518 |
glyptodon/guacamole-client | extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java | AuthenticationProviderService.getRadiusChallenge | private CredentialsInfo getRadiusChallenge(RadiusPacket challengePacket) {
// Try to get the state attribute - if it's not there, we have a problem
RadiusAttribute stateAttr = challengePacket.findAttribute(Attr_State.TYPE);
if (stateAttr == null) {
logger.error("Something went wrong... | java | private CredentialsInfo getRadiusChallenge(RadiusPacket challengePacket) {
// Try to get the state attribute - if it's not there, we have a problem
RadiusAttribute stateAttr = challengePacket.findAttribute(Attr_State.TYPE);
if (stateAttr == null) {
logger.error("Something went wrong... | [
"private",
"CredentialsInfo",
"getRadiusChallenge",
"(",
"RadiusPacket",
"challengePacket",
")",
"{",
"// Try to get the state attribute - if it's not there, we have a problem",
"RadiusAttribute",
"stateAttr",
"=",
"challengePacket",
".",
"findAttribute",
"(",
"Attr_State",
".",
... | Returns the expected credentials from a RADIUS challenge.
@param challengePacket
The AccessChallenge RadiusPacket received from the RADIUS
server.
@return
A CredentialsInfo object that represents fields that need to
be presented to the user in order to complete authentication.
One of these must be the RADIUS state. | [
"Returns",
"the",
"expected",
"credentials",
"from",
"a",
"RADIUS",
"challenge",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java#L81-L107 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/progress/ProgressionConsoleMonitor.java | ProgressionConsoleMonitor.setModel | public void setModel(Progression model) {
this.model.removeProgressionListener(new WeakListener(this, this.model));
if (model == null) {
this.model = new DefaultProgression();
} else {
this.model = model;
}
this.previousValue = this.model.getValue();
this.model.addProgressionListener(new WeakListener(... | java | public void setModel(Progression model) {
this.model.removeProgressionListener(new WeakListener(this, this.model));
if (model == null) {
this.model = new DefaultProgression();
} else {
this.model = model;
}
this.previousValue = this.model.getValue();
this.model.addProgressionListener(new WeakListener(... | [
"public",
"void",
"setModel",
"(",
"Progression",
"model",
")",
"{",
"this",
".",
"model",
".",
"removeProgressionListener",
"(",
"new",
"WeakListener",
"(",
"this",
",",
"this",
".",
"model",
")",
")",
";",
"if",
"(",
"model",
"==",
"null",
")",
"{",
... | Change the task progression model.
@param model - the task progression model. | [
"Change",
"the",
"task",
"progression",
"model",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/ProgressionConsoleMonitor.java#L69-L78 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentImpl.java | DocumentImpl.evaluateXPathNodeList | EList evaluateXPathNodeList(Node contextNode, String expression, Object... args) {
return evaluateXPathNodeListNS(contextNode, null, expression, args);
} | java | EList evaluateXPathNodeList(Node contextNode, String expression, Object... args) {
return evaluateXPathNodeListNS(contextNode, null, expression, args);
} | [
"EList",
"evaluateXPathNodeList",
"(",
"Node",
"contextNode",
",",
"String",
"expression",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"evaluateXPathNodeListNS",
"(",
"contextNode",
",",
"null",
",",
"expression",
",",
"args",
")",
";",
"}"
] | Evaluate XPath expression expected to return nodes list. Evaluate expression and return result nodes as elements list.
@param contextNode evaluation context node,
@param expression XPath expression, formatting tags supported,
@param args optional formatting arguments.
@return list of result elements, possible empty. | [
"Evaluate",
"XPath",
"expression",
"expected",
"to",
"return",
"nodes",
"list",
".",
"Evaluate",
"expression",
"and",
"return",
"result",
"nodes",
"as",
"elements",
"list",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentImpl.java#L337-L339 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkProcessor.java | CmsLinkProcessor.replaceLinks | public String replaceLinks(String content) throws ParserException {
m_mode = REPLACE_LINKS;
return process(content, m_encoding);
} | java | public String replaceLinks(String content) throws ParserException {
m_mode = REPLACE_LINKS;
return process(content, m_encoding);
} | [
"public",
"String",
"replaceLinks",
"(",
"String",
"content",
")",
"throws",
"ParserException",
"{",
"m_mode",
"=",
"REPLACE_LINKS",
";",
"return",
"process",
"(",
"content",
",",
"m_encoding",
")",
";",
"}"
] | Starts link processing for the given content in replacement mode.<p>
Links are replaced by macros.<p>
@param content the content to process
@return the processed content with replaced links
@throws ParserException if something goes wrong | [
"Starts",
"link",
"processing",
"for",
"the",
"given",
"content",
"in",
"replacement",
"mode",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkProcessor.java#L232-L236 |
avast/syringe | src/main/java/com/avast/syringe/config/internal/Injection.java | Injection.apply | public void apply(Object instance, Map<String, Property> properties, ContextualPropertyResolver resolver)
throws Exception {
if (property.isContextual() || property.isReference()) {
applyContextual(instance, properties, resolver);
} else {
applyNonContextual(instance,... | java | public void apply(Object instance, Map<String, Property> properties, ContextualPropertyResolver resolver)
throws Exception {
if (property.isContextual() || property.isReference()) {
applyContextual(instance, properties, resolver);
} else {
applyNonContextual(instance,... | [
"public",
"void",
"apply",
"(",
"Object",
"instance",
",",
"Map",
"<",
"String",
",",
"Property",
">",
"properties",
",",
"ContextualPropertyResolver",
"resolver",
")",
"throws",
"Exception",
"{",
"if",
"(",
"property",
".",
"isContextual",
"(",
")",
"||",
"... | Takes the property from the {@code properties} map, converts it to the
correct value and sets it to the {@code instance}'s property. | [
"Takes",
"the",
"property",
"from",
"the",
"{"
] | train | https://github.com/avast/syringe/blob/762da5e50776f2bc028e0cf17eac9bd09b5b6aab/src/main/java/com/avast/syringe/config/internal/Injection.java#L35-L42 |
voldemort/voldemort | contrib/collections/src/java/voldemort/collections/VStack.java | VStack.setById | public E setById(final int id, final E element) {
VListKey<K> key = new VListKey<K>(_key, id);
UpdateElementById<K, E> updateElementAction = new UpdateElementById<K, E>(key, element);
if(!_storeClient.applyUpdate(updateElementAction))
throw new ObsoleteVersionException("update faile... | java | public E setById(final int id, final E element) {
VListKey<K> key = new VListKey<K>(_key, id);
UpdateElementById<K, E> updateElementAction = new UpdateElementById<K, E>(key, element);
if(!_storeClient.applyUpdate(updateElementAction))
throw new ObsoleteVersionException("update faile... | [
"public",
"E",
"setById",
"(",
"final",
"int",
"id",
",",
"final",
"E",
"element",
")",
"{",
"VListKey",
"<",
"K",
">",
"key",
"=",
"new",
"VListKey",
"<",
"K",
">",
"(",
"_key",
",",
"id",
")",
";",
"UpdateElementById",
"<",
"K",
",",
"E",
">",
... | Put the given value to the appropriate id in the stack, using the version
of the current list node identified by that id.
@param id
@param element element to set
@return element that was replaced by the new element
@throws ObsoleteVersionException when an update fails | [
"Put",
"the",
"given",
"value",
"to",
"the",
"appropriate",
"id",
"in",
"the",
"stack",
"using",
"the",
"version",
"of",
"the",
"current",
"list",
"node",
"identified",
"by",
"that",
"id",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/collections/src/java/voldemort/collections/VStack.java#L300-L308 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java | SlingApi.postNodeAsync | public com.squareup.okhttp.Call postNodeAsync(String path, String name, String operation, String deleteAuthorizable, File file, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequ... | java | public com.squareup.okhttp.Call postNodeAsync(String path, String name, String operation, String deleteAuthorizable, File file, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequ... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postNodeAsync",
"(",
"String",
"path",
",",
"String",
"name",
",",
"String",
"operation",
",",
"String",
"deleteAuthorizable",
",",
"File",
"file",
",",
"final",
"ApiCallback",
"<",
"Void",
">",
... | (asynchronously)
@param path (required)
@param name (required)
@param operation (optional)
@param deleteAuthorizable (optional)
@param file (optional)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializ... | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java#L3752-L3776 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/Util.java | Util.setBitmapRange | public static void setBitmapRange(long[] bitmap, int start, int end) {
if (start == end) {
return;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
if (firstword == endword) {
bitmap[firstword] |= (~0L << start) & (~0L >>> -end);
return;
}
bitmap[firstword] |= ~0... | java | public static void setBitmapRange(long[] bitmap, int start, int end) {
if (start == end) {
return;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
if (firstword == endword) {
bitmap[firstword] |= (~0L << start) & (~0L >>> -end);
return;
}
bitmap[firstword] |= ~0... | [
"public",
"static",
"void",
"setBitmapRange",
"(",
"long",
"[",
"]",
"bitmap",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"end",
")",
"{",
"return",
";",
"}",
"int",
"firstword",
"=",
"start",
"/",
"64",
";",
"int",... | set bits at start, start+1,..., end-1
@param bitmap array of words to be modified
@param start first index to be modified (inclusive)
@param end last index to be modified (exclusive) | [
"set",
"bits",
"at",
"start",
"start",
"+",
"1",
"...",
"end",
"-",
"1"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L501-L516 |
apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/metadata/table/ShardingTableMetaData.java | ShardingTableMetaData.containsColumn | public boolean containsColumn(final String tableName, final String column) {
return containsTable(tableName) && tables.get(tableName).getColumns().keySet().contains(column.toLowerCase());
} | java | public boolean containsColumn(final String tableName, final String column) {
return containsTable(tableName) && tables.get(tableName).getColumns().keySet().contains(column.toLowerCase());
} | [
"public",
"boolean",
"containsColumn",
"(",
"final",
"String",
"tableName",
",",
"final",
"String",
"column",
")",
"{",
"return",
"containsTable",
"(",
"tableName",
")",
"&&",
"tables",
".",
"get",
"(",
"tableName",
")",
".",
"getColumns",
"(",
")",
".",
"... | Judge contains column from table meta data or not.
@param tableName table name
@param column column
@return contains column from table meta data or not | [
"Judge",
"contains",
"column",
"from",
"table",
"meta",
"data",
"or",
"not",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/metadata/table/ShardingTableMetaData.java#L85-L87 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.getCurrency | public static CurrencyUnit getCurrency(CurrencyQuery query) {
return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow(
() -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup."))
.getCurrency(query);
} | java | public static CurrencyUnit getCurrency(CurrencyQuery query) {
return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow(
() -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup."))
.getCurrency(query);
} | [
"public",
"static",
"CurrencyUnit",
"getCurrency",
"(",
"CurrencyQuery",
"query",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
")",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"MonetaryException",
"(",
... | Query all currencies matching the given query.
@param query The {@link javax.money.CurrencyQuery}, not null.
@return the list of known currencies, never null. | [
"Query",
"all",
"currencies",
"matching",
"the",
"given",
"query",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L470-L474 |
apereo/cas | core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/bypass/CredentialMultifactorAuthenticationProviderBypass.java | CredentialMultifactorAuthenticationProviderBypass.locateMatchingCredentialType | protected static boolean locateMatchingCredentialType(final Authentication authentication, final String credentialClassType) {
return StringUtils.isNotBlank(credentialClassType) && authentication.getCredentials()
.stream()
.anyMatch(e -> e.getCredentialClass().getName().matches(credentia... | java | protected static boolean locateMatchingCredentialType(final Authentication authentication, final String credentialClassType) {
return StringUtils.isNotBlank(credentialClassType) && authentication.getCredentials()
.stream()
.anyMatch(e -> e.getCredentialClass().getName().matches(credentia... | [
"protected",
"static",
"boolean",
"locateMatchingCredentialType",
"(",
"final",
"Authentication",
"authentication",
",",
"final",
"String",
"credentialClassType",
")",
"{",
"return",
"StringUtils",
".",
"isNotBlank",
"(",
"credentialClassType",
")",
"&&",
"authentication"... | Locate matching credential type boolean.
@param authentication the authentication
@param credentialClassType the credential class type
@return the boolean | [
"Locate",
"matching",
"credential",
"type",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/bypass/CredentialMultifactorAuthenticationProviderBypass.java#L53-L57 |
pawelprazak/java-extended | hamcrest/src/main/java/com/bluecatcode/hamcrest/matchers/LongCloseTo.java | LongCloseTo.closeTo | public static Matcher<Long> closeTo(Long operand, Long error) {
return new LongCloseTo(operand, error);
} | java | public static Matcher<Long> closeTo(Long operand, Long error) {
return new LongCloseTo(operand, error);
} | [
"public",
"static",
"Matcher",
"<",
"Long",
">",
"closeTo",
"(",
"Long",
"operand",
",",
"Long",
"error",
")",
"{",
"return",
"new",
"LongCloseTo",
"(",
"operand",
",",
"error",
")",
";",
"}"
] | Creates a matcher of {@link Long}s that matches when an examined Long is equal
to the specified <code>operand</code>, within a range of +/- <code>error</code>. The comparison for equality
is done by BigDecimals {@link Long#compareTo(Long)} method.
For example:
<pre>assertThat(103L, is(closeTo(100, 0.03)))</pre>
@para... | [
"Creates",
"a",
"matcher",
"of",
"{",
"@link",
"Long",
"}",
"s",
"that",
"matches",
"when",
"an",
"examined",
"Long",
"is",
"equal",
"to",
"the",
"specified",
"<code",
">",
"operand<",
"/",
"code",
">",
"within",
"a",
"range",
"of",
"+",
"/",
"-",
"<... | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/hamcrest/src/main/java/com/bluecatcode/hamcrest/matchers/LongCloseTo.java#L33-L35 |
czyzby/gdx-lml | lml-vis/src/main/java/com/github/czyzby/lml/vis/util/ColorPickerContainer.java | ColorPickerContainer.initiateInstance | public static void initiateInstance(final String title, final String styleName) {
INSTANCE = new ColorPicker(styleName, title, null);
} | java | public static void initiateInstance(final String title, final String styleName) {
INSTANCE = new ColorPicker(styleName, title, null);
} | [
"public",
"static",
"void",
"initiateInstance",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"styleName",
")",
"{",
"INSTANCE",
"=",
"new",
"ColorPicker",
"(",
"styleName",
",",
"title",
",",
"null",
")",
";",
"}"
] | Creates an instance of {@link ColorPicker} which will be accessible through {@link #getInstance()} and
{@link #requestInstance()} methods.
@param title will become window's title.
@param styleName determines the style of {@link ColorPicker}. | [
"Creates",
"an",
"instance",
"of",
"{",
"@link",
"ColorPicker",
"}",
"which",
"will",
"be",
"accessible",
"through",
"{",
"@link",
"#getInstance",
"()",
"}",
"and",
"{",
"@link",
"#requestInstance",
"()",
"}",
"methods",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml-vis/src/main/java/com/github/czyzby/lml/vis/util/ColorPickerContainer.java#L63-L65 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java | DialogRootView.createListViewScrollListener | @NonNull
private AbsListView.OnScrollListener createListViewScrollListener() {
return new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(final AbsListView view, final int scrollState) {
}
@Override
public void onScro... | java | @NonNull
private AbsListView.OnScrollListener createListViewScrollListener() {
return new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(final AbsListView view, final int scrollState) {
}
@Override
public void onScro... | [
"@",
"NonNull",
"private",
"AbsListView",
".",
"OnScrollListener",
"createListViewScrollListener",
"(",
")",
"{",
"return",
"new",
"AbsListView",
".",
"OnScrollListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onScrollStateChanged",
"(",
"final",
"AbsLis... | Creates and returns a listener, which allows to observe the list view, which is contained by
the dialog, is scrolled.
@return The listener, which has been created, as an instance of the type {@link
android.widget.AbsListView.OnScrollListener}. The listener may not be null | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"observe",
"the",
"list",
"view",
"which",
"is",
"contained",
"by",
"the",
"dialog",
"is",
"scrolled",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java#L864-L881 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java | LoggingInterceptorSupport.logWebServiceMessage | protected void logWebServiceMessage(String logMessage, WebServiceMessage message, boolean incoming) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
message.writeTo(os);
logMessage(logMessage, os.toString(), incoming);
} catch (IOException e) {
... | java | protected void logWebServiceMessage(String logMessage, WebServiceMessage message, boolean incoming) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
message.writeTo(os);
logMessage(logMessage, os.toString(), incoming);
} catch (IOException e) {
... | [
"protected",
"void",
"logWebServiceMessage",
"(",
"String",
"logMessage",
",",
"WebServiceMessage",
"message",
",",
"boolean",
"incoming",
")",
"{",
"ByteArrayOutputStream",
"os",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"message",
".",
"wri... | Log WebService message (other than SOAP) with in memory
{@link ByteArrayOutputStream}
@param logMessage the customized log message.
@param message the message to log.
@param incoming | [
"Log",
"WebService",
"message",
"(",
"other",
"than",
"SOAP",
")",
"with",
"in",
"memory",
"{",
"@link",
"ByteArrayOutputStream",
"}"
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java#L113-L122 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/references/UnboundTypeReference.java | UnboundTypeReference.acceptHint | public void acceptHint(
LightweightTypeReference hint, BoundTypeArgumentSource source, Object origin,
VarianceInfo expectedVariance, VarianceInfo actualVariance) {
if (!hint.isValidHint())
throw new IllegalArgumentException("Hint may not be primitive void, <any> or <unknown>");
if (hint instanceof UnboundT... | java | public void acceptHint(
LightweightTypeReference hint, BoundTypeArgumentSource source, Object origin,
VarianceInfo expectedVariance, VarianceInfo actualVariance) {
if (!hint.isValidHint())
throw new IllegalArgumentException("Hint may not be primitive void, <any> or <unknown>");
if (hint instanceof UnboundT... | [
"public",
"void",
"acceptHint",
"(",
"LightweightTypeReference",
"hint",
",",
"BoundTypeArgumentSource",
"source",
",",
"Object",
"origin",
",",
"VarianceInfo",
"expectedVariance",
",",
"VarianceInfo",
"actualVariance",
")",
"{",
"if",
"(",
"!",
"hint",
".",
"isVali... | <p>Attach a resolution hint to this unbound type reference.</p>
<p>
Only {@link #isValidHint() valid} hints can be accepted. The given source indicates the
quality of this hint. The {@link VarianceInfo variances} indicate how the hint was used and
how it was expected to be used. A hint from a co-variant location may no... | [
"<p",
">",
"Attach",
"a",
"resolution",
"hint",
"to",
"this",
"unbound",
"type",
"reference",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Only",
"{",
"@link",
"#isValidHint",
"()",
"valid",
"}",
"hints",
"can",
"be",
"accepted",
".",
"The",
"given",
"source",... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/references/UnboundTypeReference.java#L801-L812 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.createTempFile | public static File createTempFile(File dir, boolean isReCreat) throws IORuntimeException {
return createTempFile("hutool", null, dir, isReCreat);
} | java | public static File createTempFile(File dir, boolean isReCreat) throws IORuntimeException {
return createTempFile("hutool", null, dir, isReCreat);
} | [
"public",
"static",
"File",
"createTempFile",
"(",
"File",
"dir",
",",
"boolean",
"isReCreat",
")",
"throws",
"IORuntimeException",
"{",
"return",
"createTempFile",
"(",
"\"hutool\"",
",",
"null",
",",
"dir",
",",
"isReCreat",
")",
";",
"}"
] | 创建临时文件<br>
创建后的文件名为 prefix[Randon].tmp
@param dir 临时文件创建的所在目录
@param isReCreat 是否重新创建文件(删掉原来的,创建新的)
@return 临时文件
@throws IORuntimeException IO异常 | [
"创建临时文件<br",
">",
"创建后的文件名为",
"prefix",
"[",
"Randon",
"]",
".",
"tmp"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L882-L884 |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java | JobStatus.withProgress | public JobStatus withProgress(double newProgress) {
return new JobStatus(jobId, description, state, newProgress, status, eventId);
} | java | public JobStatus withProgress(double newProgress) {
return new JobStatus(jobId, description, state, newProgress, status, eventId);
} | [
"public",
"JobStatus",
"withProgress",
"(",
"double",
"newProgress",
")",
"{",
"return",
"new",
"JobStatus",
"(",
"jobId",
",",
"description",
",",
"state",
",",
"newProgress",
",",
"status",
",",
"eventId",
")",
";",
"}"
] | Creates a copy of this <code>JobStatus</code> with the progress set to
the specified value.
@param newProgress The progress toward completion (complete = 1.0). If
equal to <code>Double.NaN</code>, the progress is indeterminant.
@return A copy of this <code>JobStatus</code> with the progress set to
the specified value. | [
"Creates",
"a",
"copy",
"of",
"this",
"<code",
">",
"JobStatus<",
"/",
"code",
">",
"with",
"the",
"progress",
"set",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java#L122-L124 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/api/impl/JobOperatorImpl.java | JobOperatorImpl.markInstanceExecutionFailed | private void markInstanceExecutionFailed(WSJobInstance jobInstance, WSJobExecution jobExecution, String correlationId) {
//Disregard any attempted transitions out of the ABANDONED state.
if (jobInstance.getBatchStatus() == BatchStatus.ABANDONED) {
if (logger.isLoggable(Level.FINE)) {
... | java | private void markInstanceExecutionFailed(WSJobInstance jobInstance, WSJobExecution jobExecution, String correlationId) {
//Disregard any attempted transitions out of the ABANDONED state.
if (jobInstance.getBatchStatus() == BatchStatus.ABANDONED) {
if (logger.isLoggable(Level.FINE)) {
... | [
"private",
"void",
"markInstanceExecutionFailed",
"(",
"WSJobInstance",
"jobInstance",
",",
"WSJobExecution",
"jobExecution",
",",
"String",
"correlationId",
")",
"{",
"//Disregard any attempted transitions out of the ABANDONED state.",
"if",
"(",
"jobInstance",
".",
"getBatchS... | /*
Used to mark job failed if start attempt fails.
Example failure is a bad jsl name. | [
"/",
"*",
"Used",
"to",
"mark",
"job",
"failed",
"if",
"start",
"attempt",
"fails",
".",
"Example",
"failure",
"is",
"a",
"bad",
"jsl",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/api/impl/JobOperatorImpl.java#L284-L308 |
openengsb/openengsb | api/core/src/main/java/org/openengsb/core/api/model/ModelWrapper.java | ModelWrapper.getModelDescription | public ModelDescription getModelDescription() {
String modelName = retrieveModelName();
String modelVersion = retrieveModelVersion();
if (modelName == null || modelVersion == null) {
throw new IllegalArgumentException("Unsufficient information to create model description.");
... | java | public ModelDescription getModelDescription() {
String modelName = retrieveModelName();
String modelVersion = retrieveModelVersion();
if (modelName == null || modelVersion == null) {
throw new IllegalArgumentException("Unsufficient information to create model description.");
... | [
"public",
"ModelDescription",
"getModelDescription",
"(",
")",
"{",
"String",
"modelName",
"=",
"retrieveModelName",
"(",
")",
";",
"String",
"modelVersion",
"=",
"retrieveModelVersion",
"(",
")",
";",
"if",
"(",
"modelName",
"==",
"null",
"||",
"modelVersion",
... | Creates the model description object for the underlying model object. | [
"Creates",
"the",
"model",
"description",
"object",
"for",
"the",
"underlying",
"model",
"object",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/core/src/main/java/org/openengsb/core/api/model/ModelWrapper.java#L64-L71 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.convertJSONSchemaToJSON | @Given("^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'")
public void convertJSONSchemaToJSON(String jsonSchema, String envVar) throws Exception {
String json = commonspec.parseJSONSchema(new JSONObject(jsonSchema)).toString();
ThreadProperty.set(envVar, json);
} | java | @Given("^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'")
public void convertJSONSchemaToJSON(String jsonSchema, String envVar) throws Exception {
String json = commonspec.parseJSONSchema(new JSONObject(jsonSchema)).toString();
ThreadProperty.set(envVar, json);
} | [
"@",
"Given",
"(",
"\"^I convert jsonSchema '(.+?)' to json and save it in variable '(.+?)'\"",
")",
"public",
"void",
"convertJSONSchemaToJSON",
"(",
"String",
"jsonSchema",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"String",
"json",
"=",
"commonspec",
".... | Convert jsonSchema to json
@param jsonSchema jsonSchema to be converted to json
@param envVar environment variable where to store json
@throws Exception exception * | [
"Convert",
"jsonSchema",
"to",
"json"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L307-L311 |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java | JavassistUtils.hasAnnotation | public static boolean hasAnnotation(CtField field, String annotationName) {
FieldInfo info = field.getFieldInfo();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
info.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
... | java | public static boolean hasAnnotation(CtField field, String annotationName) {
FieldInfo info = field.getFieldInfo();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
info.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
... | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"CtField",
"field",
",",
"String",
"annotationName",
")",
"{",
"FieldInfo",
"info",
"=",
"field",
".",
"getFieldInfo",
"(",
")",
";",
"AnnotationsAttribute",
"ainfo",
"=",
"(",
"AnnotationsAttribute",
")",
"in... | Returns true if the given field has an annotation set with the given name, returns false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"field",
"has",
"an",
"annotation",
"set",
"with",
"the",
"given",
"name",
"returns",
"false",
"otherwise",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java#L49-L56 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/DataGenerator.java | DataGenerator.genFiles | private void genFiles() throws IOException {
//
// BufferedReader in = new BufferedReader(new FileReader(new File(inDir,
// StructureGenerator.FILE_STRUCTURE_FILE_NAME)));
// String line;
// while ((line = in.readLine()) != null) {
// String[] tokens = line.split(" ");
// if (tokens.length != 2) {
// th... | java | private void genFiles() throws IOException {
//
// BufferedReader in = new BufferedReader(new FileReader(new File(inDir,
// StructureGenerator.FILE_STRUCTURE_FILE_NAME)));
// String line;
// while ((line = in.readLine()) != null) {
// String[] tokens = line.split(" ");
// if (tokens.length != 2) {
// th... | [
"private",
"void",
"genFiles",
"(",
")",
"throws",
"IOException",
"{",
"//",
"// BufferedReader in = new BufferedReader(new FileReader(new File(inDir,",
"// StructureGenerator.FILE_STRUCTURE_FILE_NAME)));",
"// String line;",
"// while ((line = in.readLine()) != null) {",
"// String[] toke... | Read file structure file under the input directory. Create each file
under the specified root. The file names are relative to the root. | [
"Read",
"file",
"structure",
"file",
"under",
"the",
"input",
"directory",
".",
"Create",
"each",
"file",
"under",
"the",
"specified",
"root",
".",
"The",
"file",
"names",
"are",
"relative",
"to",
"the",
"root",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/hdfs/DataGenerator.java#L117-L157 |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java | DataModelFactory.createPromotionDetails | public static PromotionDetails createPromotionDetails(final Boolean canBePromoted, final Boolean isSnapshot, final List<String> unPromotedDependencies, final List<Artifact> doNotUseArtifacts) throws IOException{
try{
final PromotionDetails promotionDetails = new PromotionDetails();
promotionDetails.setPromotab... | java | public static PromotionDetails createPromotionDetails(final Boolean canBePromoted, final Boolean isSnapshot, final List<String> unPromotedDependencies, final List<Artifact> doNotUseArtifacts) throws IOException{
try{
final PromotionDetails promotionDetails = new PromotionDetails();
promotionDetails.setPromotab... | [
"public",
"static",
"PromotionDetails",
"createPromotionDetails",
"(",
"final",
"Boolean",
"canBePromoted",
",",
"final",
"Boolean",
"isSnapshot",
",",
"final",
"List",
"<",
"String",
">",
"unPromotedDependencies",
",",
"final",
"List",
"<",
"Artifact",
">",
"doNotU... | Generates a PromotionDetails regarding the parameters.
@param canBePromoted Boolean
@param isSnapshot Boolean
@param unPromotedDependencies List<String>
@param doNotUseArtifacts List<Artifact>
@return PromotionDetails
@throws IOException | [
"Generates",
"a",
"PromotionDetails",
"regarding",
"the",
"parameters",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/datamodel/DataModelFactory.java#L180-L194 |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/Preconditions.java | Preconditions.checkValidStream | public static URI checkValidStream(URI uri) throws IllegalArgumentException {
String scheme = checkNotNull(uri).getScheme();
scheme = checkNotNull(scheme, "URI is missing a scheme").toLowerCase();
if (rtps.contains(scheme)) {
return uri;
}
if (udpTcp.contains(scheme)) {
if (uri.getPort... | java | public static URI checkValidStream(URI uri) throws IllegalArgumentException {
String scheme = checkNotNull(uri).getScheme();
scheme = checkNotNull(scheme, "URI is missing a scheme").toLowerCase();
if (rtps.contains(scheme)) {
return uri;
}
if (udpTcp.contains(scheme)) {
if (uri.getPort... | [
"public",
"static",
"URI",
"checkValidStream",
"(",
"URI",
"uri",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"scheme",
"=",
"checkNotNull",
"(",
"uri",
")",
".",
"getScheme",
"(",
")",
";",
"scheme",
"=",
"checkNotNull",
"(",
"scheme",
",",
"\... | Checks if the URI is valid for streaming to.
@param uri The URI to check
@return The passed in URI if it is valid
@throws IllegalArgumentException if the URI is not valid. | [
"Checks",
"if",
"the",
"URI",
"is",
"valid",
"for",
"streaming",
"to",
"."
] | train | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/Preconditions.java#L43-L59 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java | AutoMlClient.createDataset | public final Dataset createDataset(String parent, Dataset dataset) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build();
return createDataset(request);
} | java | public final Dataset createDataset(String parent, Dataset dataset) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build();
return createDataset(request);
} | [
"public",
"final",
"Dataset",
"createDataset",
"(",
"String",
"parent",
",",
"Dataset",
"dataset",
")",
"{",
"CreateDatasetRequest",
"request",
"=",
"CreateDatasetRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"setDataset",
"("... | Creates a dataset.
<p>Sample code:
<pre><code>
try (AutoMlClient autoMlClient = AutoMlClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = autoMlClient.createDataset(parent.toString(), dataset);
}
</code></pre>
@param ... | [
"Creates",
"a",
"dataset",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java#L231-L236 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.attributeAccess | private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::... | java | private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::... | [
"private",
"AstNode",
"attributeAccess",
"(",
")",
"throws",
"IOException",
"{",
"int",
"tt",
"=",
"nextToken",
"(",
")",
",",
"atPos",
"=",
"ts",
".",
"tokenBeg",
";",
"switch",
"(",
"tt",
")",
"{",
"// handles: @name, @ns::name, @ns::*, @ns::[expr]",
"case",
... | Xml attribute expression:<p>
{@code @attr}, {@code @ns::attr}, {@code @ns::*}, {@code @ns::*},
{@code @*}, {@code @*::attr}, {@code @*::*}, {@code @ns::[expr]},
{@code @*::[expr]}, {@code @[expr]} <p>
Called if we peeked an '@' token. | [
"Xml",
"attribute",
"expression",
":",
"<p",
">",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L2976-L2999 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java | BingSpellCheckOperationsImpl.spellCheckerAsync | public Observable<SpellCheck> spellCheckerAsync(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
return spellCheckerWithServiceResponseAsync(text, spellCheckerOptionalParameter).map(new Func1<ServiceResponse<SpellCheck>, SpellCheck>() {
@Override
public SpellCh... | java | public Observable<SpellCheck> spellCheckerAsync(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
return spellCheckerWithServiceResponseAsync(text, spellCheckerOptionalParameter).map(new Func1<ServiceResponse<SpellCheck>, SpellCheck>() {
@Override
public SpellCh... | [
"public",
"Observable",
"<",
"SpellCheck",
">",
"spellCheckerAsync",
"(",
"String",
"text",
",",
"SpellCheckerOptionalParameter",
"spellCheckerOptionalParameter",
")",
"{",
"return",
"spellCheckerWithServiceResponseAsync",
"(",
"text",
",",
"spellCheckerOptionalParameter",
")... | The Bing Spell Check API lets you perform contextual grammar and spell checking. Bing has developed a web-based spell-checker that leverages machine learning and statistical machine translation to dynamically train a constantly evolving and highly contextual algorithm. The spell-checker is based on a massive corpus of ... | [
"The",
"Bing",
"Spell",
"Check",
"API",
"lets",
"you",
"perform",
"contextual",
"grammar",
"and",
"spell",
"checking",
".",
"Bing",
"has",
"developed",
"a",
"web",
"-",
"based",
"spell",
"-",
"checker",
"that",
"leverages",
"machine",
"learning",
"and",
"sta... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java#L100-L107 |
norbsoft/android-typeface-helper | lib/src/main/java/com/norbsoft/typefacehelper/TypefaceHelper.java | TypefaceHelper.checkTypefaceStyleThrowing | private static void checkTypefaceStyleThrowing(int style) {
switch (style) {
case Typeface.NORMAL:
case Typeface.BOLD:
case Typeface.ITALIC:
case Typeface.BOLD_ITALIC:
break;
default:
throw new IllegalArgumentException("Style have to be in (Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOL... | java | private static void checkTypefaceStyleThrowing(int style) {
switch (style) {
case Typeface.NORMAL:
case Typeface.BOLD:
case Typeface.ITALIC:
case Typeface.BOLD_ITALIC:
break;
default:
throw new IllegalArgumentException("Style have to be in (Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, Typeface.BOL... | [
"private",
"static",
"void",
"checkTypefaceStyleThrowing",
"(",
"int",
"style",
")",
"{",
"switch",
"(",
"style",
")",
"{",
"case",
"Typeface",
".",
"NORMAL",
":",
"case",
"Typeface",
".",
"BOLD",
":",
"case",
"Typeface",
".",
"ITALIC",
":",
"case",
"Typef... | Check if typeface style int is one of:
<ul>
<li>{@link android.graphics.Typeface#NORMAL}</li>
<li>{@link android.graphics.Typeface#BOLD}</li>
<li>{@link android.graphics.Typeface#ITALIC}</li>
<li>{@link android.graphics.Typeface#BOLD_ITALIC}</li>
</ul>
@param style | [
"Check",
"if",
"typeface",
"style",
"int",
"is",
"one",
"of",
":",
"<ul",
">",
"<li",
">",
"{"
] | train | https://github.com/norbsoft/android-typeface-helper/blob/f9e12655f01144efa937c1172f5de7f9b29c4df7/lib/src/main/java/com/norbsoft/typefacehelper/TypefaceHelper.java#L208-L218 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/CapBasedLoadManager.java | CapBasedLoadManager.getCap | int getCap(int totalRunnableTasks, int localMaxTasks, int totalSlots) {
double load = maxDiff + ((double)totalRunnableTasks) / totalSlots;
int cap = (int) Math.min(localMaxTasks, Math.ceil(load * localMaxTasks));
if (LOG.isDebugEnabled()) {
LOG.debug("load:" + load + " maxDiff:" + maxDiff +
... | java | int getCap(int totalRunnableTasks, int localMaxTasks, int totalSlots) {
double load = maxDiff + ((double)totalRunnableTasks) / totalSlots;
int cap = (int) Math.min(localMaxTasks, Math.ceil(load * localMaxTasks));
if (LOG.isDebugEnabled()) {
LOG.debug("load:" + load + " maxDiff:" + maxDiff +
... | [
"int",
"getCap",
"(",
"int",
"totalRunnableTasks",
",",
"int",
"localMaxTasks",
",",
"int",
"totalSlots",
")",
"{",
"double",
"load",
"=",
"maxDiff",
"+",
"(",
"(",
"double",
")",
"totalRunnableTasks",
")",
"/",
"totalSlots",
";",
"int",
"cap",
"=",
"(",
... | Determine how many tasks of a given type we want to run on a TaskTracker.
This cap is chosen based on how many tasks of that type are outstanding in
total, so that when the cluster is used below capacity, tasks are spread
out uniformly across the nodes rather than being clumped up on whichever
machines sent out heartbe... | [
"Determine",
"how",
"many",
"tasks",
"of",
"a",
"given",
"type",
"we",
"want",
"to",
"run",
"on",
"a",
"TaskTracker",
".",
"This",
"cap",
"is",
"chosen",
"based",
"on",
"how",
"many",
"tasks",
"of",
"that",
"type",
"are",
"outstanding",
"in",
"total",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/CapBasedLoadManager.java#L96-L106 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java | CouchURIHelper.changesUri | public URI changesUri(Map<String, Object> query) {
String base_uri = String.format(
"%s/%s",
this.rootUriString,
"_changes"
);
//lets find the since parameter
if(query.containsKey("since")){
Object since = query.get("since");
... | java | public URI changesUri(Map<String, Object> query) {
String base_uri = String.format(
"%s/%s",
this.rootUriString,
"_changes"
);
//lets find the since parameter
if(query.containsKey("since")){
Object since = query.get("since");
... | [
"public",
"URI",
"changesUri",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"query",
")",
"{",
"String",
"base_uri",
"=",
"String",
".",
"format",
"(",
"\"%s/%s\"",
",",
"this",
".",
"rootUriString",
",",
"\"_changes\"",
")",
";",
"//lets find the since pa... | Returns URI for {@code _changes} endpoint using passed
{@code query}. | [
"Returns",
"URI",
"for",
"{"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/CouchURIHelper.java#L60-L78 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java | DOMHelper.getParentOfNode | public static Node getParentOfNode(Node node) throws RuntimeException
{
Node parent;
short nodeType = node.getNodeType();
if (Node.ATTRIBUTE_NODE == nodeType)
{
Document doc = node.getOwnerDocument();
/*
TBD:
if(null == doc)
{
throw new RuntimeException(XSLMe... | java | public static Node getParentOfNode(Node node) throws RuntimeException
{
Node parent;
short nodeType = node.getNodeType();
if (Node.ATTRIBUTE_NODE == nodeType)
{
Document doc = node.getOwnerDocument();
/*
TBD:
if(null == doc)
{
throw new RuntimeException(XSLMe... | [
"public",
"static",
"Node",
"getParentOfNode",
"(",
"Node",
"node",
")",
"throws",
"RuntimeException",
"{",
"Node",
"parent",
";",
"short",
"nodeType",
"=",
"node",
".",
"getNodeType",
"(",
")",
";",
"if",
"(",
"Node",
".",
"ATTRIBUTE_NODE",
"==",
"nodeType"... | Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
parent for other nodes.
<p>
Background: The DOM believes that you must be your Parent's
Child, and thus Attrs don't have parents. XPath said that Attrs
do have their owning Element as their parent. This function
bridges the difference, either by usi... | [
"Obtain",
"the",
"XPath",
"-",
"model",
"parent",
"of",
"a",
"DOM",
"node",
"--",
"ownerElement",
"for",
"Attrs",
"parent",
"for",
"other",
"nodes",
".",
"<p",
">",
"Background",
":",
"The",
"DOM",
"believes",
"that",
"you",
"must",
"be",
"your",
"Parent... | 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#L1010-L1068 |
verhas/License3j | src/main/java/javax0/license3j/RevocableLicense.java | RevocableLicense.getRevocationURL | public URL getRevocationURL() throws MalformedURLException {
final var revocationURLTemplate = license.get(REVOCATION_URL) == null ? null : license.get(REVOCATION_URL).getString();
final String revocationURL;
if (revocationURLTemplate != null) {
final var id = Optional.ofNullable(lic... | java | public URL getRevocationURL() throws MalformedURLException {
final var revocationURLTemplate = license.get(REVOCATION_URL) == null ? null : license.get(REVOCATION_URL).getString();
final String revocationURL;
if (revocationURLTemplate != null) {
final var id = Optional.ofNullable(lic... | [
"public",
"URL",
"getRevocationURL",
"(",
")",
"throws",
"MalformedURLException",
"{",
"final",
"var",
"revocationURLTemplate",
"=",
"license",
".",
"get",
"(",
"REVOCATION_URL",
")",
"==",
"null",
"?",
"null",
":",
"license",
".",
"get",
"(",
"REVOCATION_URL",
... | Get the revocation URL of the license. This feature is stored in the
license under the name {@code revocationUrl}. This URL may contain the
string <code>${licenseId}</code> which is replaced by the actual license
ID. Thus there is no need to wire into the revocation URL the license ID.
<p>
If there is no license id def... | [
"Get",
"the",
"revocation",
"URL",
"of",
"the",
"license",
".",
"This",
"feature",
"is",
"stored",
"in",
"the",
"license",
"under",
"the",
"name",
"{",
"@code",
"revocationUrl",
"}",
".",
"This",
"URL",
"may",
"contain",
"the",
"string",
"<code",
">",
"$... | train | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/RevocableLicense.java#L38-L51 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/TypePoolGroupNameMap.java | TypePoolGroupNameMap.containsKey | public boolean containsKey(ResourceType type, String poolGroupName) {
Map<String, V> poolGroupNameMap = typePoolGroupNameMap.get(type);
if (poolGroupNameMap == null) {
return false;
}
return poolGroupNameMap.containsKey(poolGroupName);
} | java | public boolean containsKey(ResourceType type, String poolGroupName) {
Map<String, V> poolGroupNameMap = typePoolGroupNameMap.get(type);
if (poolGroupNameMap == null) {
return false;
}
return poolGroupNameMap.containsKey(poolGroupName);
} | [
"public",
"boolean",
"containsKey",
"(",
"ResourceType",
"type",
",",
"String",
"poolGroupName",
")",
"{",
"Map",
"<",
"String",
",",
"V",
">",
"poolGroupNameMap",
"=",
"typePoolGroupNameMap",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"poolGroupNameMap",
... | Is the value set with the appropriate keys?
@param type Resource type
@param poolGroup Name of pool group
@return True if this map contains a mapping for the specified key, false
otherwise | [
"Is",
"the",
"value",
"set",
"with",
"the",
"appropriate",
"keys?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/TypePoolGroupNameMap.java#L77-L83 |
rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.sendGetRequest | private <T extends Response> T sendGetRequest(String urlStr, Class<T> clazz) throws HttpRosetteAPIException {
HttpGet get = new HttpGet(urlStr);
for (Header header : additionalHeaders) {
get.addHeader(header);
}
try (CloseableHttpResponse httpResponse = httpClient.execute(ge... | java | private <T extends Response> T sendGetRequest(String urlStr, Class<T> clazz) throws HttpRosetteAPIException {
HttpGet get = new HttpGet(urlStr);
for (Header header : additionalHeaders) {
get.addHeader(header);
}
try (CloseableHttpResponse httpResponse = httpClient.execute(ge... | [
"private",
"<",
"T",
"extends",
"Response",
">",
"T",
"sendGetRequest",
"(",
"String",
"urlStr",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"HttpRosetteAPIException",
"{",
"HttpGet",
"get",
"=",
"new",
"HttpGet",
"(",
"urlStr",
")",
";",
"for",
... | Sends a GET request to Rosette API.
<p>
Returns a Response.
@param urlStr Rosette API end point.
@param clazz Response class
@return Response
@throws HttpRosetteAPIException | [
"Sends",
"a",
"GET",
"request",
"to",
"Rosette",
"API",
".",
"<p",
">",
"Returns",
"a",
"Response",
"."
] | train | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L326-L339 |
OpenTSDB/opentsdb | src/tools/ConfigArgP.java | ConfigArgP.loadConfig | protected static Properties loadConfig(URL url) {
InputStream is = null;
try {
URLConnection connection = url.openConnection();
if(connection instanceof HttpURLConnection) {
HttpURLConnection conn = (HttpURLConnection)connection;
conn.setConnectTimeout(5000);
conn.setReadTime... | java | protected static Properties loadConfig(URL url) {
InputStream is = null;
try {
URLConnection connection = url.openConnection();
if(connection instanceof HttpURLConnection) {
HttpURLConnection conn = (HttpURLConnection)connection;
conn.setConnectTimeout(5000);
conn.setReadTime... | [
"protected",
"static",
"Properties",
"loadConfig",
"(",
"URL",
"url",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"URLConnection",
"connection",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"if",
"(",
"connection",
"instanceof",
"HttpUR... | Loads properties from the passed URL
@param url The url to load from
@return the loaded properties | [
"Loads",
"properties",
"from",
"the",
"passed",
"URL"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ConfigArgP.java#L279-L296 |
hal/core | gui/src/main/java/org/jboss/as/console/server/proxy/HttpClient.java | HttpClient.doPost | public InputStream doPost(byte[] postData, String contentType) {
this.urlConnection.setDoOutput(true);
if (contentType != null) this.urlConnection.setRequestProperty( "Content-type", contentType );
OutputStream out = null;
try {
out = this.getOutputStream();
if(o... | java | public InputStream doPost(byte[] postData, String contentType) {
this.urlConnection.setDoOutput(true);
if (contentType != null) this.urlConnection.setRequestProperty( "Content-type", contentType );
OutputStream out = null;
try {
out = this.getOutputStream();
if(o... | [
"public",
"InputStream",
"doPost",
"(",
"byte",
"[",
"]",
"postData",
",",
"String",
"contentType",
")",
"{",
"this",
".",
"urlConnection",
".",
"setDoOutput",
"(",
"true",
")",
";",
"if",
"(",
"contentType",
"!=",
"null",
")",
"this",
".",
"urlConnection"... | posts data to the inputstream and returns the InputStream.
@param postData data to be posted. must be url-encoded already.
@param contentType allows you to set the contentType of the request.
@return InputStream input stream from URLConnection | [
"posts",
"data",
"to",
"the",
"inputstream",
"and",
"returns",
"the",
"InputStream",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/server/proxy/HttpClient.java#L315-L340 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.writeStream | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS,
@Nonnull final String sContent,
@Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sContent, "Content");
ValueEnforcer.notNull (aCharset... | java | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS,
@Nonnull final String sContent,
@Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sContent, "Content");
ValueEnforcer.notNull (aCharset... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeStream",
"(",
"@",
"WillClose",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
",",
"@",
"Nonnull",
"final",
"String",
"sContent",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnfor... | Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param sContent
The string to be written. May not be <code>null</code>.
@param aCharset
The charset to be used, to convert the String to a byte array.
@return {@lin... | [
"Write",
"bytes",
"to",
"an",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1321-L1330 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java | AVIMConversation.queryMessagesByType | public void queryMessagesByType(int msgType, final String msgId, final long timestamp, final int limit,
final AVIMMessagesQueryCallback callback) {
if (null == callback) {
return;
}
Map<String, Object> params = new HashMap<String, Object>();
params.put(Conversatio... | java | public void queryMessagesByType(int msgType, final String msgId, final long timestamp, final int limit,
final AVIMMessagesQueryCallback callback) {
if (null == callback) {
return;
}
Map<String, Object> params = new HashMap<String, Object>();
params.put(Conversatio... | [
"public",
"void",
"queryMessagesByType",
"(",
"int",
"msgType",
",",
"final",
"String",
"msgId",
",",
"final",
"long",
"timestamp",
",",
"final",
"int",
"limit",
",",
"final",
"AVIMMessagesQueryCallback",
"callback",
")",
"{",
"if",
"(",
"null",
"==",
"callbac... | 获取特定类型的历史消息。
注意:这个操作总是会从云端获取记录。
另,如果不指定 msgId 和 timestamp,则该函数效果等同于 queryMessageByType(type, limit, callback)
@param msgType 消息类型,可以参看 `AVIMMessageType` 里的定义。
@param msgId 消息id,从特定消息 id 开始向前查询(结果不会包含该记录)
@param timestamp 查询起始的时间戳,返回小于这个时间的记录,必须配合 msgId 一起使用。
要从最新消息开始获取时,请用 0 代替客户端的本地当前时间(System.currentTim... | [
"获取特定类型的历史消息。",
"注意:这个操作总是会从云端获取记录。",
"另,如果不指定",
"msgId",
"和",
"timestamp,则该函数效果等同于",
"queryMessageByType",
"(",
"type",
"limit",
"callback",
")"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L803-L824 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getPreparedImage | public BufferedImage getPreparedImage (String rset, String path, Colorization[] zations)
{
BufferedImage image = getImage(rset, path, zations);
BufferedImage prepped = null;
if (image != null) {
prepped = createImage(image.getWidth(), image.getHeight(),
... | java | public BufferedImage getPreparedImage (String rset, String path, Colorization[] zations)
{
BufferedImage image = getImage(rset, path, zations);
BufferedImage prepped = null;
if (image != null) {
prepped = createImage(image.getWidth(), image.getHeight(),
... | [
"public",
"BufferedImage",
"getPreparedImage",
"(",
"String",
"rset",
",",
"String",
"path",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"BufferedImage",
"image",
"=",
"getImage",
"(",
"rset",
",",
"path",
",",
"zations",
")",
";",
"BufferedImage",
"... | Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set and applying the using the supplied path to identify the image.
<p> Additionally the image is optimized for display in the current graphics
configuration. Consider using {@link #getMirage(ImageKey,Color... | [
"Loads",
"(",
"and",
"caches",
")",
"the",
"specified",
"image",
"from",
"the",
"resource",
"manager",
"obtaining",
"the",
"image",
"from",
"the",
"supplied",
"resource",
"set",
"and",
"applying",
"the",
"using",
"the",
"supplied",
"path",
"to",
"identify",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L244-L256 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java | CmsResourceWrapperXmlPage.getUriTemplate | protected String getUriTemplate(CmsObject cms, CmsResource res) {
String result = "";
try {
result = cms.readPropertyObject(
cms.getRequestContext().removeSiteRoot(res.getRootPath()),
CmsPropertyDefinition.PROPERTY_TEMPLATE,
true).getValue("")... | java | protected String getUriTemplate(CmsObject cms, CmsResource res) {
String result = "";
try {
result = cms.readPropertyObject(
cms.getRequestContext().removeSiteRoot(res.getRootPath()),
CmsPropertyDefinition.PROPERTY_TEMPLATE,
true).getValue("")... | [
"protected",
"String",
"getUriTemplate",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"result",
"=",
"cms",
".",
"readPropertyObject",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"... | Returns the OpenCms VFS uri of the template of the resource.<p>
@param cms the initialized CmsObject
@param res the resource where to read the template for
@return the OpenCms VFS uri of the template of the resource | [
"Returns",
"the",
"OpenCms",
"VFS",
"uri",
"of",
"the",
"template",
"of",
"the",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java#L865-L877 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getGetterMethod | public static Method getGetterMethod(Class<?> c, String field) {
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
try {
return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
... | java | public static Method getGetterMethod(Class<?> c, String field) {
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
try {
return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
... | [
"public",
"static",
"Method",
"getGetterMethod",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"field",
")",
"{",
"try",
"{",
"return",
"c",
".",
"getMethod",
"(",
"getMethodName",
"(",
"field",
",",
"GET_METHOD_PREFIX",
")",
",",
"EMPTY_CLASS",
")",
... | Gets getter method.
@param c the c
@param field the field
@return the getter method | [
"Gets",
"getter",
"method",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L216-L228 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.encodeBytesToBytes | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
{
byte [] encoded;
try
{
encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);
}
catch (final IOException ex)
{
throw new IllegalStateException ("IOExceptions on... | java | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
{
byte [] encoded;
try
{
encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);
}
catch (final IOException ex)
{
throw new IllegalStateException ("IOExceptions on... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"byte",
"[",
"]",
"encodeBytesToBytes",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"source",
")",
"{",
"byte",
"[",
"]",
"encoded",
";",
"try",
"{",
"encoded",
"=",
"encodeBytesToBytes",
"... | Similar to {@link #encodeBytes(byte[])} but returns a byte array instead of
instantiating a String. This is more efficient if you're working with I/O
streams and have large data sets to encode.
@param source
The data to convert
@return The Base64-encoded data as a byte[] (of ASCII characters)
@throws NullPointerExcept... | [
"Similar",
"to",
"{",
"@link",
"#encodeBytes",
"(",
"byte",
"[]",
")",
"}",
"but",
"returns",
"a",
"byte",
"array",
"instead",
"of",
"instantiating",
"a",
"String",
".",
"This",
"is",
"more",
"efficient",
"if",
"you",
"re",
"working",
"with",
"I",
"/",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1810-L1824 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/model/data/series/Sample.java | Sample.ofTimeDouble | public static Sample ofTimeDouble(long time, double numericValue) {
return new Sample(time, null, null, null)
.setNumericValueFromDouble(numericValue);
} | java | public static Sample ofTimeDouble(long time, double numericValue) {
return new Sample(time, null, null, null)
.setNumericValueFromDouble(numericValue);
} | [
"public",
"static",
"Sample",
"ofTimeDouble",
"(",
"long",
"time",
",",
"double",
"numericValue",
")",
"{",
"return",
"new",
"Sample",
"(",
"time",
",",
"null",
",",
"null",
",",
"null",
")",
".",
"setNumericValueFromDouble",
"(",
"numericValue",
")",
";",
... | Creates a new {@link Sample} with time and double value specified
@param time time in milliseconds from 1970-01-01 00:00:00
@param numericValue the numeric value of the sample
@return the Sample with specified fields | [
"Creates",
"a",
"new",
"{",
"@link",
"Sample",
"}",
"with",
"time",
"and",
"double",
"value",
"specified"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/model/data/series/Sample.java#L66-L69 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java | GVRSceneObject.expandBoundingVolume | public final BoundingVolume expandBoundingVolume(final Vector3f center, final float radius) {
return expandBoundingVolume(center.x, center.y, center.z, radius);
} | java | public final BoundingVolume expandBoundingVolume(final Vector3f center, final float radius) {
return expandBoundingVolume(center.x, center.y, center.z, radius);
} | [
"public",
"final",
"BoundingVolume",
"expandBoundingVolume",
"(",
"final",
"Vector3f",
"center",
",",
"final",
"float",
"radius",
")",
"{",
"return",
"expandBoundingVolume",
"(",
"center",
".",
"x",
",",
"center",
".",
"y",
",",
"center",
".",
"z",
",",
"rad... | Expand the volume by the incoming center and radius
@param center new center
@param radius new radius
@return the updated BoundingVolume. | [
"Expand",
"the",
"volume",
"by",
"the",
"incoming",
"center",
"and",
"radius"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L1297-L1299 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final String name, final Class<? extends A> clazz, final A rs) {
return register(true, name, clazz, rs);
} | java | public <A> A register(final String name, final Class<? extends A> clazz, final A rs) {
return register(true, name, clazz, rs);
} | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
"extends",
"A",
">",
"clazz",
",",
"final",
"A",
"rs",
")",
"{",
"return",
"register",
"(",
"true",
",",
"name",
",",
"clazz",
",",
"rs",
"... | 将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源
@param <A> 泛型
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象 | [
"将对象以指定资源名和类型注入到资源池中,并同步已被注入的资源"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L372-L374 |
jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readByteBlockAlignedNoCRC | public void readByteBlockAlignedNoCRC(byte[] val, int nvals) throws IOException {
int destlength = nvals;
while (nvals > 0) {
int chunk = Math.min(nvals, putByte - getByte);
if (chunk == 0) {
readFromStream();
} else {
if (val != null) ... | java | public void readByteBlockAlignedNoCRC(byte[] val, int nvals) throws IOException {
int destlength = nvals;
while (nvals > 0) {
int chunk = Math.min(nvals, putByte - getByte);
if (chunk == 0) {
readFromStream();
} else {
if (val != null) ... | [
"public",
"void",
"readByteBlockAlignedNoCRC",
"(",
"byte",
"[",
"]",
"val",
",",
"int",
"nvals",
")",
"throws",
"IOException",
"{",
"int",
"destlength",
"=",
"nvals",
";",
"while",
"(",
"nvals",
">",
"0",
")",
"{",
"int",
"chunk",
"=",
"Math",
".",
"m... | Read a block of bytes (aligned) without updating the CRC value.
@param val The array to receive the bytes. If null, no bytes are returned
@param nvals The number of bytes to read
@throws IOException Thrown if error reading input stream | [
"Read",
"a",
"block",
"of",
"bytes",
"(",
"aligned",
")",
"without",
"updating",
"the",
"CRC",
"value",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L390-L405 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamOutput.java | PrintStreamOutput.lookupPattern | protected String lookupPattern(String key, String defaultPattern) {
if (outputPatterns.containsKey(key)) {
return outputPatterns.getProperty(key);
}
return defaultPattern;
} | java | protected String lookupPattern(String key, String defaultPattern) {
if (outputPatterns.containsKey(key)) {
return outputPatterns.getProperty(key);
}
return defaultPattern;
} | [
"protected",
"String",
"lookupPattern",
"(",
"String",
"key",
",",
"String",
"defaultPattern",
")",
"{",
"if",
"(",
"outputPatterns",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"outputPatterns",
".",
"getProperty",
"(",
"key",
")",
";",
"}",
... | Looks up the format pattern for the event output by key, conventionally
equal to the method name. The pattern is used by the
{#format(String,String,Object...)} method and by default is formatted
using the {@link MessageFormat#format(String, Object...)} method. If no
pattern is found for key or needs to be overridden, t... | [
"Looks",
"up",
"the",
"format",
"pattern",
"for",
"the",
"event",
"output",
"by",
"key",
"conventionally",
"equal",
"to",
"the",
"method",
"name",
".",
"The",
"pattern",
"is",
"used",
"by",
"the",
"{",
"#format",
"(",
"String",
"String",
"Object",
"...",
... | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/reporters/PrintStreamOutput.java#L533-L538 |
weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java | SecurityActions.lookupField | static Field lookupField(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
if (System.getSecurityManager() != null) {
try {
return AccessController.doPrivileged(new FieldLookupAction(javaClass, fieldName));
} catch (PrivilegedActionException e) {
... | java | static Field lookupField(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
if (System.getSecurityManager() != null) {
try {
return AccessController.doPrivileged(new FieldLookupAction(javaClass, fieldName));
} catch (PrivilegedActionException e) {
... | [
"static",
"Field",
"lookupField",
"(",
"Class",
"<",
"?",
">",
"javaClass",
",",
"String",
"fieldName",
")",
"throws",
"NoSuchFieldException",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Acc... | Does not perform {@link PrivilegedAction} unless necessary.
@param javaClass
@param fieldName
@return a field from the class
@throws NoSuchMethodException | [
"Does",
"not",
"perform",
"{",
"@link",
"PrivilegedAction",
"}",
"unless",
"necessary",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/tomcat/SecurityActions.java#L72-L85 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java | Form.setAnswer | public void setAnswer(String variable, String value) {
FormField field = getField(variable);
if (field == null) {
throw new IllegalArgumentException("Field not found for the specified variable name.");
}
switch (field.getType()) {
case text_multi:
case text_pr... | java | public void setAnswer(String variable, String value) {
FormField field = getField(variable);
if (field == null) {
throw new IllegalArgumentException("Field not found for the specified variable name.");
}
switch (field.getType()) {
case text_multi:
case text_pr... | [
"public",
"void",
"setAnswer",
"(",
"String",
"variable",
",",
"String",
"value",
")",
"{",
"FormField",
"field",
"=",
"getField",
"(",
"variable",
")",
";",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Fi... | Sets a new String value to a given form's field. The field whose variable matches the
requested variable will be completed with the specified value. If no field could be found
for the specified variable then an exception will be raised.<p>
If the value to set to the field is not a basic type (e.g. String, boolean, int... | [
"Sets",
"a",
"new",
"String",
"value",
"to",
"a",
"given",
"form",
"s",
"field",
".",
"The",
"field",
"whose",
"variable",
"matches",
"the",
"requested",
"variable",
"will",
"be",
"completed",
"with",
"the",
"specified",
"value",
".",
"If",
"no",
"field",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java#L110-L126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.