repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/PathTools.java | PathTools.getVertexCountAtDistance | public static int getVertexCountAtDistance(IAtomContainer atomContainer, int distance) {
int natom = atomContainer.getAtomCount();
int[][] admat = AdjacencyMatrix.getMatrix(atomContainer);
int[][] distanceMatrix = computeFloydAPSP(admat);
int matches = 0;
for (int i = 0; i < n... | java | public static int getVertexCountAtDistance(IAtomContainer atomContainer, int distance) {
int natom = atomContainer.getAtomCount();
int[][] admat = AdjacencyMatrix.getMatrix(atomContainer);
int[][] distanceMatrix = computeFloydAPSP(admat);
int matches = 0;
for (int i = 0; i < n... | [
"public",
"static",
"int",
"getVertexCountAtDistance",
"(",
"IAtomContainer",
"atomContainer",
",",
"int",
"distance",
")",
"{",
"int",
"natom",
"=",
"atomContainer",
".",
"getAtomCount",
"(",
")",
";",
"int",
"[",
"]",
"[",
"]",
"admat",
"=",
"AdjacencyMatrix... | Returns the number of vertices that are a distance 'd' apart.
In this method, d is the topological distance (ie edge count).
@param atomContainer The molecule to consider
@param distance The distance to consider
@return The number of vertices | [
"Returns",
"the",
"number",
"of",
"vertices",
"that",
"are",
"a",
"distance",
"d",
"apart",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/PathTools.java#L415-L429 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/qos/qos_stats.java | qos_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
qos_stats[] resources = new qos_stats[1];
qos_response result = (qos_response) service.get_payload_formatter().string_to_resource(qos_response.class, response);
if(result.errorcode != 0) {
if (result.errorco... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
qos_stats[] resources = new qos_stats[1];
qos_response result = (qos_response) service.get_payload_formatter().string_to_resource(qos_response.class, response);
if(result.errorcode != 0) {
if (result.errorco... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"qos_stats",
"[",
"]",
"resources",
"=",
"new",
"qos_stats",
"[",
"1",
"]",
";",
"qos_response",
"result",
... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/qos/qos_stats.java#L867-L886 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java | MessageFormatMessageFactory.newMessage | @Override
public Message newMessage(final String message, final Object... params) {
return new MessageFormatMessage(message, params);
} | java | @Override
public Message newMessage(final String message, final Object... params) {
return new MessageFormatMessage(message, params);
} | [
"@",
"Override",
"public",
"Message",
"newMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"MessageFormatMessage",
"(",
"message",
",",
"params",
")",
";",
"}"
] | Creates {@link org.apache.logging.log4j.message.StringFormattedMessage} instances.
@param message The message pattern.
@param params Parameters to the message.
@return The Message.
@see org.apache.logging.log4j.message.MessageFactory#newMessage(String, Object...) | [
"Creates",
"{",
"@link",
"org",
".",
"apache",
".",
"logging",
".",
"log4j",
".",
"message",
".",
"StringFormattedMessage",
"}",
"instances",
".",
"@param",
"message",
"The",
"message",
"pattern",
".",
"@param",
"params",
"Parameters",
"to",
"the",
"message",
... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java#L46-L49 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.createShippingAddress | public ShippingAddress createShippingAddress(final String accountCode, final ShippingAddress shippingAddress) {
return doPOST(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE, shippingAddress,
ShippingAddress.class);
} | java | public ShippingAddress createShippingAddress(final String accountCode, final ShippingAddress shippingAddress) {
return doPOST(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE, shippingAddress,
ShippingAddress.class);
} | [
"public",
"ShippingAddress",
"createShippingAddress",
"(",
"final",
"String",
"accountCode",
",",
"final",
"ShippingAddress",
"shippingAddress",
")",
"{",
"return",
"doPOST",
"(",
"Accounts",
".",
"ACCOUNTS_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
"ShippingAd... | Create a shipping address on an existing account
<p>
@param accountCode recurly account id
@param shippingAddress the shipping address request data
@return the newly created shipping address on success | [
"Create",
"a",
"shipping",
"address",
"on",
"an",
"existing",
"account",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1205-L1208 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.replaceChars | public static String replaceChars(String str, char searchChar, char replaceChar) {
if (str == null) {
return null;
}
return str.replace(searchChar, replaceChar);
} | java | public static String replaceChars(String str, char searchChar, char replaceChar) {
if (str == null) {
return null;
}
return str.replace(searchChar, replaceChar);
} | [
"public",
"static",
"String",
"replaceChars",
"(",
"String",
"str",
",",
"char",
"searchChar",
",",
"char",
"replaceChar",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"str",
".",
"replace",
"(",
"searchChar",... | <p>Replaces all occurrences of a character in a String with another.
This is a null-safe version of {@link String#replace(char, char)}.</p>
<p>A <code>null</code> string input returns <code>null</code>.
An empty ("") string input returns an empty string.</p>
<pre>
GosuStringUtil.replaceChars(null, *, *) = null... | [
"<p",
">",
"Replaces",
"all",
"occurrences",
"of",
"a",
"character",
"in",
"a",
"String",
"with",
"another",
".",
"This",
"is",
"a",
"null",
"-",
"safe",
"version",
"of",
"{",
"@link",
"String#replace",
"(",
"char",
"char",
")",
"}",
".",
"<",
"/",
"... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L3744-L3749 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/HotSpotJavaDumperImpl.java | HotSpotJavaDumperImpl.createNewFile | private File createNewFile(File outputDir, String prefix, String extension) throws IOException {
String dateTime = new SimpleDateFormat("yyyyMMdd.HHmmss").format(new Date());
File outputFile;
do {
String pid = PID == null ? "" : PID + '.';
int sequenceNumber = nextSequenc... | java | private File createNewFile(File outputDir, String prefix, String extension) throws IOException {
String dateTime = new SimpleDateFormat("yyyyMMdd.HHmmss").format(new Date());
File outputFile;
do {
String pid = PID == null ? "" : PID + '.';
int sequenceNumber = nextSequenc... | [
"private",
"File",
"createNewFile",
"(",
"File",
"outputDir",
",",
"String",
"prefix",
",",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"String",
"dateTime",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyyMMdd.HHmmss\"",
")",
".",
"format",
"(",
"new"... | Create a dump file with a unique name.
@param outputDir the directory to contain the file
@param prefix the prefix for the filename
@param extension the file extension, not including a leading "."
@return the created file | [
"Create",
"a",
"dump",
"file",
"with",
"a",
"unique",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/HotSpotJavaDumperImpl.java#L116-L126 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/StatementUtil.java | StatementUtil.prepareStatement | public static PreparedStatement prepareStatement(Connection conn, String sql, Collection<Object> params) throws SQLException {
return prepareStatement(conn, sql, params.toArray(new Object[params.size()]));
} | java | public static PreparedStatement prepareStatement(Connection conn, String sql, Collection<Object> params) throws SQLException {
return prepareStatement(conn, sql, params.toArray(new Object[params.size()]));
} | [
"public",
"static",
"PreparedStatement",
"prepareStatement",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Collection",
"<",
"Object",
">",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"prepareStatement",
"(",
"conn",
",",
"sql",
",",
"params... | 创建{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param params "?"对应参数列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 3.2.3 | [
"创建",
"{",
"@link",
"PreparedStatement",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/StatementUtil.java#L124-L126 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java | NumberBindings.divideSafe | public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) {
return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue));
} | java | public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) {
return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue));
} | [
"public",
"static",
"IntegerBinding",
"divideSafe",
"(",
"ObservableIntegerValue",
"dividend",
",",
"ObservableIntegerValue",
"divisor",
",",
"int",
"defaultValue",
")",
"{",
"return",
"divideSafe",
"(",
"dividend",
",",
"divisor",
",",
"new",
"SimpleIntegerProperty",
... | An integer binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerValue,
javafx.beans.value.ObservableIntegerValue)}
for more information.
@param dividend the observable value used as dividend
@para... | [
"An",
"integer",
"binding",
"of",
"a",
"division",
"that",
"won",
"t",
"throw",
"an",
"{",
"@link",
"java",
".",
"lang",
".",
"ArithmeticException",
"}",
"when",
"a",
"division",
"by",
"zero",
"happens",
".",
"See",
"{",
"@link",
"#divideSafe",
"(",
"jav... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java#L245-L247 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DataSetFactory.java | DataSetFactory.createLineDataset | protected static JRDesignChartDataset createLineDataset(JRDesignGroup group, JRDesignGroup parentGroup, List vars, DJChart djchart) {
JRDesignCategoryDataset data = new JRDesignCategoryDataset(null);
// for (Iterator iterator = vars.iterator(); iterator.hasNext();) {
JRDesignCategorySeries serie = new JRDesignCa... | java | protected static JRDesignChartDataset createLineDataset(JRDesignGroup group, JRDesignGroup parentGroup, List vars, DJChart djchart) {
JRDesignCategoryDataset data = new JRDesignCategoryDataset(null);
// for (Iterator iterator = vars.iterator(); iterator.hasNext();) {
JRDesignCategorySeries serie = new JRDesignCa... | [
"protected",
"static",
"JRDesignChartDataset",
"createLineDataset",
"(",
"JRDesignGroup",
"group",
",",
"JRDesignGroup",
"parentGroup",
",",
"List",
"vars",
",",
"DJChart",
"djchart",
")",
"{",
"JRDesignCategoryDataset",
"data",
"=",
"new",
"JRDesignCategoryDataset",
"(... | Use vars[0] as value, user vars[1] as series
@param group
@param parentGroup
@param vars
@param djchart
@return | [
"Use",
"vars",
"[",
"0",
"]",
"as",
"value",
"user",
"vars",
"[",
"1",
"]",
"as",
"series"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DataSetFactory.java#L77-L114 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/MapUtils.java | MapUtils.findAll | public static <K, V> Map<K, V> findAll(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
return filter(map, filter);
} | java | public static <K, V> Map<K, V> findAll(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
return filter(map, filter);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"findAll",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Filter",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"filter",
")",
"{",
"return",
"filter... | Finds all key-value entries from the given {@link Map} accepted by the {@link Filter}.
@param <K> Class type of the key.
@param <V> Class type of the value.
@param map {@link Map} to search.
@param filter {@link Filter} used to find matching key-value entries from the {@link Map}.
@return a new {@link Map} containing ... | [
"Finds",
"all",
"key",
"-",
"value",
"entries",
"from",
"the",
"given",
"{",
"@link",
"Map",
"}",
"accepted",
"by",
"the",
"{",
"@link",
"Filter",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/MapUtils.java#L145-L147 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/AbstractParsedStmt.java | AbstractParsedStmt.resolveCommonTableByName | private StmtCommonTableScan resolveCommonTableByName(String tableName, String tableAlias) {
StmtCommonTableScan answer = null;
StmtCommonTableScanShared scan = null;
for (AbstractParsedStmt scope = this; scope != null && scan == null; scope = scope.getParentStmt()) {
scan = scope.get... | java | private StmtCommonTableScan resolveCommonTableByName(String tableName, String tableAlias) {
StmtCommonTableScan answer = null;
StmtCommonTableScanShared scan = null;
for (AbstractParsedStmt scope = this; scope != null && scan == null; scope = scope.getParentStmt()) {
scan = scope.get... | [
"private",
"StmtCommonTableScan",
"resolveCommonTableByName",
"(",
"String",
"tableName",
",",
"String",
"tableAlias",
")",
"{",
"StmtCommonTableScan",
"answer",
"=",
"null",
";",
"StmtCommonTableScanShared",
"scan",
"=",
"null",
";",
"for",
"(",
"AbstractParsedStmt",
... | Look for a common table by name, possibly in parent scopes.
This is different from resolveStmtTableByAlias in that it
looks for common tables and only by name, not by alias. Of
course, a name and an alias are both strings, so this is kind
of a stylized distinction.
@param tableName
@return | [
"Look",
"for",
"a",
"common",
"table",
"by",
"name",
"possibly",
"in",
"parent",
"scopes",
".",
"This",
"is",
"different",
"from",
"resolveStmtTableByAlias",
"in",
"that",
"it",
"looks",
"for",
"common",
"tables",
"and",
"only",
"by",
"name",
"not",
"by",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/AbstractParsedStmt.java#L1482-L1492 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.createForRevisions | public <T> String createForRevisions(Class<T> clazz) {
return createForRevisions(clazz, null, null);
} | java | public <T> String createForRevisions(Class<T> clazz) {
return createForRevisions(clazz, null, null);
} | [
"public",
"<",
"T",
">",
"String",
"createForRevisions",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"createForRevisions",
"(",
"clazz",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates a data subscription in a database. The subscription will expose all documents that match the specified subscription options for a given type.
@param <T> Document class
@param clazz Document class
@return created subscription | [
"Creates",
"a",
"data",
"subscription",
"in",
"a",
"database",
".",
"The",
"subscription",
"will",
"expose",
"all",
"documents",
"that",
"match",
"the",
"specified",
"subscription",
"options",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L97-L99 |
sockeqwe/mosby | sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java | SearchEngine.isProductMatchingSearchCriteria | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) return true;
if (product.getDescription().contains(w)) return true;
if (product.getCategory().cont... | java | private boolean isProductMatchingSearchCriteria(Product product, String searchQueryText) {
String words[] = searchQueryText.split(" ");
for (String w : words) {
if (product.getName().contains(w)) return true;
if (product.getDescription().contains(w)) return true;
if (product.getCategory().cont... | [
"private",
"boolean",
"isProductMatchingSearchCriteria",
"(",
"Product",
"product",
",",
"String",
"searchQueryText",
")",
"{",
"String",
"words",
"[",
"]",
"=",
"searchQueryText",
".",
"split",
"(",
"\" \"",
")",
";",
"for",
"(",
"String",
"w",
":",
"words",
... | Filters those items that contains the search query text in name, description or category | [
"Filters",
"those",
"items",
"that",
"contains",
"the",
"search",
"query",
"text",
"in",
"name",
"description",
"or",
"category"
] | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/searchengine/SearchEngine.java#L60-L68 |
lightbend/config | config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java | ConfigDelayedMerge.makeReplacement | static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) {
List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size());
if (subStack.isEmpty()) {
if (ConfigImpl.traceSubstitutionsEnabled())
ConfigImpl.tr... | java | static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) {
List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size());
if (subStack.isEmpty()) {
if (ConfigImpl.traceSubstitutionsEnabled())
ConfigImpl.tr... | [
"static",
"AbstractConfigValue",
"makeReplacement",
"(",
"ResolveContext",
"context",
",",
"List",
"<",
"AbstractConfigValue",
">",
"stack",
",",
"int",
"skipping",
")",
"{",
"List",
"<",
"AbstractConfigValue",
">",
"subStack",
"=",
"stack",
".",
"subList",
"(",
... | static method also used by ConfigDelayedMergeObject; end may be null | [
"static",
"method",
"also",
"used",
"by",
"ConfigDelayedMergeObject",
";",
"end",
"may",
"be",
"null"
] | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java#L161-L179 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/graph/BellmanFord.java | BellmanFord.hasNegativeCycle | public static boolean hasNegativeCycle(Object sourceOrDest,
DirectedGraph g, Mode mode) {
return calcShortestDistances(sourceOrDest, g, mode) == null;
} | java | public static boolean hasNegativeCycle(Object sourceOrDest,
DirectedGraph g, Mode mode) {
return calcShortestDistances(sourceOrDest, g, mode) == null;
} | [
"public",
"static",
"boolean",
"hasNegativeCycle",
"(",
"Object",
"sourceOrDest",
",",
"DirectedGraph",
"g",
",",
"Mode",
"mode",
")",
"{",
"return",
"calcShortestDistances",
"(",
"sourceOrDest",
",",
"g",
",",
"mode",
")",
"==",
"null",
";",
"}"
] | Determines if there are any negative cycles found.
@param sourceOrDest
a vertex.
@return <code>true</code> if a negative cycle was found,
<code>false</code> otherwise. | [
"Determines",
"if",
"there",
"are",
"any",
"negative",
"cycles",
"found",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/graph/BellmanFord.java#L82-L85 |
ikew0ng/SwipeBackLayout | library/src/main/java/me/imid/swipebacklayout/lib/ViewDragHelper.java | ViewDragHelper.setSensitivity | public void setSensitivity(Context context, float sensitivity) {
float s = Math.max(0f, Math.min(1.0f, sensitivity));
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
mTouchSlop = (int) (viewConfiguration.getScaledTouchSlop() * (1 / s));
} | java | public void setSensitivity(Context context, float sensitivity) {
float s = Math.max(0f, Math.min(1.0f, sensitivity));
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
mTouchSlop = (int) (viewConfiguration.getScaledTouchSlop() * (1 / s));
} | [
"public",
"void",
"setSensitivity",
"(",
"Context",
"context",
",",
"float",
"sensitivity",
")",
"{",
"float",
"s",
"=",
"Math",
".",
"max",
"(",
"0f",
",",
"Math",
".",
"min",
"(",
"1.0f",
",",
"sensitivity",
")",
")",
";",
"ViewConfiguration",
"viewCon... | Sets the sensitivity of the dragger.
@param context The application context.
@param sensitivity value between 0 and 1, the final value for touchSlop =
ViewConfiguration.getScaledTouchSlop * (1 / s); | [
"Sets",
"the",
"sensitivity",
"of",
"the",
"dragger",
"."
] | train | https://github.com/ikew0ng/SwipeBackLayout/blob/7c6b0ac424813266cec57db86d65a7c9d9ff5fa6/library/src/main/java/me/imid/swipebacklayout/lib/ViewDragHelper.java#L439-L443 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableImport.java | SSTableImport.importJson | public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException
{
ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf);
IPartitioner partitioner = DatabaseDescriptor.getPartitioner();
int importedKeys = (isSorted) ? impo... | java | public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException
{
ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf);
IPartitioner partitioner = DatabaseDescriptor.getPartitioner();
int importedKeys = (isSorted) ? impo... | [
"public",
"int",
"importJson",
"(",
"String",
"jsonFile",
",",
"String",
"keyspace",
",",
"String",
"cf",
",",
"String",
"ssTablePath",
")",
"throws",
"IOException",
"{",
"ColumnFamily",
"columnFamily",
"=",
"ArrayBackedSortedColumns",
".",
"factory",
".",
"create... | Convert a JSON formatted file to an SSTable.
@param jsonFile the file containing JSON formatted data
@param keyspace keyspace the data belongs to
@param cf column family the data belongs to
@param ssTablePath file to write the SSTable to
@throws IOException for errors reading/writing input/output | [
"Convert",
"a",
"JSON",
"formatted",
"file",
"to",
"an",
"SSTable",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L282-L294 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java | BoxApiCollaboration.getAddRequest | @Deprecated
public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role role, String login) {
return getAddToFolderRequest(folderId, role, login);
} | java | @Deprecated
public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role role, String login) {
return getAddToFolderRequest(folderId, role, login);
} | [
"@",
"Deprecated",
"public",
"BoxRequestsShare",
".",
"AddCollaboration",
"getAddRequest",
"(",
"String",
"folderId",
",",
"BoxCollaboration",
".",
"Role",
"role",
",",
"String",
"login",
")",
"{",
"return",
"getAddToFolderRequest",
"(",
"folderId",
",",
"role",
"... | Deprecated use getAddToFolderRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, String login)
@param folderId id of the folder to be collaborated.
@param role role of the collaboration
@param login email address of the user to add
@return request to add/create a collaboration | [
"Deprecated",
"use",
"getAddToFolderRequest",
"(",
"BoxCollaborationItem",
"collaborationItem",
"BoxCollaboration",
".",
"Role",
"role",
"String",
"login",
")"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L132-L135 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java | DefaultApplicationObjectConfigurer.configureDescription | protected void configureDescription(DescriptionConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
String caption = loadMessage(objectName + "." + CAPTION_KEY);
if (StringUtils.hasText(caption)) {
configurable.setCaption(ca... | java | protected void configureDescription(DescriptionConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
String caption = loadMessage(objectName + "." + CAPTION_KEY);
if (StringUtils.hasText(caption)) {
configurable.setCaption(ca... | [
"protected",
"void",
"configureDescription",
"(",
"DescriptionConfigurable",
"configurable",
",",
"String",
"objectName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"configurable",
",",
"\"configurable\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"objectName",
",",
... | Sets the description and caption of the given object. These values are
loaded from this instance's {@link MessageSource} using message codes in
the format
<pre>
<objectName>.description
</pre>
and
<pre>
<objectName>.caption
</pre>
respectively.
@param configurable The object to be configured. Must not ... | [
"Sets",
"the",
"description",
"and",
"caption",
"of",
"the",
"given",
"object",
".",
"These",
"values",
"are",
"loaded",
"from",
"this",
"instance",
"s",
"{",
"@link",
"MessageSource",
"}",
"using",
"message",
"codes",
"in",
"the",
"format"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L462-L478 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.modifyAckDeadline | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final List<String> ackIds) {
return modifyAckDeadline(Subscription.canonicalSubscription(project, subscription), ackDeadlineSeconds, ackIds);
} | java | public PubsubFuture<Void> modifyAckDeadline(final String project, final String subscription,
final int ackDeadlineSeconds, final List<String> ackIds) {
return modifyAckDeadline(Subscription.canonicalSubscription(project, subscription), ackDeadlineSeconds, ackIds);
} | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"modifyAckDeadline",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"subscription",
",",
"final",
"int",
"ackDeadlineSeconds",
",",
"final",
"List",
"<",
"String",
">",
"ackIds",
")",
"{",
"return",
"modi... | Modify the ack deadline for a list of received messages.
@param project The Google Cloud project.
@param subscription The subscription of the received message to modify the ack deadline on.
@param ackDeadlineSeconds The new ack deadline.
@param ackIds List of message ID's to modify the ack... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"a",
"list",
"of",
"received",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L687-L690 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java | ImageMemoryCache.removeFromCache | public static void removeFromCache(String imageUri, ImageMemoryCache memoryCache) {
List<String> keysToRemove = new ArrayList<String>();
for (String key : memoryCache.getKeySet()) {
if (key.startsWith(imageUri)) {
keysToRemove.add(key);
}
}
for (String keyToRemove : keysToRemove) {
memoryCache.remo... | java | public static void removeFromCache(String imageUri, ImageMemoryCache memoryCache) {
List<String> keysToRemove = new ArrayList<String>();
for (String key : memoryCache.getKeySet()) {
if (key.startsWith(imageUri)) {
keysToRemove.add(key);
}
}
for (String keyToRemove : keysToRemove) {
memoryCache.remo... | [
"public",
"static",
"void",
"removeFromCache",
"(",
"String",
"imageUri",
",",
"ImageMemoryCache",
"memoryCache",
")",
"{",
"List",
"<",
"String",
">",
"keysToRemove",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"key",
... | Removes from memory cache all sizes of a given image URI.<br /> | [
"Removes",
"from",
"memory",
"cache",
"all",
"sizes",
"of",
"a",
"given",
"image",
"URI",
".",
"<br",
"/",
">"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java#L170-L180 |
jenkinsci/jenkins | core/src/main/java/hudson/Lookup.java | Lookup.setIfNull | public <T> T setIfNull(Class<T> type, T instance) {
Object o = data.putIfAbsent(type, instance);
if (o!=null) return type.cast(o);
return instance;
} | java | public <T> T setIfNull(Class<T> type, T instance) {
Object o = data.putIfAbsent(type, instance);
if (o!=null) return type.cast(o);
return instance;
} | [
"public",
"<",
"T",
">",
"T",
"setIfNull",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"instance",
")",
"{",
"Object",
"o",
"=",
"data",
".",
"putIfAbsent",
"(",
"type",
",",
"instance",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"return",
... | Overwrites the value only if the current value is null.
@return
If the value was null, return the {@code instance} value.
Otherwise return the current value, which is non-null. | [
"Overwrites",
"the",
"value",
"only",
"if",
"the",
"current",
"value",
"is",
"null",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Lookup.java#L52-L56 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/servlets/ListAllNodes.java | ListAllNodes.process | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean doStatusQuery = request.getParameter(PING_NODES) != null;
String acceptHeader = request.getHeader("Accept");
if (acceptHeader != null && acceptHeader.equalsIgnoreCase("application/json")... | java | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean doStatusQuery = request.getParameter(PING_NODES) != null;
String acceptHeader = request.getHeader("Accept");
if (acceptHeader != null && acceptHeader.equalsIgnoreCase("application/json")... | [
"protected",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"boolean",
"doStatusQuery",
"=",
"request",
".",
"getParameter",
"(",
"PING_NODES",
")",
"!=",
"null",
";",
"String",
"... | This method gets all the nodes which are connected to the grid machine from the Registry and displays them in
html page.
@param request
{@link HttpServletRequest} that represents the servlet request
@param response
{@link HttpServletResponse} that represents the servlet response
@throws IOException | [
"This",
"method",
"gets",
"all",
"the",
"nodes",
"which",
"are",
"connected",
"to",
"the",
"grid",
"machine",
"from",
"the",
"Registry",
"and",
"displays",
"them",
"in",
"html",
"page",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/ListAllNodes.java#L76-L86 |
k3po/k3po | driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/tcp/TcpBootstrapFactorySpi.java | TcpBootstrapFactorySpi.newServerBootstrap | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
ServerSocketChannelFactory serverChannelFactory = this.serverChannelFactory;
if (serverChannelFactory == null) {
Executor bossExecutor = executorServiceFactory.newExecutorService("boss.server");
... | java | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
ServerSocketChannelFactory serverChannelFactory = this.serverChannelFactory;
if (serverChannelFactory == null) {
Executor bossExecutor = executorServiceFactory.newExecutorService("boss.server");
... | [
"@",
"Override",
"public",
"synchronized",
"ServerBootstrap",
"newServerBootstrap",
"(",
")",
"throws",
"Exception",
"{",
"ServerSocketChannelFactory",
"serverChannelFactory",
"=",
"this",
".",
"serverChannelFactory",
";",
"if",
"(",
"serverChannelFactory",
"==",
"null",
... | Returns a {@link ServerBootstrap} instance for the named transport. | [
"Returns",
"a",
"{"
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/tcp/TcpBootstrapFactorySpi.java#L124-L148 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/time/StoppedClock.java | StoppedClock.plus | public final long plus(final long value, @Nonnull final TimeUnit timeUnit) {
return this.millis.addAndGet(timeUnit.toMillis(value));
} | java | public final long plus(final long value, @Nonnull final TimeUnit timeUnit) {
return this.millis.addAndGet(timeUnit.toMillis(value));
} | [
"public",
"final",
"long",
"plus",
"(",
"final",
"long",
"value",
",",
"@",
"Nonnull",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"this",
".",
"millis",
".",
"addAndGet",
"(",
"timeUnit",
".",
"toMillis",
"(",
"value",
")",
")",
";",
"}"
] | Add the specified amount of time to the current clock.
@param value The numeric value to add to the clock after converting
based on the provided {@code timeUnit}.
@param timeUnit The time unit that {@code value} is measured in.
@return The time after being adjusted by the provided offset. | [
"Add",
"the",
"specified",
"amount",
"of",
"time",
"to",
"the",
"current",
"clock",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/time/StoppedClock.java#L48-L50 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java | DisruptorRunable.onEvent | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
if (event == null) {
return;
}
handleEvent(event, endOfBatch);
} | java | @Override
public void onEvent(Object event, long sequence, boolean endOfBatch) throws Exception {
if (event == null) {
return;
}
handleEvent(event, endOfBatch);
} | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"Object",
"event",
",",
"long",
"sequence",
",",
"boolean",
"endOfBatch",
")",
"throws",
"Exception",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"return",
";",
"}",
"handleEvent",
"(",
"event",
","... | This function need to be implements
@see com.lmax.disruptor.EventHandler#onEvent(java.lang.Object, long, boolean) | [
"This",
"function",
"need",
"to",
"be",
"implements"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/DisruptorRunable.java#L52-L58 |
eserating/siren4j | src/main/java/com/google/code/siren4j/util/ComponentUtils.java | ComponentUtils.getLinkByRel | public static Link getLinkByRel(Entity entity, String... rel) {
if(entity == null) {
throw new IllegalArgumentException("entity cannot be null.");
}
if(ArrayUtils.isEmpty(rel)) {
throw new IllegalArgumentException("rel cannot be null or empty");
}
L... | java | public static Link getLinkByRel(Entity entity, String... rel) {
if(entity == null) {
throw new IllegalArgumentException("entity cannot be null.");
}
if(ArrayUtils.isEmpty(rel)) {
throw new IllegalArgumentException("rel cannot be null or empty");
}
L... | [
"public",
"static",
"Link",
"getLinkByRel",
"(",
"Entity",
"entity",
",",
"String",
"...",
"rel",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"entity cannot be null.\"",
")",
";",
"}",
"if",
"(",
... | Retrieve a link by its relationship.
@param entity cannot be <code>null</code>.
@param rel cannot be <code>null</code> or empty.
@return the located link or <code>null</code> if not found. | [
"Retrieve",
"a",
"link",
"by",
"its",
"relationship",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ComponentUtils.java#L76-L94 |
infinispan/infinispan | core/src/main/java/org/infinispan/commands/functional/Mutations.java | Mutations.writeTo | static <K, V, T, R> void writeTo(ObjectOutput output, Mutation<K, V, R> mutation) throws IOException {
BaseMutation bm = (BaseMutation) mutation;
DataConversion.writeTo(output, bm.keyDataConversion);
DataConversion.writeTo(output, bm.valueDataConversion);
byte type = mutation.type();
outpu... | java | static <K, V, T, R> void writeTo(ObjectOutput output, Mutation<K, V, R> mutation) throws IOException {
BaseMutation bm = (BaseMutation) mutation;
DataConversion.writeTo(output, bm.keyDataConversion);
DataConversion.writeTo(output, bm.valueDataConversion);
byte type = mutation.type();
outpu... | [
"static",
"<",
"K",
",",
"V",
",",
"T",
",",
"R",
">",
"void",
"writeTo",
"(",
"ObjectOutput",
"output",
",",
"Mutation",
"<",
"K",
",",
"V",
",",
"R",
">",
"mutation",
")",
"throws",
"IOException",
"{",
"BaseMutation",
"bm",
"=",
"(",
"BaseMutation"... | No need to occupy externalizer ids when we have a limited set of options | [
"No",
"need",
"to",
"occupy",
"externalizer",
"ids",
"when",
"we",
"have",
"a",
"limited",
"set",
"of",
"options"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/commands/functional/Mutations.java#L26-L50 |
jeluard/semantic-versioning | api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java | DOMDiffHandler.classChanged | public void classChanged(ClassInfo oldInfo, ClassInfo newInfo)
throws DiffException
{
Node currentNode = this.currentNode;
Element tmp = doc.createElementNS(XML_URI, "classchange");
Element from = doc.createElementNS(XML_URI, "from");
Element to = doc.createElementNS(XML_URI... | java | public void classChanged(ClassInfo oldInfo, ClassInfo newInfo)
throws DiffException
{
Node currentNode = this.currentNode;
Element tmp = doc.createElementNS(XML_URI, "classchange");
Element from = doc.createElementNS(XML_URI, "from");
Element to = doc.createElementNS(XML_URI... | [
"public",
"void",
"classChanged",
"(",
"ClassInfo",
"oldInfo",
",",
"ClassInfo",
"newInfo",
")",
"throws",
"DiffException",
"{",
"Node",
"currentNode",
"=",
"this",
".",
"currentNode",
";",
"Element",
"tmp",
"=",
"doc",
".",
"createElementNS",
"(",
"XML_URI",
... | Write out info aboout a changed class.
This writes out a <classchange> node, followed by a
<from> node, with the old information about the class
followed by a <to> node with the new information about the
class.
@param oldInfo Info about the old class.
@param newInfo Info about the new class.
@throws ... | [
"Write",
"out",
"info",
"aboout",
"a",
"changed",
"class",
".",
"This",
"writes",
"out",
"a",
"<",
";",
"classchange>",
";",
"node",
"followed",
"by",
"a",
"<",
";",
"from>",
";",
"node",
"with",
"the",
"old",
"information",
"about",
"the",
"clas... | train | https://github.com/jeluard/semantic-versioning/blob/d0bfbeddca8ac4202f5225810227c72a708360a9/api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java#L358-L373 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java | ISOS.nominateNeighbors | public static void nominateNeighbors(DBIDIter ignore, DBIDArrayIter di, double[] p, double norm, WritableDoubleDataStore scores) {
for(di.seek(0); di.valid(); di.advance()) {
if(DBIDUtil.equal(ignore, di)) {
continue;
}
double v = p[di.getOffset()] * norm; // Normalize
if(!(v > 0)) {... | java | public static void nominateNeighbors(DBIDIter ignore, DBIDArrayIter di, double[] p, double norm, WritableDoubleDataStore scores) {
for(di.seek(0); di.valid(); di.advance()) {
if(DBIDUtil.equal(ignore, di)) {
continue;
}
double v = p[di.getOffset()] * norm; // Normalize
if(!(v > 0)) {... | [
"public",
"static",
"void",
"nominateNeighbors",
"(",
"DBIDIter",
"ignore",
",",
"DBIDArrayIter",
"di",
",",
"double",
"[",
"]",
"p",
",",
"double",
"norm",
",",
"WritableDoubleDataStore",
"scores",
")",
"{",
"for",
"(",
"di",
".",
"seek",
"(",
"0",
")",
... | Vote for neighbors not being outliers. The key method of SOS.
@param ignore Object to ignore
@param di Neighbor object IDs.
@param p Probabilities
@param norm Normalization factor (1/sum)
@param scores Output score storage | [
"Vote",
"for",
"neighbors",
"not",
"being",
"outliers",
".",
"The",
"key",
"method",
"of",
"SOS",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java#L217-L228 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.randomShuffle | public static void randomShuffle(ArrayModifiableDBIDs ids, RandomFactory rnd) {
randomShuffle(ids, rnd.getSingleThreadedRandom(), ids.size());
} | java | public static void randomShuffle(ArrayModifiableDBIDs ids, RandomFactory rnd) {
randomShuffle(ids, rnd.getSingleThreadedRandom(), ids.size());
} | [
"public",
"static",
"void",
"randomShuffle",
"(",
"ArrayModifiableDBIDs",
"ids",
",",
"RandomFactory",
"rnd",
")",
"{",
"randomShuffle",
"(",
"ids",
",",
"rnd",
".",
"getSingleThreadedRandom",
"(",
")",
",",
"ids",
".",
"size",
"(",
")",
")",
";",
"}"
] | Produce a random shuffling of the given DBID array.
@param ids Original DBIDs, no duplicates allowed
@param rnd Random generator | [
"Produce",
"a",
"random",
"shuffling",
"of",
"the",
"given",
"DBID",
"array",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L510-L512 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java | ImageIOGreyScale.getImageWriters | public static Iterator<ImageWriter> getImageWriters(ImageTypeSpecifier type, String formatName) {
if (type == null) {
throw new IllegalArgumentException("type == null!");
}
if (formatName == null) {
throw new IllegalArgumentException("formatName == null!");
}
Iterator iter;
// Ensure categor... | java | public static Iterator<ImageWriter> getImageWriters(ImageTypeSpecifier type, String formatName) {
if (type == null) {
throw new IllegalArgumentException("type == null!");
}
if (formatName == null) {
throw new IllegalArgumentException("formatName == null!");
}
Iterator iter;
// Ensure categor... | [
"public",
"static",
"Iterator",
"<",
"ImageWriter",
">",
"getImageWriters",
"(",
"ImageTypeSpecifier",
"type",
",",
"String",
"formatName",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type == null!\"",
... | Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that
claim to be able to encode images of the given layout (specified using an
<code>ImageTypeSpecifier</code>) in the given format.
@param type
an <code>ImageTypeSpecifier</code> indicating the layout of the image to be wri... | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"containing",
"all",
"currently",
"registered",
"<code",
">",
"ImageWriter<",
"/",
"code",
">",
"s",
"that",
"claim",
"to",
"be",
"able",
"to",
"encode",
"images",
"of",
"the",
"given",
"layout"... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java#L1017-L1034 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java | PDF417.calculateNumberOfRows | private static int calculateNumberOfRows(int m, int k, int c) {
int r = ((m + 1 + k) / c) + 1;
if (c * r >= (m + 1 + k + c)) {
r--;
}
return r;
} | java | private static int calculateNumberOfRows(int m, int k, int c) {
int r = ((m + 1 + k) / c) + 1;
if (c * r >= (m + 1 + k + c)) {
r--;
}
return r;
} | [
"private",
"static",
"int",
"calculateNumberOfRows",
"(",
"int",
"m",
",",
"int",
"k",
",",
"int",
"c",
")",
"{",
"int",
"r",
"=",
"(",
"(",
"m",
"+",
"1",
"+",
"k",
")",
"/",
"c",
")",
"+",
"1",
";",
"if",
"(",
"c",
"*",
"r",
">=",
"(",
... | Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
@param m the number of source codewords prior to the additional of the Symbol Length
Descriptor and any pad codewords
@param k the number of error correction codewords
@param c the number of columns in the symbol in the data regi... | [
"Calculates",
"the",
"necessary",
"number",
"of",
"rows",
"as",
"described",
"in",
"annex",
"Q",
"of",
"ISO",
"/",
"IEC",
"15438",
":",
"2001",
"(",
"E",
")",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417.java#L552-L558 |
groovy/groovy-core | src/main/groovy/beans/BindableASTTransformation.java | BindableASTTransformation.createBindableStatement | protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression) {
// create statementBody
return stmt(callThisX("firePropertyChange", args(constX(propertyNode.getName()), fieldExpression, assignX(fieldExpression, varX("value")))));
} | java | protected Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression) {
// create statementBody
return stmt(callThisX("firePropertyChange", args(constX(propertyNode.getName()), fieldExpression, assignX(fieldExpression, varX("value")))));
} | [
"protected",
"Statement",
"createBindableStatement",
"(",
"PropertyNode",
"propertyNode",
",",
"Expression",
"fieldExpression",
")",
"{",
"// create statementBody\r",
"return",
"stmt",
"(",
"callThisX",
"(",
"\"firePropertyChange\"",
",",
"args",
"(",
"constX",
"(",
"pr... | Creates a statement body similar to:
<code>this.firePropertyChange("field", field, field = value)</code>
@param propertyNode the field node for the property
@param fieldExpression a field expression for setting the property value
@return the created statement | [
"Creates",
"a",
"statement",
"body",
"similar",
"to",
":",
"<code",
">",
"this",
".",
"firePropertyChange",
"(",
"field",
"field",
"field",
"=",
"value",
")",
"<",
"/",
"code",
">"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/beans/BindableASTTransformation.java#L234-L237 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsFormatterWidget.java | A_CmsFormatterWidget.getMessage | static String getMessage(CmsObject cms, String message, Object... args) {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
return Messages.get().getBundle(locale).key(message, args);
} | java | static String getMessage(CmsObject cms, String message, Object... args) {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
return Messages.get().getBundle(locale).key(message, args);
} | [
"static",
"String",
"getMessage",
"(",
"CmsObject",
"cms",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"Locale",
"locale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceLocale",
"(",
"cms",
")",
";",
"return",
... | Gets a message string.<p>
@param cms the CMS context
@param message the message key
@param args the message arguments
@return the message string | [
"Gets",
"a",
"message",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsFormatterWidget.java#L148-L152 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthLength | static int getMonthLength(int month, int year) {
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | java | static int getMonthLength(int month, int year) {
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | [
"static",
"int",
"getMonthLength",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthLength",
"(",
"year",
")",
";",
"return",
"newMonths",
"[",
"month",
"]",
".",
"intValue",
"(",
")",
";",
"}"
] | Returns month length.
@param month month (0-based)
@param year year
@return month length | [
"Returns",
"month",
"length",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1136-L1139 |
qiujiayu/AutoLoadCache | src/main/java/com/jarvis/cache/CacheHandler.java | CacheHandler.getCacheOpType | private CacheOpType getCacheOpType(Cache cache, Object[] arguments) {
CacheOpType opType = cache.opType();
CacheOpType tmpOpType = CacheHelper.getCacheOpType();
if (null != tmpOpType) {
opType = tmpOpType;
}
if (null != arguments && arguments.length > 0) {
... | java | private CacheOpType getCacheOpType(Cache cache, Object[] arguments) {
CacheOpType opType = cache.opType();
CacheOpType tmpOpType = CacheHelper.getCacheOpType();
if (null != tmpOpType) {
opType = tmpOpType;
}
if (null != arguments && arguments.length > 0) {
... | [
"private",
"CacheOpType",
"getCacheOpType",
"(",
"Cache",
"cache",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"CacheOpType",
"opType",
"=",
"cache",
".",
"opType",
"(",
")",
";",
"CacheOpType",
"tmpOpType",
"=",
"CacheHelper",
".",
"getCacheOpType",
"(",
... | 获取CacheOpType,从三个地方获取:<br>
1. Cache注解中获取;<br>
2. 从ThreadLocal中获取;<br>
3. 从参数中获取;<br>
上面三者的优先级:从低到高。
@param cache 注解
@param arguments 参数
@return CacheOpType | [
"获取CacheOpType,从三个地方获取:<br",
">",
"1",
".",
"Cache注解中获取;<br",
">",
"2",
".",
"从ThreadLocal中获取;<br",
">",
"3",
".",
"从参数中获取;<br",
">",
"上面三者的优先级:从低到高。"
] | train | https://github.com/qiujiayu/AutoLoadCache/blob/8121c146f1a420fa6d6832e849acadb547c13622/src/main/java/com/jarvis/cache/CacheHandler.java#L131-L149 |
clanie/clanie-core | src/main/java/dk/clanie/collections/NumberMap.java | NumberMap.newBigDecimalMap | public static <K> NumberMap<K, BigDecimal> newBigDecimalMap() {
return new NumberMap<K, BigDecimal>() {
@Override
public void add(K key, BigDecimal addend) {
put(key, containsKey(key) ? get(key).add(addend) : addend);
}
@Override
public void sub(K key, BigDecimal subtrahend) {
put(key, (contain... | java | public static <K> NumberMap<K, BigDecimal> newBigDecimalMap() {
return new NumberMap<K, BigDecimal>() {
@Override
public void add(K key, BigDecimal addend) {
put(key, containsKey(key) ? get(key).add(addend) : addend);
}
@Override
public void sub(K key, BigDecimal subtrahend) {
put(key, (contain... | [
"public",
"static",
"<",
"K",
">",
"NumberMap",
"<",
"K",
",",
"BigDecimal",
">",
"newBigDecimalMap",
"(",
")",
"{",
"return",
"new",
"NumberMap",
"<",
"K",
",",
"BigDecimal",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"add",
"(",
"K",
"k... | Creates a NumberMap for BigDecimals.
@param <K>
@return NumberMap<K, BigDecimal> | [
"Creates",
"a",
"NumberMap",
"for",
"BigDecimals",
"."
] | train | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/collections/NumberMap.java#L72-L83 |
iwgang/CountdownView | library/src/main/java/cn/iwgang/countdownview/CountdownView.java | CountdownView.customTimeShow | @Deprecated
public void customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond) {
mCountdown.mHasSetIsShowDay = true;
mCountdown.mHasSetIsShowHour = true;
boolean isModCountdownInterval = mCountdown.refTimeShow(isShowDay,... | java | @Deprecated
public void customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond) {
mCountdown.mHasSetIsShowDay = true;
mCountdown.mHasSetIsShowHour = true;
boolean isModCountdownInterval = mCountdown.refTimeShow(isShowDay,... | [
"@",
"Deprecated",
"public",
"void",
"customTimeShow",
"(",
"boolean",
"isShowDay",
",",
"boolean",
"isShowHour",
",",
"boolean",
"isShowMinute",
",",
"boolean",
"isShowSecond",
",",
"boolean",
"isShowMillisecond",
")",
"{",
"mCountdown",
".",
"mHasSetIsShowDay",
"=... | custom time show
@param isShowDay isShowDay
@param isShowHour isShowHour
@param isShowMinute isShowMinute
@param isShowSecond isShowSecond
@param isShowMillisecond isShowMillisecond
use:{@link #dynamicShow(DynamicConfig)} | [
"custom",
"time",
"show",
"@param",
"isShowDay",
"isShowDay",
"@param",
"isShowHour",
"isShowHour",
"@param",
"isShowMinute",
"isShowMinute",
"@param",
"isShowSecond",
"isShowSecond",
"@param",
"isShowMillisecond",
"isShowMillisecond"
] | train | https://github.com/iwgang/CountdownView/blob/3433615826b6e0a38b92e3362ba032947d9e8be7/library/src/main/java/cn/iwgang/countdownview/CountdownView.java#L177-L188 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/rest/JsonRestService.java | JsonRestService.post | @POST
public JSONObject post(String path, JSONObject content, Map<String,String> headers) throws ServiceException, JSONException {
throw new ServiceException(ServiceException.NOT_ALLOWED, "POST not implemented");
} | java | @POST
public JSONObject post(String path, JSONObject content, Map<String,String> headers) throws ServiceException, JSONException {
throw new ServiceException(ServiceException.NOT_ALLOWED, "POST not implemented");
} | [
"@",
"POST",
"public",
"JSONObject",
"post",
"(",
"String",
"path",
",",
"JSONObject",
"content",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"ServiceException",
",",
"JSONException",
"{",
"throw",
"new",
"ServiceException",
"(",
... | Create a new entity or relationship.
Or perform other action requests that cannot be categorized into put or delete. | [
"Create",
"a",
"new",
"entity",
"or",
"relationship",
".",
"Or",
"perform",
"other",
"action",
"requests",
"that",
"cannot",
"be",
"categorized",
"into",
"put",
"or",
"delete",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/rest/JsonRestService.java#L121-L124 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/StringUtilities.java | StringUtilities.levenshteinDistance | public static int levenshteinDistance(CharSequence s, CharSequence t)
{
// degenerate cases s
if (s == null || "".equals(s))
{
return t == null || "".equals(t) ? 0 : t.length();
}
else if (t == null || "".equals(t))
{
return s.length()... | java | public static int levenshteinDistance(CharSequence s, CharSequence t)
{
// degenerate cases s
if (s == null || "".equals(s))
{
return t == null || "".equals(t) ? 0 : t.length();
}
else if (t == null || "".equals(t))
{
return s.length()... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"CharSequence",
"s",
",",
"CharSequence",
"t",
")",
"{",
"// degenerate cases s",
"if",
"(",
"s",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"t",
"==",
"null... | The Levenshtein distance is a string metric for measuring the difference between two sequences.
Informally, the Levenshtein distance between two words is the minimum number of single-character edits
(i.e. insertions, deletions or substitutions) required to change one word into the other. The phrase
'edit distance' is o... | [
"The",
"Levenshtein",
"distance",
"is",
"a",
"string",
"metric",
"for",
"measuring",
"the",
"difference",
"between",
"two",
"sequences",
".",
"Informally",
"the",
"Levenshtein",
"distance",
"between",
"two",
"words",
"is",
"the",
"minimum",
"number",
"of",
"sing... | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/StringUtilities.java#L245-L291 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java | ApplicationActivityEvent.addApplicationParticipant | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | java | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | [
"public",
"void",
"addApplicationParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"false",
",",
"Col... | Add an Application Active Participant to this message
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Add",
"an",
"Application",
"Active",
"Participant",
"to",
"this",
"message"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java#L54-L63 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java | ST_Equals.geomEquals | public static Boolean geomEquals(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.equals(b);
} | java | public static Boolean geomEquals(Geometry a, Geometry b) {
if(a==null || b==null) {
return null;
}
return a.equals(b);
} | [
"public",
"static",
"Boolean",
"geomEquals",
"(",
"Geometry",
"a",
",",
"Geometry",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"a",
".",
"equals",
"(",
"b",
")",
";",
"}"
... | Return true if Geometry A is equal to Geometry B
@param a Geometry Geometry.
@param b Geometry instance
@return true if Geometry A is equal to Geometry B | [
"Return",
"true",
"if",
"Geometry",
"A",
"is",
"equal",
"to",
"Geometry",
"B"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/predicates/ST_Equals.java#L51-L56 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java | RegistriesInner.updatePolicies | public RegistryPoliciesInner updatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().last().body();
} | java | public RegistryPoliciesInner updatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return updatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().last().body();
} | [
"public",
"RegistryPoliciesInner",
"updatePolicies",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryPoliciesInner",
"registryPoliciesUpdateParameters",
")",
"{",
"return",
"updatePoliciesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registryPoliciesUpdateParameters The parameters for updating policies of a container registry.
@thro... | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java#L1578-L1580 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getUntaggedImageCount | public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).toBlocking().single().body();
} | java | public int getUntaggedImageCount(UUID projectId, GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter) {
return getUntaggedImageCountWithServiceResponseAsync(projectId, getUntaggedImageCountOptionalParameter).toBlocking().single().body();
} | [
"public",
"int",
"getUntaggedImageCount",
"(",
"UUID",
"projectId",
",",
"GetUntaggedImageCountOptionalParameter",
"getUntaggedImageCountOptionalParameter",
")",
"{",
"return",
"getUntaggedImageCountWithServiceResponseAsync",
"(",
"projectId",
",",
"getUntaggedImageCountOptionalParam... | Gets the number of untagged images.
This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the
current workspace is used.
@param projectId The project id
@param getUntaggedImageCountOptionalParameter the object representing the optional parameters t... | [
"Gets",
"the",
"number",
"of",
"untagged",
"images",
".",
"This",
"API",
"returns",
"the",
"images",
"which",
"have",
"no",
"tags",
"for",
"a",
"given",
"project",
"and",
"optionally",
"an",
"iteration",
".",
"If",
"no",
"iteration",
"is",
"specified",
"th... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L4454-L4456 |
woxblom/DragListView | library/src/main/java/com/woxthebox/draglistview/DragItemRecyclerView.java | DragItemRecyclerView.findChildView | public View findChildView(float x, float y) {
final int count = getChildCount();
if (y <= 0 && count > 0) {
return getChildAt(0);
}
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
MarginLayoutParams params = (MarginLayoutParam... | java | public View findChildView(float x, float y) {
final int count = getChildCount();
if (y <= 0 && count > 0) {
return getChildAt(0);
}
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
MarginLayoutParams params = (MarginLayoutParam... | [
"public",
"View",
"findChildView",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"int",
"count",
"=",
"getChildCount",
"(",
")",
";",
"if",
"(",
"y",
"<=",
"0",
"&&",
"count",
">",
"0",
")",
"{",
"return",
"getChildAt",
"(",
"0",
")",
... | Returns the child view under the specific x,y coordinate.
This method will take margins of the child into account when finding it. | [
"Returns",
"the",
"child",
"view",
"under",
"the",
"specific",
"x",
"y",
"coordinate",
".",
"This",
"method",
"will",
"take",
"margins",
"of",
"the",
"child",
"into",
"account",
"when",
"finding",
"it",
"."
] | train | https://github.com/woxblom/DragListView/blob/9823406f21d96035e88d8fd173f64419d0bb89f3/library/src/main/java/com/woxthebox/draglistview/DragItemRecyclerView.java#L251-L267 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java | RouteProcessorThreadListener.onNewRouteProgress | @Override
public void onNewRouteProgress(Location location, RouteProgress routeProgress) {
notificationProvider.updateNavigationNotification(routeProgress);
eventDispatcher.onProgressChange(location, routeProgress);
} | java | @Override
public void onNewRouteProgress(Location location, RouteProgress routeProgress) {
notificationProvider.updateNavigationNotification(routeProgress);
eventDispatcher.onProgressChange(location, routeProgress);
} | [
"@",
"Override",
"public",
"void",
"onNewRouteProgress",
"(",
"Location",
"location",
",",
"RouteProgress",
"routeProgress",
")",
"{",
"notificationProvider",
".",
"updateNavigationNotification",
"(",
"routeProgress",
")",
";",
"eventDispatcher",
".",
"onProgressChange",
... | Corresponds to ProgressChangeListener object, updating the notification and passing information
to the navigation event dispatcher. | [
"Corresponds",
"to",
"ProgressChangeListener",
"object",
"updating",
"the",
"notification",
"and",
"passing",
"information",
"to",
"the",
"navigation",
"event",
"dispatcher",
"."
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/RouteProcessorThreadListener.java#L31-L35 |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java | TwoColumnTable.get2 | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
return this.second.get(txn, second);
} | java | @Nullable
public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {
return this.second.get(txn, second);
} | [
"@",
"Nullable",
"public",
"ByteIterable",
"get2",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"second",
")",
"{",
"return",
"this",
".",
"second",
".",
"get",
"(",
"txn",
",",
"second",
")",
";",
"}"... | Search for the second entry in the second database. Use this method for databases configured with no duplicates.
@param second second key (value for first).
@return null if no entry found, otherwise the value. | [
"Search",
"for",
"the",
"second",
"entry",
"in",
"the",
"second",
"database",
".",
"Use",
"this",
"method",
"for",
"databases",
"configured",
"with",
"no",
"duplicates",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java#L65-L68 |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java | SetCache.getSortedGrouping | @SuppressWarnings("unchecked")
public <T> SortedGrouping<T> getSortedGrouping(int id) {
return verifyType(id, sortedGroupings.get(id), SetType.SORTED_GROUPING);
} | java | @SuppressWarnings("unchecked")
public <T> SortedGrouping<T> getSortedGrouping(int id) {
return verifyType(id, sortedGroupings.get(id), SetType.SORTED_GROUPING);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"SortedGrouping",
"<",
"T",
">",
"getSortedGrouping",
"(",
"int",
"id",
")",
"{",
"return",
"verifyType",
"(",
"id",
",",
"sortedGroupings",
".",
"get",
"(",
"id",
")",
",",
"Se... | Returns the cached {@link SortedGrouping} for the given ID.
@param id Set ID
@param <T> SortedGrouping type
@return Cached SortedGrouping
@throws IllegalStateException if the cached set is not a SortedGrouping | [
"Returns",
"the",
"cached",
"{",
"@link",
"SortedGrouping",
"}",
"for",
"the",
"given",
"ID",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L182-L185 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/agent/TaskConfig.java | TaskConfig.containerEnv | public Map<String, String> containerEnv() {
final Map<String, String> env = Maps.newHashMap(envVars);
// Put in variables that tell the container where it's exposed
for (final Entry<String, Integer> entry : ports.entrySet()) {
env.put("HELIOS_PORT_" + entry.getKey(), host + ":" + entry.getValue());
... | java | public Map<String, String> containerEnv() {
final Map<String, String> env = Maps.newHashMap(envVars);
// Put in variables that tell the container where it's exposed
for (final Entry<String, Integer> entry : ports.entrySet()) {
env.put("HELIOS_PORT_" + entry.getKey(), host + ":" + entry.getValue());
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"containerEnv",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"env",
"=",
"Maps",
".",
"newHashMap",
"(",
"envVars",
")",
";",
"// Put in variables that tell the container where it's exposed... | Get environment variables for the container.
@return The environment variables. | [
"Get",
"environment",
"variables",
"for",
"the",
"container",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/agent/TaskConfig.java#L146-L156 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.retainAll | public static <K, V> boolean retainAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure condition) {
Iterator<Map.Entry<K, V>> iter = self.entrySet().iterator();
BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
boolean result = false;
while (iter.hasNext(... | java | public static <K, V> boolean retainAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure condition) {
Iterator<Map.Entry<K, V>> iter = self.entrySet().iterator();
BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
boolean result = false;
while (iter.hasNext(... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"boolean",
"retainAll",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"MapEntryOrKeyValue",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"Iterator",
"<",
"Map",
".",
... | Modifies this map so that it retains only its elements that are matched
according to the specified closure condition. In other words, removes from
this map all of its elements that don't match. If the closure takes one
parameter then it will be passed the <code>Map.Entry</code>. Otherwise the closure should
take two p... | [
"Modifies",
"this",
"map",
"so",
"that",
"it",
"retains",
"only",
"its",
"elements",
"that",
"are",
"matched",
"according",
"to",
"the",
"specified",
"closure",
"condition",
".",
"In",
"other",
"words",
"removes",
"from",
"this",
"map",
"all",
"of",
"its",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5045-L5057 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/BlockHouseHolder_DDRB.java | BlockHouseHolder_DDRB.decomposeQR_block_col | public static boolean decomposeQR_block_col( final int blockLength ,
final DSubmatrixD1 Y ,
final double gamma[] )
{
int width = Y.col1-Y.col0;
int height = Y.row1-Y.row0;
int min = Math.min(wid... | java | public static boolean decomposeQR_block_col( final int blockLength ,
final DSubmatrixD1 Y ,
final double gamma[] )
{
int width = Y.col1-Y.col0;
int height = Y.row1-Y.row0;
int min = Math.min(wid... | [
"public",
"static",
"boolean",
"decomposeQR_block_col",
"(",
"final",
"int",
"blockLength",
",",
"final",
"DSubmatrixD1",
"Y",
",",
"final",
"double",
"gamma",
"[",
"]",
")",
"{",
"int",
"width",
"=",
"Y",
".",
"col1",
"-",
"Y",
".",
"col0",
";",
"int",
... | Performs a standard QR decomposition on the specified submatrix that is one block wide.
@param blockLength
@param Y
@param gamma | [
"Performs",
"a",
"standard",
"QR",
"decomposition",
"on",
"the",
"specified",
"submatrix",
"that",
"is",
"one",
"block",
"wide",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/BlockHouseHolder_DDRB.java#L50-L67 |
ralscha/extdirectspring | src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java | ExtDirectFormPostResult.addError | public void addError(String field, String error) {
Assert.notNull(field, "field must not be null");
Assert.notNull(error, "field must not be null");
addErrors(field, Collections.singletonList(error));
addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
} | java | public void addError(String field, String error) {
Assert.notNull(field, "field must not be null");
Assert.notNull(error, "field must not be null");
addErrors(field, Collections.singletonList(error));
addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
} | [
"public",
"void",
"addError",
"(",
"String",
"field",
",",
"String",
"error",
")",
"{",
"Assert",
".",
"notNull",
"(",
"field",
",",
"\"field must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"error",
",",
"\"field must not be null\"",
")",
";",
... | Adds one error message to a specific field. Does not overwrite already existing
errors.
@param field the name of the field
@param error the error message | [
"Adds",
"one",
"error",
"message",
"to",
"a",
"specific",
"field",
".",
"Does",
"not",
"overwrite",
"already",
"existing",
"errors",
"."
] | train | https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java#L181-L188 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseXcsric02_zeroPivot | public static int cusparseXcsric02_zeroPivot(
cusparseHandle handle,
csric02Info info,
Pointer position)
{
return checkResult(cusparseXcsric02_zeroPivotNative(handle, info, position));
} | java | public static int cusparseXcsric02_zeroPivot(
cusparseHandle handle,
csric02Info info,
Pointer position)
{
return checkResult(cusparseXcsric02_zeroPivotNative(handle, info, position));
} | [
"public",
"static",
"int",
"cusparseXcsric02_zeroPivot",
"(",
"cusparseHandle",
"handle",
",",
"csric02Info",
"info",
",",
"Pointer",
"position",
")",
"{",
"return",
"checkResult",
"(",
"cusparseXcsric02_zeroPivotNative",
"(",
"handle",
",",
"info",
",",
"position",
... | <pre>
Description: Compute the incomplete-Cholesky factorization with 0 fill-in (IC0)
of the matrix A stored in CSR format based on the information in the opaque
structure info that was obtained from the analysis phase (csrsv2_analysis).
This routine implements algorithm 2 for this problem.
</pre> | [
"<pre",
">",
"Description",
":",
"Compute",
"the",
"incomplete",
"-",
"Cholesky",
"factorization",
"with",
"0",
"fill",
"-",
"in",
"(",
"IC0",
")",
"of",
"the",
"matrix",
"A",
"stored",
"in",
"CSR",
"format",
"based",
"on",
"the",
"information",
"in",
"t... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L7062-L7068 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java | ExistPolicyIndex.nameToId | protected static String nameToId(String name) {
try {
return URLEncoder.encode(name, "UTF-8");
} catch (UnsupportedEncodingException e) {
// should not happen
throw new RuntimeException("Unsupported encoding", e);
}
} | java | protected static String nameToId(String name) {
try {
return URLEncoder.encode(name, "UTF-8");
} catch (UnsupportedEncodingException e) {
// should not happen
throw new RuntimeException("Unsupported encoding", e);
}
} | [
"protected",
"static",
"String",
"nameToId",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"name",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"// should not happen",
... | utility methods to convert between a document name and a form that eXist accepts (ie URL-encoded) | [
"utility",
"methods",
"to",
"convert",
"between",
"a",
"document",
"name",
"and",
"a",
"form",
"that",
"eXist",
"accepts",
"(",
"ie",
"URL",
"-",
"encoded",
")"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java#L319-L326 |
fuinorg/event-store-commons | jpa/src/main/java/org/fuin/esc/jpa/AbstractJpaEventStore.java | AbstractJpaEventStore.createJpqlStreamSelect | protected final String createJpqlStreamSelect(final StreamId streamId) {
if (streamId.isProjection()) {
throw new IllegalArgumentException("Projections do not have a stream table : " + streamId);
}
final List<KeyValue> params = new ArrayList<>(streamId.getParameters());
... | java | protected final String createJpqlStreamSelect(final StreamId streamId) {
if (streamId.isProjection()) {
throw new IllegalArgumentException("Projections do not have a stream table : " + streamId);
}
final List<KeyValue> params = new ArrayList<>(streamId.getParameters());
... | [
"protected",
"final",
"String",
"createJpqlStreamSelect",
"(",
"final",
"StreamId",
"streamId",
")",
"{",
"if",
"(",
"streamId",
".",
"isProjection",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Projections do not have a stream table : \"",
... | Creates the JPQL to select the stream itself.
@param streamId
Unique stream identifier.
@return JPQL that selects the stream with the given identifier. | [
"Creates",
"the",
"JPQL",
"to",
"select",
"the",
"stream",
"itself",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/jpa/src/main/java/org/fuin/esc/jpa/AbstractJpaEventStore.java#L388-L409 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/OffsetTime.java | OffsetTime.withOffsetSameLocal | public OffsetTime withOffsetSameLocal(ZoneOffset offset) {
return offset != null && offset.equals(this.offset) ? this : new OffsetTime(time, offset);
} | java | public OffsetTime withOffsetSameLocal(ZoneOffset offset) {
return offset != null && offset.equals(this.offset) ? this : new OffsetTime(time, offset);
} | [
"public",
"OffsetTime",
"withOffsetSameLocal",
"(",
"ZoneOffset",
"offset",
")",
"{",
"return",
"offset",
"!=",
"null",
"&&",
"offset",
".",
"equals",
"(",
"this",
".",
"offset",
")",
"?",
"this",
":",
"new",
"OffsetTime",
"(",
"time",
",",
"offset",
")",
... | Returns a copy of this {@code OffsetTime} with the specified offset ensuring
that the result has the same local time.
<p>
This method returns an object with the same {@code LocalTime} and the specified {@code ZoneOffset}.
No calculation is needed or performed.
For example, if this time represents {@code 10:30+02:00} an... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"OffsetTime",
"}",
"with",
"the",
"specified",
"offset",
"ensuring",
"that",
"the",
"result",
"has",
"the",
"same",
"local",
"time",
".",
"<p",
">",
"This",
"method",
"returns",
"an",
"object",
"with",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/OffsetTime.java#L562-L564 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/CheckReturnValue.java | CheckReturnValue.matchMethod | @Override
public Description matchMethod(MethodTree tree, VisitorState state) {
MethodSymbol method = ASTHelpers.getSymbol(tree);
boolean checkReturn = hasDirectAnnotationWithSimpleName(method, CHECK_RETURN_VALUE);
boolean canIgnore = hasDirectAnnotationWithSimpleName(method, CAN_IGNORE_RETURN_VALUE);
... | java | @Override
public Description matchMethod(MethodTree tree, VisitorState state) {
MethodSymbol method = ASTHelpers.getSymbol(tree);
boolean checkReturn = hasDirectAnnotationWithSimpleName(method, CHECK_RETURN_VALUE);
boolean canIgnore = hasDirectAnnotationWithSimpleName(method, CAN_IGNORE_RETURN_VALUE);
... | [
"@",
"Override",
"public",
"Description",
"matchMethod",
"(",
"MethodTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"MethodSymbol",
"method",
"=",
"ASTHelpers",
".",
"getSymbol",
"(",
"tree",
")",
";",
"boolean",
"checkReturn",
"=",
"hasDirectAnnotationWit... | Validate {@code @CheckReturnValue} and {@link CanIgnoreReturnValue} usage on methods.
<p>The annotations should not both be appled to the same method.
<p>The annotations should not be applied to void-returning methods. Doing so makes no sense,
because there is no return value to check. | [
"Validate",
"{",
"@code",
"@CheckReturnValue",
"}",
"and",
"{",
"@link",
"CanIgnoreReturnValue",
"}",
"usage",
"on",
"methods",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/CheckReturnValue.java#L127-L156 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorSquareGrid.java | CalibrationDetectorSquareGrid.createLayout | public static List<Point2D_F64> createLayout(int numRows, int numCols, double squareWidth, double spaceWidth)
{
List<Point2D_F64> all = new ArrayList<>();
double width = (numCols*squareWidth + (numCols-1)*spaceWidth);
double height = (numRows*squareWidth + (numRows-1)*spaceWidth);
double startX = -width/2;
... | java | public static List<Point2D_F64> createLayout(int numRows, int numCols, double squareWidth, double spaceWidth)
{
List<Point2D_F64> all = new ArrayList<>();
double width = (numCols*squareWidth + (numCols-1)*spaceWidth);
double height = (numRows*squareWidth + (numRows-1)*spaceWidth);
double startX = -width/2;
... | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"createLayout",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"double",
"squareWidth",
",",
"double",
"spaceWidth",
")",
"{",
"List",
"<",
"Point2D_F64",
">",
"all",
"=",
"new",
"ArrayList",
"<>",
"... | Creates a target that is composed of squares. The squares are spaced out and each corner provides
a calibration point.
@param numRows Number of rows in calibration target. Must be odd.
@param numCols Number of column in each calibration target. Must be odd.
@param squareWidth How wide each square is. Units are targe... | [
"Creates",
"a",
"target",
"that",
"is",
"composed",
"of",
"squares",
".",
"The",
"squares",
"are",
"spaced",
"out",
"and",
"each",
"corner",
"provides",
"a",
"calibration",
"point",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/abst/fiducial/calib/CalibrationDetectorSquareGrid.java#L92-L123 |
prestodb/presto | presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardIterator.java | ShardIterator.computeMerged | private BucketShards computeMerged()
throws SQLException
{
if (resultSet.isAfterLast()) {
return endOfData();
}
if (first) {
first = false;
if (!resultSet.next()) {
return endOfData();
}
}
int bucket... | java | private BucketShards computeMerged()
throws SQLException
{
if (resultSet.isAfterLast()) {
return endOfData();
}
if (first) {
first = false;
if (!resultSet.next()) {
return endOfData();
}
}
int bucket... | [
"private",
"BucketShards",
"computeMerged",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"resultSet",
".",
"isAfterLast",
"(",
")",
")",
"{",
"return",
"endOfData",
"(",
")",
";",
"}",
"if",
"(",
"first",
")",
"{",
"first",
"=",
"false",
";",
"i... | Compute split-per-bucket (single split for all shards in a bucket). | [
"Compute",
"split",
"-",
"per",
"-",
"bucket",
"(",
"single",
"split",
"for",
"all",
"shards",
"in",
"a",
"bucket",
")",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardIterator.java#L161-L187 |
alkacon/opencms-core | src-modules/org/opencms/workplace/editors/CmsDialogProperty.java | CmsDialogProperty.addCurrentTemplate | private void addCurrentTemplate(String currentTemplate, List<String> options, List<String> values) {
CmsMessages messages = Messages.get().getBundle(getLocale());
// template was not found in regular template folders, add current template value
if (CmsStringUtil.isEmpty(currentTemplate)) {
... | java | private void addCurrentTemplate(String currentTemplate, List<String> options, List<String> values) {
CmsMessages messages = Messages.get().getBundle(getLocale());
// template was not found in regular template folders, add current template value
if (CmsStringUtil.isEmpty(currentTemplate)) {
... | [
"private",
"void",
"addCurrentTemplate",
"(",
"String",
"currentTemplate",
",",
"List",
"<",
"String",
">",
"options",
",",
"List",
"<",
"String",
">",
"values",
")",
"{",
"CmsMessages",
"messages",
"=",
"Messages",
".",
"get",
"(",
")",
".",
"getBundle",
... | Adds the currently selected template value to the option and value list.<p>
@param currentTemplate the currently selected template to add
@param options the option list
@param values the value list | [
"Adds",
"the",
"currently",
"selected",
"template",
"value",
"to",
"the",
"option",
"and",
"value",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/editors/CmsDialogProperty.java#L300-L330 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/Cache.java | Cache.free | public synchronized void free(Value value, CloseableListenable user) {
Data<Value> data = values.get(value);
if (data == null) return;
data.lastUsage = System.currentTimeMillis();
data.users.remove(user);
} | java | public synchronized void free(Value value, CloseableListenable user) {
Data<Value> data = values.get(value);
if (data == null) return;
data.lastUsage = System.currentTimeMillis();
data.users.remove(user);
} | [
"public",
"synchronized",
"void",
"free",
"(",
"Value",
"value",
",",
"CloseableListenable",
"user",
")",
"{",
"Data",
"<",
"Value",
">",
"data",
"=",
"values",
".",
"get",
"(",
"value",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"return",
";",
... | Signal that the given cached data is not anymore used by the given user. | [
"Signal",
"that",
"the",
"given",
"cached",
"data",
"is",
"not",
"anymore",
"used",
"by",
"the",
"given",
"user",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/Cache.java#L67-L72 |
google/error-prone | check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java | ErrorProneScanner.visitExpressionStatement | @Override
public Void visitExpressionStatement(ExpressionStatementTree tree, VisitorState visitorState) {
VisitorState state =
processMatchers(
expressionStatementMatchers,
tree,
ExpressionStatementTreeMatcher::matchExpressionStatement,
visitorState);
re... | java | @Override
public Void visitExpressionStatement(ExpressionStatementTree tree, VisitorState visitorState) {
VisitorState state =
processMatchers(
expressionStatementMatchers,
tree,
ExpressionStatementTreeMatcher::matchExpressionStatement,
visitorState);
re... | [
"@",
"Override",
"public",
"Void",
"visitExpressionStatement",
"(",
"ExpressionStatementTree",
"tree",
",",
"VisitorState",
"visitorState",
")",
"{",
"VisitorState",
"state",
"=",
"processMatchers",
"(",
"expressionStatementMatchers",
",",
"tree",
",",
"ExpressionStatemen... | Intentionally skip visitErroneous -- we don't analyze malformed expressions. | [
"Intentionally",
"skip",
"visitErroneous",
"--",
"we",
"don",
"t",
"analyze",
"malformed",
"expressions",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java#L611-L620 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.removeDataEventListenerFromPeer | private static void removeDataEventListenerFromPeer(Peer peer, PeerDataEventListener listener) {
peer.removeBlocksDownloadedEventListener(listener);
peer.removeChainDownloadStartedEventListener(listener);
peer.removeGetDataEventListener(listener);
peer.removePreMessageReceivedEventListen... | java | private static void removeDataEventListenerFromPeer(Peer peer, PeerDataEventListener listener) {
peer.removeBlocksDownloadedEventListener(listener);
peer.removeChainDownloadStartedEventListener(listener);
peer.removeGetDataEventListener(listener);
peer.removePreMessageReceivedEventListen... | [
"private",
"static",
"void",
"removeDataEventListenerFromPeer",
"(",
"Peer",
"peer",
",",
"PeerDataEventListener",
"listener",
")",
"{",
"peer",
".",
"removeBlocksDownloadedEventListener",
"(",
"listener",
")",
";",
"peer",
".",
"removeChainDownloadStartedEventListener",
... | Remove a registered data event listener against a single peer (i.e. for
blockchain download). Handling registration/deregistration on peer death/add is
outside the scope of these methods. | [
"Remove",
"a",
"registered",
"data",
"event",
"listener",
"against",
"a",
"single",
"peer",
"(",
"i",
".",
"e",
".",
"for",
"blockchain",
"download",
")",
".",
"Handling",
"registration",
"/",
"deregistration",
"on",
"peer",
"death",
"/",
"add",
"is",
"out... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1442-L1447 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.searchCandidates | private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) {
if (candidateMethods.isEmpty()) {
return null;
}
Method previousMethod = null;
boolean sameSig = true;
for (Method candidateMethod : candidateMethods) {
if (isBridgeMethodFor(bridgeMethod, candidateMethod, bridg... | java | private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) {
if (candidateMethods.isEmpty()) {
return null;
}
Method previousMethod = null;
boolean sameSig = true;
for (Method candidateMethod : candidateMethods) {
if (isBridgeMethodFor(bridgeMethod, candidateMethod, bridg... | [
"private",
"static",
"Method",
"searchCandidates",
"(",
"List",
"<",
"Method",
">",
"candidateMethods",
",",
"Method",
"bridgeMethod",
")",
"{",
"if",
"(",
"candidateMethods",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Method",
"previou... | Searches for the bridged method in the given candidates.
@param candidateMethods the List of candidate Methods
@param bridgeMethod the bridge method
@return the bridged method, or {@code null} if none found | [
"Searches",
"for",
"the",
"bridged",
"method",
"in",
"the",
"given",
"candidates",
"."
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L104-L121 |
alkacon/opencms-core | src/org/opencms/security/CmsPrincipal.java | CmsPrincipal.readPrincipal | public static I_CmsPrincipal readPrincipal(CmsObject cms, String type, String name) throws CmsException {
if (CmsStringUtil.isNotEmpty(type)) {
String upperCaseType = type.toUpperCase();
if (PRINCIPAL_GROUP.equals(upperCaseType)) {
// this principal is a group
... | java | public static I_CmsPrincipal readPrincipal(CmsObject cms, String type, String name) throws CmsException {
if (CmsStringUtil.isNotEmpty(type)) {
String upperCaseType = type.toUpperCase();
if (PRINCIPAL_GROUP.equals(upperCaseType)) {
// this principal is a group
... | [
"public",
"static",
"I_CmsPrincipal",
"readPrincipal",
"(",
"CmsObject",
"cms",
",",
"String",
"type",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmpty",
"(",
"type",
")",
")",
"{",
"String",
"upperCaseTyp... | Utility function to read a principal of the given type from the OpenCms database using the
provided OpenCms user context.<p>
The type must either be <code>{@link I_CmsPrincipal#PRINCIPAL_GROUP}</code> or
<code>{@link I_CmsPrincipal#PRINCIPAL_USER}</code>.<p>
@param cms the OpenCms user context to use when reading the... | [
"Utility",
"function",
"to",
"read",
"a",
"principal",
"of",
"the",
"given",
"type",
"from",
"the",
"OpenCms",
"database",
"using",
"the",
"provided",
"OpenCms",
"user",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsPrincipal.java#L310-L325 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/ogg/OggPacketReader.java | OggPacketReader.skipToSequenceNumber | public void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException {
OggPacket p = null;
while( (p = getNextPacket()) != null ) {
if(p.getSid() == sid && p.getSequenceNumber() >= sequenceNumber) {
nextPacket = p;
break;
}
}
... | java | public void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException {
OggPacket p = null;
while( (p = getNextPacket()) != null ) {
if(p.getSid() == sid && p.getSequenceNumber() >= sequenceNumber) {
nextPacket = p;
break;
}
}
... | [
"public",
"void",
"skipToSequenceNumber",
"(",
"int",
"sid",
",",
"int",
"sequenceNumber",
")",
"throws",
"IOException",
"{",
"OggPacket",
"p",
"=",
"null",
";",
"while",
"(",
"(",
"p",
"=",
"getNextPacket",
"(",
")",
")",
"!=",
"null",
")",
"{",
"if",
... | Skips forward until the first packet with a Sequence Number
of equal or greater than that specified. Call {@link #getNextPacket()}
to retrieve this packet.
This method advances across all streams, but only searches the
specified one.
@param sid The ID of the stream who's packets we will search
@param sequenceNumber The... | [
"Skips",
"forward",
"until",
"the",
"first",
"packet",
"with",
"a",
"Sequence",
"Number",
"of",
"equal",
"or",
"greater",
"than",
"that",
"specified",
".",
"Call",
"{"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/OggPacketReader.java#L171-L179 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.setRow | public Matrix3f setRow(int row, Vector3fc src) throws IndexOutOfBoundsException {
return setRow(row, src.x(), src.y(), src.z());
} | java | public Matrix3f setRow(int row, Vector3fc src) throws IndexOutOfBoundsException {
return setRow(row, src.x(), src.y(), src.z());
} | [
"public",
"Matrix3f",
"setRow",
"(",
"int",
"row",
",",
"Vector3fc",
"src",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"return",
"setRow",
"(",
"row",
",",
"src",
".",
"x",
"(",
")",
",",
"src",
".",
"y",
"(",
")",
",",
"src",
".",
"z",
"(",
... | Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..2]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>row</code> is not in <code>[0..2]</code> | [
"Set",
"the",
"row",
"at",
"the",
"given",
"<code",
">",
"row<",
"/",
"code",
">",
"index",
"starting",
"with",
"<code",
">",
"0<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3248-L3250 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java | ParsingUtils.parseNumber | public static double parseNumber(String number, Locale locale) throws ParseException {
if ("".equals(number)) {
return Double.NaN;
}
return NumberFormat.getNumberInstance(locale).parse(number).doubleValue();
} | java | public static double parseNumber(String number, Locale locale) throws ParseException {
if ("".equals(number)) {
return Double.NaN;
}
return NumberFormat.getNumberInstance(locale).parse(number).doubleValue();
} | [
"public",
"static",
"double",
"parseNumber",
"(",
"String",
"number",
",",
"Locale",
"locale",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"number",
")",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"return",
"Numb... | Parses a string with a locale and returns the corresponding number
@throws ParseException if number cannot be parsed | [
"Parses",
"a",
"string",
"with",
"a",
"locale",
"and",
"returns",
"the",
"corresponding",
"number"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java#L43-L48 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictMock | public static synchronized <T> T createStrictMock(Class<T> type, Method... methods) {
return doMock(type, false, new StrictMockStrategy(), null, methods);
} | java | public static synchronized <T> T createStrictMock(Class<T> type, Method... methods) {
return doMock(type, false, new StrictMockStrategy(), null, methods);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createStrictMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Method",
"...",
"methods",
")",
"{",
"return",
"doMock",
"(",
"type",
",",
"false",
",",
"new",
"StrictMockStrategy",
"(",
")",
",",
... | Creates a strict mock object that supports mocking of final and native
methods.
@param <T> the type of the mock object
@param type the type of the mock object
@param methods optionally what methods to mock
@return the mock object. | [
"Creates",
"a",
"strict",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L138-L140 |
dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java | AbstractGedObjectFactory.getToken | private GedToken getToken(final String tag) {
GedToken gedToken = tokens.get(tag);
if (gedToken == null) {
// Any unknown token is an attribute, retaining its tag.
gedToken = new GedToken(tag, ATTR_FACTORY);
}
return gedToken;
} | java | private GedToken getToken(final String tag) {
GedToken gedToken = tokens.get(tag);
if (gedToken == null) {
// Any unknown token is an attribute, retaining its tag.
gedToken = new GedToken(tag, ATTR_FACTORY);
}
return gedToken;
} | [
"private",
"GedToken",
"getToken",
"(",
"final",
"String",
"tag",
")",
"{",
"GedToken",
"gedToken",
"=",
"tokens",
".",
"get",
"(",
"tag",
")",
";",
"if",
"(",
"gedToken",
"==",
"null",
")",
"{",
"// Any unknown token is an attribute, retaining its tag.",
"gedTo... | Find the token processor for this tag. Defaults to attribute.
@param tag the tag.
@return the token processor. | [
"Find",
"the",
"token",
"processor",
"for",
"this",
"tag",
".",
"Defaults",
"to",
"attribute",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java#L615-L622 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/JDBCUtil.java | JDBCUtil.makeCollector | public static Connection makeCollector (final Connection conn, final List<Statement> stmts)
{
return (Connection)Proxy.newProxyInstance(
Connection.class.getClassLoader(), PROXY_IFACES, new InvocationHandler() {
public Object invoke (Object proxy, Method method, Object[] args) throws... | java | public static Connection makeCollector (final Connection conn, final List<Statement> stmts)
{
return (Connection)Proxy.newProxyInstance(
Connection.class.getClassLoader(), PROXY_IFACES, new InvocationHandler() {
public Object invoke (Object proxy, Method method, Object[] args) throws... | [
"public",
"static",
"Connection",
"makeCollector",
"(",
"final",
"Connection",
"conn",
",",
"final",
"List",
"<",
"Statement",
">",
"stmts",
")",
"{",
"return",
"(",
"Connection",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"Connection",
".",
"class",
".",
"... | Wraps the given connection in a proxied instance that will add all statements returned by
methods called on the proxy (such as {@link Connection#createStatement}) to the supplied
list. Thus you can create the proxy, pass the proxy to code that creates and uses statements
and then close any statements created by the cod... | [
"Wraps",
"the",
"given",
"connection",
"in",
"a",
"proxied",
"instance",
"that",
"will",
"add",
"all",
"statements",
"returned",
"by",
"methods",
"called",
"on",
"the",
"proxy",
"(",
"such",
"as",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JDBCUtil.java#L75-L87 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_resize_POST | public OvhInstanceDetail project_serviceName_instance_instanceId_resize_POST(String serviceName, String instanceId, String flavorId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resize";
StringBuilder sb = path(qPath, serviceName, instanceId);
HashMap<String, Object>o = ... | java | public OvhInstanceDetail project_serviceName_instance_instanceId_resize_POST(String serviceName, String instanceId, String flavorId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resize";
StringBuilder sb = path(qPath, serviceName, instanceId);
HashMap<String, Object>o = ... | [
"public",
"OvhInstanceDetail",
"project_serviceName_instance_instanceId_resize_POST",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"String",
"flavorId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/{insta... | Migrate your instance to another flavor
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/resize
@param flavorId [required] Flavor id
@param instanceId [required] Instance id
@param serviceName [required] Service name | [
"Migrate",
"your",
"instance",
"to",
"another",
"flavor"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2015-L2022 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.getPortalSearchResults | private PortalSearchResults getPortalSearchResults(PortletRequest request, String queryId) {
final PortletSession session = request.getPortletSession();
@SuppressWarnings("unchecked")
final Cache<String, PortalSearchResults> searchResultsCache =
(Cache<String, PortalSearchResults... | java | private PortalSearchResults getPortalSearchResults(PortletRequest request, String queryId) {
final PortletSession session = request.getPortletSession();
@SuppressWarnings("unchecked")
final Cache<String, PortalSearchResults> searchResultsCache =
(Cache<String, PortalSearchResults... | [
"private",
"PortalSearchResults",
"getPortalSearchResults",
"(",
"PortletRequest",
"request",
",",
"String",
"queryId",
")",
"{",
"final",
"PortletSession",
"session",
"=",
"request",
".",
"getPortletSession",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\... | Get the {@link PortalSearchResults} for the specified query id from the session. If there are
no results null is returned. | [
"Get",
"the",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L802-L813 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.incrementSafeBlockCount | void incrementSafeBlockCount(int replication, boolean skipCheck) {
if (safeMode != null && safeMode.isOn()) {
if ((int) replication == minReplication) {
this.blocksSafe++;
if(!skipCheck) {
safeMode.checkMode();
}
}
}
} | java | void incrementSafeBlockCount(int replication, boolean skipCheck) {
if (safeMode != null && safeMode.isOn()) {
if ((int) replication == minReplication) {
this.blocksSafe++;
if(!skipCheck) {
safeMode.checkMode();
}
}
}
} | [
"void",
"incrementSafeBlockCount",
"(",
"int",
"replication",
",",
"boolean",
"skipCheck",
")",
"{",
"if",
"(",
"safeMode",
"!=",
"null",
"&&",
"safeMode",
".",
"isOn",
"(",
")",
")",
"{",
"if",
"(",
"(",
"int",
")",
"replication",
"==",
"minReplication",
... | Increment number of blocks that reached minimal replication.
@param replication current replication
@param skipCheck if true the safemode will not be checked -
used for processing initial block reports to skip the
check for every block - at the end checkSafeMode() must be called | [
"Increment",
"number",
"of",
"blocks",
"that",
"reached",
"minimal",
"replication",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L8575-L8584 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.marshallUUID | public static void marshallUUID(UUID uuid, ObjectOutput out, boolean checkNull) throws IOException {
if (checkNull) {
if (uuid == null) {
out.writeBoolean(true);
return;
}
out.writeBoolean(false);
}
out.writeLong(uuid.getMostSignificantBits());
... | java | public static void marshallUUID(UUID uuid, ObjectOutput out, boolean checkNull) throws IOException {
if (checkNull) {
if (uuid == null) {
out.writeBoolean(true);
return;
}
out.writeBoolean(false);
}
out.writeLong(uuid.getMostSignificantBits());
... | [
"public",
"static",
"void",
"marshallUUID",
"(",
"UUID",
"uuid",
",",
"ObjectOutput",
"out",
",",
"boolean",
"checkNull",
")",
"throws",
"IOException",
"{",
"if",
"(",
"checkNull",
")",
"{",
"if",
"(",
"uuid",
"==",
"null",
")",
"{",
"out",
".",
"writeBo... | Marshall the {@link UUID} by sending the most and lest significant bits.
<p>
This method supports {@code null} if {@code checkNull} is set to {@code true}.
@param uuid {@link UUID} to marshall.
@param out {@link ObjectOutput} to write.
@param checkNull If {@code true}, it checks if {@code uuid} is {@code nu... | [
"Marshall",
"the",
"{",
"@link",
"UUID",
"}",
"by",
"sending",
"the",
"most",
"and",
"lest",
"significant",
"bits",
".",
"<p",
">",
"This",
"method",
"supports",
"{",
"@code",
"null",
"}",
"if",
"{",
"@code",
"checkNull",
"}",
"is",
"set",
"to",
"{",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L146-L156 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.loginUser | public String loginUser(String username, String password) throws CmsException {
return loginUser(username, password, m_context.getRemoteAddress());
} | java | public String loginUser(String username, String password) throws CmsException {
return loginUser(username, password, m_context.getRemoteAddress());
} | [
"public",
"String",
"loginUser",
"(",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"CmsException",
"{",
"return",
"loginUser",
"(",
"username",
",",
"password",
",",
"m_context",
".",
"getRemoteAddress",
"(",
")",
")",
";",
"}"
] | Logs a user into the Cms, if the password is correct.<p>
@param username the name of the user
@param password the password of the user
@return the name of the logged in user
@throws CmsException if the login was not successful | [
"Logs",
"a",
"user",
"into",
"the",
"Cms",
"if",
"the",
"password",
"is",
"correct",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2170-L2173 |
google/closure-compiler | src/com/google/javascript/jscomp/deps/DepsFileParser.java | DepsFileParser.parseFile | public List<DependencyInfo> parseFile(String filePath, String fileContents) {
return parseFileReader(filePath, new StringReader(fileContents));
} | java | public List<DependencyInfo> parseFile(String filePath, String fileContents) {
return parseFileReader(filePath, new StringReader(fileContents));
} | [
"public",
"List",
"<",
"DependencyInfo",
">",
"parseFile",
"(",
"String",
"filePath",
",",
"String",
"fileContents",
")",
"{",
"return",
"parseFileReader",
"(",
"filePath",
",",
"new",
"StringReader",
"(",
"fileContents",
")",
")",
";",
"}"
] | Parses the given file and returns a list of dependency information that it
contained.
It uses the passed in fileContents instead of reading the file.
@param filePath Path to the file to parse.
@param fileContents The contents to parse.
@return A list of DependencyInfo objects. | [
"Parses",
"the",
"given",
"file",
"and",
"returns",
"a",
"list",
"of",
"dependency",
"information",
"that",
"it",
"contained",
".",
"It",
"uses",
"the",
"passed",
"in",
"fileContents",
"instead",
"of",
"reading",
"the",
"file",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsFileParser.java#L118-L120 |
atomix/atomix | utils/src/main/java/io/atomix/utils/concurrent/Retries.java | Retries.delay | public static void delay(int ms, int nanos) {
try {
Thread.sleep(ms, nanos);
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted", e);
}
} | java | public static void delay(int ms, int nanos) {
try {
Thread.sleep(ms, nanos);
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted", e);
}
} | [
"public",
"static",
"void",
"delay",
"(",
"int",
"ms",
",",
"int",
"nanos",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"ms",
",",
"nanos",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
... | Suspends the current thread for a specified number of millis and nanos.
@param ms number of millis
@param nanos number of nanos | [
"Suspends",
"the",
"current",
"thread",
"for",
"a",
"specified",
"number",
"of",
"millis",
"and",
"nanos",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/Retries.java#L85-L91 |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.setTarget | @GwtIncompatible
public void setTarget(Reader in, int len) throws IOException {
if (len < 0) {
setAll(in);
return;
}
char[] mychars = data;
boolean shared = this.shared;
if (mychars == null || shared || mychars.length < len) {
mychars = new... | java | @GwtIncompatible
public void setTarget(Reader in, int len) throws IOException {
if (len < 0) {
setAll(in);
return;
}
char[] mychars = data;
boolean shared = this.shared;
if (mychars == null || shared || mychars.length < len) {
mychars = new... | [
"@",
"GwtIncompatible",
"public",
"void",
"setTarget",
"(",
"Reader",
"in",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"<",
"0",
")",
"{",
"setAll",
"(",
"in",
")",
";",
"return",
";",
"}",
"char",
"[",
"]",
"mychars",
... | Supplies a text to search in/match with through a stream.
Resets current search position to zero.
@param in - a data stream;
@param len - how much characters should be read; if len is -1, read the entire stream.
@see Matcher#setTarget(regexodus.Matcher, int)
@see Matcher#setTarget(java.lang.CharSequence)
@see Matcher... | [
"Supplies",
"a",
"text",
"to",
"search",
"in",
"/",
"match",
"with",
"through",
"a",
"stream",
".",
"Resets",
"current",
"search",
"position",
"to",
"zero",
"."
] | train | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L334-L354 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Iterators.java | Iterators.forArray | static <T> UnmodifiableListIterator<T> forArray(
final T[] array, final int offset, int length, int index) {
checkArgument(length >= 0);
int end = offset + length;
// Technically we should give a slightly more descriptive error on overflow
Preconditions.checkPositionIndexes(offset, end, array.len... | java | static <T> UnmodifiableListIterator<T> forArray(
final T[] array, final int offset, int length, int index) {
checkArgument(length >= 0);
int end = offset + length;
// Technically we should give a slightly more descriptive error on overflow
Preconditions.checkPositionIndexes(offset, end, array.len... | [
"static",
"<",
"T",
">",
"UnmodifiableListIterator",
"<",
"T",
">",
"forArray",
"(",
"final",
"T",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"int",
"length",
",",
"int",
"index",
")",
"{",
"checkArgument",
"(",
"length",
">=",
"0",
")",
... | Returns a list iterator containing the elements in the specified range of
{@code array} in order, starting at the specified index.
<p>The {@code Iterable} equivalent of this method is {@code
Arrays.asList(array).subList(offset, offset + length).listIterator(index)}. | [
"Returns",
"a",
"list",
"iterator",
"containing",
"the",
"elements",
"in",
"the",
"specified",
"range",
"of",
"{",
"@code",
"array",
"}",
"in",
"order",
"starting",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Iterators.java#L994-L1017 |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java | TraceSummary.setAnnotations | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
} | java | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
} | [
"public",
"void",
"setAnnotations",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"ValueWithServiceIds",
">",
">",
"annotations",
")",
"{",
"this",
".",
"annotations",
"=",
"annotations",
";",
"}"
] | <p>
Annotations from the trace's segment documents.
</p>
@param annotations
Annotations from the trace's segment documents. | [
"<p",
">",
"Annotations",
"from",
"the",
"trace",
"s",
"segment",
"documents",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java#L556-L558 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.decodeUIInput | public static void decodeUIInput(FacesContext facesContext, UIComponent component)
{
if (!(component instanceof EditableValueHolder))
{
throw new IllegalArgumentException("Component "
+ component.getClientId(facesContext)
+ " is not an EditableValu... | java | public static void decodeUIInput(FacesContext facesContext, UIComponent component)
{
if (!(component instanceof EditableValueHolder))
{
throw new IllegalArgumentException("Component "
+ component.getClientId(facesContext)
+ " is not an EditableValu... | [
"public",
"static",
"void",
"decodeUIInput",
"(",
"FacesContext",
"facesContext",
",",
"UIComponent",
"component",
")",
"{",
"if",
"(",
"!",
"(",
"component",
"instanceof",
"EditableValueHolder",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"C... | Utility to set the submitted value of the provided component from the
data in the current request object.
<p/>
Param component is required to be an EditableValueHolder. On return
from this method, the component's submittedValue property will be
set if the submitted form contained that component. | [
"Utility",
"to",
"set",
"the",
"submitted",
"value",
"of",
"the",
"provided",
"component",
"from",
"the",
"data",
"in",
"the",
"current",
"request",
"object",
".",
"<p",
"/",
">",
"Param",
"component",
"is",
"required",
"to",
"be",
"an",
"EditableValueHolder... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L107-L132 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java | AuditResources.findById | @GET
@Path("/{id}")
@Description("Returns the audit trail for a given Id.")
@Produces(MediaType.APPLICATION_JSON)
public AuditDto findById(@PathParam("id") BigInteger id) {
if (id == null || id.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("ID cannot be null and... | java | @GET
@Path("/{id}")
@Description("Returns the audit trail for a given Id.")
@Produces(MediaType.APPLICATION_JSON)
public AuditDto findById(@PathParam("id") BigInteger id) {
if (id == null || id.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("ID cannot be null and... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{id}\"",
")",
"@",
"Description",
"(",
"\"Returns the audit trail for a given Id.\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"AuditDto",
"findById",
"(",
"@",
"PathParam",
"(",
"\"id\"",
... | Returns the audit record for the given id.
@param id entityId The entity Id. Cannot be null.
@return The audit object.
@throws WebApplicationException Throws the exception for invalid input data. | [
"Returns",
"the",
"audit",
"record",
"for",
"the",
"given",
"id",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java#L106-L122 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.updateBeatGrid | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry ent... | java | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry ent... | [
"private",
"void",
"updateBeatGrid",
"(",
"TrackMetadataUpdate",
"update",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"hotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"beatGrid",
")",
";",
"... | We have obtained a beat grid for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this beat grid
@param beatGrid the beat grid which we retrieved | [
"We",
"have",
"obtained",
"a",
"beat",
"grid",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L161-L171 |
Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java | TypefaceProvider.retrieveRegisteredIconSet | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
final IconSet iconSet = REGISTERED_ICON_SETS.get(fontPath);
if (iconSet == null && !editMode) {
throw new RuntimeException(String.format("Font '%s' not properly registered, please" +
" s... | java | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
final IconSet iconSet = REGISTERED_ICON_SETS.get(fontPath);
if (iconSet == null && !editMode) {
throw new RuntimeException(String.format("Font '%s' not properly registered, please" +
" s... | [
"public",
"static",
"IconSet",
"retrieveRegisteredIconSet",
"(",
"String",
"fontPath",
",",
"boolean",
"editMode",
")",
"{",
"final",
"IconSet",
"iconSet",
"=",
"REGISTERED_ICON_SETS",
".",
"get",
"(",
"fontPath",
")",
";",
"if",
"(",
"iconSet",
"==",
"null",
... | Retrieves a registered IconSet whose font can be found in the asset directory at the given path
@param fontPath the given path
@param editMode - whether the view requesting the icon set is displayed in the preview editor
@return the registered IconSet instance | [
"Retrieves",
"a",
"registered",
"IconSet",
"whose",
"font",
"can",
"be",
"found",
"in",
"the",
"asset",
"directory",
"at",
"the",
"given",
"path"
] | train | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java#L71-L79 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CustomClassMapper.java | CustomClassMapper.convertToCustomClass | static <T> T convertToCustomClass(Object object, Class<T> clazz) {
return deserializeToClass(object, clazz, ErrorPath.EMPTY);
} | java | static <T> T convertToCustomClass(Object object, Class<T> clazz) {
return deserializeToClass(object, clazz, ErrorPath.EMPTY);
} | [
"static",
"<",
"T",
">",
"T",
"convertToCustomClass",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"deserializeToClass",
"(",
"object",
",",
"clazz",
",",
"ErrorPath",
".",
"EMPTY",
")",
";",
"}"
] | Converts a standard library Java representation of JSON data to an object of the provided
class.
@param object The representation of the JSON data
@param clazz The class of the object to convert to
@return The POJO object. | [
"Converts",
"a",
"standard",
"library",
"Java",
"representation",
"of",
"JSON",
"data",
"to",
"an",
"object",
"of",
"the",
"provided",
"class",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CustomClassMapper.java#L96-L98 |
alkacon/opencms-core | src/org/opencms/xml/types/CmsXmlBooleanValue.java | CmsXmlBooleanValue.getBooleanValue | public static boolean getBooleanValue(CmsObject cms, I_CmsWidgetParameter value) {
boolean result;
if (value instanceof CmsXmlBooleanValue) {
// this is a "native" boolean type
result = ((CmsXmlBooleanValue)value).getBooleanValue();
} else {
// get the boolea... | java | public static boolean getBooleanValue(CmsObject cms, I_CmsWidgetParameter value) {
boolean result;
if (value instanceof CmsXmlBooleanValue) {
// this is a "native" boolean type
result = ((CmsXmlBooleanValue)value).getBooleanValue();
} else {
// get the boolea... | [
"public",
"static",
"boolean",
"getBooleanValue",
"(",
"CmsObject",
"cms",
",",
"I_CmsWidgetParameter",
"value",
")",
"{",
"boolean",
"result",
";",
"if",
"(",
"value",
"instanceof",
"CmsXmlBooleanValue",
")",
"{",
"// this is a \"native\" boolean type",
"result",
"="... | Returns the boolean value of the given widget parameter.<p>
@param cms an initialized instance of a CmsObject
@param value the XML content value to get the boolean value of
@return the boolean value of the given widget parameter | [
"Returns",
"the",
"boolean",
"value",
"of",
"the",
"given",
"widget",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/types/CmsXmlBooleanValue.java#L102-L113 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/company/api/QYOauthAPI.java | QYOauthAPI.getOauthPageUrl | public String getOauthPageUrl(String redirectUrl, OauthScope scope, String state){
if(StrUtil.isBlank(redirectUrl)){
throw new NullPointerException("redirectUrl is null");
}
BeanUtil.requireNonNull(scope, "scope is null");
String userstate = StrUtil.isBlank(state) ? "STATE" :... | java | public String getOauthPageUrl(String redirectUrl, OauthScope scope, String state){
if(StrUtil.isBlank(redirectUrl)){
throw new NullPointerException("redirectUrl is null");
}
BeanUtil.requireNonNull(scope, "scope is null");
String userstate = StrUtil.isBlank(state) ? "STATE" :... | [
"public",
"String",
"getOauthPageUrl",
"(",
"String",
"redirectUrl",
",",
"OauthScope",
"scope",
",",
"String",
"state",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"redirectUrl",
")",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"redirect... | 生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl
@param redirectUrl 用户自己设置的回调url
@param scope 授权作用域
@param state 用户自带参数
@return 回调url,用户在微信中打开即可开始授权 | [
"生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/company/api/QYOauthAPI.java#L44-L63 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.delete | private boolean delete(FTPClient client, Path file, boolean recursive)
throws IOException {
Path workDir = new Path(client.printWorkingDirectory());
Path absolute = makeAbsolute(workDir, file);
String pathName = absolute.toUri().getPath();
FileStatus fileStat = getFileStatus(client, absolute);
... | java | private boolean delete(FTPClient client, Path file, boolean recursive)
throws IOException {
Path workDir = new Path(client.printWorkingDirectory());
Path absolute = makeAbsolute(workDir, file);
String pathName = absolute.toUri().getPath();
FileStatus fileStat = getFileStatus(client, absolute);
... | [
"private",
"boolean",
"delete",
"(",
"FTPClient",
"client",
",",
"Path",
"file",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"Path",
"workDir",
"=",
"new",
"Path",
"(",
"client",
".",
"printWorkingDirectory",
"(",
")",
")",
";",
"Path",
... | Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection. | [
"Convenience",
"method",
"so",
"that",
"we",
"don",
"t",
"open",
"a",
"new",
"connection",
"when",
"using",
"this",
"method",
"from",
"within",
"another",
"method",
".",
"Otherwise",
"every",
"API",
"invocation",
"incurs",
"the",
"overhead",
"of",
"opening",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L297-L316 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java | PickerUtilities.isSameYearMonth | public static boolean isSameYearMonth(YearMonth first, YearMonth second) {
// If both values are null, return true.
if (first == null && second == null) {
return true;
}
// At least one value contains a YearMonth. If the other value is null, then return false.
if (fir... | java | public static boolean isSameYearMonth(YearMonth first, YearMonth second) {
// If both values are null, return true.
if (first == null && second == null) {
return true;
}
// At least one value contains a YearMonth. If the other value is null, then return false.
if (fir... | [
"public",
"static",
"boolean",
"isSameYearMonth",
"(",
"YearMonth",
"first",
",",
"YearMonth",
"second",
")",
"{",
"// If both values are null, return true.",
"if",
"(",
"first",
"==",
"null",
"&&",
"second",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
... | isSameYearMonth, This compares two YearMonth variables to see if their values are equal.
Returns true if the values are equal, otherwise returns false.
More specifically: This returns true if both values are null (an empty YearMonth). Or, this
returns true if both of the supplied YearMonths contain a YearMonth and rep... | [
"isSameYearMonth",
"This",
"compares",
"two",
"YearMonth",
"variables",
"to",
"see",
"if",
"their",
"values",
"are",
"equal",
".",
"Returns",
"true",
"if",
"the",
"values",
"are",
"equal",
"otherwise",
"returns",
"false",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java#L99-L111 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/function/Actions.java | Actions.toFunc | public static <T1> Func1<T1, Void> toFunc(final Action1<T1> action) {
return toFunc(action, (Void) null);
} | java | public static <T1> Func1<T1, Void> toFunc(final Action1<T1> action) {
return toFunc(action, (Void) null);
} | [
"public",
"static",
"<",
"T1",
">",
"Func1",
"<",
"T1",
",",
"Void",
">",
"toFunc",
"(",
"final",
"Action1",
"<",
"T1",
">",
"action",
")",
"{",
"return",
"toFunc",
"(",
"action",
",",
"(",
"Void",
")",
"null",
")",
";",
"}"
] | Converts an {@link Action1} to a function that calls the action and returns {@code null}.
@param action the {@link Action1} to convert
@return a {@link Func1} that calls {@code action} and returns {@code null} | [
"Converts",
"an",
"{",
"@link",
"Action1",
"}",
"to",
"a",
"function",
"that",
"calls",
"the",
"action",
"and",
"returns",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L95-L97 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.populateLineString | public void populateLineString(LineString lineString, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
Point point = toPoint(latLng, lineString.hasZ(), lineString.hasM());
lineString.addPoint(point);
}
} | java | public void populateLineString(LineString lineString, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
Point point = toPoint(latLng, lineString.hasZ(), lineString.hasM());
lineString.addPoint(point);
}
} | [
"public",
"void",
"populateLineString",
"(",
"LineString",
"lineString",
",",
"List",
"<",
"LatLng",
">",
"latLngs",
")",
"{",
"for",
"(",
"LatLng",
"latLng",
":",
"latLngs",
")",
"{",
"Point",
"point",
"=",
"toPoint",
"(",
"latLng",
",",
"lineString",
"."... | Convert a list of {@link LatLng} to a {@link LineString}
@param lineString line string
@param latLngs lat lngs | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"LatLng",
"}",
"to",
"a",
"{",
"@link",
"LineString",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L391-L397 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeScannerContextDao.java | CeScannerContextDao.selectScannerContext | public Optional<String> selectScannerContext(DbSession dbSession, String taskUuid) {
try (PreparedStatement stmt = dbSession.getConnection().prepareStatement("select context_data from ce_scanner_context where task_uuid=?")) {
stmt.setString(1, taskUuid);
try (ResultSet rs = stmt.executeQuery()) {
... | java | public Optional<String> selectScannerContext(DbSession dbSession, String taskUuid) {
try (PreparedStatement stmt = dbSession.getConnection().prepareStatement("select context_data from ce_scanner_context where task_uuid=?")) {
stmt.setString(1, taskUuid);
try (ResultSet rs = stmt.executeQuery()) {
... | [
"public",
"Optional",
"<",
"String",
">",
"selectScannerContext",
"(",
"DbSession",
"dbSession",
",",
"String",
"taskUuid",
")",
"{",
"try",
"(",
"PreparedStatement",
"stmt",
"=",
"dbSession",
".",
"getConnection",
"(",
")",
".",
"prepareStatement",
"(",
"\"sele... | The scanner context is very likely to contain lines, which are forcefully separated by {@code \n} characters,
whichever the platform SQ is running on ({@see LogsIteratorInputStream}). | [
"The",
"scanner",
"context",
"is",
"very",
"likely",
"to",
"contain",
"lines",
"which",
"are",
"forcefully",
"separated",
"by",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeScannerContextDao.java#L74-L86 |
d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMinWithComparator | private void fixdownMinWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) >= 0) {
break;
}
... | java | private void fixdownMinWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) >= 0) {
break;
}
... | [
"private",
"void",
"fixdownMinWithComparator",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"minChildOrGrandchildWithComparator",
"(",
"k",
")",
";",
"if",
"(",
"m",
">",
... | Downwards fix starting from a particular element at a minimum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | train | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L565-L593 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/FeatureCallAsTypeLiteralHelper.java | FeatureCallAsTypeLiteralHelper.isPotentialTypeLiteral | public boolean isPotentialTypeLiteral(XExpression featureCall, /* @Nullable */ IResolvedTypes resolvedTypes) {
if (featureCall instanceof XMemberFeatureCall) {
return isPotentialTypeLiteralImpl(featureCall, resolvedTypes, ((XMemberFeatureCall) featureCall).isExplicitStatic());
}
return isPotentialTypeLiteralI... | java | public boolean isPotentialTypeLiteral(XExpression featureCall, /* @Nullable */ IResolvedTypes resolvedTypes) {
if (featureCall instanceof XMemberFeatureCall) {
return isPotentialTypeLiteralImpl(featureCall, resolvedTypes, ((XMemberFeatureCall) featureCall).isExplicitStatic());
}
return isPotentialTypeLiteralI... | [
"public",
"boolean",
"isPotentialTypeLiteral",
"(",
"XExpression",
"featureCall",
",",
"/* @Nullable */",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"if",
"(",
"featureCall",
"instanceof",
"XMemberFeatureCall",
")",
"{",
"return",
"isPotentialTypeLiteralImpl",
"(",
"fea... | Returns <code>true</code> if the given feature call can be a type literal (structurally).
Otherwise <code>false</code>. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"feature",
"call",
"can",
"be",
"a",
"type",
"literal",
"(",
"structurally",
")",
".",
"Otherwise",
"<code",
">",
"false<",
"/",
"code",
">",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/FeatureCallAsTypeLiteralHelper.java#L37-L42 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java | UriEscaper.encodeCharAtIndex | private String encodeCharAtIndex(final String string, final int index, final State state) {
final char c = string.charAt(index);
/* Special-case: spaces are "%20" when not within query string, or when doing strict mode */
if ((SPACE.matches(c) && ((state != State.QUERY && state != State.QUERY_P... | java | private String encodeCharAtIndex(final String string, final int index, final State state) {
final char c = string.charAt(index);
/* Special-case: spaces are "%20" when not within query string, or when doing strict mode */
if ((SPACE.matches(c) && ((state != State.QUERY && state != State.QUERY_P... | [
"private",
"String",
"encodeCharAtIndex",
"(",
"final",
"String",
"string",
",",
"final",
"int",
"index",
",",
"final",
"State",
"state",
")",
"{",
"final",
"char",
"c",
"=",
"string",
".",
"charAt",
"(",
"index",
")",
";",
"/* Special-case: spaces are \"%20\"... | Encodes the character at the given index, and returns the resulting string. If the character does not need to
be encoded, this function returns null | [
"Encodes",
"the",
"character",
"at",
"the",
"given",
"index",
"and",
"returns",
"the",
"resulting",
"string",
".",
"If",
"the",
"character",
"does",
"not",
"need",
"to",
"be",
"encoded",
"this",
"function",
"returns",
"null"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java#L172-L203 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java | MySQLQueryFactory.insertOnDuplicateKeyUpdate | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, String clause) {
SQLInsertClause insert = insert(entity);
insert.addFlag(Position.END, " on duplicate key update " + clause);
return insert;
} | java | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, String clause) {
SQLInsertClause insert = insert(entity);
insert.addFlag(Position.END, " on duplicate key update " + clause);
return insert;
} | [
"public",
"SQLInsertClause",
"insertOnDuplicateKeyUpdate",
"(",
"RelationalPath",
"<",
"?",
">",
"entity",
",",
"String",
"clause",
")",
"{",
"SQLInsertClause",
"insert",
"=",
"insert",
"(",
"entity",
")",
";",
"insert",
".",
"addFlag",
"(",
"Position",
".",
"... | Create a INSERT ... ON DUPLICATE KEY UPDATE clause
@param entity table to insert to
@param clause clause
@return insert clause | [
"Create",
"a",
"INSERT",
"...",
"ON",
"DUPLICATE",
"KEY",
"UPDATE",
"clause"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java#L67-L71 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByCountry | public Iterable<DUser> queryByCountry(java.lang.String country) {
return queryByField(null, DUserMapper.Field.COUNTRY.getFieldName(), country);
} | java | public Iterable<DUser> queryByCountry(java.lang.String country) {
return queryByField(null, DUserMapper.Field.COUNTRY.getFieldName(), country);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByCountry",
"(",
"java",
".",
"lang",
".",
"String",
"country",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"COUNTRY",
".",
"getFieldName",
"(",
")",
",",
"country",... | query-by method for field country
@param country the specified attribute
@return an Iterable of DUsers for the specified country | [
"query",
"-",
"by",
"method",
"for",
"field",
"country"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L106-L108 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/StAXUtils.java | StAXUtils.getXMLStreamWriter | public static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result) throws XMLStreamException
{
XMLStreamWriter xmlStreamWriter;
if (result instanceof SAXResult) {
// SAXResult is not supported by the standard XMLOutputFactory
xmlStreamWriter =
... | java | public static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result) throws XMLStreamException
{
XMLStreamWriter xmlStreamWriter;
if (result instanceof SAXResult) {
// SAXResult is not supported by the standard XMLOutputFactory
xmlStreamWriter =
... | [
"public",
"static",
"XMLStreamWriter",
"getXMLStreamWriter",
"(",
"XMLOutputFactory",
"factory",
",",
"Result",
"result",
")",
"throws",
"XMLStreamException",
"{",
"XMLStreamWriter",
"xmlStreamWriter",
";",
"if",
"(",
"result",
"instanceof",
"SAXResult",
")",
"{",
"//... | Extract or create an instance of {@link XMLStreamWriter} from the provided {@link Result}.
@param factory the {@link XMLOutputFactory} to use (if needed)
@param result the result
@return the {@link XMLStreamWriter}
@throws XMLStreamException when failing to extract xml stream writer
@since 9.5.2
@since 9.6RC1 | [
"Extract",
"or",
"create",
"an",
"instance",
"of",
"{",
"@link",
"XMLStreamWriter",
"}",
"from",
"the",
"provided",
"{",
"@link",
"Result",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/StAXUtils.java#L159-L180 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.