repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/NodeSet.java | NodeSet.matchRegexOrEquals | public static boolean matchRegexOrEquals(final String inputSelector, final String item) {
"""
Tests whether the selector string matches the item, in three possible ways: first, if the selector looks like:
"/.../" then it the outer '/' chars are removed and it is treated as a regular expression *only* and
Pattern... | java | public static boolean matchRegexOrEquals(final String inputSelector, final String item) {
//see if inputSelector is wrapped in '/' chars
String testregex = inputSelector;
if (testregex.length()>=2 && testregex.indexOf('/') == 0 && testregex.lastIndexOf('/') == testregex.length() - 1) {
... | [
"public",
"static",
"boolean",
"matchRegexOrEquals",
"(",
"final",
"String",
"inputSelector",
",",
"final",
"String",
"item",
")",
"{",
"//see if inputSelector is wrapped in '/' chars",
"String",
"testregex",
"=",
"inputSelector",
";",
"if",
"(",
"testregex",
".",
"le... | Tests whether the selector string matches the item, in three possible ways: first, if the selector looks like:
"/.../" then it the outer '/' chars are removed and it is treated as a regular expression *only* and
PatternSyntaxExceptions are not caught. Otherwise, it is treated as a regular expression and any
PatternSyn... | [
"Tests",
"whether",
"the",
"selector",
"string",
"matches",
"the",
"item",
"in",
"three",
"possible",
"ways",
":",
"first",
"if",
"the",
"selector",
"looks",
"like",
":",
"/",
"...",
"/",
"then",
"it",
"the",
"outer",
"/",
"chars",
"are",
"removed",
"and... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/NodeSet.java#L359-L373 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSorted | public static <T> List<T> toSorted(Iterable<T> self) {
"""
Sorts the Iterable. Assumes that the Iterable elements are
comparable and uses a {@link NumberAwareComparator} to determine the resulting order.
{@code NumberAwareComparator} has special treatment for numbers but otherwise uses the
natural ordering of t... | java | public static <T> List<T> toSorted(Iterable<T> self) {
return toSorted(self, new NumberAwareComparator<T>());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toSorted",
"(",
"Iterable",
"<",
"T",
">",
"self",
")",
"{",
"return",
"toSorted",
"(",
"self",
",",
"new",
"NumberAwareComparator",
"<",
"T",
">",
"(",
")",
")",
";",
"}"
] | Sorts the Iterable. Assumes that the Iterable elements are
comparable and uses a {@link NumberAwareComparator} to determine the resulting order.
{@code NumberAwareComparator} has special treatment for numbers but otherwise uses the
natural ordering of the Iterable elements. The elements are first placed into a new list... | [
"Sorts",
"the",
"Iterable",
".",
"Assumes",
"that",
"the",
"Iterable",
"elements",
"are",
"comparable",
"and",
"uses",
"a",
"{",
"@link",
"NumberAwareComparator",
"}",
"to",
"determine",
"the",
"resulting",
"order",
".",
"{",
"@code",
"NumberAwareComparator",
"}... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L9392-L9394 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/data/ResourceReader.java | ResourceReader._reset | private void _reset() throws UnsupportedEncodingException {
"""
Reset to the start by reconstructing the stream and readers.
We could also use mark() and reset() on the stream or reader,
but that would cause them to keep the stream data around in
memory. We don't want that because some of the resource files
a... | java | private void _reset() throws UnsupportedEncodingException {
try {
close();
} catch (IOException e) {}
if (lineNo == 0) {
return;
}
InputStream is = ICUData.getStream(root, resourceName);
if (is == null) {
throw new IllegalArgumentExcept... | [
"private",
"void",
"_reset",
"(",
")",
"throws",
"UnsupportedEncodingException",
"{",
"try",
"{",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"}",
"if",
"(",
"lineNo",
"==",
"0",
")",
"{",
"return",
";",
"}",
"InputStream",... | Reset to the start by reconstructing the stream and readers.
We could also use mark() and reset() on the stream or reader,
but that would cause them to keep the stream data around in
memory. We don't want that because some of the resource files
are large, e.g., 400k. | [
"Reset",
"to",
"the",
"start",
"by",
"reconstructing",
"the",
"stream",
"and",
"readers",
".",
"We",
"could",
"also",
"use",
"mark",
"()",
"and",
"reset",
"()",
"on",
"the",
"stream",
"or",
"reader",
"but",
"that",
"would",
"cause",
"them",
"to",
"keep",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/data/ResourceReader.java#L238-L255 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/SimpleZeroSwap.java | SimpleZeroSwap.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
RandomVariableInterface values = model.getRandomVariableForConstant(0.0);
RandomVariableInterface notional = model.getRandomVariableForConstant(1.0);
for... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"RandomVariableInterface",
"values",
"=",
"model",
".",
"getRandomVariableFo... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/SimpleZeroSwap.java#L93-L130 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java | Blob.copyTo | public CopyWriter copyTo(String targetBucket, String targetBlob, BlobSourceOption... options) {
"""
Sends a copy request for the current blob to the target blob. Possibly also some of the
metadata are copied (e.g. content-type).
<p>Example of copying the blob to a different bucket with a different name.
<pr... | java | public CopyWriter copyTo(String targetBucket, String targetBlob, BlobSourceOption... options) {
return copyTo(BlobId.of(targetBucket, targetBlob), options);
} | [
"public",
"CopyWriter",
"copyTo",
"(",
"String",
"targetBucket",
",",
"String",
"targetBlob",
",",
"BlobSourceOption",
"...",
"options",
")",
"{",
"return",
"copyTo",
"(",
"BlobId",
".",
"of",
"(",
"targetBucket",
",",
"targetBlob",
")",
",",
"options",
")",
... | Sends a copy request for the current blob to the target blob. Possibly also some of the
metadata are copied (e.g. content-type).
<p>Example of copying the blob to a different bucket with a different name.
<pre>{@code
String bucketName = "my_unique_bucket";
String blobName = "copy_blob_name";
CopyWriter copyWriter = b... | [
"Sends",
"a",
"copy",
"request",
"for",
"the",
"current",
"blob",
"to",
"the",
"target",
"blob",
".",
"Possibly",
"also",
"some",
"of",
"the",
"metadata",
"are",
"copied",
"(",
"e",
".",
"g",
".",
"content",
"-",
"type",
")",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java#L640-L642 |
diirt/util | src/main/java/org/epics/util/text/CsvParser.java | CsvParser.isTokenNumberParsable | private boolean isTokenNumberParsable(State state, String token) {
"""
Check whether the token can be parsed to a number.
@param state the state of the parser
@param token the token
@return true if token matches a double
"""
if (token.isEmpty()) {
return true;
}
ret... | java | private boolean isTokenNumberParsable(State state, String token) {
if (token.isEmpty()) {
return true;
}
return state.mDouble.reset(token).matches();
} | [
"private",
"boolean",
"isTokenNumberParsable",
"(",
"State",
"state",
",",
"String",
"token",
")",
"{",
"if",
"(",
"token",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"state",
".",
"mDouble",
".",
"reset",
"(",
"token",
"... | Check whether the token can be parsed to a number.
@param state the state of the parser
@param token the token
@return true if token matches a double | [
"Check",
"whether",
"the",
"token",
"can",
"be",
"parsed",
"to",
"a",
"number",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/text/CsvParser.java#L435-L440 |
XDean/Java-EX | src/main/java/xdean/jex/util/collection/MapUtil.java | MapUtil.getOrPutDefault | @Deprecated
public static <K, V> V getOrPutDefault(Map<K, V> map, K key, Supplier<V> defaultGetter) {
"""
Get the value of the key. If absent, put the default value.
@param map
@param key
@param defaultGetter
@return
"""
return map.computeIfAbsent(key, k -> defaultGetter.get());
} | java | @Deprecated
public static <K, V> V getOrPutDefault(Map<K, V> map, K key, Supplier<V> defaultGetter) {
return map.computeIfAbsent(key, k -> defaultGetter.get());
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getOrPutDefault",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"Supplier",
"<",
"V",
">",
"defaultGetter",
")",
"{",
"return",
"map",
".",
"computeIfAbsent",
... | Get the value of the key. If absent, put the default value.
@param map
@param key
@param defaultGetter
@return | [
"Get",
"the",
"value",
"of",
"the",
"key",
".",
"If",
"absent",
"put",
"the",
"default",
"value",
"."
] | train | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/collection/MapUtil.java#L27-L30 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.sendWithBinaryData | public MessageId sendWithBinaryData(ProducerConnectionContext context, BasicMessage basicMessage,
InputStream inputStream) throws JMSException {
"""
Same as {@link #sendWithBinaryData(ProducerConnectionContext, BasicMessage, InputStream, Map)} with
<code>null</code> headers.
"""
return sen... | java | public MessageId sendWithBinaryData(ProducerConnectionContext context, BasicMessage basicMessage,
InputStream inputStream) throws JMSException {
return sendWithBinaryData(context, basicMessage, inputStream, null);
} | [
"public",
"MessageId",
"sendWithBinaryData",
"(",
"ProducerConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"InputStream",
"inputStream",
")",
"throws",
"JMSException",
"{",
"return",
"sendWithBinaryData",
"(",
"context",
",",
"basicMessage",
",",
... | Same as {@link #sendWithBinaryData(ProducerConnectionContext, BasicMessage, InputStream, Map)} with
<code>null</code> headers. | [
"Same",
"as",
"{"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L143-L146 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseLinearRing | private LinearRing parseLinearRing(ValueGetter data, boolean haveZ, boolean haveM) {
"""
Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.LinearRing}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param haveZ True if the {@link org.locationtech... | java | private LinearRing parseLinearRing(ValueGetter data, boolean haveZ, boolean haveM) {
return JtsGeometry.geofac.createLinearRing(this.parseCS(data, haveZ, haveM));
} | [
"private",
"LinearRing",
"parseLinearRing",
"(",
"ValueGetter",
"data",
",",
"boolean",
"haveZ",
",",
"boolean",
"haveM",
")",
"{",
"return",
"JtsGeometry",
".",
"geofac",
".",
"createLinearRing",
"(",
"this",
".",
"parseCS",
"(",
"data",
",",
"haveZ",
",",
... | Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.LinearRing}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param haveZ True if the {@link org.locationtech.jts.geom.LinearRing} has a Z component.
@param haveM True if the {@link org.locationtech.jts.geom... | [
"Parse",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"a",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"LinearRing",
"}",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L267-L269 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.write | public static void write(OutputStream out, boolean isCloseOut, byte[] content) throws IORuntimeException {
"""
将byte[]写到流中
@param out 输出流
@param isCloseOut 写入完毕是否关闭输出流
@param content 写入的内容
@throws IORuntimeException IO异常
"""
try {
out.write(content);
} catch (IOException e) {
throw new IORu... | java | public static void write(OutputStream out, boolean isCloseOut, byte[] content) throws IORuntimeException {
try {
out.write(content);
} catch (IOException e) {
throw new IORuntimeException(e);
} finally {
if (isCloseOut) {
close(out);
}
}
} | [
"public",
"static",
"void",
"write",
"(",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
",",
"byte",
"[",
"]",
"content",
")",
"throws",
"IORuntimeException",
"{",
"try",
"{",
"out",
".",
"write",
"(",
"content",
")",
";",
"}",
"catch",
"(",
"IOEx... | 将byte[]写到流中
@param out 输出流
@param isCloseOut 写入完毕是否关闭输出流
@param content 写入的内容
@throws IORuntimeException IO异常 | [
"将byte",
"[]",
"写到流中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L857-L867 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/stage/hash/ThreadLocalState.java | ThreadLocalState.lockContextLocally | public boolean lockContextLocally(ChronicleHash<?, ?, ?, ?> hash) {
"""
Returns {@code true} if this is the outer context lock in this thread, {@code false} if this
is a nested context.
"""
// hash().isOpen() check guarantees no starvation of a thread calling chMap.close() and
// trying to clo... | java | public boolean lockContextLocally(ChronicleHash<?, ?, ?, ?> hash) {
// hash().isOpen() check guarantees no starvation of a thread calling chMap.close() and
// trying to close this context by closeContext() method below, while the thread owning this
// context frequently locks and unlocks it (e. ... | [
"public",
"boolean",
"lockContextLocally",
"(",
"ChronicleHash",
"<",
"?",
",",
"?",
",",
"?",
",",
"?",
">",
"hash",
")",
"{",
"// hash().isOpen() check guarantees no starvation of a thread calling chMap.close() and",
"// trying to close this context by closeContext() method bel... | Returns {@code true} if this is the outer context lock in this thread, {@code false} if this
is a nested context. | [
"Returns",
"{"
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/stage/hash/ThreadLocalState.java#L55-L72 |
kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java | ImageComponent.pointToPixel | public Point pointToPixel(Point p, boolean clipToImage) {
"""
Returns the image pixel corresponding to the given point. If the <code>clipToImage</code>
parameter is <code>false</code>, then the function will return an appropriately positioned
pixel on an infinite plane, even if the point is outside the image bou... | java | public Point pointToPixel(Point p, boolean clipToImage) {
Point2D.Double fp=new Point2D.Double(p.x+.5, p.y+.5);
try {
getImageTransform().inverseTransform(fp, fp);
} catch (NoninvertibleTransformException ex) {
throw new Error("Image transformation not invertible");
}
p.x=(int)Math.floor(fp.x);
p.y=(i... | [
"public",
"Point",
"pointToPixel",
"(",
"Point",
"p",
",",
"boolean",
"clipToImage",
")",
"{",
"Point2D",
".",
"Double",
"fp",
"=",
"new",
"Point2D",
".",
"Double",
"(",
"p",
".",
"x",
"+",
".5",
",",
"p",
".",
"y",
"+",
".5",
")",
";",
"try",
"{... | Returns the image pixel corresponding to the given point. If the <code>clipToImage</code>
parameter is <code>false</code>, then the function will return an appropriately positioned
pixel on an infinite plane, even if the point is outside the image bounds. If
<code>clipToImage</code> is <code>true</code> then the functi... | [
"Returns",
"the",
"image",
"pixel",
"corresponding",
"to",
"the",
"given",
"point",
".",
"If",
"the",
"<code",
">",
"clipToImage<",
"/",
"code",
">",
"parameter",
"is",
"<code",
">",
"false<",
"/",
"code",
">",
"then",
"the",
"function",
"will",
"return",
... | train | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/ImageComponent.java#L296-L309 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java | NaaccrXmlUtils.createWriter | public static Writer createWriter(File file) throws NaaccrIOException {
"""
Returns a generic writer for the provided file, taking care of the optional GZ compression.
@param file file to create the writer from, cannot be null
@return a generic writer to the file, never null
@throws NaaccrIOException if the wri... | java | public static Writer createWriter(File file) throws NaaccrIOException {
OutputStream os = null;
try {
os = new FileOutputStream(file);
if (file.getName().endsWith(".gz"))
os = new GZIPOutputStream(os);
return new OutputStreamWriter(os, StandardCharse... | [
"public",
"static",
"Writer",
"createWriter",
"(",
"File",
"file",
")",
"throws",
"NaaccrIOException",
"{",
"OutputStream",
"os",
"=",
"null",
";",
"try",
"{",
"os",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"if",
"(",
"file",
".",
"getName",
... | Returns a generic writer for the provided file, taking care of the optional GZ compression.
@param file file to create the writer from, cannot be null
@return a generic writer to the file, never null
@throws NaaccrIOException if the writer cannot be created | [
"Returns",
"a",
"generic",
"writer",
"for",
"the",
"provided",
"file",
"taking",
"care",
"of",
"the",
"optional",
"GZ",
"compression",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java#L504-L525 |
GerdHolz/TOVAL | src/de/invation/code/toval/types/HashList.java | HashList.addAll | public boolean addAll(int index, Collection<? extends E> c) {
"""
Inserts all of the elements in the specified Collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new eleme... | java | public boolean addAll(int index, Collection<? extends E> c) {
removeNulls(c);
c.removeAll(this);
return super.addAll(index, c);
} | [
"public",
"boolean",
"addAll",
"(",
"int",
"index",
",",
"Collection",
"<",
"?",
"extends",
"E",
">",
"c",
")",
"{",
"removeNulls",
"(",
"c",
")",
";",
"c",
".",
"removeAll",
"(",
"this",
")",
";",
"return",
"super",
".",
"addAll",
"(",
"index",
",... | Inserts all of the elements in the specified Collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new elements will appear
in the list in the order that they are returned by the
spe... | [
"Inserts",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"Collection",
"into",
"this",
"list",
"starting",
"at",
"the",
"specified",
"position",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/HashList.java#L124-L128 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/JBBPNamedNumericFieldMap.java | JBBPNamedNumericFieldMap.getExternalFieldValue | public int getExternalFieldValue(final String externalFieldName, final JBBPCompiledBlock compiledBlock, final JBBPIntegerValueEvaluator evaluator) {
"""
Ask the registered external value provider for a field value.
@param externalFieldName the name of a field, it must not be null
@param compiledBlock the c... | java | public int getExternalFieldValue(final String externalFieldName, final JBBPCompiledBlock compiledBlock, final JBBPIntegerValueEvaluator evaluator) {
final String normalizedName = JBBPUtils.normalizeFieldNameOrPath(externalFieldName);
if (this.externalValueProvider == null) {
throw new JBBPEvalException("R... | [
"public",
"int",
"getExternalFieldValue",
"(",
"final",
"String",
"externalFieldName",
",",
"final",
"JBBPCompiledBlock",
"compiledBlock",
",",
"final",
"JBBPIntegerValueEvaluator",
"evaluator",
")",
"{",
"final",
"String",
"normalizedName",
"=",
"JBBPUtils",
".",
"norm... | Ask the registered external value provider for a field value.
@param externalFieldName the name of a field, it must not be null
@param compiledBlock the compiled block, it must not be null
@param evaluator an evaluator which is calling the method, it can be null
@return integer value for the field
@throws ... | [
"Ask",
"the",
"registered",
"external",
"value",
"provider",
"for",
"a",
"field",
"value",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/JBBPNamedNumericFieldMap.java#L296-L303 |
jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/TimeDescriptionStrategy.java | TimeDescriptionStrategy.ensureInstance | private FieldExpression ensureInstance(final FieldExpression expression, final FieldExpression defaultExpression) {
"""
Give an expression instance, will return it if is not null. Otherwise will return the defaultExpression;
@param expression - CronFieldExpression instance; may be null
@param defaultExp... | java | private FieldExpression ensureInstance(final FieldExpression expression, final FieldExpression defaultExpression) {
Preconditions.checkNotNull(defaultExpression, "Default expression must not be null");
if (expression != null) {
return expression;
} else {
return defaultEx... | [
"private",
"FieldExpression",
"ensureInstance",
"(",
"final",
"FieldExpression",
"expression",
",",
"final",
"FieldExpression",
"defaultExpression",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"defaultExpression",
",",
"\"Default expression must not be null\"",
")",
... | Give an expression instance, will return it if is not null. Otherwise will return the defaultExpression;
@param expression - CronFieldExpression instance; may be null
@param defaultExpression - CronFieldExpression, never null;
@return the given expression or the given defaultExpression in case the given express... | [
"Give",
"an",
"expression",
"instance",
"will",
"return",
"it",
"if",
"is",
"not",
"null",
".",
"Otherwise",
"will",
"return",
"the",
"defaultExpression",
";"
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/TimeDescriptionStrategy.java#L73-L80 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.findGenericClass | public static Class<?> findGenericClass(final Class<?> mainClass, final Class<?> assignableClass) {
"""
Return the generic class for the given parent class and index.
@param mainClass the parent class
@param assignableClass the parent type of the generic to build
@return the class of the generic type accord... | java | public static Class<?> findGenericClass(final Class<?> mainClass, final Class<?> assignableClass) {
return findGenericClass(mainClass, new Class<?>[] { assignableClass });
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"findGenericClass",
"(",
"final",
"Class",
"<",
"?",
">",
"mainClass",
",",
"final",
"Class",
"<",
"?",
">",
"assignableClass",
")",
"{",
"return",
"findGenericClass",
"(",
"mainClass",
",",
"new",
"Class",
"<",
... | Return the generic class for the given parent class and index.
@param mainClass the parent class
@param assignableClass the parent type of the generic to build
@return the class of the generic type according to the index provided or null if not found | [
"Return",
"the",
"generic",
"class",
"for",
"the",
"given",
"parent",
"class",
"and",
"index",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L202-L204 |
nemerosa/ontrack | ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/PropertyController.java | PropertyController.getPropertyEditionForm | @RequestMapping(value = " {
"""
Gets the edition form for a given property for an entity. The content of the form may be filled or not,
according to the fact if the property is actually set for this entity or not. If the property is not
opened for edition, the call could be rejected with an authorization excepti... | java | @RequestMapping(value = "{entityType}/{id}/{propertyTypeName}/edit", method = RequestMethod.GET)
public Form getPropertyEditionForm(@PathVariable ProjectEntityType entityType, @PathVariable ID id, @PathVariable String propertyTypeName) {
return propertyService.getPropertyEditionForm(
getEnti... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"{entityType}/{id}/{propertyTypeName}/edit\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"Form",
"getPropertyEditionForm",
"(",
"@",
"PathVariable",
"ProjectEntityType",
"entityType",
",",
"@",
"PathVaria... | Gets the edition form for a given property for an entity. The content of the form may be filled or not,
according to the fact if the property is actually set for this entity or not. If the property is not
opened for edition, the call could be rejected with an authorization exception.
@param entityType Type of th... | [
"Gets",
"the",
"edition",
"form",
"for",
"a",
"given",
"property",
"for",
"an",
"entity",
".",
"The",
"content",
"of",
"the",
"form",
"may",
"be",
"filled",
"or",
"not",
"according",
"to",
"the",
"fact",
"if",
"the",
"property",
"is",
"actually",
"set",
... | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/PropertyController.java#L94-L100 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.getLongProperty | public static Long getLongProperty(Map<String, Object> properties, String key, long defaultVal) {
"""
Get long type property value from a property map.
<p>
If {@code properties} is null or property value is null, default value is returned
@param properties map of properties
@param key property name
@... | java | public static Long getLongProperty(Map<String, Object> properties, String key, long defaultVal) {
if (properties == null) {
return defaultVal;
}
Object propertyVal = properties.get(key);
if (propertyVal == null) {
return defaultVal;
}
if (!(pro... | [
"public",
"static",
"Long",
"getLongProperty",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"String",
"key",
",",
"long",
"defaultVal",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"return",
"defaultVal",
";",
"}",
"Obj... | Get long type property value from a property map.
<p>
If {@code properties} is null or property value is null, default value is returned
@param properties map of properties
@param key property name
@param defaultVal default value of the property
@return integer value of the property, | [
"Get",
"long",
"type",
"property",
"value",
"from",
"a",
"property",
"map",
".",
"<p",
">",
"If",
"{",
"@code",
"properties",
"}",
"is",
"null",
"or",
"property",
"value",
"is",
"null",
"default",
"value",
"is",
"returned"
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L496-L513 |
i-net-software/jlessc | src/com/inet/lib/less/SelectorUtils.java | SelectorUtils.replacePlaceHolder | static String replacePlaceHolder( CssFormatter formatter, String str, LessObject caller ) {
"""
Replace the possible variable place holder.
@param formatter current formatter
@param str the string
@param caller for exception handling
@return the result
"""
int pos = str.startsWith( "@{" ) ? 0 : str... | java | static String replacePlaceHolder( CssFormatter formatter, String str, LessObject caller ) {
int pos = str.startsWith( "@{" ) ? 0 : str.indexOf( "@", 1 );
if( pos >= 0 ) {
formatter.addOutput();
SelectorUtils.appendToWithPlaceHolder( formatter, str, pos, false, caller );
... | [
"static",
"String",
"replacePlaceHolder",
"(",
"CssFormatter",
"formatter",
",",
"String",
"str",
",",
"LessObject",
"caller",
")",
"{",
"int",
"pos",
"=",
"str",
".",
"startsWith",
"(",
"\"@{\"",
")",
"?",
"0",
":",
"str",
".",
"indexOf",
"(",
"\"@\"",
... | Replace the possible variable place holder.
@param formatter current formatter
@param str the string
@param caller for exception handling
@return the result | [
"Replace",
"the",
"possible",
"variable",
"place",
"holder",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/SelectorUtils.java#L213-L221 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java | MapUtils.isPointNearMarker | public static boolean isPointNearMarker(LatLng point, MarkerOptions shapeMarker, double tolerance) {
"""
Is the point near the shape marker
@param point point
@param shapeMarker shape marker
@param tolerance distance tolerance
@return true if near
"""
return isPointNearPoint(point, shapeM... | java | public static boolean isPointNearMarker(LatLng point, MarkerOptions shapeMarker, double tolerance) {
return isPointNearPoint(point, shapeMarker.getPosition(), tolerance);
} | [
"public",
"static",
"boolean",
"isPointNearMarker",
"(",
"LatLng",
"point",
",",
"MarkerOptions",
"shapeMarker",
",",
"double",
"tolerance",
")",
"{",
"return",
"isPointNearPoint",
"(",
"point",
",",
"shapeMarker",
".",
"getPosition",
"(",
")",
",",
"tolerance",
... | Is the point near the shape marker
@param point point
@param shapeMarker shape marker
@param tolerance distance tolerance
@return true if near | [
"Is",
"the",
"point",
"near",
"the",
"shape",
"marker"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java#L281-L283 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.updateHtindex | void updateHtindex(int index, long value, int tableid) {
"""
************************************************************************
Write the object pointer to the table. If we are in the process of
doubling, this method finds the correct table to update (since there are
two tables active during the doubling ... | java | void updateHtindex(int index, long value, int tableid) {
if (tableid == header.currentTableId()) {
htindex[index] = value;
} else {
new_htindex[index] = value;
}
} | [
"void",
"updateHtindex",
"(",
"int",
"index",
",",
"long",
"value",
",",
"int",
"tableid",
")",
"{",
"if",
"(",
"tableid",
"==",
"header",
".",
"currentTableId",
"(",
")",
")",
"{",
"htindex",
"[",
"index",
"]",
"=",
"value",
";",
"}",
"else",
"{",
... | ************************************************************************
Write the object pointer to the table. If we are in the process of
doubling, this method finds the correct table to update (since there are
two tables active during the doubling process).
***********************************************************... | [
"************************************************************************",
"Write",
"the",
"object",
"pointer",
"to",
"the",
"table",
".",
"If",
"we",
"are",
"in",
"the",
"process",
"of",
"doubling",
"this",
"method",
"finds",
"the",
"correct",
"table",
"to",
"update... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1433-L1439 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.createGroup | public static BoxGroup.Info createGroup(BoxAPIConnection api, String name) {
"""
Creates a new group with a specified name.
@param api the API connection to be used by the group.
@param name the name of the new group.
@return info about the created group.
"""
return createGroup(api, name, nu... | java | public static BoxGroup.Info createGroup(BoxAPIConnection api, String name) {
return createGroup(api, name, null, null, null, null, null);
} | [
"public",
"static",
"BoxGroup",
".",
"Info",
"createGroup",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
")",
"{",
"return",
"createGroup",
"(",
"api",
",",
"name",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}... | Creates a new group with a specified name.
@param api the API connection to be used by the group.
@param name the name of the new group.
@return info about the created group. | [
"Creates",
"a",
"new",
"group",
"with",
"a",
"specified",
"name",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L63-L65 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowCollect | public static <E, T> Stream<T> shiftingWindowCollect(Stream<E> stream, int rollingFactor, Collector<? super E, ?, ? extends T> collector) {
"""
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps consists in building a rolling stream with the <code>rollingFact... | java | public static <E, T> Stream<T> shiftingWindowCollect(Stream<E> stream, int rollingFactor, Collector<? super E, ?, ? extends T> collector) {
Objects.requireNonNull(stream);
Objects.requireNonNull(collector);
return roll(stream, rollingFactor).map(str -> str.collect(collector));
} | [
"public",
"static",
"<",
"E",
",",
"T",
">",
"Stream",
"<",
"T",
">",
"shiftingWindowCollect",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"rollingFactor",
",",
"Collector",
"<",
"?",
"super",
"E",
",",
"?",
",",
"?",
"extends",
"T",
">",
"... | <p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps consists in building a rolling stream with the <code>rollingFactor</code> passed as
a parameter. This rolling stream is the same the one built using the <code>roll()</code> method.
</p>
<p>Then each substream is co... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"stream",
"following",
"two",
"steps",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"first",
"steps",
"consists",
"in",
"building",
"a",
"rolling",
"stream",
"with",
... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L536-L541 |
Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java | Presenter.transformToPresenterEvent | @NonNull
private static ObservableTransformer<byte[], PresenterEvent> transformToPresenterEvent(Type type) {
"""
A convenience function creating a transformer that will wrap the emissions in either {@link ResultEvent} or {@link ErrorEvent}
with a given {@link Type}
@param type the type to wrap with
@retur... | java | @NonNull
private static ObservableTransformer<byte[], PresenterEvent> transformToPresenterEvent(Type type) {
return observable -> observable.map(writtenBytes -> ((PresenterEvent) new ResultEvent(writtenBytes, type)))
.onErrorReturn(throwable -> new ErrorEvent(throwable, type));
} | [
"@",
"NonNull",
"private",
"static",
"ObservableTransformer",
"<",
"byte",
"[",
"]",
",",
"PresenterEvent",
">",
"transformToPresenterEvent",
"(",
"Type",
"type",
")",
"{",
"return",
"observable",
"->",
"observable",
".",
"map",
"(",
"writtenBytes",
"->",
"(",
... | A convenience function creating a transformer that will wrap the emissions in either {@link ResultEvent} or {@link ErrorEvent}
with a given {@link Type}
@param type the type to wrap with
@return transformer that will emit an observable that will be emitting ResultEvent or ErrorEvent with a given type | [
"A",
"convenience",
"function",
"creating",
"a",
"transformer",
"that",
"will",
"wrap",
"the",
"emissions",
"in",
"either",
"{",
"@link",
"ResultEvent",
"}",
"or",
"{",
"@link",
"ErrorEvent",
"}",
"with",
"a",
"given",
"{",
"@link",
"Type",
"}"
] | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java#L233-L237 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.marketplace_removeListing | public boolean marketplace_removeListing(Long listingId, CharSequence status)
throws FacebookException, IOException {
"""
Remove a marketplace listing
@param listingId the listing to be removed
@param status MARKETPLACE_STATUS_DEFAULT, MARKETPLACE_STATUS_SUCCESS, or MARKETPLACE_STATUS_NOT_SUCCESS
@return bo... | java | public boolean marketplace_removeListing(Long listingId, CharSequence status)
throws FacebookException, IOException {
assert MARKETPLACE_STATUS_DEFAULT.equals(status) || MARKETPLACE_STATUS_SUCCESS.equals(status) ||
MARKETPLACE_STATUS_NOT_SUCCESS.equals(status) : "Invalid status: " + status;
T result ... | [
"public",
"boolean",
"marketplace_removeListing",
"(",
"Long",
"listingId",
",",
"CharSequence",
"status",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"assert",
"MARKETPLACE_STATUS_DEFAULT",
".",
"equals",
"(",
"status",
")",
"||",
"MARKETPLACE_STATUS_S... | Remove a marketplace listing
@param listingId the listing to be removed
@param status MARKETPLACE_STATUS_DEFAULT, MARKETPLACE_STATUS_SUCCESS, or MARKETPLACE_STATUS_NOT_SUCCESS
@return boolean indicating whether the listing was removed
@see <a href="http://wiki.developers.facebook.com/index.php/Marketplace.removeListing... | [
"Remove",
"a",
"marketplace",
"listing"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1980-L1990 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getTriangleCentroid | public static Coordinate getTriangleCentroid( Coordinate A, Coordinate B, Coordinate C ) {
"""
Get the 3d centroid {@link Coordinate} of a triangle.
@param A coordinate 1.
@param B coordinate 2.
@param C coordinate 3.
@return the centroid coordinate.
"""
double cx = (A.x + B.x + C.x) / 3.0;
... | java | public static Coordinate getTriangleCentroid( Coordinate A, Coordinate B, Coordinate C ) {
double cx = (A.x + B.x + C.x) / 3.0;
double cy = (A.y + B.y + C.y) / 3.0;
double cz = (A.z + B.z + C.z) / 3.0;
return new Coordinate(cx, cy, cz);
} | [
"public",
"static",
"Coordinate",
"getTriangleCentroid",
"(",
"Coordinate",
"A",
",",
"Coordinate",
"B",
",",
"Coordinate",
"C",
")",
"{",
"double",
"cx",
"=",
"(",
"A",
".",
"x",
"+",
"B",
".",
"x",
"+",
"C",
".",
"x",
")",
"/",
"3.0",
";",
"doubl... | Get the 3d centroid {@link Coordinate} of a triangle.
@param A coordinate 1.
@param B coordinate 2.
@param C coordinate 3.
@return the centroid coordinate. | [
"Get",
"the",
"3d",
"centroid",
"{",
"@link",
"Coordinate",
"}",
"of",
"a",
"triangle",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L891-L896 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java | CryptoPrimitives.bytesToPrivateKey | public PrivateKey bytesToPrivateKey(byte[] pemKey) throws CryptoException {
"""
Return PrivateKey from pem bytes.
@param pemKey pem-encoded private key
@return
"""
PrivateKey pk = null;
CryptoException ce = null;
try {
PemReader pr = new PemReader(new StringReader(new ... | java | public PrivateKey bytesToPrivateKey(byte[] pemKey) throws CryptoException {
PrivateKey pk = null;
CryptoException ce = null;
try {
PemReader pr = new PemReader(new StringReader(new String(pemKey)));
PemObject po = pr.readPemObject();
PEMParser pem = new PEMPa... | [
"public",
"PrivateKey",
"bytesToPrivateKey",
"(",
"byte",
"[",
"]",
"pemKey",
")",
"throws",
"CryptoException",
"{",
"PrivateKey",
"pk",
"=",
"null",
";",
"CryptoException",
"ce",
"=",
"null",
";",
"try",
"{",
"PemReader",
"pr",
"=",
"new",
"PemReader",
"(",... | Return PrivateKey from pem bytes.
@param pemKey pem-encoded private key
@return | [
"Return",
"PrivateKey",
"from",
"pem",
"bytes",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/security/CryptoPrimitives.java#L273-L293 |
abego/treelayout | org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java | TreeLayout.firstWalk | private void firstWalk(TreeNode v, TreeNode leftSibling) {
"""
In difference to the original algorithm we also pass in the leftSibling
(see {@link #apportion(Object, Object, Object, Object)} for a
motivation).
@param v
@param leftSibling
[nullable] the left sibling v, if there is any
"""
if (tree.isLe... | java | private void firstWalk(TreeNode v, TreeNode leftSibling) {
if (tree.isLeaf(v)) {
// No need to set prelim(v) to 0 as the getter takes care of this.
TreeNode w = leftSibling;
if (w != null) {
// v has left sibling
setPrelim(v, getPrelim(w) + getDistance(v, w));
}
} else {
// v is not a leaf... | [
"private",
"void",
"firstWalk",
"(",
"TreeNode",
"v",
",",
"TreeNode",
"leftSibling",
")",
"{",
"if",
"(",
"tree",
".",
"isLeaf",
"(",
"v",
")",
")",
"{",
"// No need to set prelim(v) to 0 as the getter takes care of this.",
"TreeNode",
"w",
"=",
"leftSibling",
";... | In difference to the original algorithm we also pass in the leftSibling
(see {@link #apportion(Object, Object, Object, Object)} for a
motivation).
@param v
@param leftSibling
[nullable] the left sibling v, if there is any | [
"In",
"difference",
"to",
"the",
"original",
"algorithm",
"we",
"also",
"pass",
"in",
"the",
"leftSibling",
"(",
"see",
"{",
"@link",
"#apportion",
"(",
"Object",
"Object",
"Object",
"Object",
")",
"}",
"for",
"a",
"motivation",
")",
"."
] | train | https://github.com/abego/treelayout/blob/aa73af5803c6ec30db0b4ad192c7cba55d0862d2/org.abego.treelayout/src/main/java/org/abego/treelayout/TreeLayout.java#L593-L631 |
Credntia/MVBarcodeReader | mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java | BarcodeCaptureFragment.requestCameraPermission | private void requestCameraPermission() {
"""
Handles the requesting of the camera permission. This includes
showing a "Snackbar" message of why the permission is needed then
sending the request.
"""
Log.w("BARCODE-SCANNER", "Camera permission is not granted. Requesting permission");
final S... | java | private void requestCameraPermission() {
Log.w("BARCODE-SCANNER", "Camera permission is not granted. Requesting permission");
final String[] permissions = new String[]{Manifest.permission.CAMERA};
if (!shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) {
requestPermi... | [
"private",
"void",
"requestCameraPermission",
"(",
")",
"{",
"Log",
".",
"w",
"(",
"\"BARCODE-SCANNER\"",
",",
"\"Camera permission is not granted. Requesting permission\"",
")",
";",
"final",
"String",
"[",
"]",
"permissions",
"=",
"new",
"String",
"[",
"]",
"{",
... | Handles the requesting of the camera permission. This includes
showing a "Snackbar" message of why the permission is needed then
sending the request. | [
"Handles",
"the",
"requesting",
"of",
"the",
"camera",
"permission",
".",
"This",
"includes",
"showing",
"a",
"Snackbar",
"message",
"of",
"why",
"the",
"permission",
"is",
"needed",
"then",
"sending",
"the",
"request",
"."
] | train | https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java#L274-L307 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/component/SeaGlassTitlePane.java | SeaGlassTitlePane.getTitle | private String getTitle(String text, FontMetrics fm, int availTextWidth) {
"""
Get the title text, clipped if necessary.
@param text the title text.
@param fm the font metrics to compute size with.
@param availTextWidth the available space to display the title in.
@return the text,... | java | private String getTitle(String text, FontMetrics fm, int availTextWidth) {
return SwingUtilities2.clipStringIfNecessary(rootPane, fm, text, availTextWidth);
} | [
"private",
"String",
"getTitle",
"(",
"String",
"text",
",",
"FontMetrics",
"fm",
",",
"int",
"availTextWidth",
")",
"{",
"return",
"SwingUtilities2",
".",
"clipStringIfNecessary",
"(",
"rootPane",
",",
"fm",
",",
"text",
",",
"availTextWidth",
")",
";",
"}"
] | Get the title text, clipped if necessary.
@param text the title text.
@param fm the font metrics to compute size with.
@param availTextWidth the available space to display the title in.
@return the text, clipped to fit the available space. | [
"Get",
"the",
"title",
"text",
"clipped",
"if",
"necessary",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/component/SeaGlassTitlePane.java#L762-L764 |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ReflectUtils.java | ReflectUtils.getValue | @SuppressWarnings("unchecked")
public static <T> T getValue(Field field, Object self) {
"""
Sets the specified field value while wrapping checked exception in a {@link ShedException}.
@param field the field.
@param self the instance to get the value from.
@param <T> the type of the field value.
@retur... | java | @SuppressWarnings("unchecked")
public static <T> T getValue(Field field, Object self) {
try {
return (T) field.get(self);
} catch (IllegalAccessException e) {
throw ShedException.wrap(e, ShedErrorCode.UNABLE_TO_GET_FIELD)
.put("field", field.toGenericStrin... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getValue",
"(",
"Field",
"field",
",",
"Object",
"self",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"field",
".",
"get",
"(",
"self",
")",
";",
"}",
"c... | Sets the specified field value while wrapping checked exception in a {@link ShedException}.
@param field the field.
@param self the instance to get the value from.
@param <T> the type of the field value.
@return the field value. | [
"Sets",
"the",
"specified",
"field",
"value",
"while",
"wrapping",
"checked",
"exception",
"in",
"a",
"{",
"@link",
"ShedException",
"}",
"."
] | train | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ReflectUtils.java#L85-L93 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.getPixelRelativeToTile | public static Point getPixelRelativeToTile(LatLong latLong, Tile tile) {
"""
Calculates the absolute pixel position for a tile and tile size relative to origin
@param latLong the geographic position.
@param tile tile
@return the relative pixel position to the origin values (e.g. for a tile)
"""
... | java | public static Point getPixelRelativeToTile(LatLong latLong, Tile tile) {
return getPixelRelative(latLong, tile.mapSize, tile.getOrigin());
} | [
"public",
"static",
"Point",
"getPixelRelativeToTile",
"(",
"LatLong",
"latLong",
",",
"Tile",
"tile",
")",
"{",
"return",
"getPixelRelative",
"(",
"latLong",
",",
"tile",
".",
"mapSize",
",",
"tile",
".",
"getOrigin",
"(",
")",
")",
";",
"}"
] | Calculates the absolute pixel position for a tile and tile size relative to origin
@param latLong the geographic position.
@param tile tile
@return the relative pixel position to the origin values (e.g. for a tile) | [
"Calculates",
"the",
"absolute",
"pixel",
"position",
"for",
"a",
"tile",
"and",
"tile",
"size",
"relative",
"to",
"origin"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L175-L177 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.listRoutesTable | public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
"""
Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param resourceGroupName The... | java | public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().last().body();
} | [
"public",
"ExpressRouteCircuitsRoutesTableListResultInner",
"listRoutesTable",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"listRoutesTableWithServiceResponseAsync",
"("... | Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@param devicePath The path of t... | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"associated",
"with",
"the",
"express",
"route",
"cross",
"connection",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L1286-L1288 |
voldemort/voldemort | src/java/voldemort/store/stats/StoreStats.java | StoreStats.recordGetTime | public void recordGetTime(long timeNS, boolean emptyResponse, long totalBytes, long keyBytes) {
"""
Record the duration of a get operation, along with whether or not an
empty response (ie no values matched) and the size of the values
returned.
"""
recordTime(Tracked.GET, timeNS, emptyResponse ? 1 : 0... | java | public void recordGetTime(long timeNS, boolean emptyResponse, long totalBytes, long keyBytes) {
recordTime(Tracked.GET, timeNS, emptyResponse ? 1 : 0, totalBytes, keyBytes, 0);
} | [
"public",
"void",
"recordGetTime",
"(",
"long",
"timeNS",
",",
"boolean",
"emptyResponse",
",",
"long",
"totalBytes",
",",
"long",
"keyBytes",
")",
"{",
"recordTime",
"(",
"Tracked",
".",
"GET",
",",
"timeNS",
",",
"emptyResponse",
"?",
"1",
":",
"0",
",",... | Record the duration of a get operation, along with whether or not an
empty response (ie no values matched) and the size of the values
returned. | [
"Record",
"the",
"duration",
"of",
"a",
"get",
"operation",
"along",
"with",
"whether",
"or",
"not",
"an",
"empty",
"response",
"(",
"ie",
"no",
"values",
"matched",
")",
"and",
"the",
"size",
"of",
"the",
"values",
"returned",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/StoreStats.java#L113-L115 |
threerings/nenya | core/src/main/java/com/threerings/cast/bundle/BundleUtil.java | BundleUtil.loadObject | public static Object loadObject (ResourceBundle bundle, String path, boolean wipeOnFailure)
throws IOException, ClassNotFoundException {
"""
Attempts to load an object from the supplied resource bundle with the specified path.
@param wipeOnFailure if there is an error reading the object from the bundle ... | java | public static Object loadObject (ResourceBundle bundle, String path, boolean wipeOnFailure)
throws IOException, ClassNotFoundException
{
InputStream bin = null;
try {
bin = bundle.getResource(path);
if (bin == null) {
return null;
}
... | [
"public",
"static",
"Object",
"loadObject",
"(",
"ResourceBundle",
"bundle",
",",
"String",
"path",
",",
"boolean",
"wipeOnFailure",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"InputStream",
"bin",
"=",
"null",
";",
"try",
"{",
"bin",
"=",... | Attempts to load an object from the supplied resource bundle with the specified path.
@param wipeOnFailure if there is an error reading the object from the bundle and this
parameter is true, we will instruct the bundle to delete its underlying jar file before
propagating the exception with the expectation that it will... | [
"Attempts",
"to",
"load",
"an",
"object",
"from",
"the",
"supplied",
"resource",
"bundle",
"with",
"the",
"specified",
"path",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/bundle/BundleUtil.java#L70-L101 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java | JDBCStorageConnection.itemData | private ItemData itemData(QPath parentPath, ResultSet item, int itemClass, AccessControlList parentACL)
throws RepositoryException, SQLException, IOException {
"""
Build ItemData.
@param parentPath
- parent path
@param item
database - ResultSet with Item record(s)
@param itemClass
- Item type (Node o... | java | private ItemData itemData(QPath parentPath, ResultSet item, int itemClass, AccessControlList parentACL)
throws RepositoryException, SQLException, IOException
{
String cid = item.getString(COLUMN_ID);
String cname = item.getString(COLUMN_NAME);
int cversion = item.getInt(COLUMN_VERSION);
... | [
"private",
"ItemData",
"itemData",
"(",
"QPath",
"parentPath",
",",
"ResultSet",
"item",
",",
"int",
"itemClass",
",",
"AccessControlList",
"parentACL",
")",
"throws",
"RepositoryException",
",",
"SQLException",
",",
"IOException",
"{",
"String",
"cid",
"=",
"item... | Build ItemData.
@param parentPath
- parent path
@param item
database - ResultSet with Item record(s)
@param itemClass
- Item type (Node or Property)
@param parentACL
- parent ACL
@return ItemData instance
@throws RepositoryException
Repository error
@throws SQLException
database error
@throws IOException
I/O error | [
"Build",
"ItemData",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java#L1984-L2013 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java | TmdbConfiguration.getTimezones | public ResultsMap<String, List<String>> getTimezones() throws MovieDbException {
"""
Get the list of supported timezones for the API methods that support them
@return
@throws MovieDbException
"""
URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl();
String... | java | public ResultsMap<String, List<String>> getTimezones() throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl();
String webpage = httpTools.getRequest(url);
List<Map<String, List<String>>> tzList;
try {
tzList = MAPPER... | [
"public",
"ResultsMap",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getTimezones",
"(",
")",
"throws",
"MovieDbException",
"{",
"URL",
"url",
"=",
"new",
"ApiUrl",
"(",
"apiKey",
",",
"MethodBase",
".",
"TIMEZONES",
")",
".",
"subMethod",
"(",
... | Get the list of supported timezones for the API methods that support them
@return
@throws MovieDbException | [
"Get",
"the",
"list",
"of",
"supported",
"timezones",
"for",
"the",
"API",
"methods",
"that",
"support",
"them"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java#L112-L133 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getAuthenticationCookie | protected Authentication getAuthenticationCookie(HttpServerExchange exchange) {
"""
Retrieves the current authentication from the HttpServerExchange
@param exchange The Undertow HttpServerExchange
"""
Authentication authentication = Authentication.create().withSubject(null);
String ... | java | protected Authentication getAuthenticationCookie(HttpServerExchange exchange) {
Authentication authentication = Authentication.create().withSubject(null);
String cookieValue = getCookieValue(exchange, this.config.getAuthenticationCookieName());
if (StringUtils.isNotBlank(cookieValue)) {... | [
"protected",
"Authentication",
"getAuthenticationCookie",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Authentication",
"authentication",
"=",
"Authentication",
".",
"create",
"(",
")",
".",
"withSubject",
"(",
"null",
")",
";",
"String",
"cookieValue",
"=",
"g... | Retrieves the current authentication from the HttpServerExchange
@param exchange The Undertow HttpServerExchange | [
"Retrieves",
"the",
"current",
"authentication",
"from",
"the",
"HttpServerExchange"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L123-L159 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java | ClientService.setFriendlyName | public Client setFriendlyName(int profileId, String clientUUID, String friendlyName) throws Exception {
"""
Set a friendly name for a client
@param profileId profileId of the client
@param clientUUID UUID of the client
@param friendlyName friendly name of the client
@return return Client object or null
@thr... | java | public Client setFriendlyName(int profileId, String clientUUID, String friendlyName) throws Exception {
// first see if this friendlyName is already in use
Client client = this.findClientFromFriendlyName(profileId, friendlyName);
if (client != null && !client.getUUID().equals(clientUUID)) {
... | [
"public",
"Client",
"setFriendlyName",
"(",
"int",
"profileId",
",",
"String",
"clientUUID",
",",
"String",
"friendlyName",
")",
"throws",
"Exception",
"{",
"// first see if this friendlyName is already in use",
"Client",
"client",
"=",
"this",
".",
"findClientFromFriendl... | Set a friendly name for a client
@param profileId profileId of the client
@param clientUUID UUID of the client
@param friendlyName friendly name of the client
@return return Client object or null
@throws Exception exception | [
"Set",
"a",
"friendly",
"name",
"for",
"a",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L382-L419 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/solvers/ConjugateGradient.java | ConjugateGradient.solveCGNR | public static Vec solveCGNR(double eps, Matrix A, Vec x, Vec b) {
"""
Uses the Conjugate Gradient method to compute the least squares solution to a system
of linear equations.<br>
Computes the least squares solution to A x = b. Where A is an m x n matrix and b is
a vector of length m and x is a vector of length... | java | public static Vec solveCGNR(double eps, Matrix A, Vec x, Vec b)
{
if(A.rows() != b.length())
throw new ArithmeticException("Dimensions do not agree for Matrix A and Vector b");
else if(A.cols() != x.length())
throw new ArithmeticException("Dimensions do not agree for Matrix A... | [
"public",
"static",
"Vec",
"solveCGNR",
"(",
"double",
"eps",
",",
"Matrix",
"A",
",",
"Vec",
"x",
",",
"Vec",
"b",
")",
"{",
"if",
"(",
"A",
".",
"rows",
"(",
")",
"!=",
"b",
".",
"length",
"(",
")",
")",
"throw",
"new",
"ArithmeticException",
"... | Uses the Conjugate Gradient method to compute the least squares solution to a system
of linear equations.<br>
Computes the least squares solution to A x = b. Where A is an m x n matrix and b is
a vector of length m and x is a vector of length n
<br><br>
NOTE: Unlike {@link #solve(double, jsat.linear.Matrix, jsat.linea... | [
"Uses",
"the",
"Conjugate",
"Gradient",
"method",
"to",
"compute",
"the",
"least",
"squares",
"solution",
"to",
"a",
"system",
"of",
"linear",
"equations",
".",
"<br",
">",
"Computes",
"the",
"least",
"squares",
"solution",
"to",
"A",
"x",
"=",
"b",
".",
... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/solvers/ConjugateGradient.java#L167-L180 |
influxdata/influxdb-java | src/main/java/org/influxdb/impl/InfluxDBImpl.java | InfluxDBImpl.dropRetentionPolicy | @Override
public void dropRetentionPolicy(final String rpName, final String database) {
"""
{@inheritDoc}
@param rpName the name of the retentionPolicy
@param database the name of the database
"""
Preconditions.checkNonEmptyString(rpName, "retentionPolicyName");
Preconditions.checkNonEmptyString(da... | java | @Override
public void dropRetentionPolicy(final String rpName, final String database) {
Preconditions.checkNonEmptyString(rpName, "retentionPolicyName");
Preconditions.checkNonEmptyString(database, "database");
StringBuilder queryBuilder = new StringBuilder("DROP RETENTION POLICY \"");
queryBuilder.ap... | [
"@",
"Override",
"public",
"void",
"dropRetentionPolicy",
"(",
"final",
"String",
"rpName",
",",
"final",
"String",
"database",
")",
"{",
"Preconditions",
".",
"checkNonEmptyString",
"(",
"rpName",
",",
"\"retentionPolicyName\"",
")",
";",
"Preconditions",
".",
"c... | {@inheritDoc}
@param rpName the name of the retentionPolicy
@param database the name of the database | [
"{"
] | train | https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/InfluxDBImpl.java#L917-L927 |
paymill/paymill-java | src/main/java/com/paymill/services/RefundService.java | RefundService.refundTransaction | public Refund refundTransaction( String transactionId, Integer amount, String description ) {
"""
This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at
all. The inserted amount will be refunded to the credit card / direct debit of the original... | java | public Refund refundTransaction( String transactionId, Integer amount, String description ) {
return this.refundTransaction( new Transaction( transactionId ), amount, description );
} | [
"public",
"Refund",
"refundTransaction",
"(",
"String",
"transactionId",
",",
"Integer",
"amount",
",",
"String",
"description",
")",
"{",
"return",
"this",
".",
"refundTransaction",
"(",
"new",
"Transaction",
"(",
"transactionId",
")",
",",
"amount",
",",
"desc... | This function refunds a {@link Transaction} that has been created previously and was refunded in parts or wasn't refunded at
all. The inserted amount will be refunded to the credit card / direct debit of the original {@link Transaction}. There will
be some fees for the merchant for every refund.
<p>
Note:
<ul>
<li>You ... | [
"This",
"function",
"refunds",
"a",
"{"
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/RefundService.java#L157-L159 |
json-path/JsonPath | json-path/src/main/java/com/jayway/jsonpath/JsonPath.java | JsonPath.read | @SuppressWarnings( {
"""
Creates a new JsonPath and applies it to the provided Json object
@param jsonFile json file
@param jsonPath the json path
@param filters filters to be applied to the filter place holders [?] in the path
@param <T> expected return type
@return list of objects matched by the gi... | java | @SuppressWarnings({"unchecked"})
public static <T> T read(File jsonFile, String jsonPath, Predicate... filters) throws IOException {
return new ParseContextImpl().parse(jsonFile).read(jsonPath, filters);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"read",
"(",
"File",
"jsonFile",
",",
"String",
"jsonPath",
",",
"Predicate",
"...",
"filters",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Parse... | Creates a new JsonPath and applies it to the provided Json object
@param jsonFile json file
@param jsonPath the json path
@param filters filters to be applied to the filter place holders [?] in the path
@param <T> expected return type
@return list of objects matched by the given path | [
"Creates",
"a",
"new",
"JsonPath",
"and",
"applies",
"it",
"to",
"the",
"provided",
"Json",
"object"
] | train | https://github.com/json-path/JsonPath/blob/5a09489c3252b74bbf81992aadb3073be59c04f9/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java#L526-L529 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/type/reference/ReferenceImpl.java | ReferenceImpl.referencedElementRemoved | public void referencedElementRemoved(ModelElementInstance referenceTargetElement, Object referenceIdentifier) {
"""
Remove the reference if the target element is removed
@param referenceTargetElement the reference target model element instance, which is removed
@param referenceIdentifier the identifier of th... | java | public void referencedElementRemoved(ModelElementInstance referenceTargetElement, Object referenceIdentifier) {
for (ModelElementInstance referenceSourceElement : findReferenceSourceElements(referenceTargetElement)) {
if (referenceIdentifier.equals(getReferenceIdentifier(referenceSourceElement))) {
re... | [
"public",
"void",
"referencedElementRemoved",
"(",
"ModelElementInstance",
"referenceTargetElement",
",",
"Object",
"referenceIdentifier",
")",
"{",
"for",
"(",
"ModelElementInstance",
"referenceSourceElement",
":",
"findReferenceSourceElements",
"(",
"referenceTargetElement",
... | Remove the reference if the target element is removed
@param referenceTargetElement the reference target model element instance, which is removed
@param referenceIdentifier the identifier of the reference to filter reference source elements | [
"Remove",
"the",
"reference",
"if",
"the",
"target",
"element",
"is",
"removed"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/type/reference/ReferenceImpl.java#L167-L173 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/BaseAsymmetric.java | BaseAsymmetric.init | @SuppressWarnings("unchecked")
protected T init(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
"""
初始化<br>
私钥和公钥同时为空时生成一对新的私钥和公钥<br>
私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密(签名)或者解密(校验)
@param algorithm 算法
@param privateKey 私钥
@param publicKey 公钥
@return this
"""
this.algorithm = algorithm;
... | java | @SuppressWarnings("unchecked")
protected T init(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
this.algorithm = algorithm;
if (null == privateKey && null == publicKey) {
initKeys();
} else {
if (null != privateKey) {
this.privateKey = privateKey;
}
if (null != publicKe... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"T",
"init",
"(",
"String",
"algorithm",
",",
"PrivateKey",
"privateKey",
",",
"PublicKey",
"publicKey",
")",
"{",
"this",
".",
"algorithm",
"=",
"algorithm",
";",
"if",
"(",
"null",
"==",
"pri... | 初始化<br>
私钥和公钥同时为空时生成一对新的私钥和公钥<br>
私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密(签名)或者解密(校验)
@param algorithm 算法
@param privateKey 私钥
@param publicKey 公钥
@return this | [
"初始化<br",
">",
"私钥和公钥同时为空时生成一对新的私钥和公钥<br",
">",
"私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密(签名)或者解密(校验)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/BaseAsymmetric.java#L58-L73 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnCreateViewHolderListenerImpl.java | OnCreateViewHolderListenerImpl.onPreCreateViewHolder | @Override
public RecyclerView.ViewHolder onPreCreateViewHolder(FastAdapter<Item> fastAdapter, ViewGroup parent, int viewType) {
"""
is called inside the onCreateViewHolder method and creates the viewHolder based on the provided viewTyp
@param parent the parent which will host the View
@param viewType the... | java | @Override
public RecyclerView.ViewHolder onPreCreateViewHolder(FastAdapter<Item> fastAdapter, ViewGroup parent, int viewType) {
return fastAdapter.getTypeInstance(viewType).getViewHolder(parent);
} | [
"@",
"Override",
"public",
"RecyclerView",
".",
"ViewHolder",
"onPreCreateViewHolder",
"(",
"FastAdapter",
"<",
"Item",
">",
"fastAdapter",
",",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"return",
"fastAdapter",
".",
"getTypeInstance",
"(",
"viewTyp... | is called inside the onCreateViewHolder method and creates the viewHolder based on the provided viewTyp
@param parent the parent which will host the View
@param viewType the type of the ViewHolder we want to create
@return the generated ViewHolder based on the given viewType | [
"is",
"called",
"inside",
"the",
"onCreateViewHolder",
"method",
"and",
"creates",
"the",
"viewHolder",
"based",
"on",
"the",
"provided",
"viewTyp"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnCreateViewHolderListenerImpl.java#L21-L24 |
groupby/api-java | src/main/java/com/groupbyinc/api/Query.java | Query.addCustomUrlParam | public Query addCustomUrlParam(String key, String value) {
"""
<code>
Sets any additional parameters that can be used to trigger rules.
Takes a name and a value.
JSON Reference:
Custom URL parameters separated by ~ in the form:
{ "customUrlParams": [ { "key": "region", "value": "east" } ] }
</code>
... | java | public Query addCustomUrlParam(String key, String value) {
customUrlParams.add(new CustomUrlParam().setKey(key).setValue(value));
return this;
} | [
"public",
"Query",
"addCustomUrlParam",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"customUrlParams",
".",
"add",
"(",
"new",
"CustomUrlParam",
"(",
")",
".",
"setKey",
"(",
"key",
")",
".",
"setValue",
"(",
"value",
")",
")",
";",
"return",... | <code>
Sets any additional parameters that can be used to trigger rules.
Takes a name and a value.
JSON Reference:
Custom URL parameters separated by ~ in the form:
{ "customUrlParams": [ { "key": "region", "value": "east" } ] }
</code>
@param key
The parameter key
@param value
The parameter value | [
"<code",
">",
"Sets",
"any",
"additional",
"parameters",
"that",
"can",
"be",
"used",
"to",
"trigger",
"rules",
".",
"Takes",
"a",
"name",
"and",
"a",
"value",
"."
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L627-L630 |
motown-io/motown | operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java | ChargingStationEventListener.setReservable | private void setReservable(ChargingStationId chargingStationId, boolean reservable) {
"""
Makes a charging station reservable or not reservable.
@param chargingStationId the charging station to make reservable or not reservable.
@param reservable true if reservable, false if not.
"""
Chargin... | java | private void setReservable(ChargingStationId chargingStationId, boolean reservable) {
ChargingStation chargingStation = repository.findOne(chargingStationId.getId());
if (chargingStation != null) {
chargingStation.setReservable(reservable);
repository.createOrUpdate(chargingStat... | [
"private",
"void",
"setReservable",
"(",
"ChargingStationId",
"chargingStationId",
",",
"boolean",
"reservable",
")",
"{",
"ChargingStation",
"chargingStation",
"=",
"repository",
".",
"findOne",
"(",
"chargingStationId",
".",
"getId",
"(",
")",
")",
";",
"if",
"(... | Makes a charging station reservable or not reservable.
@param chargingStationId the charging station to make reservable or not reservable.
@param reservable true if reservable, false if not. | [
"Makes",
"a",
"charging",
"station",
"reservable",
"or",
"not",
"reservable",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java#L476-L483 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SemanticAPI.java | SemanticAPI.addvoicetorecofortext | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, String lang, URI uri) {
"""
提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param lang 语言,zh_CN 或 en_US,默认中文
@param uri 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22
"""
Http... | java | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, String lang, URI uri) {
HttpPost httpPost = new HttpPost(BASE_URI + "/cgi-bin/media/voice/addvoicetorecofortext");
CloseableHttpClient tempHttpClient = HttpClients.createDefault();
try {
HttpEntity... | [
"public",
"static",
"BaseResult",
"addvoicetorecofortext",
"(",
"String",
"accessToken",
",",
"String",
"voiceId",
",",
"String",
"lang",
",",
"URI",
"uri",
")",
"{",
"HttpPost",
"httpPost",
"=",
"new",
"HttpPost",
"(",
"BASE_URI",
"+",
"\"/cgi-bin/media/voice/add... | 提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param lang 语言,zh_CN 或 en_US,默认中文
@param uri 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22 | [
"提交语音"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SemanticAPI.java#L181-L206 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java | VariantMetadataManager.addFile | public void addFile(String filename, VCFHeader vcfHeader, String studyId) {
"""
Add a variant file metadata (from VCF file and header) to a given variant study metadata (from study ID).
@param filename VCF filename (as an ID)
@param vcfHeader VCF header
@param studyId Study ID
"""
/... | java | public void addFile(String filename, VCFHeader vcfHeader, String studyId) {
// sanity check
if (StringUtils.isEmpty(filename)) {
logger.error("VCF filename is empty or null: '{}'", filename);
return;
}
if (vcfHeader == null) {
logger.error("VCF header ... | [
"public",
"void",
"addFile",
"(",
"String",
"filename",
",",
"VCFHeader",
"vcfHeader",
",",
"String",
"studyId",
")",
"{",
"// sanity check",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"filename",
")",
")",
"{",
"logger",
".",
"error",
"(",
"\"VCF filena... | Add a variant file metadata (from VCF file and header) to a given variant study metadata (from study ID).
@param filename VCF filename (as an ID)
@param vcfHeader VCF header
@param studyId Study ID | [
"Add",
"a",
"variant",
"file",
"metadata",
"(",
"from",
"VCF",
"file",
"and",
"header",
")",
"to",
"a",
"given",
"variant",
"study",
"metadata",
"(",
"from",
"study",
"ID",
")",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L258-L275 |
knowm/XChange | xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/service/CryptonitAccountService.java | CryptonitAccountService.requestDepositAddress | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
"""
This returns the currently set deposit address. It will not generate a new address (ie.
repeated calls will return the same address).
"""
CryptonitDepositAddress response = null;
throw ne... | java | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
CryptonitDepositAddress response = null;
throw new NotYetImplementedForExchangeException();
// return response.getDepositAddress();
} | [
"@",
"Override",
"public",
"String",
"requestDepositAddress",
"(",
"Currency",
"currency",
",",
"String",
"...",
"arguments",
")",
"throws",
"IOException",
"{",
"CryptonitDepositAddress",
"response",
"=",
"null",
";",
"throw",
"new",
"NotYetImplementedForExchangeExcepti... | This returns the currently set deposit address. It will not generate a new address (ie.
repeated calls will return the same address). | [
"This",
"returns",
"the",
"currently",
"set",
"deposit",
"address",
".",
"It",
"will",
"not",
"generate",
"a",
"new",
"address",
"(",
"ie",
".",
"repeated",
"calls",
"will",
"return",
"the",
"same",
"address",
")",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/service/CryptonitAccountService.java#L77-L84 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.forEach | public static <T> void forEach(Enumeration<T> enumeration, Consumer<T> consumer) {
"""
循环遍历 {@link Enumeration},使用{@link Consumer} 接受遍历的每条数据,并针对每条数据做处理
@param <T> 集合元素类型
@param enumeration {@link Enumeration}
@param consumer {@link Consumer} 遍历的每条数据处理器
"""
int index = 0;
while (enumeration.hasMoreEl... | java | public static <T> void forEach(Enumeration<T> enumeration, Consumer<T> consumer) {
int index = 0;
while (enumeration.hasMoreElements()) {
consumer.accept(enumeration.nextElement(), index);
index++;
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"forEach",
"(",
"Enumeration",
"<",
"T",
">",
"enumeration",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"enumeration",
".",
"hasMoreElements",
"(",
")",
... | 循环遍历 {@link Enumeration},使用{@link Consumer} 接受遍历的每条数据,并针对每条数据做处理
@param <T> 集合元素类型
@param enumeration {@link Enumeration}
@param consumer {@link Consumer} 遍历的每条数据处理器 | [
"循环遍历",
"{",
"@link",
"Enumeration",
"}",
",使用",
"{",
"@link",
"Consumer",
"}",
"接受遍历的每条数据,并针对每条数据做处理"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2254-L2260 |
phax/ph-commons | ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java | TreeWithIDSorter.sortByValue | public static <KEYTYPE, DATATYPE extends Comparable <? super DATATYPE>, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByValue (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree) {
"""
Sort each level of the passed tree on the value with the specified
comparator. This method assumes t... | java | public static <KEYTYPE, DATATYPE extends Comparable <? super DATATYPE>, ITEMTYPE extends ITreeItemWithID <KEYTYPE, DATATYPE, ITEMTYPE>> void sortByValue (@Nonnull final IBasicTree <DATATYPE, ITEMTYPE> aTree)
{
_sort (aTree, (o1, o2) -> o1.getData ().compareTo (o2.getData ()));
} | [
"public",
"static",
"<",
"KEYTYPE",
",",
"DATATYPE",
"extends",
"Comparable",
"<",
"?",
"super",
"DATATYPE",
">",
",",
"ITEMTYPE",
"extends",
"ITreeItemWithID",
"<",
"KEYTYPE",
",",
"DATATYPE",
",",
"ITEMTYPE",
">",
">",
"void",
"sortByValue",
"(",
"@",
"Non... | Sort each level of the passed tree on the value with the specified
comparator. This method assumes that the values in the tree item implement
the {@link Comparable} interface.
@param <KEYTYPE>
Tree item key type
@param <DATATYPE>
Tree item data type
@param <ITEMTYPE>
Tree item type
@param aTree
The tree to be sorted. | [
"Sort",
"each",
"level",
"of",
"the",
"passed",
"tree",
"on",
"the",
"value",
"with",
"the",
"specified",
"comparator",
".",
"This",
"method",
"assumes",
"that",
"the",
"values",
"in",
"the",
"tree",
"item",
"implement",
"the",
"{",
"@link",
"Comparable",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-tree/src/main/java/com/helger/tree/sort/TreeWithIDSorter.java#L148-L151 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/TranslateExprNodeVisitor.java | TranslateExprNodeVisitor.genCodeForParamAccess | Expression genCodeForParamAccess(String paramName, VarDefn varDefn) {
"""
Method that returns code to access a named parameter.
@param paramName the name of the parameter.
@param varDefn The variable definition of the parameter
@return The code to access the value of that parameter.
"""
Expression sou... | java | Expression genCodeForParamAccess(String paramName, VarDefn varDefn) {
Expression source = OPT_DATA;
if (varDefn.isInjected()) {
// Special case for csp_nonce. It is created by the compiler itself, and users should not need
// to set it. So, instead of generating opt_ij_data.csp_nonce, we generate op... | [
"Expression",
"genCodeForParamAccess",
"(",
"String",
"paramName",
",",
"VarDefn",
"varDefn",
")",
"{",
"Expression",
"source",
"=",
"OPT_DATA",
";",
"if",
"(",
"varDefn",
".",
"isInjected",
"(",
")",
")",
"{",
"// Special case for csp_nonce. It is created by the comp... | Method that returns code to access a named parameter.
@param paramName the name of the parameter.
@param varDefn The variable definition of the parameter
@return The code to access the value of that parameter. | [
"Method",
"that",
"returns",
"code",
"to",
"access",
"a",
"named",
"parameter",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/TranslateExprNodeVisitor.java#L198-L213 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/BaseReportGenerator.java | BaseReportGenerator.continueOnDataCollectionMessages | @Override
public boolean continueOnDataCollectionMessages(DataCollectionMessages messages, com.itextpdf.text.Document document) throws VectorPrintException {
"""
When messages of level {@link Level error} are present, put these in the document and return false. Otherwise log
messages and return true.
@param... | java | @Override
public boolean continueOnDataCollectionMessages(DataCollectionMessages messages, com.itextpdf.text.Document document) throws VectorPrintException {
if (!messages.getMessages(DataCollectionMessages.Level.ERROR).isEmpty()) {
try {
createAndAddElement(messages.getMessages(DataCollec... | [
"@",
"Override",
"public",
"boolean",
"continueOnDataCollectionMessages",
"(",
"DataCollectionMessages",
"messages",
",",
"com",
".",
"itextpdf",
".",
"text",
".",
"Document",
"document",
")",
"throws",
"VectorPrintException",
"{",
"if",
"(",
"!",
"messages",
".",
... | When messages of level {@link Level error} are present, put these in the document and return false. Otherwise log
messages and return true.
@param messages
@param document
@return
@throws VectorPrintException | [
"When",
"messages",
"of",
"level",
"{",
"@link",
"Level",
"error",
"}",
"are",
"present",
"put",
"these",
"in",
"the",
"document",
"and",
"return",
"false",
".",
"Otherwise",
"log",
"messages",
"and",
"return",
"true",
"."
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/BaseReportGenerator.java#L849-L866 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/OutputUtil.java | OutputUtil.appendList | public static <T> StringBuilder appendList(StringBuilder sb, List<T> list, String delimiter) {
"""
Appends all elements of <code>list</code> to buffer, separated by delimiter
@param <T> Type of elements stored in <code>list</code>
@param sb StringBuilder to be modified
@param list List of elements
@param delim... | java | public static <T> StringBuilder appendList(StringBuilder sb, List<T> list, String delimiter) {
boolean firstRun = true;
for(T elem: list) {
if(!firstRun)
sb.append(delimiter);
else
firstRun = false;
sb.append(elem.toString());
}
return sb;
} | [
"public",
"static",
"<",
"T",
">",
"StringBuilder",
"appendList",
"(",
"StringBuilder",
"sb",
",",
"List",
"<",
"T",
">",
"list",
",",
"String",
"delimiter",
")",
"{",
"boolean",
"firstRun",
"=",
"true",
";",
"for",
"(",
"T",
"elem",
":",
"list",
")",
... | Appends all elements of <code>list</code> to buffer, separated by delimiter
@param <T> Type of elements stored in <code>list</code>
@param sb StringBuilder to be modified
@param list List of elements
@param delimiter Delimiter to separate elements
@return Modified <code>sb</code> to allow chaining | [
"Appends",
"all",
"elements",
"of",
"<code",
">",
"list<",
"/",
"code",
">",
"to",
"buffer",
"separated",
"by",
"delimiter"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/OutputUtil.java#L109-L124 |
netty/netty | example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/HelloWorldHttp2Handler.java | HelloWorldHttp2Handler.onDataRead | private static void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception {
"""
If receive a frame with end-of-stream set, send a pre-canned response.
"""
if (data.isEndStream()) {
sendResponse(ctx, data.content());
} else {
// We do not send back t... | java | private static void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception {
if (data.isEndStream()) {
sendResponse(ctx, data.content());
} else {
// We do not send back the response to the remote-peer, so we need to release it.
data.release();
... | [
"private",
"static",
"void",
"onDataRead",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2DataFrame",
"data",
")",
"throws",
"Exception",
"{",
"if",
"(",
"data",
".",
"isEndStream",
"(",
")",
")",
"{",
"sendResponse",
"(",
"ctx",
",",
"data",
".",
"content"... | If receive a frame with end-of-stream set, send a pre-canned response. | [
"If",
"receive",
"a",
"frame",
"with",
"end",
"-",
"of",
"-",
"stream",
"set",
"send",
"a",
"pre",
"-",
"canned",
"response",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/HelloWorldHttp2Handler.java#L71-L78 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.convertPropertiesToServerFormat | public static Map<String, String> convertPropertiesToServerFormat(
CmsObject cms,
Map<String, String> props,
Map<String, CmsXmlContentProperty> propConfig) {
"""
Converts a map of properties from client format to server format.<p>
@param cms the CmsObject to use for VFS operations
@para... | java | public static Map<String, String> convertPropertiesToServerFormat(
CmsObject cms,
Map<String, String> props,
Map<String, CmsXmlContentProperty> propConfig) {
return convertProperties(cms, props, propConfig, false);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"convertPropertiesToServerFormat",
"(",
"CmsObject",
"cms",
",",
"Map",
"<",
"String",
",",
"String",
">",
"props",
",",
"Map",
"<",
"String",
",",
"CmsXmlContentProperty",
">",
"propConfig",
")",
... | Converts a map of properties from client format to server format.<p>
@param cms the CmsObject to use for VFS operations
@param props the map of properties
@param propConfig the property configuration
@return the converted property map | [
"Converts",
"a",
"map",
"of",
"properties",
"from",
"client",
"format",
"to",
"server",
"format",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L161-L167 |
ops4j/org.ops4j.pax.web | pax-web-runtime/src/main/java/org/ops4j/pax/web/service/internal/HttpServiceStarted.java | HttpServiceStarted.getOrCreateContext | private ContextModel getOrCreateContext(final HttpContext httpContext) {
"""
Single, bundle-scoped instance of {@link HttpService} (this class) may manage different {@link ContextModel servlet contexts}
identified by {@link HttpContext}.
@param httpContext
@return
"""
// org.osgi.service.http.HttpContext ... | java | private ContextModel getOrCreateContext(final HttpContext httpContext) {
// org.osgi.service.http.HttpContext -> org.ops4j.pax.web.service.WebContainerContext
final WebContainerContext context;
if (httpContext == null) {
context = createDefaultHttpContext();
} else if (!(httpContext instanceof WebContainerCo... | [
"private",
"ContextModel",
"getOrCreateContext",
"(",
"final",
"HttpContext",
"httpContext",
")",
"{",
"// org.osgi.service.http.HttpContext -> org.ops4j.pax.web.service.WebContainerContext",
"final",
"WebContainerContext",
"context",
";",
"if",
"(",
"httpContext",
"==",
"null",
... | Single, bundle-scoped instance of {@link HttpService} (this class) may manage different {@link ContextModel servlet contexts}
identified by {@link HttpContext}.
@param httpContext
@return | [
"Single",
"bundle",
"-",
"scoped",
"instance",
"of",
"{"
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-runtime/src/main/java/org/ops4j/pax/web/service/internal/HttpServiceStarted.java#L1204-L1226 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/activities/TypedVector.java | TypedVector.insertElementAt | @Override
public void insertElementAt(E obj, int index) {
"""
Inserts the specified object as a component in this vector at the specified index.
@param obj
the element to insert.
@param index
the index at which the element should be inserted; it can be a positive
number, or a negative number that is small... | java | @Override
public void insertElementAt(E obj, int index) {
int idx = getRealIndex(index);
super.insertElementAt(obj, idx);
} | [
"@",
"Override",
"public",
"void",
"insertElementAt",
"(",
"E",
"obj",
",",
"int",
"index",
")",
"{",
"int",
"idx",
"=",
"getRealIndex",
"(",
"index",
")",
";",
"super",
".",
"insertElementAt",
"(",
"obj",
",",
"idx",
")",
";",
"}"
] | Inserts the specified object as a component in this vector at the specified index.
@param obj
the element to insert.
@param index
the index at which the element should be inserted; it can be a positive
number, or a negative number that is smaller than the size of the vector;
see {@link #getRealIndex(int)}.
@see java.u... | [
"Inserts",
"the",
"specified",
"object",
"as",
"a",
"component",
"in",
"this",
"vector",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/activities/TypedVector.java#L167-L171 |
thiagokimo/Faker | faker-core/src/main/java/io/kimo/lib/faker/Faker.java | Faker.fillOnAndOffWithText | public void fillOnAndOffWithText(ToggleButton view, FakerTextComponent component) {
"""
Fill {@link ToggleButton} on and off text
@param view
@param component
"""
validateNotNullableView(view);
validateIfIsAToggleButton(view);
validateNotNullableFakerComponent(component);
Str... | java | public void fillOnAndOffWithText(ToggleButton view, FakerTextComponent component) {
validateNotNullableView(view);
validateIfIsAToggleButton(view);
validateNotNullableFakerComponent(component);
String word = component.randomText();
view.setTextOff(word);
view.setTextOn(... | [
"public",
"void",
"fillOnAndOffWithText",
"(",
"ToggleButton",
"view",
",",
"FakerTextComponent",
"component",
")",
"{",
"validateNotNullableView",
"(",
"view",
")",
";",
"validateIfIsAToggleButton",
"(",
"view",
")",
";",
"validateNotNullableFakerComponent",
"(",
"comp... | Fill {@link ToggleButton} on and off text
@param view
@param component | [
"Fill",
"{"
] | train | https://github.com/thiagokimo/Faker/blob/8b0eccd499817a2bc3377db0c6e1b50736d0f034/faker-core/src/main/java/io/kimo/lib/faker/Faker.java#L161-L170 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownNtoN_F32.java | AddBrownNtoN_F32.compute | @Override
public void compute(float x, float y, Point2D_F32 out) {
"""
Adds radial distortion
@param x Undistorted x-coordinate normalized image coordinates
@param y Undistorted y-coordinate normalized image coordinates
@param out Distorted normalized image coordinate.
"""
float[] radial = params.radi... | java | @Override
public void compute(float x, float y, Point2D_F32 out) {
float[] radial = params.radial;
float t1 = params.t1;
float t2 = params.t2;
float r2 = x*x + y*y;
float ri2 = r2;
float sum = 0;
for( int i = 0; i < radial.length; i++ ) {
sum += radial[i]*ri2;
ri2 *= r2;
}
out.x = x*(1 + su... | [
"@",
"Override",
"public",
"void",
"compute",
"(",
"float",
"x",
",",
"float",
"y",
",",
"Point2D_F32",
"out",
")",
"{",
"float",
"[",
"]",
"radial",
"=",
"params",
".",
"radial",
";",
"float",
"t1",
"=",
"params",
".",
"t1",
";",
"float",
"t2",
"=... | Adds radial distortion
@param x Undistorted x-coordinate normalized image coordinates
@param y Undistorted y-coordinate normalized image coordinates
@param out Distorted normalized image coordinate. | [
"Adds",
"radial",
"distortion"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownNtoN_F32.java#L53-L71 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java | LocalFileResource.newResourceFromResource | public static LocalFileResource newResourceFromResource(String normalizedPath, String repositoryPath, InternalWsResource related) {
"""
Create a new local resource
@param normalizedPath
Normalized file path for this resource; can not be null.
@param repositoryPath
An abstraction of the file location; may be ... | java | public static LocalFileResource newResourceFromResource(String normalizedPath, String repositoryPath, InternalWsResource related) {
SymbolicRootResource root = null;
if (related != null)
root = related.getSymbolicRoot();
return new LocalFileResource(normalizedPath, repositoryPath, r... | [
"public",
"static",
"LocalFileResource",
"newResourceFromResource",
"(",
"String",
"normalizedPath",
",",
"String",
"repositoryPath",
",",
"InternalWsResource",
"related",
")",
"{",
"SymbolicRootResource",
"root",
"=",
"null",
";",
"if",
"(",
"related",
"!=",
"null",
... | Create a new local resource
@param normalizedPath
Normalized file path for this resource; can not be null.
@param repositoryPath
An abstraction of the file location; may be null.
@param related
LocalFileResource with shared attributes (like the SymbolicRoot) | [
"Create",
"a",
"new",
"local",
"resource"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java#L110-L116 |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.createModelDiff | public static ModelDiff createModelDiff(OpenEngSBModel updated, String completeModelId,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
"""
Creates an instance of the ModelDiff class based on the given model. It loads the old status of the model and
calculates the differences of th... | java | public static ModelDiff createModelDiff(OpenEngSBModel updated, String completeModelId,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
EDBObject queryResult = edbService.getObject(completeModelId);
OpenEngSBModel old = edbConverter.convertEDBObjectToModel(updated.getClas... | [
"public",
"static",
"ModelDiff",
"createModelDiff",
"(",
"OpenEngSBModel",
"updated",
",",
"String",
"completeModelId",
",",
"EngineeringDatabaseService",
"edbService",
",",
"EDBConverter",
"edbConverter",
")",
"{",
"EDBObject",
"queryResult",
"=",
"edbService",
".",
"g... | Creates an instance of the ModelDiff class based on the given model. It loads the old status of the model and
calculates the differences of this two models. | [
"Creates",
"an",
"instance",
"of",
"the",
"ModelDiff",
"class",
"based",
"on",
"the",
"given",
"model",
".",
"It",
"loads",
"the",
"old",
"status",
"of",
"the",
"model",
"and",
"calculates",
"the",
"differences",
"of",
"this",
"two",
"models",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L60-L67 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.batchSynonyms | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
"""
Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operation to the replica indices
@param requestOpti... | java | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
return batchSynonyms(objects, forwardToReplicas, false, requestOptions);
} | [
"public",
"JSONObject",
"batchSynonyms",
"(",
"List",
"<",
"JSONObject",
">",
"objects",
",",
"boolean",
"forwardToReplicas",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"batchSynonyms",
"(",
"objects",
",",
"forwardToRep... | Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operation to the replica indices
@param requestOptions Options to pass to this request | [
"Add",
"or",
"Replace",
"a",
"list",
"of",
"synonyms"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1609-L1611 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/ProcessUtils.java | ProcessUtils.fatalError | public static void fatalError(Logger logger, Throwable t, String format, Object... args) {
"""
Logs a fatal error and then exits the system.
@param logger the logger to log to
@param t the throwable causing the fatal error
@param format the error message format string
@param args args for the format string
... | java | public static void fatalError(Logger logger, Throwable t, String format, Object... args) {
String message = String.format("Fatal error: " + format, args);
if (t != null) {
message += "\n" + ExceptionUtils.getStackTrace(t);
}
if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
throw ... | [
"public",
"static",
"void",
"fatalError",
"(",
"Logger",
"logger",
",",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"String",
"message",
"=",
"String",
".",
"format",
"(",
"\"Fatal error: \"",
"+",
"format",
",",
"arg... | Logs a fatal error and then exits the system.
@param logger the logger to log to
@param t the throwable causing the fatal error
@param format the error message format string
@param args args for the format string | [
"Logs",
"a",
"fatal",
"error",
"and",
"then",
"exits",
"the",
"system",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/ProcessUtils.java#L69-L79 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByFirstName | public Iterable<DContact> queryByFirstName(Object parent, java.lang.String firstName) {
"""
query-by method for field firstName
@param firstName the specified attribute
@return an Iterable of DContacts for the specified firstName
"""
return queryByField(parent, DContactMapper.Field.FIRSTNAME.getFieldName... | java | public Iterable<DContact> queryByFirstName(Object parent, java.lang.String firstName) {
return queryByField(parent, DContactMapper.Field.FIRSTNAME.getFieldName(), firstName);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByFirstName",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"firstName",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"FIRSTNAME",
".",
"get... | query-by method for field firstName
@param firstName the specified attribute
@return an Iterable of DContacts for the specified firstName | [
"query",
"-",
"by",
"method",
"for",
"field",
"firstName"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L169-L171 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.spare_spare_replace_POST | public void spare_spare_replace_POST(String spare, String domain, String ip) throws IOException {
"""
Replace the phone by its spare. The broken phone became a spare if it was bought. An RMA is created if the broken phone is under securitydeposit.
REST: POST /telephony/spare/{spare}/replace
@param domain [requ... | java | public void spare_spare_replace_POST(String spare, String domain, String ip) throws IOException {
String qPath = "/telephony/spare/{spare}/replace";
StringBuilder sb = path(qPath, spare);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "domain", domain);
addBody(o, "ip", ip);
exec(qPath... | [
"public",
"void",
"spare_spare_replace_POST",
"(",
"String",
"spare",
",",
"String",
"domain",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/spare/{spare}/replace\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Replace the phone by its spare. The broken phone became a spare if it was bought. An RMA is created if the broken phone is under securitydeposit.
REST: POST /telephony/spare/{spare}/replace
@param domain [required] The phone to replace by the spare
@param ip [required] Public ip of the phone
@param spare [required] Th... | [
"Replace",
"the",
"phone",
"by",
"its",
"spare",
".",
"The",
"broken",
"phone",
"became",
"a",
"spare",
"if",
"it",
"was",
"bought",
".",
"An",
"RMA",
"is",
"created",
"if",
"the",
"broken",
"phone",
"is",
"under",
"securitydeposit",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L9050-L9057 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.readField | public static Object readField(final Field field, final Object target) throws IllegalAccessException {
"""
Reads an accessible {@link Field}.
@param field
the field to use
@param target
the object to call on, may be {@code null} for {@code static} fields
@return the field value
@throws IllegalArgumentExcep... | java | public static Object readField(final Field field, final Object target) throws IllegalAccessException {
return readField(field, target, false);
} | [
"public",
"static",
"Object",
"readField",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"target",
")",
"throws",
"IllegalAccessException",
"{",
"return",
"readField",
"(",
"field",
",",
"target",
",",
"false",
")",
";",
"}"
] | Reads an accessible {@link Field}.
@param field
the field to use
@param target
the object to call on, may be {@code null} for {@code static} fields
@return the field value
@throws IllegalArgumentException
if the field is {@code null}
@throws IllegalAccessException
if the field is not accessible | [
"Reads",
"an",
"accessible",
"{",
"@link",
"Field",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L402-L404 |
bazaarvoice/curator-extensions | recipes/src/main/java/com/bazaarvoice/curator/recipes/leader/LeaderService.java | LeaderService.listenTo | private Service listenTo(Service delegate) {
"""
Release leadership when the service terminates (normally or abnormally).
"""
delegate.addListener(new Listener() {
@Override
public void starting() {
// Do nothing
}
@Override
p... | java | private Service listenTo(Service delegate) {
delegate.addListener(new Listener() {
@Override
public void starting() {
// Do nothing
}
@Override
public void running() {
// Do nothing
}
@Override
... | [
"private",
"Service",
"listenTo",
"(",
"Service",
"delegate",
")",
"{",
"delegate",
".",
"addListener",
"(",
"new",
"Listener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"starting",
"(",
")",
"{",
"// Do nothing",
"}",
"@",
"Override",
"public",
"v... | Release leadership when the service terminates (normally or abnormally). | [
"Release",
"leadership",
"when",
"the",
"service",
"terminates",
"(",
"normally",
"or",
"abnormally",
")",
"."
] | train | https://github.com/bazaarvoice/curator-extensions/blob/eb1e1b478f1ae6aed602bb5d5cb481277203004e/recipes/src/main/java/com/bazaarvoice/curator/recipes/leader/LeaderService.java#L294-L322 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java | HttpResponseStatus.parseLine | public static HttpResponseStatus parseLine(AsciiString line) {
"""
Parses the specified HTTP status line into a {@link HttpResponseStatus}. The expected formats of the line are:
<ul>
<li>{@code statusCode} (e.g. 200)</li>
<li>{@code statusCode} {@code reasonPhrase} (e.g. 404 Not Found)</li>
</ul>
@throws Il... | java | public static HttpResponseStatus parseLine(AsciiString line) {
try {
int space = line.forEachByte(FIND_ASCII_SPACE);
return space == -1 ? valueOf(line.parseInt()) : valueOf(line.parseInt(0, space), line.toString(space + 1));
} catch (Exception e) {
throw new IllegalAr... | [
"public",
"static",
"HttpResponseStatus",
"parseLine",
"(",
"AsciiString",
"line",
")",
"{",
"try",
"{",
"int",
"space",
"=",
"line",
".",
"forEachByte",
"(",
"FIND_ASCII_SPACE",
")",
";",
"return",
"space",
"==",
"-",
"1",
"?",
"valueOf",
"(",
"line",
"."... | Parses the specified HTTP status line into a {@link HttpResponseStatus}. The expected formats of the line are:
<ul>
<li>{@code statusCode} (e.g. 200)</li>
<li>{@code statusCode} {@code reasonPhrase} (e.g. 404 Not Found)</li>
</ul>
@throws IllegalArgumentException if the specified status line is malformed | [
"Parses",
"the",
"specified",
"HTTP",
"status",
"line",
"into",
"a",
"{",
"@link",
"HttpResponseStatus",
"}",
".",
"The",
"expected",
"formats",
"of",
"the",
"line",
"are",
":",
"<ul",
">",
"<li",
">",
"{",
"@code",
"statusCode",
"}",
"(",
"e",
".",
"g... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java#L511-L518 |
alkacon/opencms-core | src/org/opencms/loader/CmsDumpLoader.java | CmsDumpLoader.canSendLastModifiedHeader | protected boolean canSendLastModifiedHeader(CmsResource resource, HttpServletRequest req, HttpServletResponse res) {
"""
Checks if the requested resource must be send to the client by checking the "If-Modified-Since" http header.<p>
If the resource has not been modified, the "304 - not modified"
header is send... | java | protected boolean canSendLastModifiedHeader(CmsResource resource, HttpServletRequest req, HttpServletResponse res) {
// resource state must be unchanged
if (resource.getState().isUnchanged()
// the request must not have been send by a workplace user (we can't use "304 - not modified" in wor... | [
"protected",
"boolean",
"canSendLastModifiedHeader",
"(",
"CmsResource",
"resource",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"// resource state must be unchanged",
"if",
"(",
"resource",
".",
"getState",
"(",
")",
".",
"isUnchanged... | Checks if the requested resource must be send to the client by checking the "If-Modified-Since" http header.<p>
If the resource has not been modified, the "304 - not modified"
header is send to the client and <code>true</code>
is returned, otherwise nothing is send and <code>false</code> is returned.<p>
@param resour... | [
"Checks",
"if",
"the",
"requested",
"resource",
"must",
"be",
"send",
"to",
"the",
"client",
"by",
"checking",
"the",
"If",
"-",
"Modified",
"-",
"Since",
"http",
"header",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsDumpLoader.java#L284-L302 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesSharesApi.java | DevicesSharesApi.createShareForDevice | public DeviceSharingId createShareForDevice(String deviceId, DeviceShareInfo deviceShareInfo) throws ApiException {
"""
Share a device
Share a device
@param deviceId Device ID. (required)
@param deviceShareInfo Device object that needs to be added (required)
@return DeviceSharingId
@throws ApiException If fai... | java | public DeviceSharingId createShareForDevice(String deviceId, DeviceShareInfo deviceShareInfo) throws ApiException {
ApiResponse<DeviceSharingId> resp = createShareForDeviceWithHttpInfo(deviceId, deviceShareInfo);
return resp.getData();
} | [
"public",
"DeviceSharingId",
"createShareForDevice",
"(",
"String",
"deviceId",
",",
"DeviceShareInfo",
"deviceShareInfo",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"DeviceSharingId",
">",
"resp",
"=",
"createShareForDeviceWithHttpInfo",
"(",
"deviceId",
","... | Share a device
Share a device
@param deviceId Device ID. (required)
@param deviceShareInfo Device object that needs to be added (required)
@return DeviceSharingId
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Share",
"a",
"device",
"Share",
"a",
"device"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesSharesApi.java#L133-L136 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java | FieldDataTermsQuery.newLongs | public static FieldDataTermsQuery newLongs(final byte[] encodedTerms, final IndexNumericFieldData fieldData, final long cacheKey) {
"""
Get a {@link FieldDataTermsQuery} that filters on non-floating point numeric terms found in a hppc
{@link LongHashSet}.
@param encodedTerms An encoded set of terms.
@param f... | java | public static FieldDataTermsQuery newLongs(final byte[] encodedTerms, final IndexNumericFieldData fieldData, final long cacheKey) {
return new LongsFieldDataTermsQuery(encodedTerms, fieldData, cacheKey);
} | [
"public",
"static",
"FieldDataTermsQuery",
"newLongs",
"(",
"final",
"byte",
"[",
"]",
"encodedTerms",
",",
"final",
"IndexNumericFieldData",
"fieldData",
",",
"final",
"long",
"cacheKey",
")",
"{",
"return",
"new",
"LongsFieldDataTermsQuery",
"(",
"encodedTerms",
"... | Get a {@link FieldDataTermsQuery} that filters on non-floating point numeric terms found in a hppc
{@link LongHashSet}.
@param encodedTerms An encoded set of terms.
@param fieldData The fielddata for the field.
@param cacheKey A unique key to use for caching this query.
@return the query. | [
"Get",
"a",
"{",
"@link",
"FieldDataTermsQuery",
"}",
"that",
"filters",
"on",
"non",
"-",
"floating",
"point",
"numeric",
"terms",
"found",
"in",
"a",
"hppc",
"{",
"@link",
"LongHashSet",
"}",
"."
] | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java#L81-L83 |
io7m/jproperties | com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java | JProperties.getBoolean | public static boolean getBoolean(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType {
"""
<p> Returns the boolean value associated with {@code key} in the
properties referenced by {@code properties}. </p> <p> A boolean value
is syntactically the st... | java | public static boolean getBoolean(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType
{
Objects.requireNonNull(properties, "Properties");
Objects.requireNonNull(key, "Key");
final String text = getString(properties, key);
return parseBool... | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"key",
")",
"throws",
"JPropertyNonexistent",
",",
"JPropertyIncorrectType",
"{",
"Objects",
".",
"requireNonNull",
"(",
"properties",
",",
"\"Properties\"",... | <p> Returns the boolean value associated with {@code key} in the
properties referenced by {@code properties}. </p> <p> A boolean value
is syntactically the strings "true" or "false", case insensitive. </p>
@param properties The loaded properties.
@param key The requested key.
@return The value associated with ... | [
"<p",
">",
"Returns",
"the",
"boolean",
"value",
"associated",
"with",
"{",
"@code",
"key",
"}",
"in",
"the",
"properties",
"referenced",
"by",
"{",
"@code",
"properties",
"}",
".",
"<",
"/",
"p",
">",
"<p",
">",
"A",
"boolean",
"value",
"is",
"syntact... | train | https://github.com/io7m/jproperties/blob/b188b8fd87b3b078f1e2b564a9ed5996db0becfd/com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java#L202-L213 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java | RestClient.updateAttachment | @Override
public Attachment updateAttachment(String assetId, AttachmentSummary summary) throws IOException, BadVersionException, RequestFailureException {
"""
This method will update an existing attachment on an asset. Note that
Massive currently doesn't support update attachment so this will do a
delete and... | java | @Override
public Attachment updateAttachment(String assetId, AttachmentSummary summary) throws IOException, BadVersionException, RequestFailureException {
// First find the attachment to update
Asset ass = getAsset(assetId);
List<Attachment> attachments = ass.getAttachments();
if (a... | [
"@",
"Override",
"public",
"Attachment",
"updateAttachment",
"(",
"String",
"assetId",
",",
"AttachmentSummary",
"summary",
")",
"throws",
"IOException",
",",
"BadVersionException",
",",
"RequestFailureException",
"{",
"// First find the attachment to update",
"Asset",
"ass... | This method will update an existing attachment on an asset. Note that
Massive currently doesn't support update attachment so this will do a
delete and an add.
@param assetId
The ID of the asset that the attachment is attached to
@param name
The name of the attachment to update
@param file
The file to attach
@param att... | [
"This",
"method",
"will",
"update",
"an",
"existing",
"attachment",
"on",
"an",
"asset",
".",
"Note",
"that",
"Massive",
"currently",
"doesn",
"t",
"support",
"update",
"attachment",
"so",
"this",
"will",
"do",
"a",
"delete",
"and",
"an",
"add",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java#L774-L789 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java | PropertiesUtil.getInt | public static int getInt(Properties config, String key, int defaultValue) {
"""
Get integer from properties.
This method throws an exception if the integer is not valid.
@param config Properties
@param key key in Properties
@param defaultValue default value if value is not set
@return default or value of ke... | java | public static int getInt(Properties config, String key, int defaultValue) {
String val = config.getProperty(key);
if (val == null) {
return defaultValue;
} else {
try {
return Integer.parseInt(val);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Value for configuration ... | [
"public",
"static",
"int",
"getInt",
"(",
"Properties",
"config",
",",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"config",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
... | Get integer from properties.
This method throws an exception if the integer is not valid.
@param config Properties
@param key key in Properties
@param defaultValue default value if value is not set
@return default or value of key | [
"Get",
"integer",
"from",
"properties",
".",
"This",
"method",
"throws",
"an",
"exception",
"if",
"the",
"integer",
"is",
"not",
"valid",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java#L38-L50 |
shrinkwrap/resolver | maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/convert/MavenConverter.java | MavenConverter.asDependency | public static Dependency asDependency(MavenDependencySPI dependency, ArtifactTypeRegistry registry) {
"""
Converts MavenDepedency to Dependency representation used in Aether
@param dependency
the Maven dependency
@param registry
A registry of known artifact types.
@return the corresponding Aether dependency... | java | public static Dependency asDependency(MavenDependencySPI dependency, ArtifactTypeRegistry registry) {
/*
* Allow for undeclared scopes
*/
String scope = dependency.getScope().toString();
if (dependency.isUndeclaredScope()) {
scope = EMPTY;
}
return ... | [
"public",
"static",
"Dependency",
"asDependency",
"(",
"MavenDependencySPI",
"dependency",
",",
"ArtifactTypeRegistry",
"registry",
")",
"{",
"/*\n * Allow for undeclared scopes\n */",
"String",
"scope",
"=",
"dependency",
".",
"getScope",
"(",
")",
".",
"... | Converts MavenDepedency to Dependency representation used in Aether
@param dependency
the Maven dependency
@param registry
A registry of known artifact types.
@return the corresponding Aether dependency | [
"Converts",
"MavenDepedency",
"to",
"Dependency",
"representation",
"used",
"in",
"Aether"
] | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/convert/MavenConverter.java#L230-L241 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.appendComment | protected IStyleAppendable appendComment(IStyleAppendable it, String text) {
"""
Append a Vim comment.
@param it the receiver of the generated elements.
@param text the text of the comment.
@return {@code it}.
"""
return appendComment(it, true, text);
} | java | protected IStyleAppendable appendComment(IStyleAppendable it, String text) {
return appendComment(it, true, text);
} | [
"protected",
"IStyleAppendable",
"appendComment",
"(",
"IStyleAppendable",
"it",
",",
"String",
"text",
")",
"{",
"return",
"appendComment",
"(",
"it",
",",
"true",
",",
"text",
")",
";",
"}"
] | Append a Vim comment.
@param it the receiver of the generated elements.
@param text the text of the comment.
@return {@code it}. | [
"Append",
"a",
"Vim",
"comment",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L512-L514 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebSiteRequest.java | WebSiteRequest.getURL | public String getURL(Class<? extends WebPage> clazz, Object param) throws IOException, SQLException {
"""
Gets the context-relative URL to a web page.
Parameters should already be URL encoded but not yet XML encoded.
"""
WebPage page=WebPage.getWebPage(sourcePage.getServletContext(), clazz, param);
return... | java | public String getURL(Class<? extends WebPage> clazz, Object param) throws IOException, SQLException {
WebPage page=WebPage.getWebPage(sourcePage.getServletContext(), clazz, param);
return getURL(page, param);
} | [
"public",
"String",
"getURL",
"(",
"Class",
"<",
"?",
"extends",
"WebPage",
">",
"clazz",
",",
"Object",
"param",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"WebPage",
"page",
"=",
"WebPage",
".",
"getWebPage",
"(",
"sourcePage",
".",
"getServle... | Gets the context-relative URL to a web page.
Parameters should already be URL encoded but not yet XML encoded. | [
"Gets",
"the",
"context",
"-",
"relative",
"URL",
"to",
"a",
"web",
"page",
".",
"Parameters",
"should",
"already",
"be",
"URL",
"encoded",
"but",
"not",
"yet",
"XML",
"encoded",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L448-L451 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.suppressibleHydrogen | private static boolean suppressibleHydrogen(final IAtomContainer container, final IAtom atom) {
"""
Is the {@code atom} a suppressible hydrogen and can be represented as
implicit. A hydrogen is suppressible if it is not an ion, not the major
isotope (i.e. it is a deuterium or tritium atom) and is not molecular
... | java | private static boolean suppressibleHydrogen(final IAtomContainer container, final IAtom atom) {
// is the atom a hydrogen
if (!"H".equals(atom.getSymbol())) return false;
// is the hydrogen an ion?
if (atom.getFormalCharge() != null && atom.getFormalCharge() != 0) return false;
/... | [
"private",
"static",
"boolean",
"suppressibleHydrogen",
"(",
"final",
"IAtomContainer",
"container",
",",
"final",
"IAtom",
"atom",
")",
"{",
"// is the atom a hydrogen",
"if",
"(",
"!",
"\"H\"",
".",
"equals",
"(",
"atom",
".",
"getSymbol",
"(",
")",
")",
")"... | Is the {@code atom} a suppressible hydrogen and can be represented as
implicit. A hydrogen is suppressible if it is not an ion, not the major
isotope (i.e. it is a deuterium or tritium atom) and is not molecular
hydrogen.
@param container the structure
@param atom an atom in the structure
@return the atom is a hy... | [
"Is",
"the",
"{",
"@code",
"atom",
"}",
"a",
"suppressible",
"hydrogen",
"and",
"can",
"be",
"represented",
"as",
"implicit",
".",
"A",
"hydrogen",
"is",
"suppressible",
"if",
"it",
"is",
"not",
"an",
"ion",
"not",
"the",
"major",
"isotope",
"(",
"i",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1171-L1187 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.getProperty | public static PropertyDescriptor getProperty(Class<?> clazz, String propertyName, Class<?> propertyType) {
"""
Retrieves a property of the given class of the specified name and type
@param clazz The class to retrieve the property from
@param propertyName The name of the property
@param propertyType The type of ... | java | public static PropertyDescriptor getProperty(Class<?> clazz, String propertyName, Class<?> propertyType) {
if (clazz == null || propertyName == null || propertyType == null) {
return null;
}
try {
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(clazz, propertyNam... | [
"public",
"static",
"PropertyDescriptor",
"getProperty",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"propertyName",
",",
"Class",
"<",
"?",
">",
"propertyType",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
"||",
"propertyName",
"==",
"null",
"||",... | Retrieves a property of the given class of the specified name and type
@param clazz The class to retrieve the property from
@param propertyName The name of the property
@param propertyType The type of the property
@return A PropertyDescriptor instance or null if none exists | [
"Retrieves",
"a",
"property",
"of",
"the",
"given",
"class",
"of",
"the",
"specified",
"name",
"and",
"type",
"@param",
"clazz",
"The",
"class",
"to",
"retrieve",
"the",
"property",
"from",
"@param",
"propertyName",
"The",
"name",
"of",
"the",
"property",
"@... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L396-L412 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.nextAfter | public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
"""
Binding for {@link java.lang.Math#nextAfter(float, double)}
@param start starting floating-point value
@param direction value indicating which of
{@code start}'s neighbors or {@code start} should
be returned
... | java | public static FloatBinding nextAfter(final float start, final ObservableFloatValue direction) {
return createFloatBinding(() -> Math.nextAfter(start, direction.get()), direction);
} | [
"public",
"static",
"FloatBinding",
"nextAfter",
"(",
"final",
"float",
"start",
",",
"final",
"ObservableFloatValue",
"direction",
")",
"{",
"return",
"createFloatBinding",
"(",
"(",
")",
"->",
"Math",
".",
"nextAfter",
"(",
"start",
",",
"direction",
".",
"g... | Binding for {@link java.lang.Math#nextAfter(float, double)}
@param start starting floating-point value
@param direction value indicating which of
{@code start}'s neighbors or {@code start} should
be returned
@return The floating-point number adjacent to {@code start} in the
direction of {@code direction}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#nextAfter",
"(",
"float",
"double",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L1141-L1143 |
google/closure-compiler | src/com/google/javascript/jscomp/JSError.java | JSError.make | public static JSError make(CheckLevel level, DiagnosticType type, String... arguments) {
"""
Creates a JSError with no source information and a non-default level.
@param level
@param type The DiagnosticType
@param arguments Arguments to be incorporated into the message
"""
return new JSError(null, nul... | java | public static JSError make(CheckLevel level, DiagnosticType type, String... arguments) {
return new JSError(null, null, -1, -1, type, level, arguments);
} | [
"public",
"static",
"JSError",
"make",
"(",
"CheckLevel",
"level",
",",
"DiagnosticType",
"type",
",",
"String",
"...",
"arguments",
")",
"{",
"return",
"new",
"JSError",
"(",
"null",
",",
"null",
",",
"-",
"1",
",",
"-",
"1",
",",
"type",
",",
"level"... | Creates a JSError with no source information and a non-default level.
@param level
@param type The DiagnosticType
@param arguments Arguments to be incorporated into the message | [
"Creates",
"a",
"JSError",
"with",
"no",
"source",
"information",
"and",
"a",
"non",
"-",
"default",
"level",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSError.java#L79-L81 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java | ResolvableType.forMethodReturnType | public static ResolvableType forMethodReturnType(Method method) {
"""
Return a {@link ResolvableType} for the specified {@link Method} return type.
@param method the source for the method return type
@return a {@link ResolvableType} for the specified method return
@see #forMethodReturnType(Method, Class)
""... | java | public static ResolvableType forMethodReturnType(Method method) {
Assert.notNull(method, "Method must not be null");
return forMethodParameter(MethodParameter.forMethodOrConstructor(method, -1));
} | [
"public",
"static",
"ResolvableType",
"forMethodReturnType",
"(",
"Method",
"method",
")",
"{",
"Assert",
".",
"notNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"return",
"forMethodParameter",
"(",
"MethodParameter",
".",
"forMethodOrConstructor",
... | Return a {@link ResolvableType} for the specified {@link Method} return type.
@param method the source for the method return type
@return a {@link ResolvableType} for the specified method return
@see #forMethodReturnType(Method, Class) | [
"Return",
"a",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java#L1029-L1032 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEditable.java | CmsJspTagEditable.setDirectEditProvider | protected static void setDirectEditProvider(PageContext context, I_CmsDirectEditProvider provider) {
"""
Sets the current initialized instance of the direct edit provider.<p>
@param context the current JSP page context
@param provider the current initialized instance of the direct edit provider to set
""... | java | protected static void setDirectEditProvider(PageContext context, I_CmsDirectEditProvider provider) {
// set the direct edit provider as attribute to the request
context.getRequest().setAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER, provider);
} | [
"protected",
"static",
"void",
"setDirectEditProvider",
"(",
"PageContext",
"context",
",",
"I_CmsDirectEditProvider",
"provider",
")",
"{",
"// set the direct edit provider as attribute to the request",
"context",
".",
"getRequest",
"(",
")",
".",
"setAttribute",
"(",
"I_C... | Sets the current initialized instance of the direct edit provider.<p>
@param context the current JSP page context
@param provider the current initialized instance of the direct edit provider to set | [
"Sets",
"the",
"current",
"initialized",
"instance",
"of",
"the",
"direct",
"edit",
"provider",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEditable.java#L343-L347 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java | JDBCRepositoryBuilder.setSuppressReload | public void setSuppressReload(boolean suppress, String className) {
"""
By default, JDBCRepository reloads Storables after every insert or
update. This ensures that any applied defaults or triggered changes are
available to the Storable. If the database has no such defaults or
triggers, suppressing reload can i... | java | public void setSuppressReload(boolean suppress, String className) {
if (mSuppressReloadMap == null) {
mSuppressReloadMap = new HashMap<String, Boolean>();
}
mSuppressReloadMap.put(className, suppress);
} | [
"public",
"void",
"setSuppressReload",
"(",
"boolean",
"suppress",
",",
"String",
"className",
")",
"{",
"if",
"(",
"mSuppressReloadMap",
"==",
"null",
")",
"{",
"mSuppressReloadMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Boolean",
">",
"(",
")",
";",
... | By default, JDBCRepository reloads Storables after every insert or
update. This ensures that any applied defaults or triggered changes are
available to the Storable. If the database has no such defaults or
triggers, suppressing reload can improve performance.
<p>Note: If Storable has a version property and auto versio... | [
"By",
"default",
"JDBCRepository",
"reloads",
"Storables",
"after",
"every",
"insert",
"or",
"update",
".",
"This",
"ensures",
"that",
"any",
"applied",
"defaults",
"or",
"triggered",
"changes",
"are",
"available",
"to",
"the",
"Storable",
".",
"If",
"the",
"d... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java#L358-L363 |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.updateProfileField | public <F> void updateProfileField(ProfileField<F, ?> field, F... values) {
"""
Updates a single field on the profile of the user
@param field
The field that should be updated
@param values
The new values of the field
"""
updateProfileField(field, Arrays.asList(values));
} | java | public <F> void updateProfileField(ProfileField<F, ?> field, F... values) {
updateProfileField(field, Arrays.asList(values));
} | [
"public",
"<",
"F",
">",
"void",
"updateProfileField",
"(",
"ProfileField",
"<",
"F",
",",
"?",
">",
"field",
",",
"F",
"...",
"values",
")",
"{",
"updateProfileField",
"(",
"field",
",",
"Arrays",
".",
"asList",
"(",
"values",
")",
")",
";",
"}"
] | Updates a single field on the profile of the user
@param field
The field that should be updated
@param values
The new values of the field | [
"Updates",
"a",
"single",
"field",
"on",
"the",
"profile",
"of",
"the",
"user"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L120-L122 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.executeScriptActions | public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
"""
Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The ... | java | public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body();
} | [
"public",
"void",
"executeScriptActions",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ExecuteScriptActionParameters",
"parameters",
")",
"{",
"executeScriptActionsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"parame... | Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The parameters for executing script actions.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Executes",
"script",
"actions",
"on",
"the",
"specified",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1719-L1721 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/codec/JBIG2Image.java | JBIG2Image.getJbig2Image | public static Image getJbig2Image(RandomAccessFileOrArray ra, int page) {
"""
returns an Image representing the given page.
@param ra the file or array containing the image
@param page the page number of the image
@return an Image object
"""
if (page < 1)
throw new IllegalArgumentException("... | java | public static Image getJbig2Image(RandomAccessFileOrArray ra, int page) {
if (page < 1)
throw new IllegalArgumentException("The page number must be >= 1.");
try {
JBIG2SegmentReader sr = new JBIG2SegmentReader(ra);
sr.read();
JBIG2SegmentReader.JBIG2Page p = sr.getPage(page);
Imag... | [
"public",
"static",
"Image",
"getJbig2Image",
"(",
"RandomAccessFileOrArray",
"ra",
",",
"int",
"page",
")",
"{",
"if",
"(",
"page",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The page number must be >= 1.\"",
")",
";",
"try",
"{",
"JBIG2... | returns an Image representing the given page.
@param ra the file or array containing the image
@param page the page number of the image
@return an Image object | [
"returns",
"an",
"Image",
"representing",
"the",
"given",
"page",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/codec/JBIG2Image.java#L87-L100 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLEqual | public static void assertXMLEqual(Reader control, Reader test)
throws SAXException, IOException {
"""
Assert that two XML documents are similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException
"""
assertXMLEqual(null, control, t... | java | public static void assertXMLEqual(Reader control, Reader test)
throws SAXException, IOException {
assertXMLEqual(null, control, test);
} | [
"public",
"static",
"void",
"assertXMLEqual",
"(",
"Reader",
"control",
",",
"Reader",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"assertXMLEqual",
"(",
"null",
",",
"control",
",",
"test",
")",
";",
"}"
] | Assert that two XML documents are similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L202-L205 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java | ConcurrentCountingMap.put | public int put(final byte[] array, final int offset, final int length, final int value) {
"""
Sets the value associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param value a value to be ass... | java | public int put(final byte[] array, final int offset, final int length, final int value) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].put(array, offset, length, ha... | [
"public",
"int",
"put",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"int",
"value",
")",
"{",
"final",
"long",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"array",
",",
"offse... | Sets the value associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param value a value to be associated with the specified key.
@return the previous value of the counter associated with the specified ... | [
"Sets",
"the",
"value",
"associated",
"with",
"a",
"given",
"key",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java#L145-L155 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPathSegment | public static void escapeUriPathSegment(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are ... | java | public static void escapeUriPathSegment(final String text, final Writer writer)
throws IOException {
escapeUriPathSegment(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriPathSegment",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriPathSegment",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI path segment (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
"w... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L533-L536 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java | CWF2XML.isExcluded | private boolean isExcluded(String name, String cmpname, String value) {
"""
Returns true if the property is to be excluded.
@param name The property name.
@param cmpname The component name (may be null).
@param value The property value (may be null).
@return True if the property should be excluded.
"""
... | java | private boolean isExcluded(String name, String cmpname, String value) {
return exclude.contains(excludeKey(name, null, value)) || exclude.contains(excludeKey(name, cmpname, value));
} | [
"private",
"boolean",
"isExcluded",
"(",
"String",
"name",
",",
"String",
"cmpname",
",",
"String",
"value",
")",
"{",
"return",
"exclude",
".",
"contains",
"(",
"excludeKey",
"(",
"name",
",",
"null",
",",
"value",
")",
")",
"||",
"exclude",
".",
"conta... | Returns true if the property is to be excluded.
@param name The property name.
@param cmpname The component name (may be null).
@param value The property value (may be null).
@return True if the property should be excluded. | [
"Returns",
"true",
"if",
"the",
"property",
"is",
"to",
"be",
"excluded",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/CWF2XML.java#L179-L181 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java | BackupLongTermRetentionVaultsInner.createOrUpdateAsync | public Observable<BackupLongTermRetentionVaultInner> createOrUpdateAsync(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) {
"""
Updates a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtai... | java | public Observable<BackupLongTermRetentionVaultInner> createOrUpdateAsync(String resourceGroupName, String serverName, String recoveryServicesVaultResourceId) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, recoveryServicesVaultResourceId).map(new Func1<ServiceResponse<BackupLongTe... | [
"public",
"Observable",
"<",
"BackupLongTermRetentionVaultInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"recoveryServicesVaultResourceId",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Updates a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param recoveryServicesVaultResourceId The azure recovery service... | [
"Updates",
"a",
"server",
"backup",
"long",
"term",
"retention",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L200-L207 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/SubscriptionsApi.java | SubscriptionsApi.validateSubscription | public SubscriptionEnvelope validateSubscription(String subId, ValidationCallbackInfo validationCallbackRequest) throws ApiException {
"""
Validate Subscription
Validate Subscription
@param subId Subscription ID. (required)
@param validationCallbackRequest Subscription validation callback request (required)
@r... | java | public SubscriptionEnvelope validateSubscription(String subId, ValidationCallbackInfo validationCallbackRequest) throws ApiException {
ApiResponse<SubscriptionEnvelope> resp = validateSubscriptionWithHttpInfo(subId, validationCallbackRequest);
return resp.getData();
} | [
"public",
"SubscriptionEnvelope",
"validateSubscription",
"(",
"String",
"subId",
",",
"ValidationCallbackInfo",
"validationCallbackRequest",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"SubscriptionEnvelope",
">",
"resp",
"=",
"validateSubscriptionWithHttpInfo",
... | Validate Subscription
Validate Subscription
@param subId Subscription ID. (required)
@param validationCallbackRequest Subscription validation callback request (required)
@return SubscriptionEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Validate",
"Subscription",
"Validate",
"Subscription"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/SubscriptionsApi.java#L749-L752 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java | ConstructorBuilder.buildTagInfo | public void buildTagInfo(XMLNode node, Content constructorDocTree) {
"""
Build the tag information.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to which the documentation will be added
"""
writer.addTags((ConstructorDoc) constru... | java | public void buildTagInfo(XMLNode node, Content constructorDocTree) {
writer.addTags((ConstructorDoc) constructors.get(currentConstructorIndex),
constructorDocTree);
} | [
"public",
"void",
"buildTagInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"constructorDocTree",
")",
"{",
"writer",
".",
"addTags",
"(",
"(",
"ConstructorDoc",
")",
"constructors",
".",
"get",
"(",
"currentConstructorIndex",
")",
",",
"constructorDocTree",
")",
... | Build the tag information.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"tag",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java#L227-L230 |
timehop/sticky-headers-recyclerview | library/src/main/java/com/timehop/stickyheadersrecyclerview/StickyRecyclerHeadersDecoration.java | StickyRecyclerHeadersDecoration.findHeaderPositionUnder | public int findHeaderPositionUnder(int x, int y) {
"""
Gets the position of the header under the specified (x, y) coordinates.
@param x x-coordinate
@param y y-coordinate
@return position of header, or -1 if not found
"""
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHeaderRects.g... | java | public int findHeaderPositionUnder(int x, int y) {
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHeaderRects.get(mHeaderRects.keyAt(i));
if (rect.contains(x, y)) {
int position = mHeaderRects.keyAt(i);
if (mVisibilityAdapter == null || mVisibilityAdapter.isPositionVisible(... | [
"public",
"int",
"findHeaderPositionUnder",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mHeaderRects",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Rect",
"rect",
"=",
"mHeaderRects",
".",
"g... | Gets the position of the header under the specified (x, y) coordinates.
@param x x-coordinate
@param y y-coordinate
@return position of header, or -1 if not found | [
"Gets",
"the",
"position",
"of",
"the",
"header",
"under",
"the",
"specified",
"(",
"x",
"y",
")",
"coordinates",
"."
] | train | https://github.com/timehop/sticky-headers-recyclerview/blob/f5a9e9b8f5d96734e20439b0a41381865fa52fb7/library/src/main/java/com/timehop/stickyheadersrecyclerview/StickyRecyclerHeadersDecoration.java#L135-L146 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/animations/Fade.java | Fade.hide | public void hide(final View view, final int visibility) {
"""
Fades out the specified view and then sets its visibility to the specified
value (either View.INVISIBLE or View.GONE). If the view is not currently visibile, the
method will return without doing anything.
@param view The view to be hidden
@p... | java | public void hide(final View view, final int visibility) {
if (view.getVisibility() == View.VISIBLE && (visibility == View.INVISIBLE || visibility == View.GONE)) {
hideNaughtily(view, visibility);
}
} | [
"public",
"void",
"hide",
"(",
"final",
"View",
"view",
",",
"final",
"int",
"visibility",
")",
"{",
"if",
"(",
"view",
".",
"getVisibility",
"(",
")",
"==",
"View",
".",
"VISIBLE",
"&&",
"(",
"visibility",
"==",
"View",
".",
"INVISIBLE",
"||",
"visibi... | Fades out the specified view and then sets its visibility to the specified
value (either View.INVISIBLE or View.GONE). If the view is not currently visibile, the
method will return without doing anything.
@param view The view to be hidden
@param visibility The value to which the view's visibility will be set aft... | [
"Fades",
"out",
"the",
"specified",
"view",
"and",
"then",
"sets",
"its",
"visibility",
"to",
"the",
"specified",
"value",
"(",
"either",
"View",
".",
"INVISIBLE",
"or",
"View",
".",
"GONE",
")",
".",
"If",
"the",
"view",
"is",
"not",
"currently",
"visib... | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/animations/Fade.java#L96-L100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.