repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Whiley/WhileyCompiler | src/main/java/wyil/type/util/ReadWriteTypeExtractor.java | ReadWriteTypeExtractor.intersectionHelper | protected static SemanticType intersectionHelper(SemanticType lhs, SemanticType rhs) {
if (lhs.equals(rhs)) {
return lhs;
} else if (lhs instanceof Type.Void) {
return lhs;
} else if (rhs instanceof Type.Void) {
return rhs;
} else {
return new SemanticType.Intersection(new SemanticType[] { lhs, rhs ... | java | protected static SemanticType intersectionHelper(SemanticType lhs, SemanticType rhs) {
if (lhs.equals(rhs)) {
return lhs;
} else if (lhs instanceof Type.Void) {
return lhs;
} else if (rhs instanceof Type.Void) {
return rhs;
} else {
return new SemanticType.Intersection(new SemanticType[] { lhs, rhs ... | [
"protected",
"static",
"SemanticType",
"intersectionHelper",
"(",
"SemanticType",
"lhs",
",",
"SemanticType",
"rhs",
")",
"{",
"if",
"(",
"lhs",
".",
"equals",
"(",
"rhs",
")",
")",
"{",
"return",
"lhs",
";",
"}",
"else",
"if",
"(",
"lhs",
"instanceof",
... | Provides a simplistic form of type intersect which, in some cases, does
slightly better than simply creating a new intersection. For example,
intersecting <code>int</code> with <code>int</code> will return
<code>int</code> rather than <code>int&int</code>.
@param lhs
@param rhs
@return | [
"Provides",
"a",
"simplistic",
"form",
"of",
"type",
"intersect",
"which",
"in",
"some",
"cases",
"does",
"slightly",
"better",
"than",
"simply",
"creating",
"a",
"new",
"intersection",
".",
"For",
"example",
"intersecting",
"<code",
">",
"int<",
"/",
"code",
... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/util/ReadWriteTypeExtractor.java#L872-L882 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_entry.java | Dcs_entry.cs_entry | public static boolean cs_entry(Dcs T, int i, int j, double x) {
if (!Dcs_util.CS_TRIPLET(T) || i < 0 || j < 0)
return (false); /* check inputs */
if (T.nz >= T.nzmax) {
Dcs_util.cs_sprealloc(T, 2 * (T.nzmax));
}
if (T.x != null)
T.x[T.nz] = x;
... | java | public static boolean cs_entry(Dcs T, int i, int j, double x) {
if (!Dcs_util.CS_TRIPLET(T) || i < 0 || j < 0)
return (false); /* check inputs */
if (T.nz >= T.nzmax) {
Dcs_util.cs_sprealloc(T, 2 * (T.nzmax));
}
if (T.x != null)
T.x[T.nz] = x;
... | [
"public",
"static",
"boolean",
"cs_entry",
"(",
"Dcs",
"T",
",",
"int",
"i",
",",
"int",
"j",
",",
"double",
"x",
")",
"{",
"if",
"(",
"!",
"Dcs_util",
".",
"CS_TRIPLET",
"(",
"T",
")",
"||",
"i",
"<",
"0",
"||",
"j",
"<",
"0",
")",
"return",
... | Adds an entry to a triplet matrix. Memory-space and dimension of T are
increased if necessary.
@param T
triplet matrix; new entry added on output
@param i
row index of new entry
@param j
column index of new entry
@param x
numerical value of new entry
@return true if successful, false otherwise | [
"Adds",
"an",
"entry",
"to",
"a",
"triplet",
"matrix",
".",
"Memory",
"-",
"space",
"and",
"dimension",
"of",
"T",
"are",
"increased",
"if",
"necessary",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_entry.java#L50-L63 |
aws/aws-sdk-java | aws-java-sdk-simpledb/src/main/java/com/amazonaws/services/simpledb/util/SimpleDBUtils.java | SimpleDBUtils.decodeRealNumberRangeFloat | public static float decodeRealNumberRangeFloat(String value, int maxDigitsRight, int offsetValue) {
long offsetNumber = Long.parseLong(value, 10);
int shiftMultiplier = (int) Math.pow(10, maxDigitsRight);
double tempVal = (double) (offsetNumber - offsetValue * shiftMultiplier);
return (f... | java | public static float decodeRealNumberRangeFloat(String value, int maxDigitsRight, int offsetValue) {
long offsetNumber = Long.parseLong(value, 10);
int shiftMultiplier = (int) Math.pow(10, maxDigitsRight);
double tempVal = (double) (offsetNumber - offsetValue * shiftMultiplier);
return (f... | [
"public",
"static",
"float",
"decodeRealNumberRangeFloat",
"(",
"String",
"value",
",",
"int",
"maxDigitsRight",
",",
"int",
"offsetValue",
")",
"{",
"long",
"offsetNumber",
"=",
"Long",
".",
"parseLong",
"(",
"value",
",",
"10",
")",
";",
"int",
"shiftMultipl... | Decodes float value from the string representation that was created by using
encodeRealNumberRange(..) function.
@param value
string representation of the integer value
@param maxDigitsRight
maximum number of digits left of the decimal point in the largest absolute value
in the data set (must be the same as the one us... | [
"Decodes",
"float",
"value",
"from",
"the",
"string",
"representation",
"that",
"was",
"created",
"by",
"using",
"encodeRealNumberRange",
"(",
"..",
")",
"function",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-simpledb/src/main/java/com/amazonaws/services/simpledb/util/SimpleDBUtils.java#L274-L279 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckAccessControls.java | CheckAccessControls.checkPropertyDeprecation | private void checkPropertyDeprecation(NodeTraversal t, PropertyReference propRef) {
if (!shouldEmitDeprecationWarning(t, propRef)) {
return;
}
// Don't bother checking constructors.
if (propRef.getSourceNode().getParent().isNew()) {
return;
}
ObjectType objectType = castToObject(de... | java | private void checkPropertyDeprecation(NodeTraversal t, PropertyReference propRef) {
if (!shouldEmitDeprecationWarning(t, propRef)) {
return;
}
// Don't bother checking constructors.
if (propRef.getSourceNode().getParent().isNew()) {
return;
}
ObjectType objectType = castToObject(de... | [
"private",
"void",
"checkPropertyDeprecation",
"(",
"NodeTraversal",
"t",
",",
"PropertyReference",
"propRef",
")",
"{",
"if",
"(",
"!",
"shouldEmitDeprecationWarning",
"(",
"t",
",",
"propRef",
")",
")",
"{",
"return",
";",
"}",
"// Don't bother checking constructo... | Checks the given GETPROP node to ensure that access restrictions are obeyed. | [
"Checks",
"the",
"given",
"GETPROP",
"node",
"to",
"ensure",
"that",
"access",
"restrictions",
"are",
"obeyed",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckAccessControls.java#L471-L508 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java | XsdAsmVisitor.generateVisitors | static void generateVisitors(Set<String> elementNames, List<XsdAttribute> attributes, String apiName){
generateVisitorInterface(elementNames, filterAttributes(attributes), apiName);
} | java | static void generateVisitors(Set<String> elementNames, List<XsdAttribute> attributes, String apiName){
generateVisitorInterface(elementNames, filterAttributes(attributes), apiName);
} | [
"static",
"void",
"generateVisitors",
"(",
"Set",
"<",
"String",
">",
"elementNames",
",",
"List",
"<",
"XsdAttribute",
">",
"attributes",
",",
"String",
"apiName",
")",
"{",
"generateVisitorInterface",
"(",
"elementNames",
",",
"filterAttributes",
"(",
"attribute... | Generates both the abstract visitor class with methods for each element from the list.
@param elementNames The elements names list.
@param apiName The name of the generated fluent interface. | [
"Generates",
"both",
"the",
"abstract",
"visitor",
"class",
"with",
"methods",
"for",
"each",
"element",
"from",
"the",
"list",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmVisitor.java#L34-L36 |
infinispan/infinispan | core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java | StripedLock.acquireAllLocks | public void acquireAllLocks(List<Object> keys, boolean exclusive) {
for (Object k : keys) {
acquireLock(k, exclusive);
}
} | java | public void acquireAllLocks(List<Object> keys, boolean exclusive) {
for (Object k : keys) {
acquireLock(k, exclusive);
}
} | [
"public",
"void",
"acquireAllLocks",
"(",
"List",
"<",
"Object",
">",
"keys",
",",
"boolean",
"exclusive",
")",
"{",
"for",
"(",
"Object",
"k",
":",
"keys",
")",
"{",
"acquireLock",
"(",
"k",
",",
"exclusive",
")",
";",
"}",
"}"
] | Acquires locks on keys passed in. Makes multiple calls to {@link #acquireLock(Object, boolean)}
@param keys keys to unlock
@param exclusive whether locks are exclusive. | [
"Acquires",
"locks",
"on",
"keys",
"passed",
"in",
".",
"Makes",
"multiple",
"calls",
"to",
"{",
"@link",
"#acquireLock",
"(",
"Object",
"boolean",
")",
"}"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java#L171-L175 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setOrtho | public Matrix4f setOrtho(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne) {
if ((properties & PROPERTY_IDENTITY) == 0)
MemUtil.INSTANCE.identity(this);
this._m00(2.0f / (right - left));
this._m11(2.0f / (top - bottom));
this._m22(... | java | public Matrix4f setOrtho(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne) {
if ((properties & PROPERTY_IDENTITY) == 0)
MemUtil.INSTANCE.identity(this);
this._m00(2.0f / (right - left));
this._m11(2.0f / (top - bottom));
this._m22(... | [
"public",
"Matrix4f",
"setOrtho",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_... | Set this matrix to be an orthographic projection transformation for a right-handed coordinate system
using the given NDC z range.
<p>
In order to apply the orthographic projection to an already existing transformation,
use {@link #ortho(float, float, float, float, float, float, boolean) ortho()}.
<p>
Reference: <a href... | [
"Set",
"this",
"matrix",
"to",
"be",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
".",
"<p",
">",
"In",
"order",
"to",
"apply",
"the",
"ortho... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7188-L7199 |
kiswanij/jk-util | src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java | JKExceptionHandlerFactory.setHandler | public void setHandler(final Class<? extends Throwable> clas, final JKExceptionHandler handler) {
this.handlers.put(clas, handler);
} | java | public void setHandler(final Class<? extends Throwable> clas, final JKExceptionHandler handler) {
this.handlers.put(clas, handler);
} | [
"public",
"void",
"setHandler",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"clas",
",",
"final",
"JKExceptionHandler",
"handler",
")",
"{",
"this",
".",
"handlers",
".",
"put",
"(",
"clas",
",",
"handler",
")",
";",
"}"
] | Sets the handler.
@param clas the clas
@param handler the handler | [
"Sets",
"the",
"handler",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java#L113-L115 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java | EventHubConnectionsInner.beginUpdateAsync | public Observable<EventHubConnectionInner> beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, pa... | java | public Observable<EventHubConnectionInner> beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, pa... | [
"public",
"Observable",
"<",
"EventHubConnectionInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"String",
"eventHubConnectionName",
",",
"EventHubConnectionUpdate",
"parameters",
")",
"... | Updates a Event Hub connection.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param eventHubConnectionName The name of the event hub connection.
@param parameter... | [
"Updates",
"a",
"Event",
"Hub",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L736-L743 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java | InsertRawHelper.generateJavaDocReturnType | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | java | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | [
"public",
"static",
"void",
"generateJavaDocReturnType",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnType",
")",
"{",
"if",
"(",
"returnType",
"==",
"TypeName",
".",
"VOID",
")",
"{",
"}",
"else",
"if",
"(",
"TypeUtility",
".",
... | Generate javadoc about return type of method.
@param methodBuilder the method builder
@param returnType the return type | [
"Generate",
"javadoc",
"about",
"return",
"type",
"of",
"method",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java#L287-L301 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/Interval.java | Interval.oneToBy | public static Interval oneToBy(int count, int step)
{
if (count < 1)
{
throw new IllegalArgumentException("Only positive ranges allowed using oneToBy");
}
return Interval.fromToBy(1, count, step);
} | java | public static Interval oneToBy(int count, int step)
{
if (count < 1)
{
throw new IllegalArgumentException("Only positive ranges allowed using oneToBy");
}
return Interval.fromToBy(1, count, step);
} | [
"public",
"static",
"Interval",
"oneToBy",
"(",
"int",
"count",
",",
"int",
"step",
")",
"{",
"if",
"(",
"count",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Only positive ranges allowed using oneToBy\"",
")",
";",
"}",
"return",
"I... | Returns an Interval starting from 1 to the specified count value with a step value of step. | [
"Returns",
"an",
"Interval",
"starting",
"from",
"1",
"to",
"the",
"specified",
"count",
"value",
"with",
"a",
"step",
"value",
"of",
"step",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/Interval.java#L148-L155 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java | Pattern.repeat | public static Pattern repeat(Pattern pattern, int min, int max)
{
if (pattern == null)
{
throw new IllegalArgumentException("Pattern can not be null");
}
return new RepeatPattern(pattern, min, max);
} | java | public static Pattern repeat(Pattern pattern, int min, int max)
{
if (pattern == null)
{
throw new IllegalArgumentException("Pattern can not be null");
}
return new RepeatPattern(pattern, min, max);
} | [
"public",
"static",
"Pattern",
"repeat",
"(",
"Pattern",
"pattern",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pattern can not be null\"",
")",
";",
"}",
... | A pattern which matches <code>pattern</code> as many times as possible
but at least <code>min</code> times and at most <code>max</code> times.
@param pattern
@param min
@param max
@return | [
"A",
"pattern",
"which",
"matches",
"<code",
">",
"pattern<",
"/",
"code",
">",
"as",
"many",
"times",
"as",
"possible",
"but",
"at",
"least",
"<code",
">",
"min<",
"/",
"code",
">",
"times",
"and",
"at",
"most",
"<code",
">",
"max<",
"/",
"code",
">... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java#L209-L216 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.datePartStr | public static Expression datePartStr(String expression, DatePartExt part) {
return datePartStr(x(expression), part);
} | java | public static Expression datePartStr(String expression, DatePartExt part) {
return datePartStr(x(expression), part);
} | [
"public",
"static",
"Expression",
"datePartStr",
"(",
"String",
"expression",
",",
"DatePartExt",
"part",
")",
"{",
"return",
"datePartStr",
"(",
"x",
"(",
"expression",
")",
",",
"part",
")",
";",
"}"
] | Returned expression results in Date part as an integer.
The date expression is a string in a supported format, and part is one of the supported date part strings. | [
"Returned",
"expression",
"results",
"in",
"Date",
"part",
"as",
"an",
"integer",
".",
"The",
"date",
"expression",
"is",
"a",
"string",
"in",
"a",
"supported",
"format",
"and",
"part",
"is",
"one",
"of",
"the",
"supported",
"date",
"part",
"strings",
"."
... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L164-L166 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.createAccumulators | private void createAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass, AccumulateWithSubClasses... annotations) {
for (final AccumulateWithSubClasses annotation : annotations)
if (annotation != null)
AccumulatorUtil.getInstance(producerClass).createAccumulator(producer, annotation)... | java | private void createAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass, AccumulateWithSubClasses... annotations) {
for (final AccumulateWithSubClasses annotation : annotations)
if (annotation != null)
AccumulatorUtil.getInstance(producerClass).createAccumulator(producer, annotation)... | [
"private",
"void",
"createAccumulators",
"(",
"final",
"OnDemandStatsProducer",
"<",
"S",
">",
"producer",
",",
"final",
"Class",
"producerClass",
",",
"AccumulateWithSubClasses",
"...",
"annotations",
")",
"{",
"for",
"(",
"final",
"AccumulateWithSubClasses",
"annota... | Create class level accumulators from {@link AccumulateWithSubClasses} annotations.
@param producer
{@link OnDemandStatsProducer}
@param producerClass
producer class
@param annotations
{@link AccumulateWithSubClasses} annotations to process | [
"Create",
"class",
"level",
"accumulators",
"from",
"{",
"@link",
"AccumulateWithSubClasses",
"}",
"annotations",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L281-L285 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.examplesMethodWithServiceResponseAsync | public Observable<ServiceResponse<List<LabelTextObject>>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.c... | java | public Observable<ServiceResponse<List<LabelTextObject>>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.c... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"LabelTextObject",
">",
">",
">",
"examplesMethodWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"String",
"modelId",
",",
"ExamplesMethodOptionalParameter",
"examplesMet... | Gets the utterances for the given model in the given app version.
@param appId The application ID.
@param versionId The version ID.
@param modelId The ID (GUID) of the model.
@param examplesMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Gets",
"the",
"utterances",
"for",
"the",
"given",
"model",
"in",
"the",
"given",
"app",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2672-L2689 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.getFieldValue | public static Object getFieldValue(final Object object, final Class<?> clazz, final String fieldName) {
try {
final Field field = clazz.getDeclaredField(fieldName);
return getFieldValue(object, field);
} catch (final Exception e) {
throw new IllegalArgumentException("... | java | public static Object getFieldValue(final Object object, final Class<?> clazz, final String fieldName) {
try {
final Field field = clazz.getDeclaredField(fieldName);
return getFieldValue(object, field);
} catch (final Exception e) {
throw new IllegalArgumentException("... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"final",
"Object",
"object",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"fieldName",
")",
"{",
"try",
"{",
"final",
"Field",
"field",
"=",
"clazz",
".",
"getDeclaredField",
"("... | Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param clazz
-- type of argument object
@param fieldName
-- name of the field
@return -- the value of the represented field in object; primitive values
are wrapped in an appropriate object before being retur... | [
"Get",
"the",
"value",
"of",
"a",
"given",
"field",
"on",
"a",
"given",
"object",
"via",
"reflection",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L235-L242 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/format/ParseProcessor.java | ParseProcessor.checkPreconditions | private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
if(type == null) {
throw new NullPointerException("type is null.");
}
if(parser == null) {
throw new NullPointerException("parser is null.");
}
} | java | private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
if(type == null) {
throw new NullPointerException("type is null.");
}
if(parser == null) {
throw new NullPointerException("parser is null.");
}
} | [
"private",
"static",
"<",
"T",
">",
"void",
"checkPreconditions",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"TextParser",
"<",
"T",
">",
"parser",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerExcept... | コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。
@throws NullPointerException type or parser is null. | [
"コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。",
"@throws",
"NullPointerException",
"type",
"or",
"parser",
"is",
"null",
"."
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/format/ParseProcessor.java#L43-L51 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/TriggerDefinition.java | TriggerDefinition.fromSchema | public static List<TriggerDefinition> fromSchema(Row serializedTriggers)
{
List<TriggerDefinition> triggers = new ArrayList<>();
String query = String.format("SELECT * FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.SCHEMA_TRIGGERS_CF);
for (UntypedResultSet.Row row : QueryProcessor.resultif... | java | public static List<TriggerDefinition> fromSchema(Row serializedTriggers)
{
List<TriggerDefinition> triggers = new ArrayList<>();
String query = String.format("SELECT * FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.SCHEMA_TRIGGERS_CF);
for (UntypedResultSet.Row row : QueryProcessor.resultif... | [
"public",
"static",
"List",
"<",
"TriggerDefinition",
">",
"fromSchema",
"(",
"Row",
"serializedTriggers",
")",
"{",
"List",
"<",
"TriggerDefinition",
">",
"triggers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"query",
"=",
"String",
".",
"form... | Deserialize triggers from storage-level representation.
@param serializedTriggers storage-level partition containing the trigger definitions
@return the list of processed TriggerDefinitions | [
"Deserialize",
"triggers",
"from",
"storage",
"-",
"level",
"representation",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/TriggerDefinition.java#L61-L72 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java | JSchema.setAccessors | private void setAccessors(int bias, JMFSchema schema) {
int nextBoxBias = bias + fields.length + variants.length;
for (int i = 0; i < fields.length; i++) {
JSField field = fields[i];
if (field instanceof JSVariant) {
JSchema boxed = (JSchema) ((JSVariant)field).getBoxed();
boxed.setA... | java | private void setAccessors(int bias, JMFSchema schema) {
int nextBoxBias = bias + fields.length + variants.length;
for (int i = 0; i < fields.length; i++) {
JSField field = fields[i];
if (field instanceof JSVariant) {
JSchema boxed = (JSchema) ((JSVariant)field).getBoxed();
boxed.setA... | [
"private",
"void",
"setAccessors",
"(",
"int",
"bias",
",",
"JMFSchema",
"schema",
")",
"{",
"int",
"nextBoxBias",
"=",
"bias",
"+",
"fields",
".",
"length",
"+",
"variants",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"field... | permits retrieval of accessors relative to box schemas as well as the public schema. | [
"permits",
"retrieval",
"of",
"accessors",
"relative",
"to",
"box",
"schemas",
"as",
"well",
"as",
"the",
"public",
"schema",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java#L672-L691 |
samskivert/samskivert | src/main/java/com/samskivert/util/ClassUtil.java | ClassUtil.getFields | public static void getFields (Class<?> clazz, List<Field> addTo)
{
// first get the fields of the superclass
Class<?> pclazz = clazz.getSuperclass();
if (pclazz != null && !pclazz.equals(Object.class)) {
getFields(pclazz, addTo);
}
// then reflect on this class's... | java | public static void getFields (Class<?> clazz, List<Field> addTo)
{
// first get the fields of the superclass
Class<?> pclazz = clazz.getSuperclass();
if (pclazz != null && !pclazz.equals(Object.class)) {
getFields(pclazz, addTo);
}
// then reflect on this class's... | [
"public",
"static",
"void",
"getFields",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"List",
"<",
"Field",
">",
"addTo",
")",
"{",
"// first get the fields of the superclass",
"Class",
"<",
"?",
">",
"pclazz",
"=",
"clazz",
".",
"getSuperclass",
"(",
")",
"... | Add all the fields of the specifed class (and its ancestors) to the list. Note, if we are
running in a sandbox, this will only enumerate public members. | [
"Add",
"all",
"the",
"fields",
"of",
"the",
"specifed",
"class",
"(",
"and",
"its",
"ancestors",
")",
"to",
"the",
"list",
".",
"Note",
"if",
"we",
"are",
"running",
"in",
"a",
"sandbox",
"this",
"will",
"only",
"enumerate",
"public",
"members",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ClassUtil.java#L48-L79 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/stats/StatsInterface.java | StatsInterface.getPhotostreamReferrers | public ReferrerList getPhotostreamReferrers(Date date, String domain, int perPage, int page) throws FlickrException {
return getReferrers(METHOD_GET_PHOTOSTREAM_REFERRERS, domain, null, null, date, perPage, page);
} | java | public ReferrerList getPhotostreamReferrers(Date date, String domain, int perPage, int page) throws FlickrException {
return getReferrers(METHOD_GET_PHOTOSTREAM_REFERRERS, domain, null, null, date, perPage, page);
} | [
"public",
"ReferrerList",
"getPhotostreamReferrers",
"(",
"Date",
"date",
",",
"String",
"domain",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getReferrers",
"(",
"METHOD_GET_PHOTOSTREAM_REFERRERS",
",",
"domain",
","... | Get a list of referrers from a given domain to a user's photostream.
@param date
(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will
automatically be rounded down to the start of the day.
@param domain
(Required) The domain to retur... | [
"Get",
"a",
"list",
"of",
"referrers",
"from",
"a",
"given",
"domain",
"to",
"a",
"user",
"s",
"photostream",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/stats/StatsInterface.java#L289-L291 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/AtomicBiInteger.java | AtomicBiInteger.compareAndSetLo | public boolean compareAndSetLo(int expectLo, int lo) {
while (true) {
long encoded = get();
if (getLo(encoded) != expectLo)
return false;
long update = encodeLo(encoded, lo);
if (compareAndSet(encoded, update))
return true;
... | java | public boolean compareAndSetLo(int expectLo, int lo) {
while (true) {
long encoded = get();
if (getLo(encoded) != expectLo)
return false;
long update = encodeLo(encoded, lo);
if (compareAndSet(encoded, update))
return true;
... | [
"public",
"boolean",
"compareAndSetLo",
"(",
"int",
"expectLo",
",",
"int",
"lo",
")",
"{",
"while",
"(",
"true",
")",
"{",
"long",
"encoded",
"=",
"get",
"(",
")",
";",
"if",
"(",
"getLo",
"(",
"encoded",
")",
"!=",
"expectLo",
")",
"return",
"false... | <p>Atomically sets the lo value to the given updated value
only if the current value {@code ==} the expected value.</p>
<p>Concurrent changes to the hi value result in a retry.</p>
@param expectLo the expected lo value
@param lo the new lo value
@return {@code true} if successful. False return indicates that
the... | [
"<p",
">",
"Atomically",
"sets",
"the",
"lo",
"value",
"to",
"the",
"given",
"updated",
"value",
"only",
"if",
"the",
"current",
"value",
"{",
"@code",
"==",
"}",
"the",
"expected",
"value",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Concurrent",
"changes",
... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/AtomicBiInteger.java#L94-L103 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MediaAPI.java | MediaAPI.mediaGet | public static MediaGetResult mediaGet(String access_token,String media_id,boolean use_http){
String http_s = use_http?BASE_URI.replace("https", "http"):BASE_URI;
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(http_s + "/cgi-bin/media/get")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(ac... | java | public static MediaGetResult mediaGet(String access_token,String media_id,boolean use_http){
String http_s = use_http?BASE_URI.replace("https", "http"):BASE_URI;
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setUri(http_s + "/cgi-bin/media/get")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(ac... | [
"public",
"static",
"MediaGetResult",
"mediaGet",
"(",
"String",
"access_token",
",",
"String",
"media_id",
",",
"boolean",
"use_http",
")",
"{",
"String",
"http_s",
"=",
"use_http",
"?",
"BASE_URI",
".",
"replace",
"(",
"\"https\"",
",",
"\"http\"",
")",
":",... | 获取临时素材
@since 2.8.0
@param access_token access_token
@param media_id media_id
@param use_http 视频素材使用[http] true,其它使用[https] false.
@return MediaGetResult | [
"获取临时素材"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MediaAPI.java#L152-L160 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/PrivateKeyExtensions.java | PrivateKeyExtensions.toPemFormat | public static String toPemFormat(final PrivateKey privateKey) throws IOException
{
return PemObjectReader.toPemFormat(
new PemObject(PrivateKeyReader.RSA_PRIVATE_KEY, toPKCS1Format(privateKey)));
} | java | public static String toPemFormat(final PrivateKey privateKey) throws IOException
{
return PemObjectReader.toPemFormat(
new PemObject(PrivateKeyReader.RSA_PRIVATE_KEY, toPKCS1Format(privateKey)));
} | [
"public",
"static",
"String",
"toPemFormat",
"(",
"final",
"PrivateKey",
"privateKey",
")",
"throws",
"IOException",
"{",
"return",
"PemObjectReader",
".",
"toPemFormat",
"(",
"new",
"PemObject",
"(",
"PrivateKeyReader",
".",
"RSA_PRIVATE_KEY",
",",
"toPKCS1Format",
... | Transform the given private key that is in PKCS1 format and returns a {@link String} object
in pem format.
@param privateKey
the private key
@return the {@link String} object in pem format generated from the given private key.
@throws IOException
Signals that an I/O exception has occurred. | [
"Transform",
"the",
"given",
"private",
"key",
"that",
"is",
"in",
"PKCS1",
"format",
"and",
"returns",
"a",
"{",
"@link",
"String",
"}",
"object",
"in",
"pem",
"format",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/PrivateKeyExtensions.java#L213-L217 |
metafacture/metafacture-core | metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java | Iso646ByteBuffer.distanceTo | int distanceTo(final byte byteValue, final int fromIndex) {
assert 0 <= fromIndex && fromIndex < byteArray.length;
int index = fromIndex;
for (; index < byteArray.length; ++index) {
if (byteValue == byteArray[index]) {
break;
}
}
return ind... | java | int distanceTo(final byte byteValue, final int fromIndex) {
assert 0 <= fromIndex && fromIndex < byteArray.length;
int index = fromIndex;
for (; index < byteArray.length; ++index) {
if (byteValue == byteArray[index]) {
break;
}
}
return ind... | [
"int",
"distanceTo",
"(",
"final",
"byte",
"byteValue",
",",
"final",
"int",
"fromIndex",
")",
"{",
"assert",
"0",
"<=",
"fromIndex",
"&&",
"fromIndex",
"<",
"byteArray",
".",
"length",
";",
"int",
"index",
"=",
"fromIndex",
";",
"for",
"(",
";",
"index"... | Returns the distance from {@code fromIndex} to the next occurrence of
{@code byteValue}. If the byte at {@code fromIndex} is equal to {@code
byteValue} zero is returned. If there are no matching bytes between
{@code fromIndex} and the end of the buffer then the distance to the end
of the buffer is returned.
@param byt... | [
"Returns",
"the",
"distance",
"from",
"{",
"@code",
"fromIndex",
"}",
"to",
"the",
"next",
"occurrence",
"of",
"{",
"@code",
"byteValue",
"}",
".",
"If",
"the",
"byte",
"at",
"{",
"@code",
"fromIndex",
"}",
"is",
"equal",
"to",
"{",
"@code",
"byteValue",... | train | https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java#L82-L91 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/webhook/WebhookCluster.java | WebhookCluster.broadcast | public List<RequestFuture<?>> broadcast(MessageEmbed first, MessageEmbed... embeds)
{
return broadcast(WebhookMessage.embeds(first, embeds));
} | java | public List<RequestFuture<?>> broadcast(MessageEmbed first, MessageEmbed... embeds)
{
return broadcast(WebhookMessage.embeds(first, embeds));
} | [
"public",
"List",
"<",
"RequestFuture",
"<",
"?",
">",
">",
"broadcast",
"(",
"MessageEmbed",
"first",
",",
"MessageEmbed",
"...",
"embeds",
")",
"{",
"return",
"broadcast",
"(",
"WebhookMessage",
".",
"embeds",
"(",
"first",
",",
"embeds",
")",
")",
";",
... | Sends the provided {@link net.dv8tion.jda.core.entities.MessageEmbed MessageEmbeds}
to all registered {@link net.dv8tion.jda.webhook.WebhookClient WebhookClients}.
<p><b>You can send up to 10 embeds per message! If more are sent they will not be displayed.</b>
<p>Hint: Use {@link net.dv8tion.jda.core.EmbedBuilder Emb... | [
"Sends",
"the",
"provided",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"MessageEmbed",
"MessageEmbeds",
"}",
"to",
"all",
"registered",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"webhook",
".",
"Webhoo... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/webhook/WebhookCluster.java#L661-L664 |
myriadmobile/shove | library/src/main/java/com/myriadmobile/library/shove/SimpleNotificationDelegate.java | SimpleNotificationDelegate.onReceive | @Override
public void onReceive(Context context, Intent notification) {
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String messageType = gcm.getMessageType(notification);
Bundle extras = notification.getExtras();
if (!extras.isEmpty() && GoogleCloudMessagin... | java | @Override
public void onReceive(Context context, Intent notification) {
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String messageType = gcm.getMessageType(notification);
Bundle extras = notification.getExtras();
if (!extras.isEmpty() && GoogleCloudMessagin... | [
"@",
"Override",
"public",
"void",
"onReceive",
"(",
"Context",
"context",
",",
"Intent",
"notification",
")",
"{",
"GoogleCloudMessaging",
"gcm",
"=",
"GoogleCloudMessaging",
".",
"getInstance",
"(",
"context",
")",
";",
"String",
"messageType",
"=",
"gcm",
"."... | Called when a notification is received
@param context the service context
@param notification the notification intent | [
"Called",
"when",
"a",
"notification",
"is",
"received"
] | train | https://github.com/myriadmobile/shove/blob/71ab329cdbaef5bdc2b75e43af1393308c4c1eed/library/src/main/java/com/myriadmobile/library/shove/SimpleNotificationDelegate.java#L79-L88 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.feed_publishTemplatizedAction | public boolean feed_publishTemplatizedAction(CharSequence titleTemplate, Long pageActorId)
throws FacebookException, IOException {
return feed_publishTemplatizedAction(titleTemplate, null, null, null, null, null, null, pageActorId);
} | java | public boolean feed_publishTemplatizedAction(CharSequence titleTemplate, Long pageActorId)
throws FacebookException, IOException {
return feed_publishTemplatizedAction(titleTemplate, null, null, null, null, null, null, pageActorId);
} | [
"public",
"boolean",
"feed_publishTemplatizedAction",
"(",
"CharSequence",
"titleTemplate",
",",
"Long",
"pageActorId",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"feed_publishTemplatizedAction",
"(",
"titleTemplate",
",",
"null",
",",
"null",
... | Publishes a Mini-Feed story describing an action taken by the logged-in user (or, if
<code>pageActorId</code> is provided, page), and publishes aggregating News Feed stories
to the user's friends/page's fans.
Stories are identified as being combinable if they have matching templates and substituted values.
@param title... | [
"Publishes",
"a",
"Mini",
"-",
"Feed",
"story",
"describing",
"an",
"action",
"taken",
"by",
"the",
"logged",
"-",
"in",
"user",
"(",
"or",
"if",
"<code",
">",
"pageActorId<",
"/",
"code",
">",
"is",
"provided",
"page",
")",
"and",
"publishes",
"aggregat... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L427-L430 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java | MultiPartFaxJob2HTTPRequestConverter.createHTTPRequest | public HTTPRequest createHTTPRequest(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob)
{
//setup common request data
HTTPRequest httpRequest=this.createCommonHTTPRequest(faxClientSpi,faxActionType);
//create content
List<ContentPart<?>> contentList=new... | java | public HTTPRequest createHTTPRequest(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob)
{
//setup common request data
HTTPRequest httpRequest=this.createCommonHTTPRequest(faxClientSpi,faxActionType);
//create content
List<ContentPart<?>> contentList=new... | [
"public",
"HTTPRequest",
"createHTTPRequest",
"(",
"HTTPFaxClientSpi",
"faxClientSpi",
",",
"FaxActionType",
"faxActionType",
",",
"FaxJob",
"faxJob",
")",
"{",
"//setup common request data",
"HTTPRequest",
"httpRequest",
"=",
"this",
".",
"createCommonHTTPRequest",
"(",
... | Creates the HTTP request from the fax job data.
@param faxClientSpi
The HTTP fax client SPI
@param faxActionType
The fax action type
@param faxJob
The fax job object
@return The HTTP request to send | [
"Creates",
"the",
"HTTP",
"request",
"from",
"the",
"fax",
"job",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/MultiPartFaxJob2HTTPRequestConverter.java#L392-L449 |
micronaut-projects/micronaut-core | http-netty/src/main/java/io/micronaut/http/netty/stream/HttpStreamsHandler.java | HttpStreamsHandler.removeHandlerIfActive | private void removeHandlerIfActive(ChannelHandlerContext ctx, String name) {
if (ctx.channel().isActive()) {
ChannelPipeline pipeline = ctx.pipeline();
ChannelHandler handler = pipeline.get(name);
if (handler != null) {
pipeline.remove(name);
}
... | java | private void removeHandlerIfActive(ChannelHandlerContext ctx, String name) {
if (ctx.channel().isActive()) {
ChannelPipeline pipeline = ctx.pipeline();
ChannelHandler handler = pipeline.get(name);
if (handler != null) {
pipeline.remove(name);
}
... | [
"private",
"void",
"removeHandlerIfActive",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"name",
")",
"{",
"if",
"(",
"ctx",
".",
"channel",
"(",
")",
".",
"isActive",
"(",
")",
")",
"{",
"ChannelPipeline",
"pipeline",
"=",
"ctx",
".",
"pipeline",
"... | Most operations we want to do even if the channel is not active, because if it's not, then we want to encounter
the error that occurs when that operation happens and so that it can be passed up to the user. However, removing
handlers should only be done if the channel is active, because the error that is encountered wh... | [
"Most",
"operations",
"we",
"want",
"to",
"do",
"even",
"if",
"the",
"channel",
"is",
"not",
"active",
"because",
"if",
"it",
"s",
"not",
"then",
"we",
"want",
"to",
"encounter",
"the",
"error",
"that",
"occurs",
"when",
"that",
"operation",
"happens",
"... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-netty/src/main/java/io/micronaut/http/netty/stream/HttpStreamsHandler.java#L379-L387 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.listHosts | @Override
public List<String> listHosts() {
try {
// TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes)
return provider.get("listHosts").getChildren(Paths.configHosts());
} catch (KeeperException.NoNodeException e) {
return emptyList();
} catch (Keeper... | java | @Override
public List<String> listHosts() {
try {
// TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes)
return provider.get("listHosts").getChildren(Paths.configHosts());
} catch (KeeperException.NoNodeException e) {
return emptyList();
} catch (Keeper... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"listHosts",
"(",
")",
"{",
"try",
"{",
"// TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes)",
"return",
"provider",
".",
"get",
"(",
"\"listHosts\"",
")",
".",
"getChildren",
"... | Returns a list of the hosts/agents that have been registered. | [
"Returns",
"a",
"list",
"of",
"the",
"hosts",
"/",
"agents",
"that",
"have",
"been",
"registered",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L194-L204 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java | Grid.getGridCellsOn | @Pure
public Iterable<GridCell<P>> getGridCellsOn(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
return getGridCellsOn(bounds, false);
} | java | @Pure
public Iterable<GridCell<P>> getGridCellsOn(Rectangle2afp<?, ?, ?, ?, ?, ?> bounds) {
return getGridCellsOn(bounds, false);
} | [
"@",
"Pure",
"public",
"Iterable",
"<",
"GridCell",
"<",
"P",
">",
">",
"getGridCellsOn",
"(",
"Rectangle2afp",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
",",
"?",
">",
"bounds",
")",
"{",
"return",
"getGridCellsOn",
"(",
"bounds",
",",
"fa... | Replies the grid cells that are intersecting the specified bounds.
@param bounds the bounds.
@return the grid cells. | [
"Replies",
"the",
"grid",
"cells",
"that",
"are",
"intersecting",
"the",
"specified",
"bounds",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/grid/Grid.java#L278-L281 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteCompositeEntityChild | public OperationStatus deleteCompositeEntityChild(UUID appId, String versionId, UUID cEntityId, UUID cChildId) {
return deleteCompositeEntityChildWithServiceResponseAsync(appId, versionId, cEntityId, cChildId).toBlocking().single().body();
} | java | public OperationStatus deleteCompositeEntityChild(UUID appId, String versionId, UUID cEntityId, UUID cChildId) {
return deleteCompositeEntityChildWithServiceResponseAsync(appId, versionId, cEntityId, cChildId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteCompositeEntityChild",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"UUID",
"cChildId",
")",
"{",
"return",
"deleteCompositeEntityChildWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",... | Deletes a composite entity extractor child from the application.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param cChildId The hierarchical entity extractor child ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@t... | [
"Deletes",
"a",
"composite",
"entity",
"extractor",
"child",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7022-L7024 |
mockito/mockito | src/main/java/org/mockito/AdditionalAnswers.java | AdditionalAnswers.answersWithDelay | @Incubating
public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer) {
return (Answer<T>) new AnswersWithDelay(sleepyTime, (Answer<Object>) answer);
} | java | @Incubating
public static <T> Answer<T> answersWithDelay(long sleepyTime, Answer<T> answer) {
return (Answer<T>) new AnswersWithDelay(sleepyTime, (Answer<Object>) answer);
} | [
"@",
"Incubating",
"public",
"static",
"<",
"T",
">",
"Answer",
"<",
"T",
">",
"answersWithDelay",
"(",
"long",
"sleepyTime",
",",
"Answer",
"<",
"T",
">",
"answer",
")",
"{",
"return",
"(",
"Answer",
"<",
"T",
">",
")",
"new",
"AnswersWithDelay",
"(",... | Returns an answer after a delay with a defined length.
@param <T> return type
@param sleepyTime the delay in milliseconds
@param answer interface to the answer which provides the intended return value.
@return the answer object to use
@since 2.8.44 | [
"Returns",
"an",
"answer",
"after",
"a",
"delay",
"with",
"a",
"defined",
"length",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/AdditionalAnswers.java#L333-L336 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/GeometryEngine.java | GeometryEngine.geometryToJson | public static String geometryToJson(int wkid, Geometry geometry) {
return GeometryEngine.geometryToJson(
wkid > 0 ? SpatialReference.create(wkid) : null, geometry);
} | java | public static String geometryToJson(int wkid, Geometry geometry) {
return GeometryEngine.geometryToJson(
wkid > 0 ? SpatialReference.create(wkid) : null, geometry);
} | [
"public",
"static",
"String",
"geometryToJson",
"(",
"int",
"wkid",
",",
"Geometry",
"geometry",
")",
"{",
"return",
"GeometryEngine",
".",
"geometryToJson",
"(",
"wkid",
">",
"0",
"?",
"SpatialReference",
".",
"create",
"(",
"wkid",
")",
":",
"null",
",",
... | Exports the specified geometry instance to it's JSON representation.
See OperatorExportToJson.
@see GeometryEngine#geometryToJson(SpatialReference spatialiReference,
Geometry geometry)
@param wkid
The spatial reference Well Known ID to be used for the JSON
representation.
@param geometry
The geometry to be exported t... | [
"Exports",
"the",
"specified",
"geometry",
"instance",
"to",
"it",
"s",
"JSON",
"representation",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/GeometryEngine.java#L111-L114 |
youseries/urule | urule-core/src/main/java/com/bstek/urule/model/rete/builder/CriterionBuilder.java | CriterionBuilder.buildNamedCriteria | protected NamedCriteriaNode buildNamedCriteria(NamedCriteria criteria,ConditionNode prevNode,BuildContext context){
/*if(prevNode!=null){
NamedCriteriaNode targetNode=null;
String objectType=context.getObjectType(criteria);
String prevObjectType=context.getObjectType(criteria);
if(objectType.equals(prevOb... | java | protected NamedCriteriaNode buildNamedCriteria(NamedCriteria criteria,ConditionNode prevNode,BuildContext context){
/*if(prevNode!=null){
NamedCriteriaNode targetNode=null;
String objectType=context.getObjectType(criteria);
String prevObjectType=context.getObjectType(criteria);
if(objectType.equals(prevOb... | [
"protected",
"NamedCriteriaNode",
"buildNamedCriteria",
"(",
"NamedCriteria",
"criteria",
",",
"ConditionNode",
"prevNode",
",",
"BuildContext",
"context",
")",
"{",
"/*if(prevNode!=null){\n\t\t\tNamedCriteriaNode targetNode=null;\n\t\t\tString objectType=context.getObjectType(criteria);... | 带reference name的条件比较特殊,它不需要判断是否有父节点,需要将所有节点都直接挂在ObjectTypeNode下
@param criteria 命名条件对象
@param prevNode 上一节点对象
@param context 上下文对象
@return 返回命名条件节点对象 | [
"带reference",
"name的条件比较特殊,它不需要判断是否有父节点,需要将所有节点都直接挂在ObjectTypeNode下"
] | train | https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-core/src/main/java/com/bstek/urule/model/rete/builder/CriterionBuilder.java#L79-L101 |
graknlabs/grakn | server/src/graql/gremlin/sets/EquivalentFragmentSets.java | EquivalentFragmentSets.dataType | public static EquivalentFragmentSet dataType(VarProperty varProperty, Variable resourceType, AttributeType.DataType<?> dataType) {
return new AutoValue_DataTypeFragmentSet(varProperty, resourceType, dataType);
} | java | public static EquivalentFragmentSet dataType(VarProperty varProperty, Variable resourceType, AttributeType.DataType<?> dataType) {
return new AutoValue_DataTypeFragmentSet(varProperty, resourceType, dataType);
} | [
"public",
"static",
"EquivalentFragmentSet",
"dataType",
"(",
"VarProperty",
"varProperty",
",",
"Variable",
"resourceType",
",",
"AttributeType",
".",
"DataType",
"<",
"?",
">",
"dataType",
")",
"{",
"return",
"new",
"AutoValue_DataTypeFragmentSet",
"(",
"varProperty... | An {@link EquivalentFragmentSet} that indicates a variable representing a resource type with a data-type. | [
"An",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/gremlin/sets/EquivalentFragmentSets.java#L157-L159 |
jayantk/jklol | src/com/jayantkrish/jklol/p3/P3Parse.java | P3Parse.getUnevaluatedLogicalForm | public Expression2 getUnevaluatedLogicalForm(Environment env, IndexedList<String> symbolTable) {
List<String> newBindings = Lists.newArrayList();
return getUnevaluatedLogicalForm(env, symbolTable, newBindings);
} | java | public Expression2 getUnevaluatedLogicalForm(Environment env, IndexedList<String> symbolTable) {
List<String> newBindings = Lists.newArrayList();
return getUnevaluatedLogicalForm(env, symbolTable, newBindings);
} | [
"public",
"Expression2",
"getUnevaluatedLogicalForm",
"(",
"Environment",
"env",
",",
"IndexedList",
"<",
"String",
">",
"symbolTable",
")",
"{",
"List",
"<",
"String",
">",
"newBindings",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"return",
"getUnevaluat... | Gets an expression that evaluates to the denotation of
this parse. The expression will not re-evaluate any
already evaluated subexpressions of this parse. {@code env}
may be extended with additional variable bindings to
capture denotations of already-evaluated subparses.
@param env
@param symbolTable
@return | [
"Gets",
"an",
"expression",
"that",
"evaluates",
"to",
"the",
"denotation",
"of",
"this",
"parse",
".",
"The",
"expression",
"will",
"not",
"re",
"-",
"evaluate",
"any",
"already",
"evaluated",
"subexpressions",
"of",
"this",
"parse",
".",
"{",
"@code",
"env... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/p3/P3Parse.java#L173-L176 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/gen/BeanData.java | BeanData.getTypeGenericName | public String getTypeGenericName(int typeParamIndex, boolean includeBrackets) {
String result = typeGenericName[typeParamIndex];
return includeBrackets && result.length() > 0 ? '<' + result + '>' : result;
} | java | public String getTypeGenericName(int typeParamIndex, boolean includeBrackets) {
String result = typeGenericName[typeParamIndex];
return includeBrackets && result.length() > 0 ? '<' + result + '>' : result;
} | [
"public",
"String",
"getTypeGenericName",
"(",
"int",
"typeParamIndex",
",",
"boolean",
"includeBrackets",
")",
"{",
"String",
"result",
"=",
"typeGenericName",
"[",
"typeParamIndex",
"]",
";",
"return",
"includeBrackets",
"&&",
"result",
".",
"length",
"(",
")",
... | Gets the name of the parameterisation of the bean, such as '{@code <T>}'.
@param typeParamIndex the zero-based index of the type parameter
@param includeBrackets whether to include brackets
@return the generic type name, not null | [
"Gets",
"the",
"name",
"of",
"the",
"parameterisation",
"of",
"the",
"bean",
"such",
"as",
"{"
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/gen/BeanData.java#L883-L886 |
BlueBrain/bluima | modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/BlueCasUtil.java | BlueCasUtil.fixNoSentences | public static void fixNoSentences(JCas jCas) {
Collection<Sentence> sentences = select(jCas, Sentence.class);
if (sentences.size() == 0) {
String text = jCas.getDocumentText();
Sentence sentence = new Sentence(jCas, 0, text.length());
sentence.addToIndexes();
... | java | public static void fixNoSentences(JCas jCas) {
Collection<Sentence> sentences = select(jCas, Sentence.class);
if (sentences.size() == 0) {
String text = jCas.getDocumentText();
Sentence sentence = new Sentence(jCas, 0, text.length());
sentence.addToIndexes();
... | [
"public",
"static",
"void",
"fixNoSentences",
"(",
"JCas",
"jCas",
")",
"{",
"Collection",
"<",
"Sentence",
">",
"sentences",
"=",
"select",
"(",
"jCas",
",",
"Sentence",
".",
"class",
")",
";",
"if",
"(",
"sentences",
".",
"size",
"(",
")",
"==",
"0",... | If this cas has no Sentence annotation, creates one with the whole cas
text | [
"If",
"this",
"cas",
"has",
"no",
"Sentence",
"annotation",
"creates",
"one",
"with",
"the",
"whole",
"cas",
"text"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/BlueCasUtil.java#L142-L149 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java | NaaccrXmlUtils.patientToLine | public static String patientToLine(Patient patient, NaaccrContext context) throws NaaccrIOException {
if (patient == null)
throw new NaaccrIOException("Patient is required");
if (context == null)
throw new NaaccrIOException("Context is required");
// it wouldn't be very ... | java | public static String patientToLine(Patient patient, NaaccrContext context) throws NaaccrIOException {
if (patient == null)
throw new NaaccrIOException("Patient is required");
if (context == null)
throw new NaaccrIOException("Context is required");
// it wouldn't be very ... | [
"public",
"static",
"String",
"patientToLine",
"(",
"Patient",
"patient",
",",
"NaaccrContext",
"context",
")",
"throws",
"NaaccrIOException",
"{",
"if",
"(",
"patient",
"==",
"null",
")",
"throw",
"new",
"NaaccrIOException",
"(",
"\"Patient is required\"",
")",
"... | Translates a single patient into a line representing a flat file line. This method expects a patient with 0 or 1 tumor. An exception will be raised if it has more.
<br/><br/>
Unlike the methods dealing with files, this method takes a context as a parameter. The reason for that difference is that this method uses a stre... | [
"Translates",
"a",
"single",
"patient",
"into",
"a",
"line",
"representing",
"a",
"flat",
"file",
"line",
".",
"This",
"method",
"expects",
"a",
"patient",
"with",
"0",
"or",
"1",
"tumor",
".",
"An",
"exception",
"will",
"be",
"raised",
"if",
"it",
"has"... | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java#L323-L338 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.getGeneratedBy | public static ImmutableSet<String> getGeneratedBy(ClassSymbol symbol, VisitorState state) {
checkNotNull(symbol);
Optional<Compound> c =
Stream.of("javax.annotation.Generated", "javax.annotation.processing.Generated")
.map(state::getSymbolFromString)
.filter(a -> a != null)
... | java | public static ImmutableSet<String> getGeneratedBy(ClassSymbol symbol, VisitorState state) {
checkNotNull(symbol);
Optional<Compound> c =
Stream.of("javax.annotation.Generated", "javax.annotation.processing.Generated")
.map(state::getSymbolFromString)
.filter(a -> a != null)
... | [
"public",
"static",
"ImmutableSet",
"<",
"String",
">",
"getGeneratedBy",
"(",
"ClassSymbol",
"symbol",
",",
"VisitorState",
"state",
")",
"{",
"checkNotNull",
"(",
"symbol",
")",
";",
"Optional",
"<",
"Compound",
">",
"c",
"=",
"Stream",
".",
"of",
"(",
"... | Returns the values of the given symbol's {@code javax.annotation.Generated} or {@code
javax.annotation.processing.Generated} annotation, if present. | [
"Returns",
"the",
"values",
"of",
"the",
"given",
"symbol",
"s",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L1189-L1228 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setUserContext | public Config setUserContext(ConcurrentMap<String, Object> userContext) {
if (userContext == null) {
throw new IllegalArgumentException("userContext can't be null");
}
this.userContext = userContext;
return this;
} | java | public Config setUserContext(ConcurrentMap<String, Object> userContext) {
if (userContext == null) {
throw new IllegalArgumentException("userContext can't be null");
}
this.userContext = userContext;
return this;
} | [
"public",
"Config",
"setUserContext",
"(",
"ConcurrentMap",
"<",
"String",
",",
"Object",
">",
"userContext",
")",
"{",
"if",
"(",
"userContext",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"userContext can't be null\"",
")",
";",
... | Sets the user supplied context. This context can then be obtained
from an instance of {@link com.hazelcast.core.HazelcastInstance}.
@param userContext the user supplied context
@return this config instance
@see HazelcastInstance#getUserContext() | [
"Sets",
"the",
"user",
"supplied",
"context",
".",
"This",
"context",
"can",
"then",
"be",
"obtained",
"from",
"an",
"instance",
"of",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"core",
".",
"HazelcastInstance",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L3305-L3311 |
di2e/Argo | ProbeSender/src/main/java/ws/argo/transport/probe/standard/MulticastTransport.java | MulticastTransport.sendProbe | @Override
public void sendProbe(Probe probe) throws TransportException {
LOGGER.info("Sending probe [" + probe.getProbeID() + "] on network inteface [" + networkInterface.getName() + "] at port [" + multicastAddress + ":" + multicastPort + "]");
LOGGER.debug("Probe requesting TTL of [" + probe.getHopLimit() ... | java | @Override
public void sendProbe(Probe probe) throws TransportException {
LOGGER.info("Sending probe [" + probe.getProbeID() + "] on network inteface [" + networkInterface.getName() + "] at port [" + multicastAddress + ":" + multicastPort + "]");
LOGGER.debug("Probe requesting TTL of [" + probe.getHopLimit() ... | [
"@",
"Override",
"public",
"void",
"sendProbe",
"(",
"Probe",
"probe",
")",
"throws",
"TransportException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Sending probe [\"",
"+",
"probe",
".",
"getProbeID",
"(",
")",
"+",
"\"] on network inteface [\"",
"+",
"networkInterfac... | Actually send the probe out on the wire.
@param probe the Probe instance that has been pre-configured
@throws TransportException if something bad happened when sending the
probe | [
"Actually",
"send",
"the",
"probe",
"out",
"on",
"the",
"wire",
"."
] | train | https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/ProbeSender/src/main/java/ws/argo/transport/probe/standard/MulticastTransport.java#L226-L254 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster._isAllOfSameType | private static boolean _isAllOfSameType(Node[] nodes, short type) {
for (int i = 0; i < nodes.length; i++) {
if (nodes[i].getNodeType() != type) return false;
}
return true;
} | java | private static boolean _isAllOfSameType(Node[] nodes, short type) {
for (int i = 0; i < nodes.length; i++) {
if (nodes[i].getNodeType() != type) return false;
}
return true;
} | [
"private",
"static",
"boolean",
"_isAllOfSameType",
"(",
"Node",
"[",
"]",
"nodes",
",",
"short",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"nodes",
"[",
"i",
... | Check if all Node are of the type defnined by para,meter
@param nodes nodes to check
@param type to compare
@return are all of the same type | [
"Check",
"if",
"all",
"Node",
"are",
"of",
"the",
"type",
"defnined",
"by",
"para",
"meter"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L730-L735 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java | ThresholdBlock.process | public void process(T input , GrayU8 output ) {
output.reshape(input.width,input.height);
int requestedBlockWidth = this.requestedBlockWidth.computeI(Math.min(input.width,input.height));
selectBlockSize(input.width,input.height,requestedBlockWidth);
stats.reshape(input.width/blockWidth,input.height/blockHeig... | java | public void process(T input , GrayU8 output ) {
output.reshape(input.width,input.height);
int requestedBlockWidth = this.requestedBlockWidth.computeI(Math.min(input.width,input.height));
selectBlockSize(input.width,input.height,requestedBlockWidth);
stats.reshape(input.width/blockWidth,input.height/blockHeig... | [
"public",
"void",
"process",
"(",
"T",
"input",
",",
"GrayU8",
"output",
")",
"{",
"output",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"int",
"requestedBlockWidth",
"=",
"this",
".",
"requestedBlockWidth",
".",
"c... | Converts the gray scale input image into a binary image
@param input Input image
@param output Output binary image | [
"Converts",
"the",
"gray",
"scale",
"input",
"image",
"into",
"a",
"binary",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L90-L107 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getRdn | public static Rdn getRdn(Name name, String key) {
Assert.notNull(name, "name must not be null");
Assert.hasText(key, "key must not be blank");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
List<Rdn> rdns = ldapName.getRdns();
for (Rdn rdn : rdns) {
Na... | java | public static Rdn getRdn(Name name, String key) {
Assert.notNull(name, "name must not be null");
Assert.hasText(key, "key must not be blank");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
List<Rdn> rdns = ldapName.getRdns();
for (Rdn rdn : rdns) {
Na... | [
"public",
"static",
"Rdn",
"getRdn",
"(",
"Name",
"name",
",",
"String",
"key",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"Assert",
".",
"hasText",
"(",
"key",
",",
"\"key must not be blank\"",
")",
";",
"... | Find the Rdn with the requested key in the supplied Name.
@param name the Name in which to search for the key.
@param key the attribute key to search for.
@return the rdn corresponding to the <b>first</b> occurrence of the requested key.
@throws NoSuchElementException if no corresponding entry is found.
@since 2.0 | [
"Find",
"the",
"Rdn",
"with",
"the",
"requested",
"key",
"in",
"the",
"supplied",
"Name",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L506-L524 |
VoltDB/voltdb | src/frontend/org/voltdb/ProcedureStatsCollector.java | ProcedureStatsCollector.updateStatsRow | @Override
protected void updateStatsRow(Object rowKey, Object rowValues[]) {
super.updateStatsRow(rowKey, rowValues);
rowValues[columnNameToIndex.get("PARTITION_ID")] = m_partitionId;
rowValues[columnNameToIndex.get("PROCEDURE")] = m_procName;
StatementStats currRow = (StatementStats... | java | @Override
protected void updateStatsRow(Object rowKey, Object rowValues[]) {
super.updateStatsRow(rowKey, rowValues);
rowValues[columnNameToIndex.get("PARTITION_ID")] = m_partitionId;
rowValues[columnNameToIndex.get("PROCEDURE")] = m_procName;
StatementStats currRow = (StatementStats... | [
"@",
"Override",
"protected",
"void",
"updateStatsRow",
"(",
"Object",
"rowKey",
",",
"Object",
"rowValues",
"[",
"]",
")",
"{",
"super",
".",
"updateStatsRow",
"(",
"rowKey",
",",
"rowValues",
")",
";",
"rowValues",
"[",
"columnNameToIndex",
".",
"get",
"("... | Update the rowValues array with the latest statistical information.
This method overrides the super class version
which must also be called so that it can update its columns.
@param rowKey The corresponding StatementStats structure for this row.
@param rowValues Values of each column of the row of stats. Used as output... | [
"Update",
"the",
"rowValues",
"array",
"with",
"the",
"latest",
"statistical",
"information",
".",
"This",
"method",
"overrides",
"the",
"super",
"class",
"version",
"which",
"must",
"also",
"be",
"called",
"so",
"that",
"it",
"can",
"update",
"its",
"columns"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ProcedureStatsCollector.java#L281-L345 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java | CQLService.getPreparedUpdate | public PreparedStatement getPreparedUpdate(Update update, String storeName) {
String tableName = storeToCQLName(storeName);
return m_statementCache.getPreparedUpdate(tableName, update);
} | java | public PreparedStatement getPreparedUpdate(Update update, String storeName) {
String tableName = storeToCQLName(storeName);
return m_statementCache.getPreparedUpdate(tableName, update);
} | [
"public",
"PreparedStatement",
"getPreparedUpdate",
"(",
"Update",
"update",
",",
"String",
"storeName",
")",
"{",
"String",
"tableName",
"=",
"storeToCQLName",
"(",
"storeName",
")",
";",
"return",
"m_statementCache",
".",
"getPreparedUpdate",
"(",
"tableName",
","... | Get the {@link PreparedStatement} for the given {@link CQLStatementCache.Update} to
the given table name. If needed, the update statement is compiled and cached.
@param update Update statement type.
@param storeName Store (ColumnFamily) name.
@return PreparedStatement for requested table/update... | [
"Get",
"the",
"{",
"@link",
"PreparedStatement",
"}",
"for",
"the",
"given",
"{",
"@link",
"CQLStatementCache",
".",
"Update",
"}",
"to",
"the",
"given",
"table",
"name",
".",
"If",
"needed",
"the",
"update",
"statement",
"is",
"compiled",
"and",
"cached",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java#L262-L265 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/IOUtil.java | IOUtil.readFully | public static int readFully(Reader reader, char ch[], int off, int len) throws IOException{
if(len<0)
throw new IndexOutOfBoundsException();
int n = 0;
while(n<len){
int count = reader.read(ch, off+n, len-n);
if(count<0)
return n;
n += count;
}
r... | java | public static int readFully(Reader reader, char ch[], int off, int len) throws IOException{
if(len<0)
throw new IndexOutOfBoundsException();
int n = 0;
while(n<len){
int count = reader.read(ch, off+n, len-n);
if(count<0)
return n;
n += count;
}
r... | [
"public",
"static",
"int",
"readFully",
"(",
"Reader",
"reader",
",",
"char",
"ch",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")... | Reads <code>len</code> chars from given reader into specified buffer.<br>
If the given reader doesn't have <code>len</code> chars available,
it simply reads only the availabel number of chars.
@param reader input stream from which data is read
@param ch the buffer into which the data is read.
@param off ... | [
"Reads",
"<code",
">",
"len<",
"/",
"code",
">",
"chars",
"from",
"given",
"reader",
"into",
"specified",
"buffer",
".",
"<br",
">",
"If",
"the",
"given",
"reader",
"doesn",
"t",
"have",
"<code",
">",
"len<",
"/",
"code",
">",
"chars",
"available",
"it... | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/IOUtil.java#L278-L289 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java | AlbumUtils.setDrawableTint | public static void setDrawableTint(@NonNull Drawable drawable, @ColorInt int color) {
DrawableCompat.setTint(DrawableCompat.wrap(drawable.mutate()), color);
} | java | public static void setDrawableTint(@NonNull Drawable drawable, @ColorInt int color) {
DrawableCompat.setTint(DrawableCompat.wrap(drawable.mutate()), color);
} | [
"public",
"static",
"void",
"setDrawableTint",
"(",
"@",
"NonNull",
"Drawable",
"drawable",
",",
"@",
"ColorInt",
"int",
"color",
")",
"{",
"DrawableCompat",
".",
"setTint",
"(",
"DrawableCompat",
".",
"wrap",
"(",
"drawable",
".",
"mutate",
"(",
")",
")",
... | Specifies a tint for {@code drawable}.
@param drawable drawable target, mutate.
@param color color. | [
"Specifies",
"a",
"tint",
"for",
"{",
"@code",
"drawable",
"}",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L305-L307 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/AbstractAdvancedAction.java | AbstractAdvancedAction.onError | public void onError(Exception parentException, Context context) throws AdvancedActionException
{
int eventId = (Integer)context.get(InvocationContext.EVENT);
if (eventId != ExtendedEvent.READ)
{
Item item = (Item)context.get(InvocationContext.CURRENT_ITEM);
try
{
... | java | public void onError(Exception parentException, Context context) throws AdvancedActionException
{
int eventId = (Integer)context.get(InvocationContext.EVENT);
if (eventId != ExtendedEvent.READ)
{
Item item = (Item)context.get(InvocationContext.CURRENT_ITEM);
try
{
... | [
"public",
"void",
"onError",
"(",
"Exception",
"parentException",
",",
"Context",
"context",
")",
"throws",
"AdvancedActionException",
"{",
"int",
"eventId",
"=",
"(",
"Integer",
")",
"context",
".",
"get",
"(",
"InvocationContext",
".",
"EVENT",
")",
";",
"if... | Simple implementation of onError() method. It reverts all pending changes of the current JCR session for any kind of event corresponding to a write operation.
Then in case the provided parentException is an instance of type AdvancedActionException, it will throw it otherwise it will log simply it.
An AdvancedActionExce... | [
"Simple",
"implementation",
"of",
"onError",
"()",
"method",
".",
"It",
"reverts",
"all",
"pending",
"changes",
"of",
"the",
"current",
"JCR",
"session",
"for",
"any",
"kind",
"of",
"event",
"corresponding",
"to",
"a",
"write",
"operation",
".",
"Then",
"in"... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/AbstractAdvancedAction.java#L45-L69 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addUnknownSourceLine | @Nonnull
public BugInstance addUnknownSourceLine(String className, String sourceFile) {
SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.createUnknown(className, sourceFile);
if (sourceLineAnnotation != null) {
add(sourceLineAnnotation);
}
return this;
... | java | @Nonnull
public BugInstance addUnknownSourceLine(String className, String sourceFile) {
SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.createUnknown(className, sourceFile);
if (sourceLineAnnotation != null) {
add(sourceLineAnnotation);
}
return this;
... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addUnknownSourceLine",
"(",
"String",
"className",
",",
"String",
"sourceFile",
")",
"{",
"SourceLineAnnotation",
"sourceLineAnnotation",
"=",
"SourceLineAnnotation",
".",
"createUnknown",
"(",
"className",
",",
"sourceFile",
")... | Add a non-specific source line annotation. This will result in the entire
source file being displayed.
@param className
the class name
@param sourceFile
the source file name
@return this object | [
"Add",
"a",
"non",
"-",
"specific",
"source",
"line",
"annotation",
".",
"This",
"will",
"result",
"in",
"the",
"entire",
"source",
"file",
"being",
"displayed",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1834-L1841 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/plugin/AbstractPlugin.java | AbstractPlugin.getViewContent | private String getViewContent(final Map<String, Object> dataModel) {
if (null == configuration) {
initTemplateEngineCfg();
}
try {
final Template template = configuration.getTemplate("plugin.ftl");
final StringWriter sw = new StringWriter();
temp... | java | private String getViewContent(final Map<String, Object> dataModel) {
if (null == configuration) {
initTemplateEngineCfg();
}
try {
final Template template = configuration.getTemplate("plugin.ftl");
final StringWriter sw = new StringWriter();
temp... | [
"private",
"String",
"getViewContent",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"dataModel",
")",
"{",
"if",
"(",
"null",
"==",
"configuration",
")",
"{",
"initTemplateEngineCfg",
"(",
")",
";",
"}",
"try",
"{",
"final",
"Template",
"templat... | Gets view content of a plugin. The content is processed with the
specified data model by template engine.
@param dataModel the specified data model
@return plugin view content | [
"Gets",
"view",
"content",
"of",
"a",
"plugin",
".",
"The",
"content",
"is",
"processed",
"with",
"the",
"specified",
"data",
"model",
"by",
"template",
"engine",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/plugin/AbstractPlugin.java#L356-L373 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.toTimestamp | public static Long toTimestamp(String dateStr, TimeZone tz) {
int length = dateStr.length();
String format;
if (length == 21) {
format = DEFAULT_DATETIME_FORMATS[1];
} else if (length == 22) {
format = DEFAULT_DATETIME_FORMATS[2];
} else if (length == 23) {
format = DEFAULT_DATETIME_FORMATS[3];
} e... | java | public static Long toTimestamp(String dateStr, TimeZone tz) {
int length = dateStr.length();
String format;
if (length == 21) {
format = DEFAULT_DATETIME_FORMATS[1];
} else if (length == 22) {
format = DEFAULT_DATETIME_FORMATS[2];
} else if (length == 23) {
format = DEFAULT_DATETIME_FORMATS[3];
} e... | [
"public",
"static",
"Long",
"toTimestamp",
"(",
"String",
"dateStr",
",",
"TimeZone",
"tz",
")",
"{",
"int",
"length",
"=",
"dateStr",
".",
"length",
"(",
")",
";",
"String",
"format",
";",
"if",
"(",
"length",
"==",
"21",
")",
"{",
"format",
"=",
"D... | Parse date time string to timestamp based on the given time zone and
"yyyy-MM-dd HH:mm:ss" format. Returns null if parsing failed.
@param dateStr the date time string
@param tz the time zone | [
"Parse",
"date",
"time",
"string",
"to",
"timestamp",
"based",
"on",
"the",
"given",
"time",
"zone",
"and",
"yyyy",
"-",
"MM",
"-",
"dd",
"HH",
":",
"mm",
":",
"ss",
"format",
".",
"Returns",
"null",
"if",
"parsing",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L247-L261 |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.processStartOfScope | public void processStartOfScope(Scope scopeStarting, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope handlerScope = handlerAnnotation.scope();
i... | java | public void processStartOfScope(Scope scopeStarting, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope handlerScope = handlerAnnotation.scope();
i... | [
"public",
"void",
"processStartOfScope",
"(",
"Scope",
"scopeStarting",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Object",
"handler",
":",
"handlerInstances",
")",
"{",
"Handler",
"handlerAnnotation",
"=... | Scope is starting, perform the required processing on the supplied handlers. | [
"Scope",
"is",
"starting",
"perform",
"the",
"required",
"processing",
"on",
"the",
"supplied",
"handlers",
"."
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L117-L125 |
ops4j/org.ops4j.pax.web | pax-web-undertow/src/main/java/org/ops4j/pax/web/service/undertow/internal/ServerControllerImpl.java | ServerControllerImpl.configureIdentityManager | private void configureIdentityManager(URL undertowResource) {
try {
Properties props = new Properties();
try (InputStream is = undertowResource.openStream()) {
props.load(is);
}
Map<String, String> config = new LinkedHashMap<>();
for (M... | java | private void configureIdentityManager(URL undertowResource) {
try {
Properties props = new Properties();
try (InputStream is = undertowResource.openStream()) {
props.load(is);
}
Map<String, String> config = new LinkedHashMap<>();
for (M... | [
"private",
"void",
"configureIdentityManager",
"(",
"URL",
"undertowResource",
")",
"{",
"try",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
"undertowResource",
".",
"openStream",
"(",
")",
")",
"... | Loads additional properties and configure {@link ServerControllerImpl#identityManager}
@param undertowResource | [
"Loads",
"additional",
"properties",
"and",
"configure",
"{"
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-undertow/src/main/java/org/ops4j/pax/web/service/undertow/internal/ServerControllerImpl.java#L312-L340 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.generatePrimitiveTypes | protected void generatePrimitiveTypes(IStyleAppendable it, Iterable<String> types) {
final Iterator<String> iterator = types.iterator();
if (iterator.hasNext()) {
appendComment(it, "primitive types."); //$NON-NLS-1$
appendMatch(it, "sarlArrayDeclaration", "\\(\\s*\\[\\s*\\]\\)*", true); //$NON-NLS-1$//$NON-NL... | java | protected void generatePrimitiveTypes(IStyleAppendable it, Iterable<String> types) {
final Iterator<String> iterator = types.iterator();
if (iterator.hasNext()) {
appendComment(it, "primitive types."); //$NON-NLS-1$
appendMatch(it, "sarlArrayDeclaration", "\\(\\s*\\[\\s*\\]\\)*", true); //$NON-NLS-1$//$NON-NL... | [
"protected",
"void",
"generatePrimitiveTypes",
"(",
"IStyleAppendable",
"it",
",",
"Iterable",
"<",
"String",
">",
"types",
")",
"{",
"final",
"Iterator",
"<",
"String",
">",
"iterator",
"=",
"types",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"iterator",
... | Generate the keywords for the primitive types.
@param it the receiver of the generated elements.
@param types the primitive types. | [
"Generate",
"the",
"keywords",
"for",
"the",
"primitive",
"types",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L222-L238 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java | Main.execute | public static int execute(ClassLoader docletParentClassLoader, String... args) {
Start jdoc = new Start(docletParentClassLoader);
return jdoc.begin(args);
} | java | public static int execute(ClassLoader docletParentClassLoader, String... args) {
Start jdoc = new Start(docletParentClassLoader);
return jdoc.begin(args);
} | [
"public",
"static",
"int",
"execute",
"(",
"ClassLoader",
"docletParentClassLoader",
",",
"String",
"...",
"args",
")",
"{",
"Start",
"jdoc",
"=",
"new",
"Start",
"(",
"docletParentClassLoader",
")",
";",
"return",
"jdoc",
".",
"begin",
"(",
"args",
")",
";"... | Programmatic interface.
@param args The command line parameters.
@param docletParentClassLoader The parent class loader used when
creating the doclet classloader. If null, the class loader used
to instantiate doclets will be created without specifying a parent
class loader.
@return The return code.
@since 1.7 | [
"Programmatic",
"interface",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java#L88-L91 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java | CertificateOperations.listCertificates | public PagedList<Certificate> listCertificates(DetailLevel detailLevel) throws BatchErrorException, IOException {
return listCertificates(detailLevel, null);
} | java | public PagedList<Certificate> listCertificates(DetailLevel detailLevel) throws BatchErrorException, IOException {
return listCertificates(detailLevel, null);
} | [
"public",
"PagedList",
"<",
"Certificate",
">",
"listCertificates",
"(",
"DetailLevel",
"detailLevel",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"listCertificates",
"(",
"detailLevel",
",",
"null",
")",
";",
"}"
] | Lists the {@link Certificate certificates} in the Batch account.
@param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
@return A list of {@link Certificate} objects.
@throws BatchErrorException Exception thrown when an error response i... | [
"Lists",
"the",
"{",
"@link",
"Certificate",
"certificates",
"}",
"in",
"the",
"Batch",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java#L301-L303 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java | LocaleFormatter.getFormatted | @Nonnull
public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);
} | java | @Nonnull
public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getFormatted",
"(",
"final",
"double",
"dValue",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDisplayLocale",
",",
"\"DisplayLocale\"",
")",
";",
"retur... | Format the passed value according to the rules specified by the given
locale. All calls to {@link Double#toString(double)} that are displayed to
the user should instead use this method.
@param dValue
The value to be formatted.
@param aDisplayLocale
The locale to be used. May not be <code>null</code>.
@return The forma... | [
"Format",
"the",
"passed",
"value",
"according",
"to",
"the",
"rules",
"specified",
"by",
"the",
"given",
"locale",
".",
"All",
"calls",
"to",
"{",
"@link",
"Double#toString",
"(",
"double",
")",
"}",
"that",
"are",
"displayed",
"to",
"the",
"user",
"shoul... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L56-L62 |
javagl/ND | nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/i/IntTupleIterators.java | IntTupleIterators.clampingIterator | public static Iterator<MutableIntTuple> clampingIterator(
IntTuple min, IntTuple max,
Iterator<? extends MutableIntTuple> delegate)
{
Utils.checkForEqualSize(min, max);
IntTuple localMin = IntTuples.copy(min);
IntTuple localMax = IntTuples.copy(max);
return cl... | java | public static Iterator<MutableIntTuple> clampingIterator(
IntTuple min, IntTuple max,
Iterator<? extends MutableIntTuple> delegate)
{
Utils.checkForEqualSize(min, max);
IntTuple localMin = IntTuples.copy(min);
IntTuple localMax = IntTuples.copy(max);
return cl... | [
"public",
"static",
"Iterator",
"<",
"MutableIntTuple",
">",
"clampingIterator",
"(",
"IntTuple",
"min",
",",
"IntTuple",
"max",
",",
"Iterator",
"<",
"?",
"extends",
"MutableIntTuple",
">",
"delegate",
")",
"{",
"Utils",
".",
"checkForEqualSize",
"(",
"min",
... | Returns an iterator that returns the {@link MutableIntTuple}s from the
given delegate that are contained in the given bounds.<br>
@param min The minimum, inclusive. A copy of this tuple will be
stored internally.
@param max The maximum, exclusive. A copy of this tuple will be
stored internally.
@param delegate The del... | [
"Returns",
"an",
"iterator",
"that",
"returns",
"the",
"{",
"@link",
"MutableIntTuple",
"}",
"s",
"from",
"the",
"given",
"delegate",
"that",
"are",
"contained",
"in",
"the",
"given",
"bounds",
".",
"<br",
">"
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/i/IntTupleIterators.java#L197-L205 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XSynchronizedExpression synchronizedStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
return generate(synchronizedStatement.getExpression(), context.getExpectedExpressionType(), it, context);
} | java | protected XExpression _generate(XSynchronizedExpression synchronizedStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
return generate(synchronizedStatement.getExpression(), context.getExpectedExpressionType(), it, context);
} | [
"protected",
"XExpression",
"_generate",
"(",
"XSynchronizedExpression",
"synchronizedStatement",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"return",
"generate",
"(",
"synchronizedStatement",
".",
"getExpression",
"(",
")",
",",... | Generate the given object.
@param synchronizedStatement the synchronized statement.
@param it the target for the generated content.
@param context the context.
@return the statement. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L905-L907 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.classNotMapped | public static void classNotMapped(Class<?> aClass){
throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException1,aClass.getSimpleName()));
} | java | public static void classNotMapped(Class<?> aClass){
throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException1,aClass.getSimpleName()));
} | [
"public",
"static",
"void",
"classNotMapped",
"(",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"ClassNotMappedException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"classNotMappedException1",
",",
"aClass",
".",
"getSimpleName",
"(",
")... | Thrown if the class isn't mapped.
@param aClass class to analyze | [
"Thrown",
"if",
"the",
"class",
"isn",
"t",
"mapped",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L565-L567 |
quattor/pan | panc/src/main/java/org/quattor/pan/Compiler.java | Compiler.run | public static CompilerResults run(CompilerOptions options, List<String> objectNames, Collection<File> tplFiles) {
return (new Compiler(options, objectNames, tplFiles)).process();
} | java | public static CompilerResults run(CompilerOptions options, List<String> objectNames, Collection<File> tplFiles) {
return (new Compiler(options, objectNames, tplFiles)).process();
} | [
"public",
"static",
"CompilerResults",
"run",
"(",
"CompilerOptions",
"options",
",",
"List",
"<",
"String",
">",
"objectNames",
",",
"Collection",
"<",
"File",
">",
"tplFiles",
")",
"{",
"return",
"(",
"new",
"Compiler",
"(",
"options",
",",
"objectNames",
... | This is a convenience method which creates a compiler and then invokes the <code>process</code> method.
@param options compiler options to use for the created compiler
@param objectNames object template names to compile/build; these will be looked-up on the load path
@param tplFiles absolute file names of templ... | [
"This",
"is",
"a",
"convenience",
"method",
"which",
"creates",
"a",
"compiler",
"and",
"then",
"invokes",
"the",
"<code",
">",
"process<",
"/",
"code",
">",
"method",
"."
] | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/Compiler.java#L201-L203 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/international/pennchinese/CTBTreeReaderFactory.java | CTBTreeReaderFactory.newTreeReader | public TreeReader newTreeReader(Reader in) {
if (discardFrags) {
return new FragDiscardingPennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
} else {
return new PennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
}
} | java | public TreeReader newTreeReader(Reader in) {
if (discardFrags) {
return new FragDiscardingPennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
} else {
return new PennTreeReader(in, new LabeledScoredTreeFactory(), tn, new CHTBTokenizer(in));
}
} | [
"public",
"TreeReader",
"newTreeReader",
"(",
"Reader",
"in",
")",
"{",
"if",
"(",
"discardFrags",
")",
"{",
"return",
"new",
"FragDiscardingPennTreeReader",
"(",
"in",
",",
"new",
"LabeledScoredTreeFactory",
"(",
")",
",",
"tn",
",",
"new",
"CHTBTokenizer",
"... | Create a new <code>TreeReader</code> using the provided
<code>Reader</code>.
@param in The <code>Reader</code> to build on
@return The new TreeReader | [
"Create",
"a",
"new",
"<code",
">",
"TreeReader<",
"/",
"code",
">",
"using",
"the",
"provided",
"<code",
">",
"Reader<",
"/",
"code",
">",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/international/pennchinese/CTBTreeReaderFactory.java#L39-L45 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getGuildMemberInfo | public void getGuildMemberInfo(String id, String api, Callback<List<GuildMember>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildMemberInfo(id, api).enqueue(callback);
} | java | public void getGuildMemberInfo(String id, String api, Callback<List<GuildMember>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildMemberInfo(id, api).enqueue(callback);
} | [
"public",
"void",
"getGuildMemberInfo",
"(",
"String",
"id",
",",
"String",
"api",
",",
"Callback",
"<",
"List",
"<",
"GuildMember",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamC... | For more info on guild member API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/members">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api Guild l... | [
"For",
"more",
"info",
"on",
"guild",
"member",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"members",
">",
"here<",
"/",
"a",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1501-L1504 |
Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonpipelineWrite | public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET ... | java | public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET ... | [
"public",
"String",
"nonpipelineWrite",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
")",
"{",
"String",
"value",
"=",
"key",
"+",
"\"__\"",
"+",
"dataGenerator",
".",
"getRandomValue",
"(",
")",
"+",
"\"__\"",
"+",
"key",
";",
"String",
"res... | a simple write without a pipeline
@param key
@return the result of write (i.e. "OK" if it was successful | [
"a",
"simple",
"write",
"without",
"a",
"pipeline"
] | train | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L162-L173 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java | PlacesApi.findByLatLon | public Places findByLatLon(Float latitude, Float longitude, Integer accuracy) throws JinxException {
JinxUtils.validateParams(latitude, longitude);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.places.findByLatLon");
params.put("lat", latitude.toString());
params.put("lo... | java | public Places findByLatLon(Float latitude, Float longitude, Integer accuracy) throws JinxException {
JinxUtils.validateParams(latitude, longitude);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.places.findByLatLon");
params.put("lat", latitude.toString());
params.put("lo... | [
"public",
"Places",
"findByLatLon",
"(",
"Float",
"latitude",
",",
"Float",
"longitude",
",",
"Integer",
"accuracy",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"latitude",
",",
"longitude",
")",
";",
"Map",
"<",
"String",
","... | Return a place ID for a latitude, longitude and accuracy triple.
<p>
The flickr.places.findByLatLon method is not meant to be a (reverse) geocoder in the
traditional sense. It is designed to allow users to find photos for "places" and will
round up to the nearest place type to which corresponding place IDs apply.
<p>
F... | [
"Return",
"a",
"place",
"ID",
"for",
"a",
"latitude",
"longitude",
"and",
"accuracy",
"triple",
".",
"<p",
">",
"The",
"flickr",
".",
"places",
".",
"findByLatLon",
"method",
"is",
"not",
"meant",
"to",
"be",
"a",
"(",
"reverse",
")",
"geocoder",
"in",
... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java#L101-L111 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/io/StaticBuffers.java | StaticBuffers.byteBuffer | public ByteBuffer byteBuffer(Key key, int minSize) {
minSize = Math.max(minSize, GLOBAL_MIN_SIZE);
ByteBuffer r = _byteBuffers[key.ordinal()];
if (r == null || r.capacity() < minSize) {
r = ByteBuffer.allocate(minSize);
} else {
_byteBuffers[key.ordinal()] = null;
r.clear();
}
return r;
} | java | public ByteBuffer byteBuffer(Key key, int minSize) {
minSize = Math.max(minSize, GLOBAL_MIN_SIZE);
ByteBuffer r = _byteBuffers[key.ordinal()];
if (r == null || r.capacity() < minSize) {
r = ByteBuffer.allocate(minSize);
} else {
_byteBuffers[key.ordinal()] = null;
r.clear();
}
return r;
} | [
"public",
"ByteBuffer",
"byteBuffer",
"(",
"Key",
"key",
",",
"int",
"minSize",
")",
"{",
"minSize",
"=",
"Math",
".",
"max",
"(",
"minSize",
",",
"GLOBAL_MIN_SIZE",
")",
";",
"ByteBuffer",
"r",
"=",
"_byteBuffers",
"[",
"key",
".",
"ordinal",
"(",
")",
... | Creates or re-uses a {@link ByteBuffer} that has a minimum size. Calling
this method multiple times with the same key will always return the
same buffer, as long as it has the minimum size and is marked to be
re-used. Buffers that are allowed to be re-used should be released using
{@link #releaseByteBuffer(Key, ByteBuf... | [
"Creates",
"or",
"re",
"-",
"uses",
"a",
"{"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/io/StaticBuffers.java#L129-L140 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.create | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final String appId, @NonNull final String apiKey, @NonNull final String indexName) {
return create(new Client(appId, apiKey).getIndex(indexName), indexName);
} | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final String appId, @NonNull final String apiKey, @NonNull final String indexName) {
return create(new Client(appId, apiKey).getIndex(indexName), indexName);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"static",
"Searcher",
"create",
"(",
"@",
"NonNull",
"final",
"String",
"appId",
",",
"@",
"NonNull",
"final",
"String",
"apiKey",
",",
"@",
"... | Constructs a Searcher, creating its {@link Searcher#searchable} and {@link Searcher#client} with the given parameters.
@param appId your Algolia Application ID.
@param apiKey a search-only API Key. (never use API keys that could modify your records! see https://www.algolia.com/doc/guides/security/api-keys)
@par... | [
"Constructs",
"a",
"Searcher",
"creating",
"its",
"{",
"@link",
"Searcher#searchable",
"}",
"and",
"{",
"@link",
"Searcher#client",
"}",
"with",
"the",
"given",
"parameters",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L182-L185 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.visitDescendants | public static void visitDescendants(Component component, Predicate<Component> handler) {
List<Component> stack = Lists.newArrayList();
stack.add(component);
while (!stack.isEmpty()) {
Component currentComponent = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1... | java | public static void visitDescendants(Component component, Predicate<Component> handler) {
List<Component> stack = Lists.newArrayList();
stack.add(component);
while (!stack.isEmpty()) {
Component currentComponent = stack.get(stack.size() - 1);
stack.remove(stack.size() - 1... | [
"public",
"static",
"void",
"visitDescendants",
"(",
"Component",
"component",
",",
"Predicate",
"<",
"Component",
">",
"handler",
")",
"{",
"List",
"<",
"Component",
">",
"stack",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"stack",
".",
"add",
"(",... | Visits all descendants of a given component (including the component itself) and applies a predicate
to each.<p>
If the predicate returns false for a component, no further descendants will be processed.<p>
@param component the component
@param handler the predicate | [
"Visits",
"all",
"descendants",
"of",
"a",
"given",
"component",
"(",
"including",
"the",
"component",
"itself",
")",
"and",
"applies",
"a",
"predicate",
"to",
"each",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L1251-L1267 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.searchDescending | public static int searchDescending(short[] shortArray, short value) {
int start = 0;
int end = shortArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == shortArray[middle]) {
return mid... | java | public static int searchDescending(short[] shortArray, short value) {
int start = 0;
int end = shortArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == shortArray[middle]) {
return mid... | [
"public",
"static",
"int",
"searchDescending",
"(",
"short",
"[",
"]",
"shortArray",
",",
"short",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"shortArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"while... | Search for the value in the reverse sorted short array and return the index.
@param shortArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"reverse",
"sorted",
"short",
"array",
"and",
"return",
"the",
"index",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L505-L527 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java | RequestedAttributeTemplates.DATE_OF_BIRTH | public static RequestedAttribute DATE_OF_BIRTH(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
} | java | public static RequestedAttribute DATE_OF_BIRTH(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_DATE_OF_BIRTH_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
} | [
"public",
"static",
"RequestedAttribute",
"DATE_OF_BIRTH",
"(",
"Boolean",
"isRequired",
",",
"boolean",
"includeFriendlyName",
")",
"{",
"return",
"create",
"(",
"AttributeConstants",
".",
"EIDAS_DATE_OF_BIRTH_ATTRIBUTE_NAME",
",",
"includeFriendlyName",
"?",
"AttributeCon... | Creates a {@code RequestedAttribute} object for the DateOfBirth attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly name should be included
@return a {@code RequestedAttribute} object representing the DateOfBirth attribute | [
"Creates",
"a",
"{",
"@code",
"RequestedAttribute",
"}",
"object",
"for",
"the",
"DateOfBirth",
"attribute",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L86-L90 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/ArrayMap.java | ArrayMap.put | @Override
public final V put(K key, V value) {
int index = getIndexOfKey(key);
if (index == -1) {
index = this.size;
}
return set(index, key, value);
} | java | @Override
public final V put(K key, V value) {
int index = getIndexOfKey(key);
if (index == -1) {
index = this.size;
}
return set(index, key, value);
} | [
"@",
"Override",
"public",
"final",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"int",
"index",
"=",
"getIndexOfKey",
"(",
"key",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"index",
"=",
"this",
".",
"size",
";",
"}",... | Sets the value for the given key, overriding any existing value.
@return previous value or {@code null} for none | [
"Sets",
"the",
"value",
"for",
"the",
"given",
"key",
"overriding",
"any",
"existing",
"value",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/ArrayMap.java#L198-L205 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java | BackupEnginesInner.getAsync | public Observable<Page<BackupEngineBaseResourceInner>> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken)
.map(new Func1<ServiceResponse<Page<BackupEngineB... | java | public Observable<Page<BackupEngineBaseResourceInner>> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken)
.map(new Func1<ServiceResponse<Page<BackupEngineB... | [
"public",
"Observable",
"<",
"Page",
"<",
"BackupEngineBaseResourceInner",
">",
">",
"getAsync",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"filter",
",",
"final",
"String",
"skipToken",
")",
"{",
"r... | The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param filter Use this filter to choose the spec... | [
"The",
"backup",
"management",
"servers",
"registered",
"to",
"a",
"Recovery",
"Services",
"vault",
".",
"This",
"returns",
"a",
"pageable",
"list",
"of",
"servers",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java#L242-L250 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/AirlineBoardingPassTemplateBuilder.java | AirlineBoardingPassTemplateBuilder.addQuickReply | public AirlineBoardingPassTemplateBuilder addQuickReply(String title,
String payload) {
this.messageBuilder.addQuickReply(title, payload);
return this;
} | java | public AirlineBoardingPassTemplateBuilder addQuickReply(String title,
String payload) {
this.messageBuilder.addQuickReply(title, payload);
return this;
} | [
"public",
"AirlineBoardingPassTemplateBuilder",
"addQuickReply",
"(",
"String",
"title",
",",
"String",
"payload",
")",
"{",
"this",
".",
"messageBuilder",
".",
"addQuickReply",
"(",
"title",
",",
"payload",
")",
";",
"return",
"this",
";",
"}"
] | Adds a {@link QuickReply} to the current object.
@param title
the quick reply button label. It can't be empty.
@param payload
the payload sent back when the button is pressed. It can't be
empty.
@return this builder.
@see <a href=
"https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replie... | [
"Adds",
"a",
"{",
"@link",
"QuickReply",
"}",
"to",
"the",
"current",
"object",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/AirlineBoardingPassTemplateBuilder.java#L140-L144 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.createShowAndPosition | public static JFrame createShowAndPosition(final String title, final Container content,
final boolean exitOnClose, final FramePositioner positioner) {
return createShowAndPosition(title, content, exitOnClose, true, positioner);
} | java | public static JFrame createShowAndPosition(final String title, final Container content,
final boolean exitOnClose, final FramePositioner positioner) {
return createShowAndPosition(title, content, exitOnClose, true, positioner);
} | [
"public",
"static",
"JFrame",
"createShowAndPosition",
"(",
"final",
"String",
"title",
",",
"final",
"Container",
"content",
",",
"final",
"boolean",
"exitOnClose",
",",
"final",
"FramePositioner",
"positioner",
")",
"{",
"return",
"createShowAndPosition",
"(",
"ti... | Create a new resizeable frame with a panel as it's content pane and
position the frame.
@param title
Frame title.
@param content
Content.
@param exitOnClose
Exit the program on closing the frame?
@param positioner
FramePositioner.
@return A visible frame at the preferred position. | [
"Create",
"a",
"new",
"resizeable",
"frame",
"with",
"a",
"panel",
"as",
"it",
"s",
"content",
"pane",
"and",
"position",
"the",
"frame",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L66-L69 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java | ScientificNumberFormatter.getMarkupInstance | public static ScientificNumberFormatter getMarkupInstance(
ULocale locale,
String beginMarkup,
String endMarkup) {
return getInstanceForLocale(
locale, new MarkupStyle(beginMarkup, endMarkup));
} | java | public static ScientificNumberFormatter getMarkupInstance(
ULocale locale,
String beginMarkup,
String endMarkup) {
return getInstanceForLocale(
locale, new MarkupStyle(beginMarkup, endMarkup));
} | [
"public",
"static",
"ScientificNumberFormatter",
"getMarkupInstance",
"(",
"ULocale",
"locale",
",",
"String",
"beginMarkup",
",",
"String",
"endMarkup",
")",
"{",
"return",
"getInstanceForLocale",
"(",
"locale",
",",
"new",
"MarkupStyle",
"(",
"beginMarkup",
",",
"... | Gets a ScientificNumberFormatter instance that uses
markup for exponents for this locale.
@param locale The locale
@param beginMarkup the markup to start superscript e.g {@code <sup>}
@param endMarkup the markup to end superscript e.g {@code </sup>}
@return The ScientificNumberFormatter instance. | [
"Gets",
"a",
"ScientificNumberFormatter",
"instance",
"that",
"uses",
"markup",
"for",
"exponents",
"for",
"this",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java#L74-L80 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.setAttribute | public final Jar setAttribute(String name, String value) {
verifyNotSealed();
if (jos != null)
throw new IllegalStateException("Manifest cannot be modified after entries are added.");
getManifest().getMainAttributes().putValue(name, value);
return this;
} | java | public final Jar setAttribute(String name, String value) {
verifyNotSealed();
if (jos != null)
throw new IllegalStateException("Manifest cannot be modified after entries are added.");
getManifest().getMainAttributes().putValue(name, value);
return this;
} | [
"public",
"final",
"Jar",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"verifyNotSealed",
"(",
")",
";",
"if",
"(",
"jos",
"!=",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Manifest cannot be modified after entries are... | Sets an attribute in the main section of the manifest.
@param name the attribute's name
@param value the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to calling this methods. | [
"Sets",
"an",
"attribute",
"in",
"the",
"main",
"section",
"of",
"the",
"manifest",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L135-L141 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueFactory.java | StatValueFactory.createStatValue | public static TypeAwareStatValue createStatValue(StatValueTypes aType, String aName, Interval[] aIntervals) {
IValueHolderFactory valueHolderFactory = StatValueTypeUtility.createValueHolderFactory(aType);
TypeAwareStatValue value = new TypeAwareStatValueImpl(aName, aType, valueHolderFactory);
// now we have to ad... | java | public static TypeAwareStatValue createStatValue(StatValueTypes aType, String aName, Interval[] aIntervals) {
IValueHolderFactory valueHolderFactory = StatValueTypeUtility.createValueHolderFactory(aType);
TypeAwareStatValue value = new TypeAwareStatValueImpl(aName, aType, valueHolderFactory);
// now we have to ad... | [
"public",
"static",
"TypeAwareStatValue",
"createStatValue",
"(",
"StatValueTypes",
"aType",
",",
"String",
"aName",
",",
"Interval",
"[",
"]",
"aIntervals",
")",
"{",
"IValueHolderFactory",
"valueHolderFactory",
"=",
"StatValueTypeUtility",
".",
"createValueHolderFactory... | This method creates a StatValue instance.
@param aType the type of the value
@param aName the name of the value
@param aIntervals the list of Intervals to be used
@return the StatValue instance | [
"This",
"method",
"creates",
"a",
"StatValue",
"instance",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueFactory.java#L73-L81 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserRepository.java | UserRepository.deleteUser | public void deleteUser (final User user)
throws PersistenceException
{
if (user.isDeleted()) {
return;
}
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws PersistenceException, SQLEx... | java | public void deleteUser (final User user)
throws PersistenceException
{
if (user.isDeleted()) {
return;
}
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws PersistenceException, SQLEx... | [
"public",
"void",
"deleteUser",
"(",
"final",
"User",
"user",
")",
"throws",
"PersistenceException",
"{",
"if",
"(",
"user",
".",
"isDeleted",
"(",
")",
")",
"{",
"return",
";",
"}",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",... | 'Delete' the users account such that they can no longer access it, however we do not delete
the record from the db. The name is changed such that the original name has XX=FOO if the
name were FOO originally. If we have to lop off any of the name to get our prefix to fit we
use a minus sign instead of a equals side. ... | [
"Delete",
"the",
"users",
"account",
"such",
"that",
"they",
"can",
"no",
"longer",
"access",
"it",
"however",
"we",
"do",
"not",
"delete",
"the",
"record",
"from",
"the",
"db",
".",
"The",
"name",
"is",
"changed",
"such",
"that",
"the",
"original",
"nam... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L200-L241 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.notEmpty | public static void notEmpty(Collection<?> collection, String message, Object... arguments) {
notEmpty(collection, new IllegalArgumentException(format(message, arguments)));
} | java | public static void notEmpty(Collection<?> collection, String message, Object... arguments) {
notEmpty(collection, new IllegalArgumentException(format(message, arguments)));
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"notEmpty",
"(",
"collection",
",",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"message",... | Asserts that the {@link Collection} is not empty.
The assertion holds if and only if the {@link Collection} is not {@literal null} and contains at least 1 element.
@param collection {@link Collection} to evaluate.
@param message {@link String} containing the message using in the {@link IllegalArgumentException} throw... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Collection",
"}",
"is",
"not",
"empty",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1034-L1036 |
dwdyer/reportng | reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java | HTMLReporter.createResults | private void createResults(List<ISuite> suites,
File outputDirectory,
boolean onlyShowFailures) throws Exception
{
int index = 1;
for (ISuite suite : suites)
{
int index2 = 1;
for (ISuiteResult result : sui... | java | private void createResults(List<ISuite> suites,
File outputDirectory,
boolean onlyShowFailures) throws Exception
{
int index = 1;
for (ISuite suite : suites)
{
int index2 = 1;
for (ISuiteResult result : sui... | [
"private",
"void",
"createResults",
"(",
"List",
"<",
"ISuite",
">",
"suites",
",",
"File",
"outputDirectory",
",",
"boolean",
"onlyShowFailures",
")",
"throws",
"Exception",
"{",
"int",
"index",
"=",
"1",
";",
"for",
"(",
"ISuite",
"suite",
":",
"suites",
... | Generate a results file for each test in each suite.
@param outputDirectory The target directory for the generated file(s). | [
"Generate",
"a",
"results",
"file",
"for",
"each",
"test",
"in",
"each",
"suite",
"."
] | train | https://github.com/dwdyer/reportng/blob/df11f9cd9ab3fb5847fbba94ed3098ae0448f770/reportng/src/java/main/org/uncommons/reportng/HTMLReporter.java#L170-L200 |
omadahealth/TypefaceView | lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceTextView.java | TypefaceTextView.setCustomHtml | @BindingAdapter("bind:tv_html")
public static void setCustomHtml(TypefaceTextView textView, Boolean isHtml) {
isHtml = isHtml != null ? isHtml : false;
textView.mHtmlEnabled = isHtml;
textView.setText(textView.getText());
} | java | @BindingAdapter("bind:tv_html")
public static void setCustomHtml(TypefaceTextView textView, Boolean isHtml) {
isHtml = isHtml != null ? isHtml : false;
textView.mHtmlEnabled = isHtml;
textView.setText(textView.getText());
} | [
"@",
"BindingAdapter",
"(",
"\"bind:tv_html\"",
")",
"public",
"static",
"void",
"setCustomHtml",
"(",
"TypefaceTextView",
"textView",
",",
"Boolean",
"isHtml",
")",
"{",
"isHtml",
"=",
"isHtml",
"!=",
"null",
"?",
"isHtml",
":",
"false",
";",
"textView",
".",... | Data-binding method for custom attribute bind:tv_html to be set
@param textView The instance of the object to set value on
@param isHtml True if html text, false otherwise | [
"Data",
"-",
"binding",
"method",
"for",
"custom",
"attribute",
"bind",
":",
"tv_html",
"to",
"be",
"set"
] | train | https://github.com/omadahealth/TypefaceView/blob/9a36a67b0fb26584c3e20a24f8f0bafad6a0badd/lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceTextView.java#L91-L96 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.evaluateRegression | public <T extends RegressionEvaluation> T evaluateRegression(DataSetIterator iterator, List<String> columnNames) {
return (T)doEvaluation(iterator, new org.deeplearning4j.eval.RegressionEvaluation(columnNames))[0];
} | java | public <T extends RegressionEvaluation> T evaluateRegression(DataSetIterator iterator, List<String> columnNames) {
return (T)doEvaluation(iterator, new org.deeplearning4j.eval.RegressionEvaluation(columnNames))[0];
} | [
"public",
"<",
"T",
"extends",
"RegressionEvaluation",
">",
"T",
"evaluateRegression",
"(",
"DataSetIterator",
"iterator",
",",
"List",
"<",
"String",
">",
"columnNames",
")",
"{",
"return",
"(",
"T",
")",
"doEvaluation",
"(",
"iterator",
",",
"new",
"org",
... | Evaluate the (single output layer only) network for regression performance
@param iterator Data to evaluate on
@param columnNames Column names for the regression evaluation. May be null.
@return Regression evaluation | [
"Evaluate",
"the",
"(",
"single",
"output",
"layer",
"only",
")",
"network",
"for",
"regression",
"performance"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L3903-L3905 |
osglworks/java-tool | src/main/java/org/osgl/util/E.java | E.invalidArgIf | public static void invalidArgIf(boolean tester, String msg, Object... args) {
if (tester) {
throw invalidArg(msg, args);
}
} | java | public static void invalidArgIf(boolean tester, String msg, Object... args) {
if (tester) {
throw invalidArg(msg, args);
}
} | [
"public",
"static",
"void",
"invalidArgIf",
"(",
"boolean",
"tester",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"tester",
")",
"{",
"throw",
"invalidArg",
"(",
"msg",
",",
"args",
")",
";",
"}",
"}"
] | Throws out an {@link InvalidArgException} with error message specified
when `tester` is `true`.
@param tester
when `true` then throws out the exception.
@param msg
the error message format pattern.
@param args
the error message format arguments. | [
"Throws",
"out",
"an",
"{",
"@link",
"InvalidArgException",
"}",
"with",
"error",
"message",
"specified",
"when",
"tester",
"is",
"true",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/E.java#L403-L407 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsUserDataFormLayout.java | CmsUserDataFormLayout.submit | public void submit(CmsUser user, CmsObject cms, Runnable afterWrite) {
submit(user, cms, afterWrite, false);
} | java | public void submit(CmsUser user, CmsObject cms, Runnable afterWrite) {
submit(user, cms, afterWrite, false);
} | [
"public",
"void",
"submit",
"(",
"CmsUser",
"user",
",",
"CmsObject",
"cms",
",",
"Runnable",
"afterWrite",
")",
"{",
"submit",
"(",
"user",
",",
"cms",
",",
"afterWrite",
",",
"false",
")",
";",
"}"
] | Store fields to given user.<p>
@param user User to write information to
@param cms CmsObject
@param afterWrite runnable which gets called after writing user | [
"Store",
"fields",
"to",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsUserDataFormLayout.java#L198-L201 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/otm/copy/MetadataObjectCopyStrategy.java | MetadataObjectCopyStrategy.copy | public Object copy(final Object obj, final PersistenceBroker broker)
{
return clone(obj, IdentityMapFactory.getIdentityMap(), broker);
} | java | public Object copy(final Object obj, final PersistenceBroker broker)
{
return clone(obj, IdentityMapFactory.getIdentityMap(), broker);
} | [
"public",
"Object",
"copy",
"(",
"final",
"Object",
"obj",
",",
"final",
"PersistenceBroker",
"broker",
")",
"{",
"return",
"clone",
"(",
"obj",
",",
"IdentityMapFactory",
".",
"getIdentityMap",
"(",
")",
",",
"broker",
")",
";",
"}"
] | Uses an IdentityMap to make sure we don't recurse infinitely on the same object in a cyclic object model.
Proxies
@param obj
@return | [
"Uses",
"an",
"IdentityMap",
"to",
"make",
"sure",
"we",
"don",
"t",
"recurse",
"infinitely",
"on",
"the",
"same",
"object",
"in",
"a",
"cyclic",
"object",
"model",
".",
"Proxies"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/otm/copy/MetadataObjectCopyStrategy.java#L48-L51 |
AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/Type3Message.java | Type3Message.setupMIC | public void setupMIC ( byte[] type1, byte[] type2 ) throws GeneralSecurityException, IOException {
byte[] sk = this.masterKey;
if ( sk == null ) {
return;
}
MessageDigest mac = Crypto.getHMACT64(sk);
mac.update(type1);
mac.update(type2);
byte[] type3 =... | java | public void setupMIC ( byte[] type1, byte[] type2 ) throws GeneralSecurityException, IOException {
byte[] sk = this.masterKey;
if ( sk == null ) {
return;
}
MessageDigest mac = Crypto.getHMACT64(sk);
mac.update(type1);
mac.update(type2);
byte[] type3 =... | [
"public",
"void",
"setupMIC",
"(",
"byte",
"[",
"]",
"type1",
",",
"byte",
"[",
"]",
"type2",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"byte",
"[",
"]",
"sk",
"=",
"this",
".",
"masterKey",
";",
"if",
"(",
"sk",
"==",
"null",... | Sets the MIC
@param type1
@param type2
@throws GeneralSecurityException
@throws IOException | [
"Sets",
"the",
"MIC"
] | train | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/Type3Message.java#L297-L308 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/xml/MetaCharacterMap.java | MetaCharacterMap.addMeta | public void addMeta(char meta, String replacement) {
metaCharacterSet.set(meta);
replacementMap.put(new String(new char[] { meta }), replacement);
} | java | public void addMeta(char meta, String replacement) {
metaCharacterSet.set(meta);
replacementMap.put(new String(new char[] { meta }), replacement);
} | [
"public",
"void",
"addMeta",
"(",
"char",
"meta",
",",
"String",
"replacement",
")",
"{",
"metaCharacterSet",
".",
"set",
"(",
"meta",
")",
";",
"replacementMap",
".",
"put",
"(",
"new",
"String",
"(",
"new",
"char",
"[",
"]",
"{",
"meta",
"}",
")",
... | Add a metacharacter and its replacement.
@param meta
the metacharacter
@param replacement
the String to replace the metacharacter with | [
"Add",
"a",
"metacharacter",
"and",
"its",
"replacement",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/MetaCharacterMap.java#L53-L56 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/SpiUtil.java | SpiUtil.urlDecode | public static String urlDecode(String text)
{
String urlEncodedString=text;
if(text!=null)
{
try
{
urlEncodedString=URLDecoder.decode(text,SpiUtil.UTF_8_ENCODING_NAME);
}
catch(UnsupportedEncodingException exception)
... | java | public static String urlDecode(String text)
{
String urlEncodedString=text;
if(text!=null)
{
try
{
urlEncodedString=URLDecoder.decode(text,SpiUtil.UTF_8_ENCODING_NAME);
}
catch(UnsupportedEncodingException exception)
... | [
"public",
"static",
"String",
"urlDecode",
"(",
"String",
"text",
")",
"{",
"String",
"urlEncodedString",
"=",
"text",
";",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"try",
"{",
"urlEncodedString",
"=",
"URLDecoder",
".",
"decode",
"(",
"text",
",",
"Sp... | This function URL decodes the given text.
@param text
The text to decode
@return The decoded text | [
"This",
"function",
"URL",
"decodes",
"the",
"given",
"text",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/SpiUtil.java#L235-L251 |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java | VectorizedColumnReader.readBooleanBatch | private void readBooleanBatch(int rowId, int num, WritableColumnVector column)
throws IOException {
if (column.dataType() != DataTypes.BooleanType) {
throw constructConvertNotSupportedException(descriptor, column);
}
defColumn.readBooleans(
num, column, rowId, maxDefLevel, (VectorizedVal... | java | private void readBooleanBatch(int rowId, int num, WritableColumnVector column)
throws IOException {
if (column.dataType() != DataTypes.BooleanType) {
throw constructConvertNotSupportedException(descriptor, column);
}
defColumn.readBooleans(
num, column, rowId, maxDefLevel, (VectorizedVal... | [
"private",
"void",
"readBooleanBatch",
"(",
"int",
"rowId",
",",
"int",
"num",
",",
"WritableColumnVector",
"column",
")",
"throws",
"IOException",
"{",
"if",
"(",
"column",
".",
"dataType",
"(",
")",
"!=",
"DataTypes",
".",
"BooleanType",
")",
"{",
"throw",... | For all the read*Batch functions, reads `num` values from this columnReader into column. It
is guaranteed that num is smaller than the number of values left in the current page. | [
"For",
"all",
"the",
"read",
"*",
"Batch",
"functions",
"reads",
"num",
"values",
"from",
"this",
"columnReader",
"into",
"column",
".",
"It",
"is",
"guaranteed",
"that",
"num",
"is",
"smaller",
"than",
"the",
"number",
"of",
"values",
"left",
"in",
"the",... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java#L397-L404 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Scene.java | Scene.setPixelSize | public final Scene setPixelSize(final int wide, final int high)
{
m_wide = wide;
m_high = high;
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getStyle().setHeight(high, Unit.PX);
final NFastArrayList<Layer> layers = getChildNodes();
if (null != la... | java | public final Scene setPixelSize(final int wide, final int high)
{
m_wide = wide;
m_high = high;
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getStyle().setHeight(high, Unit.PX);
final NFastArrayList<Layer> layers = getChildNodes();
if (null != la... | [
"public",
"final",
"Scene",
"setPixelSize",
"(",
"final",
"int",
"wide",
",",
"final",
"int",
"high",
")",
"{",
"m_wide",
"=",
"wide",
";",
"m_high",
"=",
"high",
";",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"wide",
"... | Sets this scene's size (width and height) in pixels.
@param wide
@param high
@return this Scene | [
"Sets",
"this",
"scene",
"s",
"size",
"(",
"width",
"and",
"height",
")",
"in",
"pixels",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Scene.java#L160-L187 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/Crawler.java | Crawler.createUri | private String createUri(String uri) {
try {
return FileUtil.URI_SEPARATOR_CHAR
+ FilenameUtils.getPath(uri)
+ URLEncoder.encode(FilenameUtils.getBaseName(uri), StandardCharsets.UTF_8.name())
+ config.getOutputExtension();
} catch (UnsupportedE... | java | private String createUri(String uri) {
try {
return FileUtil.URI_SEPARATOR_CHAR
+ FilenameUtils.getPath(uri)
+ URLEncoder.encode(FilenameUtils.getBaseName(uri), StandardCharsets.UTF_8.name())
+ config.getOutputExtension();
} catch (UnsupportedE... | [
"private",
"String",
"createUri",
"(",
"String",
"uri",
")",
"{",
"try",
"{",
"return",
"FileUtil",
".",
"URI_SEPARATOR_CHAR",
"+",
"FilenameUtils",
".",
"getPath",
"(",
"uri",
")",
"+",
"URLEncoder",
".",
"encode",
"(",
"FilenameUtils",
".",
"getBaseName",
... | commons-codec's URLCodec could be used when we add that dependency. | [
"commons",
"-",
"codec",
"s",
"URLCodec",
"could",
"be",
"used",
"when",
"we",
"add",
"that",
"dependency",
"."
] | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/Crawler.java#L153-L162 |
casmi/casmi | src/main/java/casmi/graphics/element/Lines.java | Lines.vertex | public void vertex(double x, double y) {
MODE = LINES;
this.x.add(x);
this.y.add(y);
colors.add(this.strokeColor);
calcG();
} | java | public void vertex(double x, double y) {
MODE = LINES;
this.x.add(x);
this.y.add(y);
colors.add(this.strokeColor);
calcG();
} | [
"public",
"void",
"vertex",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"MODE",
"=",
"LINES",
";",
"this",
".",
"x",
".",
"add",
"(",
"x",
")",
";",
"this",
".",
"y",
".",
"add",
"(",
"y",
")",
";",
"colors",
".",
"add",
"(",
"this",
... | Adds the point to Lines.
@param x The x-coordinate of a new added point.
@param y The y-coordinate of a new added point. | [
"Adds",
"the",
"point",
"to",
"Lines",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Lines.java#L78-L84 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java | AccountsInner.checkNameAvailabilityAsync | public Observable<NameAvailabilityInformationInner> checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) {
return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1<ServiceResponse<NameAvailabilityInformationInner>, NameAvailabilityInformationInn... | java | public Observable<NameAvailabilityInformationInner> checkNameAvailabilityAsync(String location, CheckNameAvailabilityParameters parameters) {
return checkNameAvailabilityWithServiceResponseAsync(location, parameters).map(new Func1<ServiceResponse<NameAvailabilityInformationInner>, NameAvailabilityInformationInn... | [
"public",
"Observable",
"<",
"NameAvailabilityInformationInner",
">",
"checkNameAvailabilityAsync",
"(",
"String",
"location",
",",
"CheckNameAvailabilityParameters",
"parameters",
")",
"{",
"return",
"checkNameAvailabilityWithServiceResponseAsync",
"(",
"location",
",",
"param... | Checks whether the specified account name is available or taken.
@param location The resource location without whitespace.
@param parameters Parameters supplied to check the Data Lake Analytics account name availability.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable t... | [
"Checks",
"whether",
"the",
"specified",
"account",
"name",
"is",
"available",
"or",
"taken",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/AccountsInner.java#L1388-L1395 |
knightliao/disconf | disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/dao/GenericDao.java | GenericDao.find | public List<ENTITY> find(String column, Object value) {
return find(Operators.match(column, value));
} | java | public List<ENTITY> find(String column, Object value) {
return find(Operators.match(column, value));
} | [
"public",
"List",
"<",
"ENTITY",
">",
"find",
"(",
"String",
"column",
",",
"Object",
"value",
")",
"{",
"return",
"find",
"(",
"Operators",
".",
"match",
"(",
"column",
",",
"value",
")",
")",
";",
"}"
] | 获取查询结果
@param column 条件字段
@param value 条件字段的值。支持集合对象,支持数组,会按照in 操作来组装条件
@return | [
"获取查询结果"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/dao/GenericDao.java#L278-L280 |
zxing/zxing | core/src/main/java/com/google/zxing/oned/UPCEANReader.java | UPCEANReader.decodeDigit | static int decodeDigit(BitArray row, int[] counters, int rowOffset, int[][] patterns)
throws NotFoundException {
recordPattern(row, rowOffset, counters);
float bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
int bestMatch = -1;
int max = patterns.length;
for (int i = 0; i < max... | java | static int decodeDigit(BitArray row, int[] counters, int rowOffset, int[][] patterns)
throws NotFoundException {
recordPattern(row, rowOffset, counters);
float bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
int bestMatch = -1;
int max = patterns.length;
for (int i = 0; i < max... | [
"static",
"int",
"decodeDigit",
"(",
"BitArray",
"row",
",",
"int",
"[",
"]",
"counters",
",",
"int",
"rowOffset",
",",
"int",
"[",
"]",
"[",
"]",
"patterns",
")",
"throws",
"NotFoundException",
"{",
"recordPattern",
"(",
"row",
",",
"rowOffset",
",",
"c... | Attempts to decode a single UPC/EAN-encoded digit.
@param row row of black/white values to decode
@param counters the counts of runs of observed black/white/black/... values
@param rowOffset horizontal offset to start decoding from
@param patterns the set of patterns to use to decode -- sometimes different encodings
f... | [
"Attempts",
"to",
"decode",
"a",
"single",
"UPC",
"/",
"EAN",
"-",
"encoded",
"digit",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/UPCEANReader.java#L361-L380 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.newTimer | public static Timer newTimer(String name, TaggingContext context) {
return newTimer(name, TimeUnit.MILLISECONDS, context);
} | java | public static Timer newTimer(String name, TaggingContext context) {
return newTimer(name, TimeUnit.MILLISECONDS, context);
} | [
"public",
"static",
"Timer",
"newTimer",
"(",
"String",
"name",
",",
"TaggingContext",
"context",
")",
"{",
"return",
"newTimer",
"(",
"name",
",",
"TimeUnit",
".",
"MILLISECONDS",
",",
"context",
")",
";",
"}"
] | Create a new timer with a name and context. The returned timer will maintain separate
sub-monitors for each distinct set of tags returned from the context on an update operation. | [
"Create",
"a",
"new",
"timer",
"with",
"a",
"name",
"and",
"context",
".",
"The",
"returned",
"timer",
"will",
"maintain",
"separate",
"sub",
"-",
"monitors",
"for",
"each",
"distinct",
"set",
"of",
"tags",
"returned",
"from",
"the",
"context",
"on",
"an",... | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L90-L92 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.