repo stringclasses 11 values | path stringlengths 41 234 | func_name stringlengths 5 78 | original_string stringlengths 71 14.1k | language stringclasses 1 value | code stringlengths 71 14.1k | code_tokens listlengths 22 2.65k | docstring stringlengths 2 5.35k | docstring_tokens listlengths 1 369 | sha stringclasses 11 values | url stringlengths 129 339 | partition stringclasses 1 value | summary stringlengths 7 175 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.orderBy | public SqlBuilder orderBy(Order... orders) {
if (ArrayUtil.isEmpty(orders)) {
return this;
}
sql.append(" ORDER BY ");
String field = null;
boolean isFirst = true;
for (Order order : orders) {
if (null != wrapper) {
// 包装字段名
field = wrapper.wrap(order.getField());
}
if (StrUtil.isBlank(field)) {
continue;
}
// 只有在非第一项前添加逗号
if (isFirst) {
isFirst = false;
} else {
sql.append(StrUtil.COMMA);
}
sql.append(field);
final Direction direction = order.getDirection();
if (null != direction) {
sql.append(StrUtil.SPACE).append(direction);
}
}
return this;
} | java | public SqlBuilder orderBy(Order... orders) {
if (ArrayUtil.isEmpty(orders)) {
return this;
}
sql.append(" ORDER BY ");
String field = null;
boolean isFirst = true;
for (Order order : orders) {
if (null != wrapper) {
// 包装字段名
field = wrapper.wrap(order.getField());
}
if (StrUtil.isBlank(field)) {
continue;
}
// 只有在非第一项前添加逗号
if (isFirst) {
isFirst = false;
} else {
sql.append(StrUtil.COMMA);
}
sql.append(field);
final Direction direction = order.getDirection();
if (null != direction) {
sql.append(StrUtil.SPACE).append(direction);
}
}
return this;
} | [
"public",
"SqlBuilder",
"orderBy",
"(",
"Order",
"...",
"orders",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"orders",
")",
")",
"{",
"return",
"this",
";",
"}",
"sql",
".",
"append",
"(",
"\" ORDER BY \"",
")",
";",
"String",
"field",
"=",... | 排序
@param orders 排序对象
@return 自己 | [
"排序"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L400-L430 | train | Add a ORDER BY clause to the SQL query. | [
30522,
2270,
29296,
8569,
23891,
2099,
2344,
3762,
1006,
2344,
1012,
1012,
1012,
4449,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
4449,
1007,
1007,
1063,
2709,
2023,
1025,
1065,
29296,
1012,
10439,
10497... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.formatPercent | public static String formatPercent(double number, int scale) {
final NumberFormat format = NumberFormat.getPercentInstance();
format.setMaximumFractionDigits(scale);
return format.format(number);
} | java | public static String formatPercent(double number, int scale) {
final NumberFormat format = NumberFormat.getPercentInstance();
format.setMaximumFractionDigits(scale);
return format.format(number);
} | [
"public",
"static",
"String",
"formatPercent",
"(",
"double",
"number",
",",
"int",
"scale",
")",
"{",
"final",
"NumberFormat",
"format",
"=",
"NumberFormat",
".",
"getPercentInstance",
"(",
")",
";",
"format",
".",
"setMaximumFractionDigits",
"(",
"scale",
")",... | 格式化百分比,小数采用四舍五入方式
@param number 值
@param scale 保留小数位数
@return 百分比
@since 3.2.3 | [
"格式化百分比,小数采用四舍五入方式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1038-L1042 | train | Format a double with the specified fraction scale. | [
30522,
2270,
10763,
5164,
4289,
4842,
13013,
1006,
3313,
2193,
1010,
20014,
4094,
1007,
1063,
2345,
2193,
14192,
4017,
4289,
1027,
2193,
14192,
4017,
1012,
2131,
4842,
13013,
7076,
26897,
1006,
1007,
1025,
4289,
1012,
2275,
17848,
28591,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/PythonStreamBinder.java | PythonStreamBinder.deleteIfExists | private static void deleteIfExists(Path path) throws IOException {
FileSystem fs = path.getFileSystem();
if (fs.exists(path)) {
fs.delete(path, true);
}
} | java | private static void deleteIfExists(Path path) throws IOException {
FileSystem fs = path.getFileSystem();
if (fs.exists(path)) {
fs.delete(path, true);
}
} | [
"private",
"static",
"void",
"deleteIfExists",
"(",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fs",
"=",
"path",
".",
"getFileSystem",
"(",
")",
";",
"if",
"(",
"fs",
".",
"exists",
"(",
"path",
")",
")",
"{",
"fs",
".",
"delete"... | =====File utils=================================================================================================== | [
"=====",
"File",
"utils",
"==================================================================================================="
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/PythonStreamBinder.java#L136-L141 | train | Delete the file if it exists. | [
30522,
2797,
10763,
11675,
3972,
12870,
29323,
9048,
12837,
1006,
4130,
4130,
1007,
11618,
22834,
10288,
24422,
1063,
6764,
27268,
6633,
1042,
2015,
1027,
4130,
1012,
2131,
8873,
4244,
27268,
6633,
1006,
1007,
1025,
2065,
1006,
1042,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java | JavaUtils.readFully | public static void readFully(ReadableByteChannel channel, ByteBuffer dst) throws IOException {
int expected = dst.remaining();
while (dst.hasRemaining()) {
if (channel.read(dst) < 0) {
throw new EOFException(String.format("Not enough bytes in channel (expected %d).",
expected));
}
}
} | java | public static void readFully(ReadableByteChannel channel, ByteBuffer dst) throws IOException {
int expected = dst.remaining();
while (dst.hasRemaining()) {
if (channel.read(dst) < 0) {
throw new EOFException(String.format("Not enough bytes in channel (expected %d).",
expected));
}
}
} | [
"public",
"static",
"void",
"readFully",
"(",
"ReadableByteChannel",
"channel",
",",
"ByteBuffer",
"dst",
")",
"throws",
"IOException",
"{",
"int",
"expected",
"=",
"dst",
".",
"remaining",
"(",
")",
";",
"while",
"(",
"dst",
".",
"hasRemaining",
"(",
")",
... | Fills a buffer with data read from the channel. | [
"Fills",
"a",
"buffer",
"with",
"data",
"read",
"from",
"the",
"channel",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java#L368-L376 | train | Read a block of bytes from a channel. | [
30522,
2270,
10763,
11675,
3191,
7699,
1006,
3191,
3085,
3762,
15007,
20147,
2140,
3149,
1010,
24880,
8569,
12494,
16233,
2102,
1007,
11618,
22834,
10288,
24422,
1063,
20014,
3517,
1027,
16233,
2102,
1012,
3588,
1006,
1007,
1025,
2096,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java | EntityScanPackages.register | public static void register(BeanDefinitionRegistry registry, String... packageNames) {
Assert.notNull(registry, "Registry must not be null");
Assert.notNull(packageNames, "PackageNames must not be null");
register(registry, Arrays.asList(packageNames));
} | java | public static void register(BeanDefinitionRegistry registry, String... packageNames) {
Assert.notNull(registry, "Registry must not be null");
Assert.notNull(packageNames, "PackageNames must not be null");
register(registry, Arrays.asList(packageNames));
} | [
"public",
"static",
"void",
"register",
"(",
"BeanDefinitionRegistry",
"registry",
",",
"String",
"...",
"packageNames",
")",
"{",
"Assert",
".",
"notNull",
"(",
"registry",
",",
"\"Registry must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"packageNam... | Register the specified entity scan packages with the system.
@param registry the source registry
@param packageNames the package names to register | [
"Register",
"the",
"specified",
"entity",
"scan",
"packages",
"with",
"the",
"system",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java#L97-L101 | train | Register bean definitions with the given registry. | [
30522,
2270,
10763,
11675,
4236,
1006,
14068,
3207,
16294,
22753,
2890,
24063,
2854,
15584,
1010,
5164,
1012,
1012,
1012,
7427,
18442,
2015,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
15584,
1010,
1000,
15584,
2442,
2025,
2022,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java | NestedMapsStateTable.size | @Override
public int size() {
int count = 0;
for (Map<N, Map<K, S>> namespaceMap : state) {
if (null != namespaceMap) {
for (Map<K, S> keyMap : namespaceMap.values()) {
if (null != keyMap) {
count += keyMap.size();
}
}
}
}
return count;
} | java | @Override
public int size() {
int count = 0;
for (Map<N, Map<K, S>> namespaceMap : state) {
if (null != namespaceMap) {
for (Map<K, S> keyMap : namespaceMap.values()) {
if (null != keyMap) {
count += keyMap.size();
}
}
}
}
return count;
} | [
"@",
"Override",
"public",
"int",
"size",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Map",
"<",
"N",
",",
"Map",
"<",
"K",
",",
"S",
">",
">",
"namespaceMap",
":",
"state",
")",
"{",
"if",
"(",
"null",
"!=",
"namespaceMap",
")",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java#L138-L151 | train | Returns the number of elements in the state. | [
30522,
1030,
2058,
15637,
2270,
20014,
2946,
1006,
1007,
1063,
20014,
4175,
1027,
1014,
1025,
2005,
1006,
4949,
1026,
1050,
1010,
4949,
30524,
1006,
19701,
999,
1027,
3145,
2863,
2361,
1007,
1063,
4175,
1009,
1027,
3145,
2863,
2361,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.createSimpleMDAGTransitionSet | private int createSimpleMDAGTransitionSet(MDAGNode node, SimpleMDAGNode[] mdagDataArray, int onePastLastCreatedTransitionSetIndex)
{
int pivotIndex = onePastLastCreatedTransitionSetIndex; // node自己的位置
node.setTransitionSetBeginIndex(pivotIndex);
onePastLastCreatedTransitionSetIndex += node.getOutgoingTransitionCount(); // 这个参数代表id的消耗
//Create a SimpleMDAGNode representing each _transition label/target combo in transitionTreeMap, recursively calling this method (if necessary)
//to set indices in these SimpleMDAGNodes that the set of transitions emitting from their respective _transition targets starts from.
TreeMap<Character, MDAGNode> transitionTreeMap = node.getOutgoingTransitions();
for (Entry<Character, MDAGNode> transitionKeyValuePair : transitionTreeMap.entrySet())
{
//Use the current _transition's label and target node to create a SimpleMDAGNode
//(which is a space-saving representation of the _transition), and insert it in to mdagDataArray
char transitionLabelChar = transitionKeyValuePair.getKey();
MDAGNode transitionTargetNode = transitionKeyValuePair.getValue();
mdagDataArray[pivotIndex] = new SimpleMDAGNode(transitionLabelChar, transitionTargetNode.isAcceptNode(), transitionTargetNode.getOutgoingTransitionCount());
/////
//If targetTransitionNode's outgoing _transition set hasn't been inserted in to mdagDataArray yet, call this method on it to do so.
//After this call returns, transitionTargetNode will contain the index in mdagDataArray that its _transition set starts from
if (transitionTargetNode.getTransitionSetBeginIndex() == -1)
onePastLastCreatedTransitionSetIndex = createSimpleMDAGTransitionSet(transitionTargetNode, mdagDataArray, onePastLastCreatedTransitionSetIndex);
mdagDataArray[pivotIndex++].setTransitionSetBeginIndex(transitionTargetNode.getTransitionSetBeginIndex());
}
/////
return onePastLastCreatedTransitionSetIndex;
} | java | private int createSimpleMDAGTransitionSet(MDAGNode node, SimpleMDAGNode[] mdagDataArray, int onePastLastCreatedTransitionSetIndex)
{
int pivotIndex = onePastLastCreatedTransitionSetIndex; // node自己的位置
node.setTransitionSetBeginIndex(pivotIndex);
onePastLastCreatedTransitionSetIndex += node.getOutgoingTransitionCount(); // 这个参数代表id的消耗
//Create a SimpleMDAGNode representing each _transition label/target combo in transitionTreeMap, recursively calling this method (if necessary)
//to set indices in these SimpleMDAGNodes that the set of transitions emitting from their respective _transition targets starts from.
TreeMap<Character, MDAGNode> transitionTreeMap = node.getOutgoingTransitions();
for (Entry<Character, MDAGNode> transitionKeyValuePair : transitionTreeMap.entrySet())
{
//Use the current _transition's label and target node to create a SimpleMDAGNode
//(which is a space-saving representation of the _transition), and insert it in to mdagDataArray
char transitionLabelChar = transitionKeyValuePair.getKey();
MDAGNode transitionTargetNode = transitionKeyValuePair.getValue();
mdagDataArray[pivotIndex] = new SimpleMDAGNode(transitionLabelChar, transitionTargetNode.isAcceptNode(), transitionTargetNode.getOutgoingTransitionCount());
/////
//If targetTransitionNode's outgoing _transition set hasn't been inserted in to mdagDataArray yet, call this method on it to do so.
//After this call returns, transitionTargetNode will contain the index in mdagDataArray that its _transition set starts from
if (transitionTargetNode.getTransitionSetBeginIndex() == -1)
onePastLastCreatedTransitionSetIndex = createSimpleMDAGTransitionSet(transitionTargetNode, mdagDataArray, onePastLastCreatedTransitionSetIndex);
mdagDataArray[pivotIndex++].setTransitionSetBeginIndex(transitionTargetNode.getTransitionSetBeginIndex());
}
/////
return onePastLastCreatedTransitionSetIndex;
} | [
"private",
"int",
"createSimpleMDAGTransitionSet",
"(",
"MDAGNode",
"node",
",",
"SimpleMDAGNode",
"[",
"]",
"mdagDataArray",
",",
"int",
"onePastLastCreatedTransitionSetIndex",
")",
"{",
"int",
"pivotIndex",
"=",
"onePastLastCreatedTransitionSetIndex",
";",
"// node自己的位置",... | Creates a SimpleMDAGNode version of an MDAGNode's outgoing _transition set in mdagDataArray.
@param node the MDAGNode containing the _transition set to be inserted in to {@code mdagDataArray}
@param mdagDataArray an array of SimpleMDAGNodes containing a subset of the data of the MDAG
@param onePastLastCreatedTransitionSetIndex an int of the index in {@code mdagDataArray} that the outgoing _transition set of {@code node} is to start from
@return an int of one past the end of the _transition set located farthest in {@code mdagDataArray} | [
"Creates",
"a",
"SimpleMDAGNode",
"version",
"of",
"an",
"MDAGNode",
"s",
"outgoing",
"_transition",
"set",
"in",
"mdagDataArray",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L723-L752 | train | Create a SimpleMDAGNode | [
30522,
2797,
20014,
9005,
5714,
10814,
26876,
8490,
6494,
3619,
22753,
13462,
1006,
9108,
8490,
3630,
3207,
13045,
1010,
3722,
26876,
8490,
3630,
3207,
1031,
1033,
9108,
8490,
2850,
2696,
2906,
9447,
1010,
20014,
2028,
19707,
19646,
14083,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java | CommandBuilderUtils.quoteForCommandString | static String quoteForCommandString(String s) {
StringBuilder quoted = new StringBuilder().append('"');
for (int i = 0; i < s.length(); i++) {
int cp = s.codePointAt(i);
if (cp == '"' || cp == '\\') {
quoted.appendCodePoint('\\');
}
quoted.appendCodePoint(cp);
}
return quoted.append('"').toString();
} | java | static String quoteForCommandString(String s) {
StringBuilder quoted = new StringBuilder().append('"');
for (int i = 0; i < s.length(); i++) {
int cp = s.codePointAt(i);
if (cp == '"' || cp == '\\') {
quoted.appendCodePoint('\\');
}
quoted.appendCodePoint(cp);
}
return quoted.append('"').toString();
} | [
"static",
"String",
"quoteForCommandString",
"(",
"String",
"s",
")",
"{",
"StringBuilder",
"quoted",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
... | Quotes a string so that it can be used in a command string.
Basically, just add simple escapes. E.g.:
original single argument : ab "cd" ef
after: "ab \"cd\" ef"
This can be parsed back into a single argument by python's "shlex.split()" function. | [
"Quotes",
"a",
"string",
"so",
"that",
"it",
"can",
"be",
"used",
"in",
"a",
"command",
"string",
".",
"Basically",
"just",
"add",
"simple",
"escapes",
".",
"E",
".",
"g",
".",
":",
"original",
"single",
"argument",
":",
"ab",
"cd",
"ef",
"after",
":... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java#L283-L293 | train | Quote a command string for use in a command string. | [
30522,
10763,
5164,
14686,
29278,
9006,
2386,
5104,
18886,
3070,
1006,
5164,
1055,
1007,
1063,
5164,
8569,
23891,
2099,
9339,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1012,
10439,
10497,
1006,
1005,
30524,
18133,
1027,
1027,
1005,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/instance/Instance.java | Instance.tags | public String[] tags(TagSet tagSet)
{
assert tagArray != null;
String[] tags = new String[tagArray.length];
for (int i = 0; i < tags.length; i++)
{
tags[i] = tagSet.stringOf(tagArray[i]);
}
return tags;
} | java | public String[] tags(TagSet tagSet)
{
assert tagArray != null;
String[] tags = new String[tagArray.length];
for (int i = 0; i < tags.length; i++)
{
tags[i] = tagSet.stringOf(tagArray[i]);
}
return tags;
} | [
"public",
"String",
"[",
"]",
"tags",
"(",
"TagSet",
"tagSet",
")",
"{",
"assert",
"tagArray",
"!=",
"null",
";",
"String",
"[",
"]",
"tags",
"=",
"new",
"String",
"[",
"tagArray",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | 根据标注集还原字符形式的标签
@param tagSet
@return | [
"根据标注集还原字符形式的标签"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/instance/Instance.java#L85-L96 | train | Get the tags of this tag set. | [
30522,
2270,
5164,
1031,
1033,
22073,
1006,
22073,
3388,
22073,
3388,
1007,
1063,
20865,
6415,
2906,
9447,
999,
1027,
19701,
1025,
5164,
1031,
1033,
22073,
1027,
2047,
5164,
1031,
6415,
2906,
9447,
1012,
3091,
1033,
1025,
2005,
1006,
20014,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java | Http2Exception.closedStreamError | public static Http2Exception closedStreamError(Http2Error error, String fmt, Object... args) {
return new ClosedStreamCreationException(error, String.format(fmt, args));
} | java | public static Http2Exception closedStreamError(Http2Error error, String fmt, Object... args) {
return new ClosedStreamCreationException(error, String.format(fmt, args));
} | [
"public",
"static",
"Http2Exception",
"closedStreamError",
"(",
"Http2Error",
"error",
",",
"String",
"fmt",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ClosedStreamCreationException",
"(",
"error",
",",
"String",
".",
"format",
"(",
"fmt",
",",
... | Use if an error has occurred which can not be isolated to a single stream, but instead applies
to the entire connection.
@param error The type of error as defined by the HTTP/2 specification.
@param fmt String with the content and format for the additional debug data.
@param args Objects which fit into the format defined by {@code fmt}.
@return An exception which can be translated into a HTTP/2 error. | [
"Use",
"if",
"an",
"error",
"has",
"occurred",
"which",
"can",
"not",
"be",
"isolated",
"to",
"a",
"single",
"stream",
"but",
"instead",
"applies",
"to",
"the",
"entire",
"connection",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Exception.java#L110-L112 | train | Creates a ClosedStreamCreationException with the given error message. | [
30522,
2270,
10763,
8299,
2475,
10288,
24422,
2701,
21422,
2121,
29165,
1006,
8299,
2475,
2121,
29165,
7561,
1010,
5164,
4718,
2102,
1010,
4874,
1012,
1012,
1012,
12098,
5620,
1007,
1063,
2709,
2047,
2701,
21422,
16748,
3370,
10288,
24422,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.getTransitionPathFirstConfluenceNodeData | private HashMap<String, Object> getTransitionPathFirstConfluenceNodeData(MDAGNode originNode, String str)
{
int currentIndex = 0;
int charCount = str.length();
MDAGNode currentNode = originNode;
//Loop thorugh the characters in str, sequentially using them to _transition through the MDAG in search of
//(and breaking upon reaching) the first node that is the target of two or more transitions. The loop is
//also broken from if the currently processing node doesn't have a _transition labeled with the currently processing char.
for (; currentIndex < charCount; currentIndex++)
{
char currentChar = str.charAt(currentIndex);
currentNode = (currentNode.hasOutgoingTransition(currentChar) ? currentNode.transition(currentChar) : null);
if (currentNode == null || currentNode.isConfluenceNode())
break;
}
/////
boolean noConfluenceNode = (currentNode == originNode || currentIndex == charCount);
//Create a HashMap containing the index of the last char in the substring corresponding
//to the transitoin path to the confluence node, as well as the actual confluence node
HashMap<String, Object> confluenceNodeDataHashMap = new HashMap<String, Object>(2);
confluenceNodeDataHashMap.put("toConfluenceNodeTransitionCharIndex", (noConfluenceNode ? null : currentIndex));
confluenceNodeDataHashMap.put("confluenceNode", noConfluenceNode ? null : currentNode);
/////
return confluenceNodeDataHashMap;
} | java | private HashMap<String, Object> getTransitionPathFirstConfluenceNodeData(MDAGNode originNode, String str)
{
int currentIndex = 0;
int charCount = str.length();
MDAGNode currentNode = originNode;
//Loop thorugh the characters in str, sequentially using them to _transition through the MDAG in search of
//(and breaking upon reaching) the first node that is the target of two or more transitions. The loop is
//also broken from if the currently processing node doesn't have a _transition labeled with the currently processing char.
for (; currentIndex < charCount; currentIndex++)
{
char currentChar = str.charAt(currentIndex);
currentNode = (currentNode.hasOutgoingTransition(currentChar) ? currentNode.transition(currentChar) : null);
if (currentNode == null || currentNode.isConfluenceNode())
break;
}
/////
boolean noConfluenceNode = (currentNode == originNode || currentIndex == charCount);
//Create a HashMap containing the index of the last char in the substring corresponding
//to the transitoin path to the confluence node, as well as the actual confluence node
HashMap<String, Object> confluenceNodeDataHashMap = new HashMap<String, Object>(2);
confluenceNodeDataHashMap.put("toConfluenceNodeTransitionCharIndex", (noConfluenceNode ? null : currentIndex));
confluenceNodeDataHashMap.put("confluenceNode", noConfluenceNode ? null : currentNode);
/////
return confluenceNodeDataHashMap;
} | [
"private",
"HashMap",
"<",
"String",
",",
"Object",
">",
"getTransitionPathFirstConfluenceNodeData",
"(",
"MDAGNode",
"originNode",
",",
"String",
"str",
")",
"{",
"int",
"currentIndex",
"=",
"0",
";",
"int",
"charCount",
"=",
"str",
".",
"length",
"(",
")",
... | Determines and retrieves data related to the first confluence node
(defined as a node with two or more incoming transitions) of a
_transition path corresponding to a given String from a given node.
@param originNode the MDAGNode from which the _transition path corresponding to str starts from
@param str a String corresponding to a _transition path in the MDAG
@return a HashMap of Strings to Objects containing:
- an int denoting the length of the path to the first confluence node in the _transition path of interest
- the MDAGNode which is the first confluence node in the _transition path of interest (or null if one does not exist) | [
"Determines",
"and",
"retrieves",
"data",
"related",
"to",
"the",
"first",
"confluence",
"node",
"(",
"defined",
"as",
"a",
"node",
"with",
"two",
"or",
"more",
"incoming",
"transitions",
")",
"of",
"a",
"_transition",
"path",
"corresponding",
"to",
"a",
"gi... | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L496-L525 | train | Get the TransitPathFirstConfluenceNodeData HashMap for the given MDAGNode and the String. | [
30522,
2797,
23325,
2863,
2361,
1026,
5164,
1010,
4874,
1028,
2131,
6494,
3619,
22753,
15069,
8873,
12096,
8663,
10258,
24997,
27524,
10244,
2850,
2696,
1006,
9108,
8490,
3630,
3207,
4761,
3630,
3207,
1010,
5164,
2358,
2099,
1007,
1063,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | handler/src/main/java/com/networknt/handler/Handler.java | Handler.next | public static void next(HttpServerExchange httpServerExchange) throws Exception {
HttpHandler httpHandler = getNext(httpServerExchange);
if (httpHandler != null) {
httpHandler.handleRequest(httpServerExchange);
} else if(lastHandler != null) {
lastHandler.handleRequest(httpServerExchange);
}
} | java | public static void next(HttpServerExchange httpServerExchange) throws Exception {
HttpHandler httpHandler = getNext(httpServerExchange);
if (httpHandler != null) {
httpHandler.handleRequest(httpServerExchange);
} else if(lastHandler != null) {
lastHandler.handleRequest(httpServerExchange);
}
} | [
"public",
"static",
"void",
"next",
"(",
"HttpServerExchange",
"httpServerExchange",
")",
"throws",
"Exception",
"{",
"HttpHandler",
"httpHandler",
"=",
"getNext",
"(",
"httpServerExchange",
")",
";",
"if",
"(",
"httpHandler",
"!=",
"null",
")",
"{",
"httpHandler"... | Handle the next request in the chain.
@param httpServerExchange
The current requests server exchange.
@throws Exception
Propagated exception in the handleRequest chain. | [
"Handle",
"the",
"next",
"request",
"in",
"the",
"chain",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/handler/src/main/java/com/networknt/handler/Handler.java#L204-L211 | train | Handle the next request. | [
30522,
2270,
10763,
11675,
2279,
1006,
16770,
2121,
28943,
2595,
22305,
2063,
16770,
2121,
28943,
2595,
22305,
2063,
1007,
11618,
6453,
1063,
8299,
11774,
3917,
8299,
11774,
3917,
1027,
2131,
2638,
18413,
1006,
16770,
2121,
28943,
2595,
22305... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.setFaultMessageResolver | public WebServiceTemplateBuilder setFaultMessageResolver(
FaultMessageResolver faultMessageResolver) {
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors,
append(this.internalCustomizers,
new FaultMessageResolverCustomizer(faultMessageResolver)),
this.customizers, this.messageSenders, this.marshaller, this.unmarshaller,
this.destinationProvider, this.transformerFactoryClass,
this.messageFactory);
} | java | public WebServiceTemplateBuilder setFaultMessageResolver(
FaultMessageResolver faultMessageResolver) {
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors,
append(this.internalCustomizers,
new FaultMessageResolverCustomizer(faultMessageResolver)),
this.customizers, this.messageSenders, this.marshaller, this.unmarshaller,
this.destinationProvider, this.transformerFactoryClass,
this.messageFactory);
} | [
"public",
"WebServiceTemplateBuilder",
"setFaultMessageResolver",
"(",
"FaultMessageResolver",
"faultMessageResolver",
")",
"{",
"return",
"new",
"WebServiceTemplateBuilder",
"(",
"this",
".",
"detectHttpMessageSender",
",",
"this",
".",
"interceptors",
",",
"append",
"(",
... | Set the {@link FaultMessageResolver} to use.
@param faultMessageResolver the fault message resolver to use
@return a new builder instance.
@see WebServiceTemplate#setFaultMessageResolver(FaultMessageResolver) | [
"Set",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L410-L419 | train | Sets the fault message resolver. | [
30522,
2270,
4773,
8043,
7903,
12870,
8737,
13806,
8569,
23891,
2099,
2275,
7011,
11314,
7834,
3736,
4590,
2229,
4747,
6299,
1006,
6346,
7834,
3736,
4590,
2229,
4747,
6299,
6346,
7834,
3736,
4590,
2229,
4747,
6299,
1007,
1063,
2709,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerStaticFileServerHandler.java | HistoryServerStaticFileServerHandler.channelRead0 | @Override
public void channelRead0(ChannelHandlerContext ctx, RoutedRequest routedRequest) throws Exception {
String requestPath = routedRequest.getPath();
respondWithFile(ctx, routedRequest.getRequest(), requestPath);
} | java | @Override
public void channelRead0(ChannelHandlerContext ctx, RoutedRequest routedRequest) throws Exception {
String requestPath = routedRequest.getPath();
respondWithFile(ctx, routedRequest.getRequest(), requestPath);
} | [
"@",
"Override",
"public",
"void",
"channelRead0",
"(",
"ChannelHandlerContext",
"ctx",
",",
"RoutedRequest",
"routedRequest",
")",
"throws",
"Exception",
"{",
"String",
"requestPath",
"=",
"routedRequest",
".",
"getPath",
"(",
")",
";",
"respondWithFile",
"(",
"c... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerStaticFileServerHandler.java#L105-L110 | train | Handle a read request. | [
30522,
1030,
2058,
15637,
2270,
11675,
3149,
16416,
2094,
2692,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
19578,
2890,
15500,
19578,
2890,
15500,
1007,
11618,
6453,
1063,
5164,
5227,
15069,
1027,
19578,
2890,
15500,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java | DoubleArray.open | public void open(InputStream stream) throws IOException
{
int size = (int) (stream.available() / UNIT_SIZE);
_array = new int[size];
DataInputStream in = null;
try
{
in = new DataInputStream(new BufferedInputStream(
stream));
for (int i = 0; i < size; ++i)
{
_array[i] = in.readInt();
}
}
finally
{
if (in != null)
{
in.close();
}
}
} | java | public void open(InputStream stream) throws IOException
{
int size = (int) (stream.available() / UNIT_SIZE);
_array = new int[size];
DataInputStream in = null;
try
{
in = new DataInputStream(new BufferedInputStream(
stream));
for (int i = 0; i < size; ++i)
{
_array[i] = in.readInt();
}
}
finally
{
if (in != null)
{
in.close();
}
}
} | [
"public",
"void",
"open",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"(",
"int",
")",
"(",
"stream",
".",
"available",
"(",
")",
"/",
"UNIT_SIZE",
")",
";",
"_array",
"=",
"new",
"int",
"[",
"size",
"]",
";",... | Read from a stream. The stream must implement the available() method.
@param stream
@throws java.io.IOException | [
"Read",
"from",
"a",
"stream",
".",
"The",
"stream",
"must",
"implement",
"the",
"available",
"()",
"method",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java#L60-L83 | train | This method is used to open a stream of a Crazil language file. | [
30522,
2270,
11675,
2330,
1006,
20407,
25379,
5460,
1007,
11618,
22834,
10288,
24422,
1063,
20014,
2946,
1027,
1006,
20014,
1007,
1006,
5460,
1012,
2800,
1006,
1007,
1013,
3131,
1035,
2946,
1007,
1025,
1035,
9140,
1027,
2047,
20014,
1031,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java | SingleThreadEventExecutor.confirmShutdown | protected boolean confirmShutdown() {
if (!isShuttingDown()) {
return false;
}
if (!inEventLoop()) {
throw new IllegalStateException("must be invoked from an event loop");
}
cancelScheduledTasks();
if (gracefulShutdownStartTime == 0) {
gracefulShutdownStartTime = ScheduledFutureTask.nanoTime();
}
if (runAllTasks() || runShutdownHooks()) {
if (isShutdown()) {
// Executor shut down - no new tasks anymore.
return true;
}
// There were tasks in the queue. Wait a little bit more until no tasks are queued for the quiet period or
// terminate if the quiet period is 0.
// See https://github.com/netty/netty/issues/4241
if (gracefulShutdownQuietPeriod == 0) {
return true;
}
wakeup(true);
return false;
}
final long nanoTime = ScheduledFutureTask.nanoTime();
if (isShutdown() || nanoTime - gracefulShutdownStartTime > gracefulShutdownTimeout) {
return true;
}
if (nanoTime - lastExecutionTime <= gracefulShutdownQuietPeriod) {
// Check if any tasks were added to the queue every 100ms.
// TODO: Change the behavior of takeTask() so that it returns on timeout.
wakeup(true);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// Ignore
}
return false;
}
// No tasks were added for last quiet period - hopefully safe to shut down.
// (Hopefully because we really cannot make a guarantee that there will be no execute() calls by a user.)
return true;
} | java | protected boolean confirmShutdown() {
if (!isShuttingDown()) {
return false;
}
if (!inEventLoop()) {
throw new IllegalStateException("must be invoked from an event loop");
}
cancelScheduledTasks();
if (gracefulShutdownStartTime == 0) {
gracefulShutdownStartTime = ScheduledFutureTask.nanoTime();
}
if (runAllTasks() || runShutdownHooks()) {
if (isShutdown()) {
// Executor shut down - no new tasks anymore.
return true;
}
// There were tasks in the queue. Wait a little bit more until no tasks are queued for the quiet period or
// terminate if the quiet period is 0.
// See https://github.com/netty/netty/issues/4241
if (gracefulShutdownQuietPeriod == 0) {
return true;
}
wakeup(true);
return false;
}
final long nanoTime = ScheduledFutureTask.nanoTime();
if (isShutdown() || nanoTime - gracefulShutdownStartTime > gracefulShutdownTimeout) {
return true;
}
if (nanoTime - lastExecutionTime <= gracefulShutdownQuietPeriod) {
// Check if any tasks were added to the queue every 100ms.
// TODO: Change the behavior of takeTask() so that it returns on timeout.
wakeup(true);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// Ignore
}
return false;
}
// No tasks were added for last quiet period - hopefully safe to shut down.
// (Hopefully because we really cannot make a guarantee that there will be no execute() calls by a user.)
return true;
} | [
"protected",
"boolean",
"confirmShutdown",
"(",
")",
"{",
"if",
"(",
"!",
"isShuttingDown",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"inEventLoop",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"must be invoked... | Confirm that the shutdown if the instance should be done now! | [
"Confirm",
"that",
"the",
"shutdown",
"if",
"the",
"instance",
"should",
"be",
"done",
"now!"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java#L678-L731 | train | Confirm shutdown. | [
30522,
5123,
22017,
20898,
23283,
6979,
2102,
7698,
1006,
1007,
1063,
2065,
1006,
999,
26354,
6979,
13027,
7698,
1006,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
999,
1999,
18697,
3372,
4135,
7361,
1006,
1007,
1007,
1063,
5466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java | Restarter.restart | public void restart(FailureHandler failureHandler) {
if (!this.enabled) {
this.logger.debug("Application restart is disabled");
return;
}
this.logger.debug("Restarting application");
getLeakSafeThread().call(() -> {
Restarter.this.stop();
Restarter.this.start(failureHandler);
return null;
});
} | java | public void restart(FailureHandler failureHandler) {
if (!this.enabled) {
this.logger.debug("Application restart is disabled");
return;
}
this.logger.debug("Restarting application");
getLeakSafeThread().call(() -> {
Restarter.this.stop();
Restarter.this.start(failureHandler);
return null;
});
} | [
"public",
"void",
"restart",
"(",
"FailureHandler",
"failureHandler",
")",
"{",
"if",
"(",
"!",
"this",
".",
"enabled",
")",
"{",
"this",
".",
"logger",
".",
"debug",
"(",
"\"Application restart is disabled\"",
")",
";",
"return",
";",
"}",
"this",
".",
"l... | Restart the running application.
@param failureHandler a failure handler to deal with application that doesn't start | [
"Restart",
"the",
"running",
"application",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java#L245-L256 | train | Restart the application. | [
30522,
2270,
11675,
23818,
1006,
4945,
11774,
3917,
4945,
11774,
3917,
1007,
1063,
2065,
1006,
999,
2023,
1012,
9124,
1007,
1063,
2023,
1012,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
1000,
4646,
23818,
2003,
9776,
1000,
1007,
1025,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/HanLP.java | HanLP.convertToPinyinString | public static String convertToPinyinString(String text, String separator, boolean remainNone)
{
List<Pinyin> pinyinList = PinyinDictionary.convertToPinyin(text, true);
int length = pinyinList.size();
StringBuilder sb = new StringBuilder(length * (5 + separator.length()));
int i = 1;
for (Pinyin pinyin : pinyinList)
{
if (pinyin == Pinyin.none5 && !remainNone)
{
sb.append(text.charAt(i - 1));
}
else sb.append(pinyin.getPinyinWithoutTone());
if (i < length)
{
sb.append(separator);
}
++i;
}
return sb.toString();
} | java | public static String convertToPinyinString(String text, String separator, boolean remainNone)
{
List<Pinyin> pinyinList = PinyinDictionary.convertToPinyin(text, true);
int length = pinyinList.size();
StringBuilder sb = new StringBuilder(length * (5 + separator.length()));
int i = 1;
for (Pinyin pinyin : pinyinList)
{
if (pinyin == Pinyin.none5 && !remainNone)
{
sb.append(text.charAt(i - 1));
}
else sb.append(pinyin.getPinyinWithoutTone());
if (i < length)
{
sb.append(separator);
}
++i;
}
return sb.toString();
} | [
"public",
"static",
"String",
"convertToPinyinString",
"(",
"String",
"text",
",",
"String",
"separator",
",",
"boolean",
"remainNone",
")",
"{",
"List",
"<",
"Pinyin",
">",
"pinyinList",
"=",
"PinyinDictionary",
".",
"convertToPinyin",
"(",
"text",
",",
"true",... | 转化为拼音
@param text 文本
@param separator 分隔符
@param remainNone 有些字没有拼音(如标点),是否保留它们的拼音(true用none表示,false用原字符表示)
@return 一个字符串,由[拼音][分隔符][拼音]构成 | [
"转化为拼音"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/HanLP.java#L566-L587 | train | Convert a string of Pinyin to a String of Pinyin. | [
30522,
2270,
10763,
5164,
10463,
14399,
24300,
7076,
18886,
3070,
1006,
5164,
3793,
1010,
5164,
19802,
25879,
2953,
1010,
22017,
20898,
3961,
8540,
2063,
1007,
1063,
2862,
1026,
9973,
1028,
9973,
9863,
1027,
9973,
29201,
3258,
5649,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.endsWithDelimiter | public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
if (endPos < delim.length - 1) {
return false;
}
for (int pos = 0; pos < delim.length; ++pos) {
if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
return false;
}
}
return true;
} | java | public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
if (endPos < delim.length - 1) {
return false;
}
for (int pos = 0; pos < delim.length; ++pos) {
if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"boolean",
"endsWithDelimiter",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"endPos",
",",
"byte",
"[",
"]",
"delim",
")",
"{",
"if",
"(",
"endPos",
"<",
"delim",
".",
"length",
"-",
"1",
")",
"{",
"return",
"false",
";",... | Checks if the given bytes ends with the delimiter at the given end position.
@param bytes The byte array that holds the value.
@param endPos The index of the byte array where the check for the delimiter ends.
@param delim The delimiter to check for.
@return true if a delimiter ends at the given end position, false otherwise. | [
"Checks",
"if",
"the",
"given",
"bytes",
"ends",
"with",
"the",
"delimiter",
"at",
"the",
"given",
"end",
"position",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L169-L179 | train | Checks if the byte array ends with the delimiter. | [
30522,
2270,
10763,
2345,
22017,
20898,
4515,
24415,
9247,
27605,
3334,
1006,
24880,
1031,
1033,
27507,
1010,
20014,
2203,
6873,
2015,
1010,
24880,
1031,
1033,
3972,
5714,
1007,
1063,
2065,
1006,
2203,
6873,
2015,
1026,
3972,
5714,
1012,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java | PerSessionLogHandler.fetchAndStoreLogsFromDriver | public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver)
throws IOException {
if (!perSessionDriverEntries.containsKey(sessionId)) {
perSessionDriverEntries.put(sessionId, new HashMap<>());
}
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId);
if (storeLogsOnSessionQuit) {
typeToEntriesMap.put(LogType.SERVER, getSessionLog(sessionId));
Set<String> logTypeSet = driver.manage().logs().getAvailableLogTypes();
for (String logType : logTypeSet) {
typeToEntriesMap.put(logType, driver.manage().logs().get(logType));
}
}
} | java | public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver)
throws IOException {
if (!perSessionDriverEntries.containsKey(sessionId)) {
perSessionDriverEntries.put(sessionId, new HashMap<>());
}
Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId);
if (storeLogsOnSessionQuit) {
typeToEntriesMap.put(LogType.SERVER, getSessionLog(sessionId));
Set<String> logTypeSet = driver.manage().logs().getAvailableLogTypes();
for (String logType : logTypeSet) {
typeToEntriesMap.put(logType, driver.manage().logs().get(logType));
}
}
} | [
"public",
"synchronized",
"void",
"fetchAndStoreLogsFromDriver",
"(",
"SessionId",
"sessionId",
",",
"WebDriver",
"driver",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"perSessionDriverEntries",
".",
"containsKey",
"(",
"sessionId",
")",
")",
"{",
"perSession... | Fetches and stores available logs from the given session and driver.
@param sessionId The id of the session.
@param driver The driver to get the logs from.
@throws IOException If there was a problem reading from file. | [
"Fetches",
"and",
"stores",
"available",
"logs",
"from",
"the",
"given",
"session",
"and",
"driver",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/PerSessionLogHandler.java#L236-L249 | train | Fetch and store logs from the given session. | [
30522,
2270,
25549,
11675,
18584,
29560,
19277,
21197,
22747,
21716,
23663,
2099,
1006,
5219,
3593,
5219,
3593,
1010,
4773,
23663,
2099,
4062,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
999,
2566,
8583,
10992,
23663,
22787,
5134,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/ConnectionStateHandler.java | ConnectionStateHandler.setStatus | public void setStatus(final ConnectionStatus update) {
status.getAndSet(update);
if (ConnectionStatus.TERMINATED == status.get()) {
resourceSynchronizer.doNotify();
}
} | java | public void setStatus(final ConnectionStatus update) {
status.getAndSet(update);
if (ConnectionStatus.TERMINATED == status.get()) {
resourceSynchronizer.doNotify();
}
} | [
"public",
"void",
"setStatus",
"(",
"final",
"ConnectionStatus",
"update",
")",
"{",
"status",
".",
"getAndSet",
"(",
"update",
")",
";",
"if",
"(",
"ConnectionStatus",
".",
"TERMINATED",
"==",
"status",
".",
"get",
"(",
")",
")",
"{",
"resourceSynchronizer"... | Change connection status using get and set.
@param update new update status | [
"Change",
"connection",
"status",
"using",
"get",
"and",
"set",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/ConnectionStateHandler.java#L41-L46 | train | Sets the status of the application. | [
30522,
2270,
11675,
4520,
29336,
2271,
1006,
2345,
7264,
29336,
2271,
10651,
1007,
1063,
3570,
1012,
2131,
29560,
3388,
1006,
10651,
1007,
1025,
2065,
1006,
7264,
29336,
2271,
1012,
12527,
1027,
1027,
3570,
1012,
2131,
1006,
1007,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java | OffHeapColumnVector.allocateColumns | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
OffHeapColumnVector[] vectors = new OffHeapColumnVector[fields.length];
for (int i = 0; i < fields.length; i++) {
vectors[i] = new OffHeapColumnVector(capacity, fields[i].dataType());
}
return vectors;
} | java | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
OffHeapColumnVector[] vectors = new OffHeapColumnVector[fields.length];
for (int i = 0; i < fields.length; i++) {
vectors[i] = new OffHeapColumnVector(capacity, fields[i].dataType());
}
return vectors;
} | [
"public",
"static",
"OffHeapColumnVector",
"[",
"]",
"allocateColumns",
"(",
"int",
"capacity",
",",
"StructField",
"[",
"]",
"fields",
")",
"{",
"OffHeapColumnVector",
"[",
"]",
"vectors",
"=",
"new",
"OffHeapColumnVector",
"[",
"fields",
".",
"length",
"]",
... | Allocates columns to store elements of each field off heap.
Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is
in number of elements, not number of bytes. | [
"Allocates",
"columns",
"to",
"store",
"elements",
"of",
"each",
"field",
"off",
"heap",
".",
"Capacity",
"is",
"the",
"initial",
"capacity",
"of",
"the",
"vector",
"and",
"it",
"will",
"grow",
"as",
"necessary",
".",
"Capacity",
"is",
"in",
"number",
"of"... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java#L50-L56 | train | Allocate columns. | [
30522,
2270,
10763,
2125,
20192,
15042,
4747,
2819,
2078,
3726,
16761,
1031,
1033,
2035,
24755,
26557,
4747,
2819,
3619,
1006,
20014,
3977,
1010,
2358,
6820,
6593,
3790,
1031,
1033,
4249,
1007,
1063,
2125,
20192,
15042,
4747,
2819,
2078,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/swing/RobotUtil.java | RobotUtil.click | public static void click() {
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
delay();
} | java | public static void click() {
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
delay();
} | [
"public",
"static",
"void",
"click",
"(",
")",
"{",
"robot",
".",
"mousePress",
"(",
"InputEvent",
".",
"BUTTON1_MASK",
")",
";",
"robot",
".",
"mouseRelease",
"(",
"InputEvent",
".",
"BUTTON1_MASK",
")",
";",
"delay",
"(",
")",
";",
"}"
] | 模拟单击<br>
鼠标单击包括鼠标左键的按下和释放
@since 4.5.7 | [
"模拟单击<br",
">",
"鼠标单击包括鼠标左键的按下和释放"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/RobotUtil.java#L62-L66 | train | Clicks the user with the mouse button 1. | [
30522,
2270,
10763,
11675,
11562,
1006,
1007,
1063,
8957,
1012,
8000,
20110,
1006,
7953,
18697,
3372,
1012,
6462,
2487,
1035,
7308,
1007,
1025,
8957,
1012,
8000,
16570,
19500,
1006,
7953,
18697,
3372,
1012,
6462,
2487,
1035,
7308,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java | WindowOperator.isElementLate | protected boolean isElementLate(StreamRecord<IN> element){
return (windowAssigner.isEventTime()) &&
(element.getTimestamp() + allowedLateness <= internalTimerService.currentWatermark());
} | java | protected boolean isElementLate(StreamRecord<IN> element){
return (windowAssigner.isEventTime()) &&
(element.getTimestamp() + allowedLateness <= internalTimerService.currentWatermark());
} | [
"protected",
"boolean",
"isElementLate",
"(",
"StreamRecord",
"<",
"IN",
">",
"element",
")",
"{",
"return",
"(",
"windowAssigner",
".",
"isEventTime",
"(",
")",
")",
"&&",
"(",
"element",
".",
"getTimestamp",
"(",
")",
"+",
"allowedLateness",
"<=",
"interna... | Decide if a record is currently late, based on current watermark and allowed lateness.
@param element The element to check
@return The element for which should be considered when sideoutputs | [
"Decide",
"if",
"a",
"record",
"is",
"currently",
"late",
"based",
"on",
"current",
"watermark",
"and",
"allowed",
"lateness",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L585-L588 | train | Checks if the element is late. | [
30522,
5123,
22017,
20898,
2003,
12260,
3672,
13806,
1006,
5460,
2890,
27108,
2094,
1026,
1999,
1028,
5783,
1007,
1063,
2709,
1006,
3332,
12054,
23773,
2121,
1012,
2003,
18697,
3372,
7292,
1006,
1007,
1007,
1004,
1004,
1006,
5783,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java | Excel03SaxReader.getSheetName | public String getSheetName() {
if (this.boundSheetRecords.size() > this.sheetIndex) {
return this.boundSheetRecords.get(this.sheetIndex > -1 ? this.sheetIndex : this.curSheetIndex).getSheetname();
}
return null;
} | java | public String getSheetName() {
if (this.boundSheetRecords.size() > this.sheetIndex) {
return this.boundSheetRecords.get(this.sheetIndex > -1 ? this.sheetIndex : this.curSheetIndex).getSheetname();
}
return null;
} | [
"public",
"String",
"getSheetName",
"(",
")",
"{",
"if",
"(",
"this",
".",
"boundSheetRecords",
".",
"size",
"(",
")",
">",
"this",
".",
"sheetIndex",
")",
"{",
"return",
"this",
".",
"boundSheetRecords",
".",
"get",
"(",
"this",
".",
"sheetIndex",
">",
... | 获得Sheet名,如果处理所有sheet,获得后一个Sheet名,从0开始
@return Sheet名 | [
"获得Sheet名,如果处理所有sheet,获得后一个Sheet名,从0开始"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java#L144-L149 | train | Returns the name of the sheet in the file. | [
30522,
2270,
5164,
4152,
21030,
2102,
18442,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19202,
21030,
7913,
27108,
5104,
1012,
2946,
1006,
1007,
1028,
2023,
1012,
7123,
22254,
10288,
1007,
1063,
2709,
2023,
1012,
19202,
21030,
7913,
27108,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/StrBuilder.java | StrBuilder.insert | public StrBuilder insert(int index, Object obj) {
if (obj instanceof CharSequence) {
return insert(index, (CharSequence) obj);
}
return insert(index, Convert.toStr(obj));
} | java | public StrBuilder insert(int index, Object obj) {
if (obj instanceof CharSequence) {
return insert(index, (CharSequence) obj);
}
return insert(index, Convert.toStr(obj));
} | [
"public",
"StrBuilder",
"insert",
"(",
"int",
"index",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"CharSequence",
")",
"{",
"return",
"insert",
"(",
"index",
",",
"(",
"CharSequence",
")",
"obj",
")",
";",
"}",
"return",
"insert",
... | 追加对象,对象会被转换为字符串
@param obj 对象
@return this | [
"追加对象,对象会被转换为字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrBuilder.java#L149-L154 | train | Inserts the specified object into this builder. | [
30522,
2270,
2358,
15185,
19231,
4063,
19274,
1006,
20014,
5950,
1010,
4874,
27885,
3501,
1007,
1063,
2065,
1006,
27885,
3501,
6013,
11253,
25869,
3366,
4226,
5897,
1007,
1063,
2709,
19274,
1006,
5950,
1010,
1006,
25869,
3366,
4226,
5897,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanPropertyName.java | BeanPropertyName.toDashedForm | public static String toDashedForm(String name, int start) {
StringBuilder result = new StringBuilder();
String replaced = name.replace('_', '-');
for (int i = start; i < replaced.length(); i++) {
char ch = replaced.charAt(i);
if (Character.isUpperCase(ch) && result.length() > 0
&& result.charAt(result.length() - 1) != '-') {
result.append('-');
}
result.append(Character.toLowerCase(ch));
}
return result.toString();
} | java | public static String toDashedForm(String name, int start) {
StringBuilder result = new StringBuilder();
String replaced = name.replace('_', '-');
for (int i = start; i < replaced.length(); i++) {
char ch = replaced.charAt(i);
if (Character.isUpperCase(ch) && result.length() > 0
&& result.charAt(result.length() - 1) != '-') {
result.append('-');
}
result.append(Character.toLowerCase(ch));
}
return result.toString();
} | [
"public",
"static",
"String",
"toDashedForm",
"(",
"String",
"name",
",",
"int",
"start",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"replaced",
"=",
"name",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
... | Return the specified Java Bean property name in dashed form.
@param name the source name
@param start the starting char
@return the dashed from | [
"Return",
"the",
"specified",
"Java",
"Bean",
"property",
"name",
"in",
"dashed",
"form",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanPropertyName.java#L45-L57 | train | Converts a name in a dashed form. | [
30522,
2270,
10763,
5164,
28681,
11823,
2098,
14192,
1006,
5164,
2171,
1010,
20014,
2707,
1007,
1063,
5164,
8569,
23891,
2099,
2765,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
5164,
2999,
1027,
2171,
1012,
5672,
1006,
1005,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/MaterializedCollectStreamResult.java | MaterializedCollectStreamResult.processRecord | @Override
protected void processRecord(Tuple2<Boolean, Row> change) {
synchronized (resultLock) {
// insert
if (change.f0) {
processInsert(change.f1);
}
// delete
else {
processDelete(change.f1);
}
}
} | java | @Override
protected void processRecord(Tuple2<Boolean, Row> change) {
synchronized (resultLock) {
// insert
if (change.f0) {
processInsert(change.f1);
}
// delete
else {
processDelete(change.f1);
}
}
} | [
"@",
"Override",
"protected",
"void",
"processRecord",
"(",
"Tuple2",
"<",
"Boolean",
",",
"Row",
">",
"change",
")",
"{",
"synchronized",
"(",
"resultLock",
")",
"{",
"// insert",
"if",
"(",
"change",
".",
"f0",
")",
"{",
"processInsert",
"(",
"change",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/MaterializedCollectStreamResult.java#L183-L195 | train | Process a record change. | [
30522,
1030,
2058,
15637,
5123,
11675,
2832,
2890,
27108,
2094,
1006,
10722,
10814,
2475,
1026,
22017,
20898,
1010,
5216,
1028,
2689,
1007,
1063,
25549,
1006,
2765,
7878,
1007,
1063,
1013,
1013,
19274,
2065,
1006,
2689,
1012,
1042,
2692,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/AbstractBinaryExternalMerger.java | AbstractBinaryExternalMerger.mergeChannels | private ChannelWithMeta mergeChannels(List<ChannelWithMeta> channelIDs) throws IOException {
// the list with the target iterators
List<FileIOChannel> openChannels = new ArrayList<>(channelIDs.size());
final BinaryMergeIterator<Entry> mergeIterator =
getMergingIterator(channelIDs, openChannels);
// create a new channel writer
final FileIOChannel.ID mergedChannelID = ioManager.createChannel();
channelManager.addChannel(mergedChannelID);
AbstractChannelWriterOutputView output = null;
int numBytesInLastBlock;
int numBlocksWritten;
try {
output = FileChannelUtil.createOutputView(
ioManager, mergedChannelID, compressionEnable,
compressionCodecFactory, compressionBlockSize, pageSize);
writeMergingOutput(mergeIterator, output);
numBytesInLastBlock = output.close();
numBlocksWritten = output.getBlockCount();
} catch (IOException e) {
if (output != null) {
output.close();
output.getChannel().deleteChannel();
}
throw e;
}
// remove, close and delete channels
for (FileIOChannel channel : openChannels) {
channelManager.removeChannel(channel.getChannelID());
try {
channel.closeAndDelete();
} catch (Throwable ignored) {
}
}
return new ChannelWithMeta(mergedChannelID, numBlocksWritten, numBytesInLastBlock);
} | java | private ChannelWithMeta mergeChannels(List<ChannelWithMeta> channelIDs) throws IOException {
// the list with the target iterators
List<FileIOChannel> openChannels = new ArrayList<>(channelIDs.size());
final BinaryMergeIterator<Entry> mergeIterator =
getMergingIterator(channelIDs, openChannels);
// create a new channel writer
final FileIOChannel.ID mergedChannelID = ioManager.createChannel();
channelManager.addChannel(mergedChannelID);
AbstractChannelWriterOutputView output = null;
int numBytesInLastBlock;
int numBlocksWritten;
try {
output = FileChannelUtil.createOutputView(
ioManager, mergedChannelID, compressionEnable,
compressionCodecFactory, compressionBlockSize, pageSize);
writeMergingOutput(mergeIterator, output);
numBytesInLastBlock = output.close();
numBlocksWritten = output.getBlockCount();
} catch (IOException e) {
if (output != null) {
output.close();
output.getChannel().deleteChannel();
}
throw e;
}
// remove, close and delete channels
for (FileIOChannel channel : openChannels) {
channelManager.removeChannel(channel.getChannelID());
try {
channel.closeAndDelete();
} catch (Throwable ignored) {
}
}
return new ChannelWithMeta(mergedChannelID, numBlocksWritten, numBytesInLastBlock);
} | [
"private",
"ChannelWithMeta",
"mergeChannels",
"(",
"List",
"<",
"ChannelWithMeta",
">",
"channelIDs",
")",
"throws",
"IOException",
"{",
"// the list with the target iterators",
"List",
"<",
"FileIOChannel",
">",
"openChannels",
"=",
"new",
"ArrayList",
"<>",
"(",
"c... | Merges the sorted runs described by the given Channel IDs into a single sorted run.
@param channelIDs The IDs of the runs' channels.
@return The ID and number of blocks of the channel that describes the merged run. | [
"Merges",
"the",
"sorted",
"runs",
"described",
"by",
"the",
"given",
"Channel",
"IDs",
"into",
"a",
"single",
"sorted",
"run",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/AbstractBinaryExternalMerger.java#L160-L198 | train | Merge the given list of channels. | [
30522,
2797,
3149,
24415,
11368,
2050,
13590,
26058,
2015,
1006,
2862,
1026,
3149,
24415,
11368,
2050,
1028,
3149,
9821,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
1996,
2862,
2007,
1996,
4539,
2009,
6906,
6591,
2862,
1026,
5371,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.queryString | public String queryString(String sql, Object... params) throws SQLException {
return query(sql, new StringHandler(), params);
} | java | public String queryString(String sql, Object... params) throws SQLException {
return query(sql, new StringHandler(), params);
} | [
"public",
"String",
"queryString",
"(",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"query",
"(",
"sql",
",",
"new",
"StringHandler",
"(",
")",
",",
"params",
")",
";",
"}"
] | 查询单条单个字段记录,并将其转换为String
@param sql 查询语句
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常 | [
"查询单条单个字段记录",
"并将其转换为String"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L130-L132 | train | Returns a String representation of the given SQL statement. | [
30522,
2270,
5164,
23032,
3367,
4892,
1006,
5164,
29296,
1010,
4874,
1012,
1012,
1012,
11498,
5244,
1007,
11618,
29296,
10288,
24422,
1063,
2709,
23032,
1006,
29296,
1010,
2047,
5164,
11774,
3917,
1006,
1007,
1010,
11498,
5244,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple3.java | Tuple3.of | public static <T0, T1, T2> Tuple3<T0, T1, T2> of(T0 value0, T1 value1, T2 value2) {
return new Tuple3<>(value0,
value1,
value2);
} | java | public static <T0, T1, T2> Tuple3<T0, T1, T2> of(T0 value0, T1 value1, T2 value2) {
return new Tuple3<>(value0,
value1,
value2);
} | [
"public",
"static",
"<",
"T0",
",",
"T1",
",",
"T2",
">",
"Tuple3",
"<",
"T0",
",",
"T1",
",",
"T2",
">",
"of",
"(",
"T0",
"value0",
",",
"T1",
"value1",
",",
"T2",
"value2",
")",
"{",
"return",
"new",
"Tuple3",
"<>",
"(",
"value0",
",",
"value... | Creates a new tuple and assigns the given values to the tuple's fields.
This is more convenient than using the constructor, because the compiler can
infer the generic type arguments implicitly. For example:
{@code Tuple3.of(n, x, s)}
instead of
{@code new Tuple3<Integer, Double, String>(n, x, s)} | [
"Creates",
"a",
"new",
"tuple",
"and",
"assigns",
"the",
"given",
"values",
"to",
"the",
"tuple",
"s",
"fields",
".",
"This",
"is",
"more",
"convenient",
"than",
"using",
"the",
"constructor",
"because",
"the",
"compiler",
"can",
"infer",
"the",
"generic",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple3.java#L200-L204 | train | Construct a tuple of degree 3. | [
30522,
2270,
10763,
1026,
1056,
2692,
1010,
1056,
2487,
1010,
1056,
2475,
1028,
10722,
10814,
2509,
1026,
1056,
2692,
1010,
1056,
2487,
1010,
1056,
2475,
1028,
1997,
1006,
1056,
2692,
3643,
2692,
1010,
1056,
2487,
3643,
2487,
1010,
1056,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | server/src/main/java/com/networknt/server/Server.java | Server.mergeStatusConfig | protected static void mergeStatusConfig() {
Map<String, Object> appStatusConfig = Config.getInstance().getJsonMapConfigNoCache(STATUS_CONFIG_NAME[1]);
if (appStatusConfig == null) {
return;
}
Map<String, Object> statusConfig = Config.getInstance().getJsonMapConfig(STATUS_CONFIG_NAME[0]);
// clone the default status config key set
Set<String> duplicatedStatusSet = new HashSet<>(statusConfig.keySet());
duplicatedStatusSet.retainAll(appStatusConfig.keySet());
if (!duplicatedStatusSet.isEmpty()) {
logger.error("The status code(s): " + duplicatedStatusSet.toString() + " is already in use by light-4j and cannot be overwritten," +
" please change to another status code in app-status.yml if necessary.");
throw new RuntimeException("The status code(s): " + duplicatedStatusSet.toString() + " in status.yml and app-status.yml are duplicated.");
}
statusConfig.putAll(appStatusConfig);
} | java | protected static void mergeStatusConfig() {
Map<String, Object> appStatusConfig = Config.getInstance().getJsonMapConfigNoCache(STATUS_CONFIG_NAME[1]);
if (appStatusConfig == null) {
return;
}
Map<String, Object> statusConfig = Config.getInstance().getJsonMapConfig(STATUS_CONFIG_NAME[0]);
// clone the default status config key set
Set<String> duplicatedStatusSet = new HashSet<>(statusConfig.keySet());
duplicatedStatusSet.retainAll(appStatusConfig.keySet());
if (!duplicatedStatusSet.isEmpty()) {
logger.error("The status code(s): " + duplicatedStatusSet.toString() + " is already in use by light-4j and cannot be overwritten," +
" please change to another status code in app-status.yml if necessary.");
throw new RuntimeException("The status code(s): " + duplicatedStatusSet.toString() + " in status.yml and app-status.yml are duplicated.");
}
statusConfig.putAll(appStatusConfig);
} | [
"protected",
"static",
"void",
"mergeStatusConfig",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"appStatusConfig",
"=",
"Config",
".",
"getInstance",
"(",
")",
".",
"getJsonMapConfigNoCache",
"(",
"STATUS_CONFIG_NAME",
"[",
"1",
"]",
")",
";",
"... | method used to merge status.yml and app-status.yml | [
"method",
"used",
"to",
"merge",
"status",
".",
"yml",
"and",
"app",
"-",
"status",
".",
"yml"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/server/src/main/java/com/networknt/server/Server.java#L444-L459 | train | Merge the status config from the default status config into the status config. | [
30522,
5123,
10763,
11675,
13590,
9153,
5809,
8663,
8873,
2290,
1006,
1007,
1063,
4949,
1026,
5164,
1010,
4874,
1028,
18726,
29336,
2271,
8663,
8873,
2290,
1027,
9530,
8873,
2290,
1012,
2131,
7076,
26897,
1006,
1007,
1012,
2131,
22578,
2239... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java | ContinuousDistributions.Gser | protected static double Gser(double x, double A)
{
// Good for X<A+1.
double T9 = 1 / A;
double G = T9;
double I = 1;
while (T9 > G * 0.00001)
{
T9 = T9 * x / (A + I);
G = G + T9;
++I;
}
G = G * Math.exp(A * Math.log(x) - x - LogGamma(A));
return G;
} | java | protected static double Gser(double x, double A)
{
// Good for X<A+1.
double T9 = 1 / A;
double G = T9;
double I = 1;
while (T9 > G * 0.00001)
{
T9 = T9 * x / (A + I);
G = G + T9;
++I;
}
G = G * Math.exp(A * Math.log(x) - x - LogGamma(A));
return G;
} | [
"protected",
"static",
"double",
"Gser",
"(",
"double",
"x",
",",
"double",
"A",
")",
"{",
"// Good for X<A+1.",
"double",
"T9",
"=",
"1",
"/",
"A",
";",
"double",
"G",
"=",
"T9",
";",
"double",
"I",
"=",
"1",
";",
"while",
"(",
"T9",
">",
"G",
"... | Internal function used by GammaCdf
@param x
@param A
@return | [
"Internal",
"function",
"used",
"by",
"GammaCdf"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/classification/statistics/ContinuousDistributions.java#L159-L174 | train | Gser function. | [
30522,
5123,
10763,
3313,
28177,
2121,
1006,
3313,
1060,
1010,
3313,
1037,
1007,
1063,
1013,
1013,
2204,
2005,
1060,
1026,
1037,
1009,
1015,
1012,
3313,
1056,
2683,
1027,
1015,
1013,
1037,
1025,
3313,
1043,
1027,
1056,
2683,
1025,
3313,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java | CorsConfigBuilder.preflightResponseHeader | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Iterable<T> value) {
preflightHeaders.put(name, new ConstantValueGenerator(value));
return this;
} | java | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Iterable<T> value) {
preflightHeaders.put(name, new ConstantValueGenerator(value));
return this;
} | [
"public",
"<",
"T",
">",
"CorsConfigBuilder",
"preflightResponseHeader",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"Iterable",
"<",
"T",
">",
"value",
")",
"{",
"preflightHeaders",
".",
"put",
"(",
"name",
",",
"new",
"ConstantValueGenerator",
"(",
"... | Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
@param name the name of the HTTP header.
@param value the values for the HTTP header.
@param <T> the type of values that the Iterable contains.
@return {@link CorsConfigBuilder} to support method chaining. | [
"Returns",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L303-L306 | train | Add a preflight response header. | [
30522,
2270,
1026,
1056,
1028,
2522,
2869,
8663,
8873,
18259,
19231,
4063,
3653,
28968,
6072,
26029,
3366,
4974,
2121,
1006,
2345,
25869,
3366,
4226,
5897,
2171,
1010,
2345,
2009,
6906,
3468,
1026,
1056,
1028,
3643,
1007,
1063,
3653,
28968,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java | Bzip2HuffmanStageEncoder.writeBlockData | private void writeBlockData(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final byte[] selectors = this.selectors;
final char[] mtf = mtfBlock;
final int mtfLength = this.mtfLength;
int selectorIndex = 0;
for (int mtfIndex = 0; mtfIndex < mtfLength;) {
final int groupEnd = Math.min(mtfIndex + HUFFMAN_GROUP_RUN_LENGTH, mtfLength) - 1;
final int[] tableMergedCodeSymbols = huffmanMergedCodeSymbols[selectors[selectorIndex++]];
while (mtfIndex <= groupEnd) {
final int mergedCodeSymbol = tableMergedCodeSymbols[mtf[mtfIndex++]];
writer.writeBits(out, mergedCodeSymbol >>> 24, mergedCodeSymbol);
}
}
} | java | private void writeBlockData(ByteBuf out) {
final Bzip2BitWriter writer = this.writer;
final int[][] huffmanMergedCodeSymbols = this.huffmanMergedCodeSymbols;
final byte[] selectors = this.selectors;
final char[] mtf = mtfBlock;
final int mtfLength = this.mtfLength;
int selectorIndex = 0;
for (int mtfIndex = 0; mtfIndex < mtfLength;) {
final int groupEnd = Math.min(mtfIndex + HUFFMAN_GROUP_RUN_LENGTH, mtfLength) - 1;
final int[] tableMergedCodeSymbols = huffmanMergedCodeSymbols[selectors[selectorIndex++]];
while (mtfIndex <= groupEnd) {
final int mergedCodeSymbol = tableMergedCodeSymbols[mtf[mtfIndex++]];
writer.writeBits(out, mergedCodeSymbol >>> 24, mergedCodeSymbol);
}
}
} | [
"private",
"void",
"writeBlockData",
"(",
"ByteBuf",
"out",
")",
"{",
"final",
"Bzip2BitWriter",
"writer",
"=",
"this",
".",
"writer",
";",
"final",
"int",
"[",
"]",
"[",
"]",
"huffmanMergedCodeSymbols",
"=",
"this",
".",
"huffmanMergedCodeSymbols",
";",
"fina... | Writes out the encoded block data. | [
"Writes",
"out",
"the",
"encoded",
"block",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L340-L357 | train | Write the block data. | [
30522,
2797,
11675,
4339,
23467,
2850,
2696,
1006,
24880,
8569,
2546,
2041,
1007,
1063,
2345,
1038,
5831,
2361,
2475,
16313,
15994,
3213,
1027,
2023,
1012,
3213,
1025,
2345,
20014,
1031,
1033,
1031,
1033,
21301,
2386,
5017,
5999,
23237,
243... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java | AkkaInvocationHandler.isRpcTimeout | private static boolean isRpcTimeout(Annotation[] annotations) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().equals(RpcTimeout.class)) {
return true;
}
}
return false;
} | java | private static boolean isRpcTimeout(Annotation[] annotations) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().equals(RpcTimeout.class)) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"isRpcTimeout",
"(",
"Annotation",
"[",
"]",
"annotations",
")",
"{",
"for",
"(",
"Annotation",
"annotation",
":",
"annotations",
")",
"{",
"if",
"(",
"annotation",
".",
"annotationType",
"(",
")",
".",
"equals",
"(",
"RpcTime... | Checks whether any of the annotations is of type {@link RpcTimeout}.
@param annotations Array of annotations
@return True if {@link RpcTimeout} was found; otherwise false | [
"Checks",
"whether",
"any",
"of",
"the",
"annotations",
"is",
"of",
"type",
"{",
"@link",
"RpcTimeout",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L324-L332 | train | Checks if the annotations array contains an RpcTimeout annotation. | [
30522,
2797,
10763,
22017,
20898,
2003,
14536,
6593,
14428,
5833,
1006,
5754,
17287,
3508,
1031,
1033,
5754,
17287,
9285,
1007,
1063,
2005,
1006,
5754,
17287,
3508,
5754,
17287,
3508,
1024,
5754,
17287,
9285,
1007,
1063,
2065,
1006,
5754,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.timestampCeil | public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) {
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
long utcTs = ts + offset;
switch (range) {
case HOUR:
return ceil(utcTs, MILLIS_PER_HOUR) - offset;
case DAY:
return ceil(utcTs, MILLIS_PER_DAY) - offset;
case MONTH:
case YEAR:
case QUARTER:
int days = (int) (utcTs / MILLIS_PER_DAY + EPOCH_JULIAN);
return julianDateFloor(range, days, false) * MILLIS_PER_DAY - offset;
default:
// for MINUTE and SECONDS etc...,
// it is more effective to use arithmetic Method
throw new AssertionError(range);
}
} | java | public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) {
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
long utcTs = ts + offset;
switch (range) {
case HOUR:
return ceil(utcTs, MILLIS_PER_HOUR) - offset;
case DAY:
return ceil(utcTs, MILLIS_PER_DAY) - offset;
case MONTH:
case YEAR:
case QUARTER:
int days = (int) (utcTs / MILLIS_PER_DAY + EPOCH_JULIAN);
return julianDateFloor(range, days, false) * MILLIS_PER_DAY - offset;
default:
// for MINUTE and SECONDS etc...,
// it is more effective to use arithmetic Method
throw new AssertionError(range);
}
} | [
"public",
"static",
"long",
"timestampCeil",
"(",
"TimeUnitRange",
"range",
",",
"long",
"ts",
",",
"TimeZone",
"tz",
")",
"{",
"// assume that we are at UTC timezone, just for algorithm performance",
"long",
"offset",
"=",
"tz",
".",
"getOffset",
"(",
"ts",
")",
";... | Keep the algorithm consistent with Calcite DateTimeUtils.julianDateFloor, but here
we take time zone into account. | [
"Keep",
"the",
"algorithm",
"consistent",
"with",
"Calcite",
"DateTimeUtils",
".",
"julianDateFloor",
"but",
"here",
"we",
"take",
"time",
"zone",
"into",
"account",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L627-L647 | train | Returns the ceil value of the timestamp in the given time unit range. | [
30522,
2270,
10763,
2146,
2335,
15464,
15042,
24359,
1006,
2051,
19496,
6494,
15465,
2846,
1010,
2146,
24529,
1010,
2051,
15975,
1056,
2480,
1007,
1063,
1013,
1013,
7868,
2008,
2057,
2024,
2012,
11396,
2051,
15975,
1010,
2074,
2005,
9896,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java | Json.jsonSchema | public Json jsonSchema(String jsonSchema) {
Preconditions.checkNotNull(jsonSchema);
this.jsonSchema = jsonSchema;
this.schema = null;
this.deriveSchema = null;
return this;
} | java | public Json jsonSchema(String jsonSchema) {
Preconditions.checkNotNull(jsonSchema);
this.jsonSchema = jsonSchema;
this.schema = null;
this.deriveSchema = null;
return this;
} | [
"public",
"Json",
"jsonSchema",
"(",
"String",
"jsonSchema",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"jsonSchema",
")",
";",
"this",
".",
"jsonSchema",
"=",
"jsonSchema",
";",
"this",
".",
"schema",
"=",
"null",
";",
"this",
".",
"deriveSchema",... | Sets the JSON schema string with field names and the types according to the JSON schema
specification [[http://json-schema.org/specification.html]].
<p>The schema might be nested.
@param jsonSchema JSON schema | [
"Sets",
"the",
"JSON",
"schema",
"string",
"with",
"field",
"names",
"and",
"the",
"types",
"according",
"to",
"the",
"JSON",
"schema",
"specification",
"[[",
"http",
":",
"//",
"json",
"-",
"schema",
".",
"org",
"/",
"specification",
".",
"html",
"]]",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java#L70-L76 | train | Sets the JSON schema. | [
30522,
2270,
1046,
3385,
1046,
23345,
5403,
2863,
1006,
5164,
1046,
23345,
5403,
2863,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
1046,
23345,
5403,
2863,
1007,
1025,
2023,
1012,
1046,
23345,
5403,
2863,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java | JarWriter.writeEntry | private void writeEntry(JarArchiveEntry entry, EntryWriter entryWriter,
UnpackHandler unpackHandler) throws IOException {
String parent = entry.getName();
if (parent.endsWith("/")) {
parent = parent.substring(0, parent.length() - 1);
entry.setUnixMode(UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM);
}
else {
entry.setUnixMode(UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM);
}
if (parent.lastIndexOf('/') != -1) {
parent = parent.substring(0, parent.lastIndexOf('/') + 1);
if (!parent.isEmpty()) {
writeEntry(new JarArchiveEntry(parent), null, unpackHandler);
}
}
if (this.writtenEntries.add(entry.getName())) {
entryWriter = addUnpackCommentIfNecessary(entry, entryWriter, unpackHandler);
this.jarOutput.putArchiveEntry(entry);
if (entryWriter != null) {
entryWriter.write(this.jarOutput);
}
this.jarOutput.closeArchiveEntry();
}
} | java | private void writeEntry(JarArchiveEntry entry, EntryWriter entryWriter,
UnpackHandler unpackHandler) throws IOException {
String parent = entry.getName();
if (parent.endsWith("/")) {
parent = parent.substring(0, parent.length() - 1);
entry.setUnixMode(UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM);
}
else {
entry.setUnixMode(UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM);
}
if (parent.lastIndexOf('/') != -1) {
parent = parent.substring(0, parent.lastIndexOf('/') + 1);
if (!parent.isEmpty()) {
writeEntry(new JarArchiveEntry(parent), null, unpackHandler);
}
}
if (this.writtenEntries.add(entry.getName())) {
entryWriter = addUnpackCommentIfNecessary(entry, entryWriter, unpackHandler);
this.jarOutput.putArchiveEntry(entry);
if (entryWriter != null) {
entryWriter.write(this.jarOutput);
}
this.jarOutput.closeArchiveEntry();
}
} | [
"private",
"void",
"writeEntry",
"(",
"JarArchiveEntry",
"entry",
",",
"EntryWriter",
"entryWriter",
",",
"UnpackHandler",
"unpackHandler",
")",
"throws",
"IOException",
"{",
"String",
"parent",
"=",
"entry",
".",
"getName",
"(",
")",
";",
"if",
"(",
"parent",
... | Perform the actual write of a {@link JarEntry}. All other write methods delegate to
this one.
@param entry the entry to write
@param entryWriter the entry writer or {@code null} if there is no content
@param unpackHandler handles possible unpacking for the entry
@throws IOException in case of I/O errors | [
"Perform",
"the",
"actual",
"write",
"of",
"a",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java#L259-L284 | train | Write a single entry to the output. | [
30522,
2797,
11675,
4339,
4765,
2854,
1006,
15723,
2906,
5428,
3726,
4765,
2854,
4443,
1010,
4443,
15994,
4443,
15994,
1010,
4895,
23947,
11774,
3917,
4895,
23947,
11774,
3917,
1007,
11618,
22834,
10288,
24422,
1063,
5164,
6687,
1027,
4443,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java | ClipboardUtil.listen | public static void listen(int tryCount, long delay, ClipboardListener listener, boolean sync) {
ClipboardMonitor.INSTANCE//
.setTryCount(tryCount)//
.setDelay(delay)//
.addListener(listener)//
.listen(sync);
} | java | public static void listen(int tryCount, long delay, ClipboardListener listener, boolean sync) {
ClipboardMonitor.INSTANCE//
.setTryCount(tryCount)//
.setDelay(delay)//
.addListener(listener)//
.listen(sync);
} | [
"public",
"static",
"void",
"listen",
"(",
"int",
"tryCount",
",",
"long",
"delay",
",",
"ClipboardListener",
"listener",
",",
"boolean",
"sync",
")",
"{",
"ClipboardMonitor",
".",
"INSTANCE",
"//\r",
".",
"setTryCount",
"(",
"tryCount",
")",
"//\r",
".",
"s... | 监听剪贴板修改事件
@param tryCount 尝试获取剪贴板内容的次数
@param delay 响应延迟,当从第二次开始,延迟一定毫秒数等待剪贴板可以获取
@param listener 监听处理接口
@param sync 是否同步阻塞
@since 4.5.6
@see ClipboardMonitor#listen(boolean) | [
"监听剪贴板修改事件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java#L170-L176 | train | Creates a listener for events on the clipboard monitor. | [
30522,
2270,
10763,
11675,
4952,
1006,
20014,
3046,
3597,
16671,
1010,
2146,
8536,
1010,
12528,
6277,
9863,
24454,
19373,
1010,
22017,
20898,
26351,
1007,
1063,
12528,
6277,
8202,
15660,
1012,
6013,
1013,
1013,
1012,
2275,
11129,
3597,
16671,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/Plan.java | Plan.registerCachedFile | public void registerCachedFile(String name, DistributedCacheEntry entry) throws IOException {
if (!this.cacheFile.containsKey(name)) {
this.cacheFile.put(name, entry);
} else {
throw new IOException("cache file " + name + "already exists!");
}
} | java | public void registerCachedFile(String name, DistributedCacheEntry entry) throws IOException {
if (!this.cacheFile.containsKey(name)) {
this.cacheFile.put(name, entry);
} else {
throw new IOException("cache file " + name + "already exists!");
}
} | [
"public",
"void",
"registerCachedFile",
"(",
"String",
"name",
",",
"DistributedCacheEntry",
"entry",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"this",
".",
"cacheFile",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"this",
".",
"cacheFile",
".",
... | register cache files in program level
@param entry contains all relevant information
@param name user defined name of that file
@throws java.io.IOException | [
"register",
"cache",
"files",
"in",
"program",
"level"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/Plan.java#L339-L345 | train | Registers a new cache entry. | [
30522,
2270,
11675,
4236,
3540,
7690,
8873,
2571,
1006,
5164,
2171,
1010,
5500,
3540,
25923,
3372,
2854,
4443,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
999,
2023,
1012,
17053,
8873,
2571,
1012,
3397,
14839,
1006,
2171,
1007,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/base/CoGroupRawOperatorBase.java | CoGroupRawOperatorBase.executeOnCollections | @Override
protected List<OUT> executeOnCollections(List<IN1> input1, List<IN2> input2, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
// --------------------------------------------------------------------
// Setup
// --------------------------------------------------------------------
TypeInformation<IN1> inputType1 = getOperatorInfo().getFirstInputType();
TypeInformation<IN2> inputType2 = getOperatorInfo().getSecondInputType();
int[] inputKeys1 = getKeyColumns(0);
int[] inputKeys2 = getKeyColumns(1);
boolean[] inputSortDirections1 = new boolean[inputKeys1.length];
boolean[] inputSortDirections2 = new boolean[inputKeys2.length];
Arrays.fill(inputSortDirections1, true);
Arrays.fill(inputSortDirections2, true);
final TypeSerializer<IN1> inputSerializer1 = inputType1.createSerializer(executionConfig);
final TypeSerializer<IN2> inputSerializer2 = inputType2.createSerializer(executionConfig);
final TypeComparator<IN1> inputComparator1 = getTypeComparator(executionConfig, inputType1, inputKeys1, inputSortDirections1);
final TypeComparator<IN2> inputComparator2 = getTypeComparator(executionConfig, inputType2, inputKeys2, inputSortDirections2);
SimpleListIterable<IN1> iterator1 = new SimpleListIterable<IN1>(input1, inputComparator1, inputSerializer1);
SimpleListIterable<IN2> iterator2 = new SimpleListIterable<IN2>(input2, inputComparator2, inputSerializer2);
// --------------------------------------------------------------------
// Run UDF
// --------------------------------------------------------------------
CoGroupFunction<IN1, IN2, OUT> function = userFunction.getUserCodeObject();
FunctionUtils.setFunctionRuntimeContext(function, ctx);
FunctionUtils.openFunction(function, parameters);
List<OUT> result = new ArrayList<OUT>();
Collector<OUT> resultCollector = new CopyingListCollector<OUT>(result, getOperatorInfo().getOutputType().createSerializer(executionConfig));
function.coGroup(iterator1, iterator2, resultCollector);
FunctionUtils.closeFunction(function);
return result;
} | java | @Override
protected List<OUT> executeOnCollections(List<IN1> input1, List<IN2> input2, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
// --------------------------------------------------------------------
// Setup
// --------------------------------------------------------------------
TypeInformation<IN1> inputType1 = getOperatorInfo().getFirstInputType();
TypeInformation<IN2> inputType2 = getOperatorInfo().getSecondInputType();
int[] inputKeys1 = getKeyColumns(0);
int[] inputKeys2 = getKeyColumns(1);
boolean[] inputSortDirections1 = new boolean[inputKeys1.length];
boolean[] inputSortDirections2 = new boolean[inputKeys2.length];
Arrays.fill(inputSortDirections1, true);
Arrays.fill(inputSortDirections2, true);
final TypeSerializer<IN1> inputSerializer1 = inputType1.createSerializer(executionConfig);
final TypeSerializer<IN2> inputSerializer2 = inputType2.createSerializer(executionConfig);
final TypeComparator<IN1> inputComparator1 = getTypeComparator(executionConfig, inputType1, inputKeys1, inputSortDirections1);
final TypeComparator<IN2> inputComparator2 = getTypeComparator(executionConfig, inputType2, inputKeys2, inputSortDirections2);
SimpleListIterable<IN1> iterator1 = new SimpleListIterable<IN1>(input1, inputComparator1, inputSerializer1);
SimpleListIterable<IN2> iterator2 = new SimpleListIterable<IN2>(input2, inputComparator2, inputSerializer2);
// --------------------------------------------------------------------
// Run UDF
// --------------------------------------------------------------------
CoGroupFunction<IN1, IN2, OUT> function = userFunction.getUserCodeObject();
FunctionUtils.setFunctionRuntimeContext(function, ctx);
FunctionUtils.openFunction(function, parameters);
List<OUT> result = new ArrayList<OUT>();
Collector<OUT> resultCollector = new CopyingListCollector<OUT>(result, getOperatorInfo().getOutputType().createSerializer(executionConfig));
function.coGroup(iterator1, iterator2, resultCollector);
FunctionUtils.closeFunction(function);
return result;
} | [
"@",
"Override",
"protected",
"List",
"<",
"OUT",
">",
"executeOnCollections",
"(",
"List",
"<",
"IN1",
">",
"input1",
",",
"List",
"<",
"IN2",
">",
"input2",
",",
"RuntimeContext",
"ctx",
",",
"ExecutionConfig",
"executionConfig",
")",
"throws",
"Exception",
... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/base/CoGroupRawOperatorBase.java#L172-L214 | train | Execute on collections. | [
30522,
1030,
2058,
15637,
5123,
2862,
1026,
2041,
1028,
15389,
2239,
26895,
18491,
2015,
1006,
2862,
1026,
1999,
2487,
1028,
7953,
2487,
1010,
2862,
1026,
1999,
2475,
1028,
7953,
2475,
1010,
2448,
7292,
8663,
18209,
14931,
2595,
1010,
7781,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java | VectorizedRleValuesReader.readIntegers | @Override
public void readIntegers(int total, WritableColumnVector c, int rowId) {
int left = total;
while (left > 0) {
if (this.currentCount == 0) this.readNextGroup();
int n = Math.min(left, this.currentCount);
switch (mode) {
case RLE:
c.putInts(rowId, n, currentValue);
break;
case PACKED:
c.putInts(rowId, n, currentBuffer, currentBufferIdx);
currentBufferIdx += n;
break;
}
rowId += n;
left -= n;
currentCount -= n;
}
} | java | @Override
public void readIntegers(int total, WritableColumnVector c, int rowId) {
int left = total;
while (left > 0) {
if (this.currentCount == 0) this.readNextGroup();
int n = Math.min(left, this.currentCount);
switch (mode) {
case RLE:
c.putInts(rowId, n, currentValue);
break;
case PACKED:
c.putInts(rowId, n, currentBuffer, currentBufferIdx);
currentBufferIdx += n;
break;
}
rowId += n;
left -= n;
currentCount -= n;
}
} | [
"@",
"Override",
"public",
"void",
"readIntegers",
"(",
"int",
"total",
",",
"WritableColumnVector",
"c",
",",
"int",
"rowId",
")",
"{",
"int",
"left",
"=",
"total",
";",
"while",
"(",
"left",
">",
"0",
")",
"{",
"if",
"(",
"this",
".",
"currentCount",... | Since this is only used to decode dictionary IDs, only decoding integers is supported. | [
"Since",
"this",
"is",
"only",
"used",
"to",
"decode",
"dictionary",
"IDs",
"only",
"decoding",
"integers",
"is",
"supported",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java#L490-L509 | train | read integers. | [
30522,
1030,
2058,
15637,
2270,
11675,
3191,
18447,
26320,
2015,
1006,
20014,
2561,
1010,
25697,
3085,
25778,
2819,
2078,
3726,
16761,
1039,
1010,
20014,
5216,
3593,
1007,
1063,
20014,
2187,
1027,
2561,
1025,
2096,
1006,
2187,
1028,
1014,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java | LogicSchemas.init | public void init(final Collection<String> localSchemaNames, final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources,
final Map<String, RuleConfiguration> schemaRules, final boolean isUsingRegistry) {
databaseType = JDBCDriverURLRecognizerEngine.getDatabaseType(schemaDataSources.values().iterator().next().values().iterator().next().getUrl());
initSchemas(localSchemaNames, schemaDataSources, schemaRules, isUsingRegistry);
} | java | public void init(final Collection<String> localSchemaNames, final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources,
final Map<String, RuleConfiguration> schemaRules, final boolean isUsingRegistry) {
databaseType = JDBCDriverURLRecognizerEngine.getDatabaseType(schemaDataSources.values().iterator().next().values().iterator().next().getUrl());
initSchemas(localSchemaNames, schemaDataSources, schemaRules, isUsingRegistry);
} | [
"public",
"void",
"init",
"(",
"final",
"Collection",
"<",
"String",
">",
"localSchemaNames",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"YamlDataSourceParameter",
">",
">",
"schemaDataSources",
",",
"final",
"Map",
"<",
"String",
",... | Initialize proxy context.
@param localSchemaNames local schema names
@param schemaDataSources data source map
@param schemaRules schema rule map
@param isUsingRegistry is using registry or not | [
"Initialize",
"proxy",
"context",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java#L90-L94 | train | Initialize the schema manager. | [
30522,
2270,
11675,
1999,
4183,
1006,
2345,
3074,
1026,
5164,
1028,
10575,
5403,
24805,
7834,
1010,
2345,
4949,
1026,
5164,
1010,
4949,
1026,
5164,
1010,
8038,
19968,
2850,
10230,
8162,
3401,
28689,
22828,
1028,
1028,
8040,
28433,
2850,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java | Http2CodecUtil.headerListSizeExceeded | public static void headerListSizeExceeded(int streamId, long maxHeaderListSize,
boolean onDecode) throws Http2Exception {
throw headerListSizeError(streamId, PROTOCOL_ERROR, onDecode, "Header size exceeded max " +
"allowed size (%d)", maxHeaderListSize);
} | java | public static void headerListSizeExceeded(int streamId, long maxHeaderListSize,
boolean onDecode) throws Http2Exception {
throw headerListSizeError(streamId, PROTOCOL_ERROR, onDecode, "Header size exceeded max " +
"allowed size (%d)", maxHeaderListSize);
} | [
"public",
"static",
"void",
"headerListSizeExceeded",
"(",
"int",
"streamId",
",",
"long",
"maxHeaderListSize",
",",
"boolean",
"onDecode",
")",
"throws",
"Http2Exception",
"{",
"throw",
"headerListSizeError",
"(",
"streamId",
",",
"PROTOCOL_ERROR",
",",
"onDecode",
... | Results in a RST_STREAM being sent for {@code streamId} due to violating
<a href="https://tools.ietf.org/html/rfc7540#section-6.5.2">SETTINGS_MAX_HEADER_LIST_SIZE</a>.
@param streamId The stream ID that was being processed when the exceptional condition occurred.
@param maxHeaderListSize The max allowed size for a list of headers in bytes which was exceeded.
@param onDecode {@code true} if the exception was encountered during decoder. {@code false} for encode.
@throws Http2Exception a stream error. | [
"Results",
"in",
"a",
"RST_STREAM",
"being",
"sent",
"for",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java#L226-L230 | train | Thrown when the header list size exceeded. | [
30522,
2270,
10763,
11675,
20346,
27103,
4697,
10288,
3401,
19082,
1006,
20014,
5460,
3593,
1010,
2146,
4098,
4974,
2121,
27103,
4697,
1010,
22017,
20898,
2006,
3207,
16044,
1007,
11618,
8299,
2475,
10288,
24422,
1063,
5466,
20346,
27103,
469... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java | TemplateAvailabilityProviders.getProvider | public TemplateAvailabilityProvider getProvider(String view, Environment environment,
ClassLoader classLoader, ResourceLoader resourceLoader) {
Assert.notNull(view, "View must not be null");
Assert.notNull(environment, "Environment must not be null");
Assert.notNull(classLoader, "ClassLoader must not be null");
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
Boolean useCache = environment.getProperty("spring.template.provider.cache",
Boolean.class, true);
if (!useCache) {
return findProvider(view, environment, classLoader, resourceLoader);
}
TemplateAvailabilityProvider provider = this.resolved.get(view);
if (provider == null) {
synchronized (this.cache) {
provider = findProvider(view, environment, classLoader, resourceLoader);
provider = (provider != null) ? provider : NONE;
this.resolved.put(view, provider);
this.cache.put(view, provider);
}
}
return (provider != NONE) ? provider : null;
} | java | public TemplateAvailabilityProvider getProvider(String view, Environment environment,
ClassLoader classLoader, ResourceLoader resourceLoader) {
Assert.notNull(view, "View must not be null");
Assert.notNull(environment, "Environment must not be null");
Assert.notNull(classLoader, "ClassLoader must not be null");
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
Boolean useCache = environment.getProperty("spring.template.provider.cache",
Boolean.class, true);
if (!useCache) {
return findProvider(view, environment, classLoader, resourceLoader);
}
TemplateAvailabilityProvider provider = this.resolved.get(view);
if (provider == null) {
synchronized (this.cache) {
provider = findProvider(view, environment, classLoader, resourceLoader);
provider = (provider != null) ? provider : NONE;
this.resolved.put(view, provider);
this.cache.put(view, provider);
}
}
return (provider != NONE) ? provider : null;
} | [
"public",
"TemplateAvailabilityProvider",
"getProvider",
"(",
"String",
"view",
",",
"Environment",
"environment",
",",
"ClassLoader",
"classLoader",
",",
"ResourceLoader",
"resourceLoader",
")",
"{",
"Assert",
".",
"notNull",
"(",
"view",
",",
"\"View must not be null\... | Get the provider that can be used to render the given view.
@param view the view to render
@param environment the environment
@param classLoader the class loader
@param resourceLoader the resource loader
@return a {@link TemplateAvailabilityProvider} or null | [
"Get",
"the",
"provider",
"that",
"can",
"be",
"used",
"to",
"render",
"the",
"given",
"view",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java#L131-L152 | train | Get the provider for the given view. | [
30522,
2270,
23561,
12462,
11733,
8553,
21572,
17258,
2121,
2131,
21572,
17258,
2121,
1006,
5164,
3193,
1010,
4044,
4044,
1010,
2465,
11066,
2121,
2465,
11066,
2121,
1010,
7692,
11066,
2121,
7692,
11066,
2121,
1007,
1063,
20865,
1012,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/StringValue.java | StringValue.grow | private void grow(int size) {
if (this.value.length < size) {
char[] value = new char[ Math.max(this.value.length * 3 / 2, size)];
System.arraycopy(this.value, 0, value, 0, this.len);
this.value = value;
}
} | java | private void grow(int size) {
if (this.value.length < size) {
char[] value = new char[ Math.max(this.value.length * 3 / 2, size)];
System.arraycopy(this.value, 0, value, 0, this.len);
this.value = value;
}
} | [
"private",
"void",
"grow",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"this",
".",
"value",
".",
"length",
"<",
"size",
")",
"{",
"char",
"[",
"]",
"value",
"=",
"new",
"char",
"[",
"Math",
".",
"max",
"(",
"this",
".",
"value",
".",
"length",
"*... | Grow and retain content. | [
"Grow",
"and",
"retain",
"content",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L732-L738 | train | Grows the array to a given size. | [
30522,
2797,
11675,
4982,
1006,
20014,
2946,
1007,
1063,
2065,
1006,
2023,
1012,
3643,
30524,
1027,
2047,
25869,
1031,
8785,
1012,
4098,
1006,
2023,
1012,
3643,
1012,
3091,
1008,
1017,
1013,
1016,
1010,
2946,
1007,
1033,
1025,
2291,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | client/src/main/java/com/networknt/client/oauth/OauthHelper.java | OauthHelper.getTokenResult | public static Result<TokenResponse> getTokenResult(TokenRequest tokenRequest, String envTag) {
final AtomicReference<Result<TokenResponse>> reference = new AtomicReference<>();
final Http2Client client = Http2Client.getInstance();
final CountDownLatch latch = new CountDownLatch(1);
final ClientConnection connection;
try {
if(tokenRequest.getServerUrl() != null) {
connection = client.connect(new URI(tokenRequest.getServerUrl()), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, tokenRequest.enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();
} else if(tokenRequest.getServiceId() != null) {
Cluster cluster = SingletonServiceFactory.getBean(Cluster.class);
String url = cluster.serviceToUrl("https", tokenRequest.getServiceId(), envTag, null);
connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, tokenRequest.enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();
} else {
// both server_url and serviceId are empty in the config.
logger.error("Error: both server_url and serviceId are not configured in client.yml for " + tokenRequest.getClass());
throw new ClientException("both server_url and serviceId are not configured in client.yml for " + tokenRequest.getClass());
}
} catch (Exception e) {
logger.error("cannot establish connection:", e);
return Failure.of(new Status(ESTABLISH_CONNECTION_ERROR, tokenRequest.getServerUrl() != null? tokenRequest.getServerUrl() : tokenRequest.getServiceId()));
}
try {
IClientRequestComposable requestComposer = ClientRequestComposerProvider.getInstance().getComposer(ClientRequestComposerProvider.ClientRequestComposers.CLIENT_CREDENTIAL_REQUEST_COMPOSER);
connection.getIoThread().execute(new TokenRequestAction(tokenRequest, requestComposer, connection, reference, latch));
latch.await(4, TimeUnit.SECONDS);
} catch (Exception e) {
logger.error("IOException: ", e);
return Failure.of(new Status(FAIL_TO_SEND_REQUEST));
} finally {
IoUtils.safeClose(connection);
}
//if reference.get() is null at this point, mostly likely couldn't get token within latch.await() timeout.
return reference.get() == null ? Failure.of(new Status(GET_TOKEN_TIMEOUT)) : reference.get();
} | java | public static Result<TokenResponse> getTokenResult(TokenRequest tokenRequest, String envTag) {
final AtomicReference<Result<TokenResponse>> reference = new AtomicReference<>();
final Http2Client client = Http2Client.getInstance();
final CountDownLatch latch = new CountDownLatch(1);
final ClientConnection connection;
try {
if(tokenRequest.getServerUrl() != null) {
connection = client.connect(new URI(tokenRequest.getServerUrl()), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, tokenRequest.enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();
} else if(tokenRequest.getServiceId() != null) {
Cluster cluster = SingletonServiceFactory.getBean(Cluster.class);
String url = cluster.serviceToUrl("https", tokenRequest.getServiceId(), envTag, null);
connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, tokenRequest.enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();
} else {
// both server_url and serviceId are empty in the config.
logger.error("Error: both server_url and serviceId are not configured in client.yml for " + tokenRequest.getClass());
throw new ClientException("both server_url and serviceId are not configured in client.yml for " + tokenRequest.getClass());
}
} catch (Exception e) {
logger.error("cannot establish connection:", e);
return Failure.of(new Status(ESTABLISH_CONNECTION_ERROR, tokenRequest.getServerUrl() != null? tokenRequest.getServerUrl() : tokenRequest.getServiceId()));
}
try {
IClientRequestComposable requestComposer = ClientRequestComposerProvider.getInstance().getComposer(ClientRequestComposerProvider.ClientRequestComposers.CLIENT_CREDENTIAL_REQUEST_COMPOSER);
connection.getIoThread().execute(new TokenRequestAction(tokenRequest, requestComposer, connection, reference, latch));
latch.await(4, TimeUnit.SECONDS);
} catch (Exception e) {
logger.error("IOException: ", e);
return Failure.of(new Status(FAIL_TO_SEND_REQUEST));
} finally {
IoUtils.safeClose(connection);
}
//if reference.get() is null at this point, mostly likely couldn't get token within latch.await() timeout.
return reference.get() == null ? Failure.of(new Status(GET_TOKEN_TIMEOUT)) : reference.get();
} | [
"public",
"static",
"Result",
"<",
"TokenResponse",
">",
"getTokenResult",
"(",
"TokenRequest",
"tokenRequest",
",",
"String",
"envTag",
")",
"{",
"final",
"AtomicReference",
"<",
"Result",
"<",
"TokenResponse",
">",
">",
"reference",
"=",
"new",
"AtomicReference"... | Get an access token from the token service. A Result of TokenResponse will be returned if the invocation is successfully.
Otherwise, a Result of Status will be returned.
@param tokenRequest token request constructed from the client.yml token section.
@param envTag the environment tag from the server.yml for service lookup.
@return Result of TokenResponse or error Status. | [
"Get",
"an",
"access",
"token",
"from",
"the",
"token",
"service",
".",
"A",
"Result",
"of",
"TokenResponse",
"will",
"be",
"returned",
"if",
"the",
"invocation",
"is",
"successfully",
".",
"Otherwise",
"a",
"Result",
"of",
"Status",
"will",
"be",
"returned"... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/oauth/OauthHelper.java#L105-L142 | train | Get the token result. | [
30522,
2270,
10763,
2765,
1026,
19204,
6072,
26029,
3366,
1028,
2131,
18715,
2368,
6072,
11314,
1006,
19204,
2890,
15500,
19204,
2890,
15500,
1010,
5164,
4372,
2615,
15900,
1007,
1063,
2345,
9593,
2890,
25523,
1026,
2765,
1026,
19204,
6072,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java | MesosArtifactServer.stop | public synchronized void stop() throws Exception {
if (this.serverChannel != null) {
this.serverChannel.close().awaitUninterruptibly();
this.serverChannel = null;
}
if (bootstrap != null) {
if (bootstrap.group() != null) {
bootstrap.group().shutdownGracefully();
}
bootstrap = null;
}
} | java | public synchronized void stop() throws Exception {
if (this.serverChannel != null) {
this.serverChannel.close().awaitUninterruptibly();
this.serverChannel = null;
}
if (bootstrap != null) {
if (bootstrap.group() != null) {
bootstrap.group().shutdownGracefully();
}
bootstrap = null;
}
} | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"serverChannel",
"!=",
"null",
")",
"{",
"this",
".",
"serverChannel",
".",
"close",
"(",
")",
".",
"awaitUninterruptibly",
"(",
")",
";",
"this",
"."... | Stops the artifact server.
@throws Exception | [
"Stops",
"the",
"artifact",
"server",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L246-L257 | train | Stop the server. | [
30522,
2270,
25549,
11675,
2644,
1006,
1007,
11618,
6453,
1063,
2065,
1006,
2023,
1012,
8241,
26058,
999,
1027,
19701,
1007,
1063,
2023,
1012,
8241,
26058,
1012,
2485,
1006,
1007,
1012,
26751,
19496,
10111,
12171,
29441,
17296,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/CanalAdapterLoader.java | CanalAdapterLoader.destroy | public void destroy() {
if (!canalWorkers.isEmpty()) {
ExecutorService stopExecutorService = Executors.newFixedThreadPool(canalWorkers.size());
for (CanalAdapterWorker canalAdapterWorker : canalWorkers.values()) {
stopExecutorService.execute(canalAdapterWorker::stop);
}
stopExecutorService.shutdown();
try {
while (!stopExecutorService.awaitTermination(1, TimeUnit.SECONDS)) {
// ignore
}
} catch (InterruptedException e) {
// ignore
}
}
if (!canalMQWorker.isEmpty()) {
ExecutorService stopMQWorkerService = Executors.newFixedThreadPool(canalMQWorker.size());
for (AbstractCanalAdapterWorker canalAdapterMQWorker : canalMQWorker.values()) {
stopMQWorkerService.execute(canalAdapterMQWorker::stop);
}
stopMQWorkerService.shutdown();
try {
while (!stopMQWorkerService.awaitTermination(1, TimeUnit.SECONDS)) {
// ignore
}
} catch (InterruptedException e) {
// ignore
}
}
logger.info("All canal adapters destroyed");
} | java | public void destroy() {
if (!canalWorkers.isEmpty()) {
ExecutorService stopExecutorService = Executors.newFixedThreadPool(canalWorkers.size());
for (CanalAdapterWorker canalAdapterWorker : canalWorkers.values()) {
stopExecutorService.execute(canalAdapterWorker::stop);
}
stopExecutorService.shutdown();
try {
while (!stopExecutorService.awaitTermination(1, TimeUnit.SECONDS)) {
// ignore
}
} catch (InterruptedException e) {
// ignore
}
}
if (!canalMQWorker.isEmpty()) {
ExecutorService stopMQWorkerService = Executors.newFixedThreadPool(canalMQWorker.size());
for (AbstractCanalAdapterWorker canalAdapterMQWorker : canalMQWorker.values()) {
stopMQWorkerService.execute(canalAdapterMQWorker::stop);
}
stopMQWorkerService.shutdown();
try {
while (!stopMQWorkerService.awaitTermination(1, TimeUnit.SECONDS)) {
// ignore
}
} catch (InterruptedException e) {
// ignore
}
}
logger.info("All canal adapters destroyed");
} | [
"public",
"void",
"destroy",
"(",
")",
"{",
"if",
"(",
"!",
"canalWorkers",
".",
"isEmpty",
"(",
")",
")",
"{",
"ExecutorService",
"stopExecutorService",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"canalWorkers",
".",
"size",
"(",
")",
")",
";",
"fo... | 销毁所有适配器 为防止canal实例太多造成销毁阻塞, 并行销毁 | [
"销毁所有适配器",
"为防止canal实例太多造成销毁阻塞",
"并行销毁"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/CanalAdapterLoader.java#L180-L211 | train | Destroy all the related canal adapters. | [
30522,
2270,
11675,
6033,
1006,
1007,
1063,
2065,
1006,
999,
5033,
6198,
2545,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
4654,
8586,
16161,
22573,
2099,
7903,
2063,
2644,
10288,
8586,
16161,
22573,
2099,
7903,
2063,
1027,
4654,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManager.java | IOManager.getSpillingDirectoriesPaths | public String[] getSpillingDirectoriesPaths() {
String[] strings = new String[this.paths.length];
for (int i = 0; i < strings.length; i++) {
strings[i] = paths[i].getAbsolutePath();
}
return strings;
} | java | public String[] getSpillingDirectoriesPaths() {
String[] strings = new String[this.paths.length];
for (int i = 0; i < strings.length; i++) {
strings[i] = paths[i].getAbsolutePath();
}
return strings;
} | [
"public",
"String",
"[",
"]",
"getSpillingDirectoriesPaths",
"(",
")",
"{",
"String",
"[",
"]",
"strings",
"=",
"new",
"String",
"[",
"this",
".",
"paths",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"strings",
".",
"l... | Gets the directories that the I/O manager spills to, as path strings.
@return The directories that the I/O manager spills to, as path strings. | [
"Gets",
"the",
"directories",
"that",
"the",
"I",
"/",
"O",
"manager",
"spills",
"to",
"as",
"path",
"strings",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManager.java#L275-L281 | train | Get the list of directories that are spilling. | [
30522,
2270,
5164,
1031,
1033,
4152,
8197,
13112,
4305,
2890,
16761,
3111,
15069,
2015,
1006,
1007,
1063,
5164,
1031,
1033,
7817,
1027,
2047,
5164,
1031,
2023,
1012,
10425,
1012,
3091,
1033,
1025,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TimerService.java | TimerService.registerTimeout | public void registerTimeout(final K key, final long delay, final TimeUnit unit) {
Preconditions.checkState(timeoutListener != null, "The " + getClass().getSimpleName() +
" has not been started.");
if (timeouts.containsKey(key)) {
unregisterTimeout(key);
}
timeouts.put(key, new Timeout<>(timeoutListener, key, delay, unit, scheduledExecutorService));
} | java | public void registerTimeout(final K key, final long delay, final TimeUnit unit) {
Preconditions.checkState(timeoutListener != null, "The " + getClass().getSimpleName() +
" has not been started.");
if (timeouts.containsKey(key)) {
unregisterTimeout(key);
}
timeouts.put(key, new Timeout<>(timeoutListener, key, delay, unit, scheduledExecutorService));
} | [
"public",
"void",
"registerTimeout",
"(",
"final",
"K",
"key",
",",
"final",
"long",
"delay",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"timeoutListener",
"!=",
"null",
",",
"\"The \"",
"+",
"getClass",
"(",
")",
... | Register a timeout for the given key which shall occur in the given delay.
@param key for which to register the timeout
@param delay until the timeout
@param unit of the timeout delay | [
"Register",
"a",
"timeout",
"for",
"the",
"given",
"key",
"which",
"shall",
"occur",
"in",
"the",
"given",
"delay",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TimerService.java#L101-L110 | train | Registers a timeout for the specified key. | [
30522,
2270,
11675,
4236,
7292,
5833,
1006,
2345,
1047,
3145,
1010,
2345,
2146,
8536,
1010,
2345,
2051,
19496,
2102,
3131,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
14148,
12259,
1006,
2051,
5833,
9863,
24454,
999,
1027,
19701,
1010,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/Proxy.java | Proxy.setAutodetect | public Proxy setAutodetect(boolean autodetect) {
if (this.autodetect == autodetect) {
return this;
}
if (autodetect) {
verifyProxyTypeCompatibility(ProxyType.AUTODETECT);
this.proxyType = ProxyType.AUTODETECT;
} else {
this.proxyType = ProxyType.UNSPECIFIED;
}
this.autodetect = autodetect;
return this;
} | java | public Proxy setAutodetect(boolean autodetect) {
if (this.autodetect == autodetect) {
return this;
}
if (autodetect) {
verifyProxyTypeCompatibility(ProxyType.AUTODETECT);
this.proxyType = ProxyType.AUTODETECT;
} else {
this.proxyType = ProxyType.UNSPECIFIED;
}
this.autodetect = autodetect;
return this;
} | [
"public",
"Proxy",
"setAutodetect",
"(",
"boolean",
"autodetect",
")",
"{",
"if",
"(",
"this",
".",
"autodetect",
"==",
"autodetect",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"autodetect",
")",
"{",
"verifyProxyTypeCompatibility",
"(",
"ProxyType",
"... | Specifies whether to autodetect proxy settings.
@param autodetect set to true to use proxy auto detection, false to leave proxy settings
unspecified
@return reference to self | [
"Specifies",
"whether",
"to",
"autodetect",
"proxy",
"settings",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L188-L200 | train | Sets the autodetect flag. | [
30522,
2270,
24540,
2275,
4887,
3406,
3207,
26557,
2102,
1006,
22017,
20898,
8285,
3207,
26557,
2102,
1007,
1063,
2065,
1006,
2023,
1012,
8285,
3207,
26557,
2102,
1027,
1027,
8285,
3207,
26557,
2102,
1007,
1063,
2709,
2023,
1025,
1065,
2065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/JaasModule.java | JaasModule.generateDefaultConfigFile | private static File generateDefaultConfigFile() {
final File jaasConfFile;
try {
Path jaasConfPath = Files.createTempFile("jaas-", ".conf");
try (InputStream resourceStream = JaasModule.class.getClassLoader().getResourceAsStream(JAAS_CONF_RESOURCE_NAME)) {
Files.copy(resourceStream, jaasConfPath, StandardCopyOption.REPLACE_EXISTING);
}
jaasConfFile = jaasConfPath.toFile();
jaasConfFile.deleteOnExit();
} catch (IOException e) {
throw new RuntimeException("unable to generate a JAAS configuration file", e);
}
return jaasConfFile;
} | java | private static File generateDefaultConfigFile() {
final File jaasConfFile;
try {
Path jaasConfPath = Files.createTempFile("jaas-", ".conf");
try (InputStream resourceStream = JaasModule.class.getClassLoader().getResourceAsStream(JAAS_CONF_RESOURCE_NAME)) {
Files.copy(resourceStream, jaasConfPath, StandardCopyOption.REPLACE_EXISTING);
}
jaasConfFile = jaasConfPath.toFile();
jaasConfFile.deleteOnExit();
} catch (IOException e) {
throw new RuntimeException("unable to generate a JAAS configuration file", e);
}
return jaasConfFile;
} | [
"private",
"static",
"File",
"generateDefaultConfigFile",
"(",
")",
"{",
"final",
"File",
"jaasConfFile",
";",
"try",
"{",
"Path",
"jaasConfPath",
"=",
"Files",
".",
"createTempFile",
"(",
"\"jaas-\"",
",",
"\".conf\"",
")",
";",
"try",
"(",
"InputStream",
"re... | Generate the default JAAS config file. | [
"Generate",
"the",
"default",
"JAAS",
"config",
"file",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/JaasModule.java#L143-L156 | train | Generate the default configuration file. | [
30522,
2797,
10763,
5371,
7013,
12879,
23505,
8663,
8873,
25708,
9463,
1006,
1007,
1063,
2345,
5371,
14855,
28187,
2078,
26989,
2571,
1025,
3046,
1063,
4130,
14855,
28187,
2078,
22540,
8988,
1027,
6764,
1012,
3443,
18532,
14376,
9463,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/common/Vertex.java | Vertex.newTranslatedPersonInstance | public static Vertex newTranslatedPersonInstance(String realWord, int frequency)
{
return new Vertex(Predefine.TAG_PEOPLE, realWord, new CoreDictionary.Attribute(Nature.nrf, frequency));
} | java | public static Vertex newTranslatedPersonInstance(String realWord, int frequency)
{
return new Vertex(Predefine.TAG_PEOPLE, realWord, new CoreDictionary.Attribute(Nature.nrf, frequency));
} | [
"public",
"static",
"Vertex",
"newTranslatedPersonInstance",
"(",
"String",
"realWord",
",",
"int",
"frequency",
")",
"{",
"return",
"new",
"Vertex",
"(",
"Predefine",
".",
"TAG_PEOPLE",
",",
"realWord",
",",
"new",
"CoreDictionary",
".",
"Attribute",
"(",
"Natu... | 创建一个音译人名实例
@param realWord
@return | [
"创建一个音译人名实例"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/Vertex.java#L386-L389 | train | Create a translated person instance. | [
30522,
2270,
10763,
19449,
25597,
5521,
14540,
4383,
27576,
7076,
26897,
1006,
5164,
2613,
18351,
1010,
20014,
6075,
1007,
1063,
2709,
2047,
19449,
1006,
3653,
3207,
23460,
1012,
6415,
1035,
2111,
1010,
2613,
18351,
1010,
2047,
4563,
29201,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java | StreamingJobGraphGenerator.setChaining | private void setChaining(Map<Integer, byte[]> hashes, List<Map<Integer, byte[]>> legacyHashes, Map<Integer, List<Tuple2<byte[], byte[]>>> chainedOperatorHashes) {
for (Integer sourceNodeId : streamGraph.getSourceIDs()) {
createChain(sourceNodeId, sourceNodeId, hashes, legacyHashes, 0, chainedOperatorHashes);
}
} | java | private void setChaining(Map<Integer, byte[]> hashes, List<Map<Integer, byte[]>> legacyHashes, Map<Integer, List<Tuple2<byte[], byte[]>>> chainedOperatorHashes) {
for (Integer sourceNodeId : streamGraph.getSourceIDs()) {
createChain(sourceNodeId, sourceNodeId, hashes, legacyHashes, 0, chainedOperatorHashes);
}
} | [
"private",
"void",
"setChaining",
"(",
"Map",
"<",
"Integer",
",",
"byte",
"[",
"]",
">",
"hashes",
",",
"List",
"<",
"Map",
"<",
"Integer",
",",
"byte",
"[",
"]",
">",
">",
"legacyHashes",
",",
"Map",
"<",
"Integer",
",",
"List",
"<",
"Tuple2",
"<... | Sets up task chains from the source {@link StreamNode} instances.
<p>This will recursively create all {@link JobVertex} instances. | [
"Sets",
"up",
"task",
"chains",
"from",
"the",
"source",
"{",
"@link",
"StreamNode",
"}",
"instances",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java#L201-L205 | train | Sets the chained operator hashes for all source nodes. | [
30522,
2797,
11675,
2275,
24925,
5582,
1006,
4949,
1026,
16109,
1010,
24880,
1031,
1033,
1028,
23325,
2229,
1010,
2862,
1026,
4949,
1026,
16109,
1010,
24880,
1031,
1033,
1028,
1028,
8027,
14949,
15689,
1010,
4949,
1026,
16109,
1010,
2862,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslX509Certificate.java | OpenSslX509Certificate.verify | public void verify(PublicKey key, Provider sigProvider)
throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
unwrap().verify(key, sigProvider);
} | java | public void verify(PublicKey key, Provider sigProvider)
throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
unwrap().verify(key, sigProvider);
} | [
"public",
"void",
"verify",
"(",
"PublicKey",
"key",
",",
"Provider",
"sigProvider",
")",
"throws",
"CertificateException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"SignatureException",
"{",
"unwrap",
"(",
")",
".",
"verify",
"(",
"key",
... | No @Override annotation as it was only introduced in Java8. | [
"No"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslX509Certificate.java#L84-L87 | train | Verify the certificate using the specified public key and signature provider. | [
30522,
2270,
11675,
20410,
1006,
2270,
14839,
3145,
1010,
10802,
9033,
21600,
12298,
18688,
1007,
11618,
8196,
10288,
24422,
1010,
16839,
10875,
2389,
20255,
8939,
4168,
2595,
24422,
1010,
19528,
14839,
10288,
24422,
1010,
8085,
10288,
24422,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/StaticLog.java | StaticLog.log | public static boolean log(Log log, Level level, Throwable t, String format, Object... arguments) {
if (log instanceof LocationAwareLog) {
((LocationAwareLog) log).log(FQCN, level, t, format, arguments);
return true;
} else {
return false;
}
} | java | public static boolean log(Log log, Level level, Throwable t, String format, Object... arguments) {
if (log instanceof LocationAwareLog) {
((LocationAwareLog) log).log(FQCN, level, t, format, arguments);
return true;
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"log",
"(",
"Log",
"log",
",",
"Level",
"level",
",",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"arguments",
")",
"{",
"if",
"(",
"log",
"instanceof",
"LocationAwareLog",
")",
"{",
"(",
"(",
"Location... | 打印日志<br>
@param log 日志对象
@param level 日志级别
@param t 需在日志中堆栈打印的异常
@param format 格式文本,{} 代表变量
@param arguments 变量对应的参数
@return 是否为LocationAwareLog日志 | [
"打印日志<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/StaticLog.java#L237-L244 | train | Logs a message at the specified level with a throwable. | [
30522,
2270,
10763,
22017,
20898,
8833,
1006,
8833,
8833,
1010,
2504,
2504,
1010,
5466,
3085,
1056,
1010,
5164,
4289,
1010,
4874,
1012,
1012,
1012,
9918,
1007,
1063,
2065,
1006,
8833,
6013,
11253,
3295,
10830,
16570,
8649,
1007,
1063,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | http-url/src/main/java/com/networknt/url/URLNormalizer.java | URLNormalizer.addDomainTrailingSlash | public URLNormalizer addDomainTrailingSlash() {
String urlRoot = HttpURL.getRoot(url);
String path = toURL().getPath();
if (StringUtils.isNotBlank(path)) {
// there is a path so do nothing
return this;
}
String urlRootAndPath = urlRoot + "/";
url = StringUtils.replaceOnce(url, urlRoot, urlRootAndPath);
return this;
} | java | public URLNormalizer addDomainTrailingSlash() {
String urlRoot = HttpURL.getRoot(url);
String path = toURL().getPath();
if (StringUtils.isNotBlank(path)) {
// there is a path so do nothing
return this;
}
String urlRootAndPath = urlRoot + "/";
url = StringUtils.replaceOnce(url, urlRoot, urlRootAndPath);
return this;
} | [
"public",
"URLNormalizer",
"addDomainTrailingSlash",
"(",
")",
"{",
"String",
"urlRoot",
"=",
"HttpURL",
".",
"getRoot",
"(",
"url",
")",
";",
"String",
"path",
"=",
"toURL",
"(",
")",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotB... | <p>Adds a trailing slash (/) right after the domain for URLs with no
path, before any fragment (#) or query string (?).</p>
<p><b>Please Note:</b> Adding a trailing slash to URLs could
potentially break its semantic equivalence.</p>
<code>http://www.example.com →
http://www.example.com/</code>
@return this instance
@since 1.12.0 | [
"<p",
">",
"Adds",
"a",
"trailing",
"slash",
"(",
"/",
")",
"right",
"after",
"the",
"domain",
"for",
"URLs",
"with",
"no",
"path",
"before",
"any",
"fragment",
"(",
"#",
")",
"or",
"query",
"string",
"(",
"?",
")",
".",
"<",
"/",
"p",
">"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/URLNormalizer.java#L348-L358 | train | Add a trailing slash to the URL. | [
30522,
2270,
24471,
19666,
2953,
9067,
17629,
5587,
9527,
22325,
15118,
8613,
27067,
1006,
1007,
1063,
5164,
24471,
20974,
17206,
1027,
8299,
3126,
2140,
1012,
2131,
3217,
4140,
1006,
24471,
2140,
1007,
1025,
5164,
4130,
1027,
2778,
2140,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java | Instance.actionCost | public int actionCost(Action action, int dependency, State state)
{
if (!ArcEager.canDo(action, state))
return Integer.MAX_VALUE;
int cost = 0;
// added by me to take care of labels
if (action == Action.LeftArc)
{ // left arc
int bufferHead = state.bufferHead();
int stackHead = state.stackTop();
if (goldDependencies.containsKey(stackHead) && goldDependencies.get(stackHead).headIndex == bufferHead
&& goldDependencies.get(stackHead).relationId != (dependency))
cost += 1;
}
else if (action == Action.RightArc)
{ //right arc
int bufferHead = state.bufferHead();
int stackHead = state.stackTop();
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == stackHead
&& goldDependencies.get(bufferHead).relationId != (dependency))
cost += 1;
}
if (action == Action.Shift)
{ //shift
int bufferHead = state.bufferHead();
for (int stackItem : state.getStack())
{
if (goldDependencies.containsKey(stackItem) && goldDependencies.get(stackItem).headIndex == (bufferHead))
cost += 1;
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (stackItem))
cost += 1;
}
}
else if (action == Action.Reduce)
{ //reduce
int stackHead = state.stackTop();
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferItem) && goldDependencies.get(bufferItem).headIndex == (stackHead))
cost += 1;
}
}
else if (action == Action.LeftArc && cost == 0)
{ //left arc
int stackHead = state.stackTop();
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferItem) && goldDependencies.get(bufferItem).headIndex == (stackHead))
cost += 1;
if (goldDependencies.containsKey(stackHead) && goldDependencies.get(stackHead).headIndex == (bufferItem))
if (bufferItem != state.bufferHead())
cost += 1;
}
}
else if (action == Action.RightArc && cost == 0)
{ //right arc
int stackHead = state.stackTop();
int bufferHead = state.bufferHead();
for (int stackItem : state.getStack())
{
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (stackItem))
if (stackItem != stackHead)
cost += 1;
if (goldDependencies.containsKey(stackItem) && goldDependencies.get(stackItem).headIndex == (bufferHead))
cost += 1;
}
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (bufferItem))
cost += 1;
}
}
return cost;
} | java | public int actionCost(Action action, int dependency, State state)
{
if (!ArcEager.canDo(action, state))
return Integer.MAX_VALUE;
int cost = 0;
// added by me to take care of labels
if (action == Action.LeftArc)
{ // left arc
int bufferHead = state.bufferHead();
int stackHead = state.stackTop();
if (goldDependencies.containsKey(stackHead) && goldDependencies.get(stackHead).headIndex == bufferHead
&& goldDependencies.get(stackHead).relationId != (dependency))
cost += 1;
}
else if (action == Action.RightArc)
{ //right arc
int bufferHead = state.bufferHead();
int stackHead = state.stackTop();
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == stackHead
&& goldDependencies.get(bufferHead).relationId != (dependency))
cost += 1;
}
if (action == Action.Shift)
{ //shift
int bufferHead = state.bufferHead();
for (int stackItem : state.getStack())
{
if (goldDependencies.containsKey(stackItem) && goldDependencies.get(stackItem).headIndex == (bufferHead))
cost += 1;
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (stackItem))
cost += 1;
}
}
else if (action == Action.Reduce)
{ //reduce
int stackHead = state.stackTop();
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferItem) && goldDependencies.get(bufferItem).headIndex == (stackHead))
cost += 1;
}
}
else if (action == Action.LeftArc && cost == 0)
{ //left arc
int stackHead = state.stackTop();
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferItem) && goldDependencies.get(bufferItem).headIndex == (stackHead))
cost += 1;
if (goldDependencies.containsKey(stackHead) && goldDependencies.get(stackHead).headIndex == (bufferItem))
if (bufferItem != state.bufferHead())
cost += 1;
}
}
else if (action == Action.RightArc && cost == 0)
{ //right arc
int stackHead = state.stackTop();
int bufferHead = state.bufferHead();
for (int stackItem : state.getStack())
{
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (stackItem))
if (stackItem != stackHead)
cost += 1;
if (goldDependencies.containsKey(stackItem) && goldDependencies.get(stackItem).headIndex == (bufferHead))
cost += 1;
}
if (!state.bufferEmpty())
for (int bufferItem = state.bufferHead(); bufferItem <= state.maxSentenceSize; bufferItem++)
{
if (goldDependencies.containsKey(bufferHead) && goldDependencies.get(bufferHead).headIndex == (bufferItem))
cost += 1;
}
}
return cost;
} | [
"public",
"int",
"actionCost",
"(",
"Action",
"action",
",",
"int",
"dependency",
",",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"ArcEager",
".",
"canDo",
"(",
"action",
",",
"state",
")",
")",
"return",
"Integer",
".",
"MAX_VALUE",
";",
"int",
"cost... | For the cost of an action given the gold dependencies
For more information see:
Yoav Goldberg and Joakim Nivre. "Training Deterministic Parsers with Non-Deterministic Oracles."
TACL 1 (2013): 403-414.
@param action
@param dependency
@param state
@return oracle cost of the action
@throws Exception | [
"For",
"the",
"cost",
"of",
"an",
"action",
"given",
"the",
"gold",
"dependencies",
"For",
"more",
"information",
"see",
":",
"Yoav",
"Goldberg",
"and",
"Joakim",
"Nivre",
".",
"Training",
"Deterministic",
"Parsers",
"with",
"Non",
"-",
"Deterministic",
"Oracl... | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java#L135-L216 | train | Cost of a single action. | [
30522,
2270,
20014,
2895,
13186,
2102,
1006,
2895,
2895,
1010,
20014,
24394,
1010,
2110,
2110,
1007,
1063,
2065,
1006,
999,
8115,
5243,
4590,
1012,
2064,
3527,
1006,
2895,
1010,
2110,
1007,
1007,
2709,
16109,
1012,
4098,
1035,
3643,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java | HttpObjectDecoder.isSwitchingToNonHttp1Protocol | protected boolean isSwitchingToNonHttp1Protocol(HttpResponse msg) {
if (msg.status().code() != HttpResponseStatus.SWITCHING_PROTOCOLS.code()) {
return false;
}
String newProtocol = msg.headers().get(HttpHeaderNames.UPGRADE);
return newProtocol == null ||
!newProtocol.contains(HttpVersion.HTTP_1_0.text()) &&
!newProtocol.contains(HttpVersion.HTTP_1_1.text());
} | java | protected boolean isSwitchingToNonHttp1Protocol(HttpResponse msg) {
if (msg.status().code() != HttpResponseStatus.SWITCHING_PROTOCOLS.code()) {
return false;
}
String newProtocol = msg.headers().get(HttpHeaderNames.UPGRADE);
return newProtocol == null ||
!newProtocol.contains(HttpVersion.HTTP_1_0.text()) &&
!newProtocol.contains(HttpVersion.HTTP_1_1.text());
} | [
"protected",
"boolean",
"isSwitchingToNonHttp1Protocol",
"(",
"HttpResponse",
"msg",
")",
"{",
"if",
"(",
"msg",
".",
"status",
"(",
")",
".",
"code",
"(",
")",
"!=",
"HttpResponseStatus",
".",
"SWITCHING_PROTOCOLS",
".",
"code",
"(",
")",
")",
"{",
"return"... | Returns true if the server switched to a different protocol than HTTP/1.0 or HTTP/1.1, e.g. HTTP/2 or Websocket.
Returns false if the upgrade happened in a different layer, e.g. upgrade from HTTP/1.1 to HTTP/1.1 over TLS. | [
"Returns",
"true",
"if",
"the",
"server",
"switched",
"to",
"a",
"different",
"protocol",
"than",
"HTTP",
"/",
"1",
".",
"0",
"or",
"HTTP",
"/",
"1",
".",
"1",
"e",
".",
"g",
".",
"HTTP",
"/",
"2",
"or",
"Websocket",
".",
"Returns",
"false",
"if",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java#L482-L490 | train | Checks if the response is switching to a non - HTTP 1 protocol. | [
30522,
5123,
22017,
20898,
26354,
9148,
10649,
7853,
2239,
11039,
25856,
2487,
21572,
3406,
25778,
1006,
8299,
6072,
26029,
3366,
5796,
2290,
1007,
1063,
2065,
1006,
5796,
2290,
1012,
3570,
1006,
1007,
1012,
3642,
1006,
1007,
999,
1027,
829... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.keyBy | public KeyedStream<T, Tuple> keyBy(int... fields) {
if (getType() instanceof BasicArrayTypeInfo || getType() instanceof PrimitiveArrayTypeInfo) {
return keyBy(KeySelectorUtil.getSelectorForArray(fields, getType()));
} else {
return keyBy(new Keys.ExpressionKeys<>(fields, getType()));
}
} | java | public KeyedStream<T, Tuple> keyBy(int... fields) {
if (getType() instanceof BasicArrayTypeInfo || getType() instanceof PrimitiveArrayTypeInfo) {
return keyBy(KeySelectorUtil.getSelectorForArray(fields, getType()));
} else {
return keyBy(new Keys.ExpressionKeys<>(fields, getType()));
}
} | [
"public",
"KeyedStream",
"<",
"T",
",",
"Tuple",
">",
"keyBy",
"(",
"int",
"...",
"fields",
")",
"{",
"if",
"(",
"getType",
"(",
")",
"instanceof",
"BasicArrayTypeInfo",
"||",
"getType",
"(",
")",
"instanceof",
"PrimitiveArrayTypeInfo",
")",
"{",
"return",
... | Partitions the operator state of a {@link DataStream} by the given key positions.
@param fields
The position of the fields on which the {@link DataStream}
will be grouped.
@return The {@link DataStream} with partitioned state (i.e. KeyedStream) | [
"Partitions",
"the",
"operator",
"state",
"of",
"a",
"{",
"@link",
"DataStream",
"}",
"by",
"the",
"given",
"key",
"positions",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L317-L323 | train | KeyBy method. | [
30522,
2270,
3145,
2098,
21422,
1026,
1056,
1010,
10722,
10814,
1028,
3145,
3762,
1006,
20014,
1012,
1012,
1012,
4249,
1007,
1063,
2065,
1006,
2131,
13874,
1006,
1007,
6013,
11253,
3937,
2906,
9447,
13874,
2378,
14876,
1064,
1064,
2131,
138... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
redisson/redisson | redisson/src/main/java/org/redisson/liveobject/misc/ClassUtils.java | ClassUtils.searchForMethod | public static Method searchForMethod(Class<?> type, String name, Class<?>[] parms) {
try {
return type.getMethod(name, parms);
} catch (NoSuchMethodException e) {}
Method[] methods = type.getMethods();
for (int i = 0; i < methods.length; i++) {
// Has to be named the same of course.
if (!methods[i].getName().equals(name)) {
continue;
}
Class<?>[] types = methods[i].getParameterTypes();
// Does it have the same number of arguments that we're looking for.
if (types.length != parms.length) {
continue;
}
// Check for type compatibility
if (areTypesCompatible(types, parms)) {
return methods[i];
}
}
return null;
} | java | public static Method searchForMethod(Class<?> type, String name, Class<?>[] parms) {
try {
return type.getMethod(name, parms);
} catch (NoSuchMethodException e) {}
Method[] methods = type.getMethods();
for (int i = 0; i < methods.length; i++) {
// Has to be named the same of course.
if (!methods[i].getName().equals(name)) {
continue;
}
Class<?>[] types = methods[i].getParameterTypes();
// Does it have the same number of arguments that we're looking for.
if (types.length != parms.length) {
continue;
}
// Check for type compatibility
if (areTypesCompatible(types, parms)) {
return methods[i];
}
}
return null;
} | [
"public",
"static",
"Method",
"searchForMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parms",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getMethod",
"(",
"name",
",",
"parms",
")",
"... | Searches through all methods looking for one with the specified name that
will take the specified paramaters even if the parameter types are more
generic in the actual method implementation. This is similar to the
findConstructor() method and has the similar limitations that it doesn't
do a real widening scope search and simply processes the methods in
order.
@param type param
@param name of class
@param parms classes
@return Method object | [
"Searches",
"through",
"all",
"methods",
"looking",
"for",
"one",
"with",
"the",
"specified",
"name",
"that",
"will",
"take",
"the",
"specified",
"paramaters",
"even",
"if",
"the",
"parameter",
"types",
"are",
"more",
"generic",
"in",
"the",
"actual",
"method"... | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/liveobject/misc/ClassUtils.java#L169-L192 | train | Search for a Method in a Class. | [
30522,
2270,
10763,
4118,
3945,
14192,
11031,
7716,
1006,
2465,
1026,
1029,
1028,
2828,
1010,
5164,
2171,
1010,
2465,
1026,
1029,
1028,
1031,
1033,
11968,
5244,
1007,
1063,
3046,
1063,
2709,
2828,
1012,
2131,
11368,
6806,
2094,
1006,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java | HadoopInputs.createHadoopInput | public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> createHadoopInput(
org.apache.hadoop.mapreduce.InputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, Job job) {
return new org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<>(mapreduceInputFormat, key, value, job);
} | java | public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> createHadoopInput(
org.apache.hadoop.mapreduce.InputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, Job job) {
return new org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<>(mapreduceInputFormat, key, value, job);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"java",
".",
"hadoop",
".",
"mapreduce",
".",
"HadoopInputFormat",
"<",
"K",
",",
"V",
">",
"createHadoopInput",
"(",
"org",
".",
"apache",
".",
"hadoop... | Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapreduce.InputFormat}.
@return A Flink InputFormat that wraps the Hadoop InputFormat. | [
"Creates",
"a",
"Flink",
"{",
"@link",
"InputFormat",
"}",
"that",
"wraps",
"the",
"given",
"Hadoop",
"{",
"@link",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapreduce",
".",
"InputFormat",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L112-L115 | train | Create hadoop input. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
8917,
1012,
15895,
1012,
13109,
19839,
1012,
17928,
1012,
9262,
1012,
2018,
18589,
1012,
4949,
5596,
18796,
1012,
2018,
18589,
2378,
18780,
14192,
4017,
1026,
1047,
1010,
1058,
1028,
3443,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/MutableHashTable.java | MutableHashTable.open | public void open(final MutableObjectIterator<BT> buildSide, final MutableObjectIterator<PT> probeSide)
throws IOException {
open(buildSide, probeSide, false);
} | java | public void open(final MutableObjectIterator<BT> buildSide, final MutableObjectIterator<PT> probeSide)
throws IOException {
open(buildSide, probeSide, false);
} | [
"public",
"void",
"open",
"(",
"final",
"MutableObjectIterator",
"<",
"BT",
">",
"buildSide",
",",
"final",
"MutableObjectIterator",
"<",
"PT",
">",
"probeSide",
")",
"throws",
"IOException",
"{",
"open",
"(",
"buildSide",
",",
"probeSide",
",",
"false",
")",
... | Opens the hash join. This method reads the build-side input and constructs the initial
hash table, gradually spilling partitions that do not fit into memory.
@param buildSide Build side input.
@param probeSide Probe side input.
@throws IOException Thrown, if an I/O problem occurs while spilling a partition. | [
"Opens",
"the",
"hash",
"join",
".",
"This",
"method",
"reads",
"the",
"build",
"-",
"side",
"input",
"and",
"constructs",
"the",
"initial",
"hash",
"table",
"gradually",
"spilling",
"partitions",
"that",
"do",
"not",
"fit",
"into",
"memory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/MutableHashTable.java#L456-L460 | train | Open the underlying data source. | [
30522,
2270,
11675,
2330,
1006,
2345,
14163,
10880,
16429,
20614,
21646,
8844,
1026,
18411,
1028,
16473,
5178,
1010,
2345,
14163,
10880,
16429,
20614,
21646,
8844,
1026,
13866,
1028,
15113,
7363,
1007,
11618,
22834,
10288,
24422,
1063,
2330,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperUtilityFactory.java | ZooKeeperUtilityFactory.createSharedCount | public ZooKeeperSharedCount createSharedCount(String path, int seedCount) {
return new ZooKeeperSharedCount(
new SharedCount(
facade,
path,
seedCount));
} | java | public ZooKeeperSharedCount createSharedCount(String path, int seedCount) {
return new ZooKeeperSharedCount(
new SharedCount(
facade,
path,
seedCount));
} | [
"public",
"ZooKeeperSharedCount",
"createSharedCount",
"(",
"String",
"path",
",",
"int",
"seedCount",
")",
"{",
"return",
"new",
"ZooKeeperSharedCount",
"(",
"new",
"SharedCount",
"(",
"facade",
",",
"path",
",",
"seedCount",
")",
")",
";",
"}"
] | Creates a {@link ZooKeeperSharedCount} to store a shared count between multiple instances.
@param path to the shared count in ZooKeeper
@param seedCount for the shared count
@return a shared count | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperSharedCount",
"}",
"to",
"store",
"a",
"shared",
"count",
"between",
"multiple",
"instances",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperUtilityFactory.java#L111-L117 | train | Create a new SharedCount object. | [
30522,
2270,
9201,
24764,
8167,
2098,
3597,
16671,
9005,
8167,
2098,
3597,
16671,
1006,
5164,
4130,
1010,
20014,
6534,
3597,
16671,
1007,
1063,
2709,
2047,
9201,
24764,
8167,
2098,
3597,
16671,
1006,
2047,
4207,
3597,
16671,
1006,
8508,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/AggregationDistinctQueryMetaData.java | AggregationDistinctQueryMetaData.getAggregationDistinctColumnIndex | public int getAggregationDistinctColumnIndex(final int derivedSumIndex) {
for (Entry<Integer, Integer> entry : aggregationDistinctColumnIndexAndSumColumnIndexes.entrySet()) {
if (entry.getValue().equals(derivedSumIndex)) {
return entry.getKey();
}
}
throw new ShardingException("Can not get aggregation distinct column index.");
} | java | public int getAggregationDistinctColumnIndex(final int derivedSumIndex) {
for (Entry<Integer, Integer> entry : aggregationDistinctColumnIndexAndSumColumnIndexes.entrySet()) {
if (entry.getValue().equals(derivedSumIndex)) {
return entry.getKey();
}
}
throw new ShardingException("Can not get aggregation distinct column index.");
} | [
"public",
"int",
"getAggregationDistinctColumnIndex",
"(",
"final",
"int",
"derivedSumIndex",
")",
"{",
"for",
"(",
"Entry",
"<",
"Integer",
",",
"Integer",
">",
"entry",
":",
"aggregationDistinctColumnIndexAndSumColumnIndexes",
".",
"entrySet",
"(",
")",
")",
"{",
... | Get aggregation distinct column index.
@param derivedSumIndex derived sum index
@return aggregation distinct column index | [
"Get",
"aggregation",
"distinct",
"column",
"index",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/AggregationDistinctQueryMetaData.java#L176-L183 | train | Gets the aggregation distinct column index. | [
30522,
2270,
20014,
2131,
8490,
17603,
12540,
10521,
7629,
6593,
25778,
2819,
11483,
3207,
2595,
1006,
2345,
20014,
5173,
17421,
22254,
10288,
1007,
1063,
2005,
1006,
4443,
1026,
16109,
1010,
16109,
1028,
4443,
1024,
28041,
10521,
7629,
6593,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapBuilder.java | MapBuilder.join | public String join(String separator, final String keyValueSeparator) {
return MapUtil.join(this.map, separator, keyValueSeparator);
} | java | public String join(String separator, final String keyValueSeparator) {
return MapUtil.join(this.map, separator, keyValueSeparator);
} | [
"public",
"String",
"join",
"(",
"String",
"separator",
",",
"final",
"String",
"keyValueSeparator",
")",
"{",
"return",
"MapUtil",
".",
"join",
"(",
"this",
".",
"map",
",",
"separator",
",",
"keyValueSeparator",
")",
";",
"}"
] | 将map转成字符串
@param separator entry之间的连接符
@param keyValueSeparator kv之间的连接符
@return 连接字符串 | [
"将map转成字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapBuilder.java#L86-L88 | train | Join the map with the specified separator and key value separator. | [
30522,
2270,
5164,
3693,
1006,
5164,
19802,
25879,
2953,
1010,
2345,
5164,
3145,
10175,
15808,
13699,
25879,
2953,
1007,
1063,
2709,
4949,
21823,
2140,
1012,
3693,
1006,
2023,
1012,
4949,
1010,
19802,
25879,
2953,
1010,
3145,
10175,
15808,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java | DataSourceTask.initOutputs | private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry().getUserMap());
} | java | private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry().getUserMap());
} | [
"private",
"void",
"initOutputs",
"(",
"ClassLoader",
"cl",
")",
"throws",
"Exception",
"{",
"this",
".",
"chainedTasks",
"=",
"new",
"ArrayList",
"<",
"ChainedDriver",
"<",
"?",
",",
"?",
">",
">",
"(",
")",
";",
"this",
".",
"eventualOutputs",
"=",
"ne... | Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
The output collector applies the configured shipping strategy. | [
"Creates",
"a",
"writer",
"for",
"each",
"output",
".",
"Creates",
"an",
"OutputCollector",
"which",
"forwards",
"its",
"input",
"to",
"all",
"writers",
".",
"The",
"output",
"collector",
"applies",
"the",
"configured",
"shipping",
"strategy",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java#L308-L314 | train | Initialize the output list. | [
30522,
2797,
11675,
1999,
9956,
4904,
18780,
2015,
1006,
2465,
11066,
2121,
18856,
1007,
11618,
6453,
1063,
2023,
1012,
22075,
10230,
5705,
1027,
2047,
9140,
9863,
1026,
22075,
23663,
2099,
1026,
1029,
1010,
1029,
1028,
1028,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/lookups/FieldReferenceLookup.java | FieldReferenceLookup.getAllInputFields | public List<FieldReferenceExpression> getAllInputFields() {
return fieldReferences.stream().flatMap(input -> input.values().stream()).collect(toList());
} | java | public List<FieldReferenceExpression> getAllInputFields() {
return fieldReferences.stream().flatMap(input -> input.values().stream()).collect(toList());
} | [
"public",
"List",
"<",
"FieldReferenceExpression",
">",
"getAllInputFields",
"(",
")",
"{",
"return",
"fieldReferences",
".",
"stream",
"(",
")",
".",
"flatMap",
"(",
"input",
"->",
"input",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
")",
".",
"co... | Gives all fields of underlying inputs in order of those inputs and order of fields within input.
@return concatenated list of fields of all inputs. | [
"Gives",
"all",
"fields",
"of",
"underlying",
"inputs",
"in",
"order",
"of",
"those",
"inputs",
"and",
"order",
"of",
"fields",
"within",
"input",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/lookups/FieldReferenceLookup.java#L77-L79 | train | Returns all input fields. | [
30522,
2270,
2862,
1026,
2492,
2890,
25523,
10288,
20110,
3258,
1028,
2131,
8095,
2378,
18780,
15155,
1006,
1007,
1063,
2709,
2492,
2890,
25523,
2015,
1012,
5460,
1006,
1007,
1012,
4257,
2863,
2361,
1006,
7953,
1011,
1028,
7953,
1012,
5300,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java | RelaxedDataBinder.modifyProperties | private MutablePropertyValues modifyProperties(MutablePropertyValues propertyValues, Object target) {
propertyValues = getPropertyValuesForNamePrefix(propertyValues);
if (target instanceof RelaxedDataBinder.MapHolder) {
propertyValues = addMapPrefix(propertyValues);
}
BeanWrapper wrapper = new BeanWrapperImpl(target);
wrapper.setConversionService(new RelaxedConversionService(getConversionService()));
wrapper.setAutoGrowNestedPaths(true);
List<PropertyValue> sortedValues = new ArrayList<PropertyValue>();
Set<String> modifiedNames = new HashSet<String>();
List<String> sortedNames = getSortedPropertyNames(propertyValues);
for (String name : sortedNames) {
PropertyValue propertyValue = propertyValues.getPropertyValue(name);
PropertyValue modifiedProperty = modifyProperty(wrapper, propertyValue);
if (modifiedNames.add(modifiedProperty.getName())) {
sortedValues.add(modifiedProperty);
}
}
return new MutablePropertyValues(sortedValues);
} | java | private MutablePropertyValues modifyProperties(MutablePropertyValues propertyValues, Object target) {
propertyValues = getPropertyValuesForNamePrefix(propertyValues);
if (target instanceof RelaxedDataBinder.MapHolder) {
propertyValues = addMapPrefix(propertyValues);
}
BeanWrapper wrapper = new BeanWrapperImpl(target);
wrapper.setConversionService(new RelaxedConversionService(getConversionService()));
wrapper.setAutoGrowNestedPaths(true);
List<PropertyValue> sortedValues = new ArrayList<PropertyValue>();
Set<String> modifiedNames = new HashSet<String>();
List<String> sortedNames = getSortedPropertyNames(propertyValues);
for (String name : sortedNames) {
PropertyValue propertyValue = propertyValues.getPropertyValue(name);
PropertyValue modifiedProperty = modifyProperty(wrapper, propertyValue);
if (modifiedNames.add(modifiedProperty.getName())) {
sortedValues.add(modifiedProperty);
}
}
return new MutablePropertyValues(sortedValues);
} | [
"private",
"MutablePropertyValues",
"modifyProperties",
"(",
"MutablePropertyValues",
"propertyValues",
",",
"Object",
"target",
")",
"{",
"propertyValues",
"=",
"getPropertyValuesForNamePrefix",
"(",
"propertyValues",
")",
";",
"if",
"(",
"target",
"instanceof",
"Relaxed... | Modify the property values so that period separated property paths are valid
for map keys. Also creates new maps for properties of map type that are null
(assuming all maps are potentially nested). The standard bracket {@code[...]}
dereferencing is also accepted.
@param propertyValues the property values
@param target the target object
@return modified property values | [
"Modify",
"the",
"property",
"values",
"so",
"that",
"period",
"separated",
"property",
"paths",
"are",
"valid",
"for",
"map",
"keys",
".",
"Also",
"creates",
"new",
"maps",
"for",
"properties",
"of",
"map",
"type",
"that",
"are",
"null",
"(",
"assuming",
... | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L124-L143 | train | Modify properties. | [
30522,
2797,
14163,
10880,
21572,
4842,
3723,
10175,
15808,
19933,
21572,
4842,
7368,
1006,
14163,
10880,
21572,
4842,
3723,
10175,
15808,
3200,
10175,
15808,
1010,
4874,
4539,
1007,
1063,
3200,
10175,
15808,
1027,
2131,
21572,
4842,
3723,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word2vec/WordVectorModel.java | WordVectorModel.analogy | public List<Map.Entry<String, Float>> analogy(String A, String B, String C)
{
return analogy(A, B, C, 10);
} | java | public List<Map.Entry<String, Float>> analogy(String A, String B, String C)
{
return analogy(A, B, C, 10);
} | [
"public",
"List",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Float",
">",
">",
"analogy",
"(",
"String",
"A",
",",
"String",
"B",
",",
"String",
"C",
")",
"{",
"return",
"analogy",
"(",
"A",
",",
"B",
",",
"C",
",",
"10",
")",
";",
"}"
] | 返回跟 A - B + C 最相似的词语,比如 中国 - 北京 + 东京 = 日本。输入顺序按照 中国 北京 东京
@param A 做加法的词语
@param B 做减法的词语
@param C 做加法的词语
@return 与(A - B + C)语义距离最近的词语及其相似度列表 | [
"返回跟",
"A",
"-",
"B",
"+",
"C",
"最相似的词语",
"比如",
"中国",
"-",
"北京",
"+",
"东京",
"=",
"日本。输入顺序按照",
"中国",
"北京",
"东京"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/WordVectorModel.java#L55-L58 | train | Analogy method for the segment. | [
30522,
2270,
2862,
1026,
4949,
1012,
4443,
1026,
5164,
1010,
14257,
1028,
1028,
23323,
1006,
5164,
1037,
1010,
5164,
1038,
1010,
5164,
1039,
1007,
1063,
2709,
23323,
1006,
1037,
1010,
1038,
1010,
1039,
1010,
2184,
1007,
1025,
1065,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.readTextFileWithValue | public DataSource<StringValue> readTextFileWithValue(String filePath) {
Preconditions.checkNotNull(filePath, "The file path may not be null.");
return new DataSource<>(this, new TextValueInputFormat(new Path(filePath)), new ValueTypeInfo<>(StringValue.class), Utils.getCallLocationName());
} | java | public DataSource<StringValue> readTextFileWithValue(String filePath) {
Preconditions.checkNotNull(filePath, "The file path may not be null.");
return new DataSource<>(this, new TextValueInputFormat(new Path(filePath)), new ValueTypeInfo<>(StringValue.class), Utils.getCallLocationName());
} | [
"public",
"DataSource",
"<",
"StringValue",
">",
"readTextFileWithValue",
"(",
"String",
"filePath",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"filePath",
",",
"\"The file path may not be null.\"",
")",
";",
"return",
"new",
"DataSource",
"<>",
"(",
"this... | Creates a {@link DataSet} that represents the Strings produced by reading the given file line wise.
This method is similar to {@link #readTextFile(String)}, but it produces a DataSet with mutable
{@link StringValue} objects, rather than Java Strings. StringValues can be used to tune implementations
to be less object and garbage collection heavy.
<p>The file will be read with the UTF-8 character set.
@param filePath The path of the file, as a URI (e.g., "file:///some/local/file" or "hdfs://host:port/file/path").
@return A {@link DataSet} that represents the data read from the given file as text lines. | [
"Creates",
"a",
"{",
"@link",
"DataSet",
"}",
"that",
"represents",
"the",
"Strings",
"produced",
"by",
"reading",
"the",
"given",
"file",
"line",
"wise",
".",
"This",
"method",
"is",
"similar",
"to",
"{",
"@link",
"#readTextFile",
"(",
"String",
")",
"}",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L428-L432 | train | Reads a text file with a value. | [
30522,
2270,
2951,
6499,
3126,
3401,
1026,
5164,
10175,
5657,
1028,
3191,
18209,
8873,
2571,
24415,
10175,
5657,
1006,
5164,
5371,
15069,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
5371,
15069,
1010,
1000,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java | GroupedMap.remove | public String remove(String group, String key) {
group = StrUtil.nullToEmpty(group).trim();
writeLock.lock();
try {
final LinkedHashMap<String, String> valueMap = this.get(group);
if (MapUtil.isNotEmpty(valueMap)) {
return valueMap.remove(key);
}
} finally {
writeLock.unlock();
}
return null;
} | java | public String remove(String group, String key) {
group = StrUtil.nullToEmpty(group).trim();
writeLock.lock();
try {
final LinkedHashMap<String, String> valueMap = this.get(group);
if (MapUtil.isNotEmpty(valueMap)) {
return valueMap.remove(key);
}
} finally {
writeLock.unlock();
}
return null;
} | [
"public",
"String",
"remove",
"(",
"String",
"group",
",",
"String",
"key",
")",
"{",
"group",
"=",
"StrUtil",
".",
"nullToEmpty",
"(",
"group",
")",
".",
"trim",
"(",
")",
";",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"final",
"LinkedHas... | 从指定分组中删除指定值
@param group 分组
@param key 键
@return 被删除的值,如果值不存在,返回null | [
"从指定分组中删除指定值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java#L126-L138 | train | Removes the specified key from the specified group. | [
30522,
2270,
5164,
6366,
1006,
5164,
2177,
1010,
5164,
3145,
1007,
1063,
2177,
1027,
2358,
22134,
4014,
1012,
19701,
3406,
6633,
13876,
2100,
1006,
2177,
1007,
1012,
12241,
1006,
1007,
1025,
4339,
7878,
1012,
5843,
1006,
1007,
1025,
3046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java | CronPattern.parseGroupPattern | private void parseGroupPattern(String groupPattern) {
List<String> patternList = StrUtil.split(groupPattern, '|');
for (String pattern : patternList) {
parseSinglePattern(pattern);
}
} | java | private void parseGroupPattern(String groupPattern) {
List<String> patternList = StrUtil.split(groupPattern, '|');
for (String pattern : patternList) {
parseSinglePattern(pattern);
}
} | [
"private",
"void",
"parseGroupPattern",
"(",
"String",
"groupPattern",
")",
"{",
"List",
"<",
"String",
">",
"patternList",
"=",
"StrUtil",
".",
"split",
"(",
"groupPattern",
",",
"'",
"'",
")",
";",
"for",
"(",
"String",
"pattern",
":",
"patternList",
")"... | 解析复合任务表达式
@param groupPattern 复合表达式 | [
"解析复合任务表达式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPattern.java#L222-L227 | train | Parses a group pattern. | [
30522,
2797,
11675,
11968,
3366,
17058,
4502,
12079,
2078,
1006,
5164,
2177,
4502,
12079,
2078,
1007,
1063,
2862,
1026,
5164,
1028,
5418,
9863,
1027,
2358,
22134,
4014,
1012,
3975,
1006,
2177,
30524,
1007,
1025,
1065,
1065,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.scale | public static Image scale(Image srcImg, int width, int height) {
return Img.from(srcImg).scale(width, height).getImg();
} | java | public static Image scale(Image srcImg, int width, int height) {
return Img.from(srcImg).scale(width, height).getImg();
} | [
"public",
"static",
"Image",
"scale",
"(",
"Image",
"srcImg",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"Img",
".",
"from",
"(",
"srcImg",
")",
".",
"scale",
"(",
"width",
",",
"height",
")",
".",
"getImg",
"(",
")",
";",
"}"
] | 缩放图像(按长宽缩放)<br>
注意:目标长宽与原图不成比例会变形
@param srcImg 源图像来源流
@param width 目标宽度
@param height 目标高度
@return {@link Image}
@since 3.1.0 | [
"缩放图像(按长宽缩放)<br",
">",
"注意:目标长宽与原图不成比例会变形"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L169-L171 | train | Scales an image. | [
30522,
2270,
10763,
3746,
4094,
1006,
3746,
5034,
6895,
24798,
1010,
20014,
9381,
1010,
20014,
4578,
1007,
1063,
2709,
10047,
2290,
1012,
2013,
1006,
5034,
6895,
24798,
1007,
1012,
4094,
1006,
9381,
1010,
4578,
1007,
1012,
2131,
5714,
2290,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | client/src/main/java/com/networknt/client/ssl/ClientX509ExtendedTrustManager.java | ClientX509ExtendedTrustManager.checkIdentity | private void checkIdentity(SSLSession session, X509Certificate cert) throws CertificateException {
if (session == null) {
throw new CertificateException("No handshake session");
}
if (EndpointIdentificationAlgorithm.HTTPS == identityAlg) {
String hostname = session.getPeerHost();
APINameChecker.verifyAndThrow(hostname, cert);
}
} | java | private void checkIdentity(SSLSession session, X509Certificate cert) throws CertificateException {
if (session == null) {
throw new CertificateException("No handshake session");
}
if (EndpointIdentificationAlgorithm.HTTPS == identityAlg) {
String hostname = session.getPeerHost();
APINameChecker.verifyAndThrow(hostname, cert);
}
} | [
"private",
"void",
"checkIdentity",
"(",
"SSLSession",
"session",
",",
"X509Certificate",
"cert",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"throw",
"new",
"CertificateException",
"(",
"\"No handshake session\"",
")",
... | check server identify against hostnames. This method is used to enhance X509TrustManager to provide standard identity check.
This method can be applied to both clients and servers.
@param session
@param cert
@throws CertificateException | [
"check",
"server",
"identify",
"against",
"hostnames",
".",
"This",
"method",
"is",
"used",
"to",
"enhance",
"X509TrustManager",
"to",
"provide",
"standard",
"identity",
"check",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/ClientX509ExtendedTrustManager.java#L175-L184 | train | Check the identity of the SSLSession and certificate. | [
30522,
2797,
11675,
4638,
5178,
16778,
3723,
1006,
7020,
4877,
7971,
3258,
5219,
1010,
1060,
12376,
2683,
17119,
3775,
8873,
16280,
8292,
5339,
1007,
11618,
8196,
10288,
24422,
1063,
2065,
1006,
5219,
1027,
1027,
19701,
1007,
1063,
5466,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java | ServletUtil.write | public static void write(HttpServletResponse response, InputStream in) {
write(response, in, IoUtil.DEFAULT_BUFFER_SIZE);
} | java | public static void write(HttpServletResponse response, InputStream in) {
write(response, in, IoUtil.DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"void",
"write",
"(",
"HttpServletResponse",
"response",
",",
"InputStream",
"in",
")",
"{",
"write",
"(",
"response",
",",
"in",
",",
"IoUtil",
".",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | 返回数据给客户端
@param response 响应对象{@link HttpServletResponse}
@param in 需要返回客户端的内容 | [
"返回数据给客户端"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L547-L549 | train | Write a raw XML document to the response. | [
30522,
2270,
10763,
11675,
4339,
1006,
16770,
2121,
2615,
7485,
6072,
26029,
3366,
3433,
1010,
20407,
25379,
1999,
1007,
1063,
4339,
1006,
3433,
1010,
1999,
1010,
22834,
21823,
2140,
1012,
12398,
1035,
17698,
1035,
2946,
1007,
1025,
1065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java | SystemPropertyUtil.getLong | public static long getLong(String key, long def) {
String value = get(key);
if (value == null) {
return def;
}
value = value.trim();
try {
return Long.parseLong(value);
} catch (Exception e) {
// Ignore
}
logger.warn(
"Unable to parse the long integer system property '{}':{} - using the default value: {}",
key, value, def
);
return def;
} | java | public static long getLong(String key, long def) {
String value = get(key);
if (value == null) {
return def;
}
value = value.trim();
try {
return Long.parseLong(value);
} catch (Exception e) {
// Ignore
}
logger.warn(
"Unable to parse the long integer system property '{}':{} - using the default value: {}",
key, value, def
);
return def;
} | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"def",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"def",
";",
"}",
"value",
"=",
"value",
".",
"tr... | Returns the value of the Java system property with the specified
{@code key}, while falling back to the specified default value if
the property access fails.
@return the property value.
{@code def} if there's no such property or if an access to the
specified property is not allowed. | [
"Returns",
"the",
"value",
"of",
"the",
"Java",
"system",
"property",
"with",
"the",
"specified",
"{",
"@code",
"key",
"}",
"while",
"falling",
"back",
"to",
"the",
"specified",
"default",
"value",
"if",
"the",
"property",
"access",
"fails",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java#L164-L183 | train | Gets the long system property. | [
30522,
2270,
10763,
2146,
2131,
10052,
1006,
5164,
3145,
1010,
2146,
13366,
1007,
1063,
5164,
3643,
1027,
2131,
1006,
3145,
1007,
1025,
2065,
1006,
3643,
1027,
1027,
19701,
1007,
1063,
2709,
13366,
1025,
1065,
3643,
1027,
3643,
1012,
12241,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/StateSerializerProvider.java | StateSerializerProvider.currentSchemaSerializer | @Nonnull
public final TypeSerializer<T> currentSchemaSerializer() {
if (registeredSerializer != null) {
checkState(
!isRegisteredWithIncompatibleSerializer,
"Unable to provide a serializer with the current schema, because the restored state was " +
"registered with a new serializer that has incompatible schema.");
return registeredSerializer;
}
// if we are not yet registered with a new serializer,
// we can just use the restore serializer to read / write the state.
return previousSchemaSerializer();
} | java | @Nonnull
public final TypeSerializer<T> currentSchemaSerializer() {
if (registeredSerializer != null) {
checkState(
!isRegisteredWithIncompatibleSerializer,
"Unable to provide a serializer with the current schema, because the restored state was " +
"registered with a new serializer that has incompatible schema.");
return registeredSerializer;
}
// if we are not yet registered with a new serializer,
// we can just use the restore serializer to read / write the state.
return previousSchemaSerializer();
} | [
"@",
"Nonnull",
"public",
"final",
"TypeSerializer",
"<",
"T",
">",
"currentSchemaSerializer",
"(",
")",
"{",
"if",
"(",
"registeredSerializer",
"!=",
"null",
")",
"{",
"checkState",
"(",
"!",
"isRegisteredWithIncompatibleSerializer",
",",
"\"Unable to provide a seria... | Gets the serializer that recognizes the current serialization schema of the state.
This is the serializer that should be used for regular state serialization and
deserialization after state has been restored.
<p>If this provider was created from a restored state's serializer snapshot, while a
new serializer (with a new schema) was not registered for the state (i.e., because
the state was never accessed after it was restored), then the schema of state remains
identical. Therefore, in this case, it is guaranteed that the serializer returned by
this method is the same as the one returned by {@link #previousSchemaSerializer()}.
<p>If this provider was created from a serializer instance, then this always returns the
that same serializer instance. If later on a snapshot of the previous serializer is supplied
via {@link #setPreviousSerializerSnapshotForRestoredState(TypeSerializerSnapshot)}, then
the initially supplied serializer instance will be checked for compatibility.
@return a serializer that reads and writes in the current schema of the state. | [
"Gets",
"the",
"serializer",
"that",
"recognizes",
"the",
"current",
"serialization",
"schema",
"of",
"the",
"state",
".",
"This",
"is",
"the",
"serializer",
"that",
"should",
"be",
"used",
"for",
"regular",
"state",
"serialization",
"and",
"deserialization",
"a... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/StateSerializerProvider.java#L151-L165 | train | Returns the serializer that is used to read the current schema. | [
30522,
1030,
2512,
11231,
3363,
2270,
2345,
4127,
11610,
28863,
1026,
1056,
1028,
14731,
5403,
9335,
11610,
28863,
1006,
1007,
1063,
2065,
1006,
5068,
8043,
4818,
17629,
999,
1027,
19701,
1007,
1063,
14148,
12259,
1006,
999,
2003,
2890,
240... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/avro/ParquetAvroWriters.java | ParquetAvroWriters.forReflectRecord | public static <T> ParquetWriterFactory<T> forReflectRecord(Class<T> type) {
final String schemaString = ReflectData.get().getSchema(type).toString();
final ParquetBuilder<T> builder = (out) -> createAvroParquetWriter(schemaString, ReflectData.get(), out);
return new ParquetWriterFactory<>(builder);
} | java | public static <T> ParquetWriterFactory<T> forReflectRecord(Class<T> type) {
final String schemaString = ReflectData.get().getSchema(type).toString();
final ParquetBuilder<T> builder = (out) -> createAvroParquetWriter(schemaString, ReflectData.get(), out);
return new ParquetWriterFactory<>(builder);
} | [
"public",
"static",
"<",
"T",
">",
"ParquetWriterFactory",
"<",
"T",
">",
"forReflectRecord",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"final",
"String",
"schemaString",
"=",
"ReflectData",
".",
"get",
"(",
")",
".",
"getSchema",
"(",
"type",
")",
... | Creates a ParquetWriterFactory for the given type. The Parquet writers will use Avro
to reflectively create a schema for the type and use that schema to write the columnar data.
@param type The class of the type to write. | [
"Creates",
"a",
"ParquetWriterFactory",
"for",
"the",
"given",
"type",
".",
"The",
"Parquet",
"writers",
"will",
"use",
"Avro",
"to",
"reflectively",
"create",
"a",
"schema",
"for",
"the",
"type",
"and",
"use",
"that",
"schema",
"to",
"write",
"the",
"column... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/avro/ParquetAvroWriters.java#L71-L75 | train | Creates a ParquetWriterFactory for a ReflectRecord. | [
30522,
2270,
10763,
1026,
1056,
1028,
11968,
12647,
15994,
21450,
1026,
1056,
1028,
2005,
2890,
21031,
6593,
2890,
27108,
2094,
1006,
2465,
1026,
1056,
1028,
2828,
1007,
1063,
2345,
5164,
8040,
28433,
3367,
4892,
1027,
8339,
2850,
2696,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java | RabbitProperties.determineAddresses | public String determineAddresses() {
if (CollectionUtils.isEmpty(this.parsedAddresses)) {
return this.host + ":" + this.port;
}
List<String> addressStrings = new ArrayList<>();
for (Address parsedAddress : this.parsedAddresses) {
addressStrings.add(parsedAddress.host + ":" + parsedAddress.port);
}
return StringUtils.collectionToCommaDelimitedString(addressStrings);
} | java | public String determineAddresses() {
if (CollectionUtils.isEmpty(this.parsedAddresses)) {
return this.host + ":" + this.port;
}
List<String> addressStrings = new ArrayList<>();
for (Address parsedAddress : this.parsedAddresses) {
addressStrings.add(parsedAddress.host + ":" + parsedAddress.port);
}
return StringUtils.collectionToCommaDelimitedString(addressStrings);
} | [
"public",
"String",
"determineAddresses",
"(",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isEmpty",
"(",
"this",
".",
"parsedAddresses",
")",
")",
"{",
"return",
"this",
".",
"host",
"+",
"\":\"",
"+",
"this",
".",
"port",
";",
"}",
"List",
"<",
"St... | Returns the comma-separated addresses or a single address ({@code host:port})
created from the configured host and port if no addresses have been set.
@return the addresses | [
"Returns",
"the",
"comma",
"-",
"separated",
"addresses",
"or",
"a",
"single",
"address",
"(",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java#L170-L179 | train | Determine the addresses of the connection. | [
30522,
2270,
5164,
5646,
4215,
16200,
11393,
2015,
1006,
1007,
1063,
2065,
1006,
3074,
21823,
4877,
1012,
2003,
6633,
13876,
2100,
1006,
2023,
1012,
11968,
6924,
4215,
16200,
11393,
2015,
1007,
1007,
1063,
2709,
2023,
1012,
3677,
1009,
1000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.sqrt | public static long sqrt(long x) {
long y = 0;
long b = (~Long.MAX_VALUE) >>> 1;
while (b > 0) {
if (x >= y + b) {
x -= y + b;
y >>= 1;
y += b;
} else {
y >>= 1;
}
b >>= 2;
}
return y;
} | java | public static long sqrt(long x) {
long y = 0;
long b = (~Long.MAX_VALUE) >>> 1;
while (b > 0) {
if (x >= y + b) {
x -= y + b;
y >>= 1;
y += b;
} else {
y >>= 1;
}
b >>= 2;
}
return y;
} | [
"public",
"static",
"long",
"sqrt",
"(",
"long",
"x",
")",
"{",
"long",
"y",
"=",
"0",
";",
"long",
"b",
"=",
"(",
"~",
"Long",
".",
"MAX_VALUE",
")",
">>>",
"1",
";",
"while",
"(",
"b",
">",
"0",
")",
"{",
"if",
"(",
"x",
">=",
"y",
"+",
... | 平方根算法<br>
推荐使用 {@link Math#sqrt(double)}
@param x 值
@return 平方根 | [
"平方根算法<br",
">",
"推荐使用",
"{",
"@link",
"Math#sqrt",
"(",
"double",
")",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1414-L1428 | train | Returns the sqrt value of x. | [
30522,
2270,
10763,
2146,
5490,
5339,
1006,
2146,
1060,
1007,
1063,
2146,
1061,
1027,
1014,
1025,
2146,
1038,
1027,
1006,
1066,
2146,
1012,
4098,
1035,
3643,
1007,
1028,
1028,
1028,
1015,
1025,
2096,
1006,
1038,
1028,
1014,
1007,
1063,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventArray.java | EpollEventArray.increase | void increase() {
// double the size
length <<= 1;
// There is no need to preserve what was in the memory before.
ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(length));
Buffer.free(memory);
memory = buffer;
memoryAddress = Buffer.memoryAddress(buffer);
} | java | void increase() {
// double the size
length <<= 1;
// There is no need to preserve what was in the memory before.
ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(length));
Buffer.free(memory);
memory = buffer;
memoryAddress = Buffer.memoryAddress(buffer);
} | [
"void",
"increase",
"(",
")",
"{",
"// double the size",
"length",
"<<=",
"1",
";",
"// There is no need to preserve what was in the memory before.",
"ByteBuffer",
"buffer",
"=",
"Buffer",
".",
"allocateDirectWithNativeOrder",
"(",
"calculateBufferCapacity",
"(",
"length",
... | Increase the storage of this {@link EpollEventArray}. | [
"Increase",
"the",
"storage",
"of",
"this",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventArray.java#L78-L86 | train | Increases the size of the array by one. | [
30522,
11675,
3623,
1006,
1007,
1063,
1013,
1013,
3313,
1996,
2946,
3091,
1026,
1026,
1027,
1015,
1025,
1013,
1013,
2045,
2003,
2053,
2342,
2000,
7969,
2054,
2001,
1999,
1996,
3638,
2077,
1012,
24880,
8569,
12494,
17698,
1027,
17698,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java | SpdySessionHandler.issueStreamError | private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) {
boolean fireChannelRead = !spdySession.isRemoteSideClosed(streamId);
ChannelPromise promise = ctx.newPromise();
removeStream(streamId, promise);
SpdyRstStreamFrame spdyRstStreamFrame = new DefaultSpdyRstStreamFrame(streamId, status);
ctx.writeAndFlush(spdyRstStreamFrame, promise);
if (fireChannelRead) {
ctx.fireChannelRead(spdyRstStreamFrame);
}
} | java | private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) {
boolean fireChannelRead = !spdySession.isRemoteSideClosed(streamId);
ChannelPromise promise = ctx.newPromise();
removeStream(streamId, promise);
SpdyRstStreamFrame spdyRstStreamFrame = new DefaultSpdyRstStreamFrame(streamId, status);
ctx.writeAndFlush(spdyRstStreamFrame, promise);
if (fireChannelRead) {
ctx.fireChannelRead(spdyRstStreamFrame);
}
} | [
"private",
"void",
"issueStreamError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"int",
"streamId",
",",
"SpdyStreamStatus",
"status",
")",
"{",
"boolean",
"fireChannelRead",
"=",
"!",
"spdySession",
".",
"isRemoteSideClosed",
"(",
"streamId",
")",
";",
"ChannelProm... | /*
SPDY Stream Error Handling:
Upon a stream error, the endpoint must send a RST_STREAM frame which contains
the Stream-ID for the stream where the error occurred and the error getStatus which
caused the error.
After sending the RST_STREAM, the stream is closed to the sending endpoint.
Note: this is only called by the worker thread | [
"/",
"*",
"SPDY",
"Stream",
"Error",
"Handling",
":"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java#L677-L687 | train | Issue a stream error. | [
30522,
2797,
11675,
3314,
25379,
2121,
29165,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
20014,
5460,
3593,
1010,
23772,
27268,
16416,
5244,
29336,
2271,
3570,
1007,
1063,
22017,
20898,
2543,
26058,
16416,
2094,
1027,
999,
23772... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponent0 | private int addComponent0(boolean increaseWriterIndex, int cIndex, ByteBuf buffer) {
assert buffer != null;
boolean wasAdded = false;
try {
checkComponentIndex(cIndex);
// No need to consolidate - just add a component to the list.
Component c = newComponent(buffer, 0);
int readableBytes = c.length();
addComp(cIndex, c);
wasAdded = true;
if (readableBytes > 0 && cIndex < componentCount - 1) {
updateComponentOffsets(cIndex);
} else if (cIndex > 0) {
c.reposition(components[cIndex - 1].endOffset);
}
if (increaseWriterIndex) {
writerIndex += readableBytes;
}
return cIndex;
} finally {
if (!wasAdded) {
buffer.release();
}
}
} | java | private int addComponent0(boolean increaseWriterIndex, int cIndex, ByteBuf buffer) {
assert buffer != null;
boolean wasAdded = false;
try {
checkComponentIndex(cIndex);
// No need to consolidate - just add a component to the list.
Component c = newComponent(buffer, 0);
int readableBytes = c.length();
addComp(cIndex, c);
wasAdded = true;
if (readableBytes > 0 && cIndex < componentCount - 1) {
updateComponentOffsets(cIndex);
} else if (cIndex > 0) {
c.reposition(components[cIndex - 1].endOffset);
}
if (increaseWriterIndex) {
writerIndex += readableBytes;
}
return cIndex;
} finally {
if (!wasAdded) {
buffer.release();
}
}
} | [
"private",
"int",
"addComponent0",
"(",
"boolean",
"increaseWriterIndex",
",",
"int",
"cIndex",
",",
"ByteBuf",
"buffer",
")",
"{",
"assert",
"buffer",
"!=",
"null",
";",
"boolean",
"wasAdded",
"=",
"false",
";",
"try",
"{",
"checkComponentIndex",
"(",
"cIndex... | Precondition is that {@code buffer != null}. | [
"Precondition",
"is",
"that",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L273-L299 | train | Add a component to the list. | [
30522,
2797,
20014,
5587,
9006,
29513,
3372,
2692,
1006,
22017,
20898,
3623,
15994,
22254,
10288,
1010,
20014,
25022,
13629,
2595,
1010,
24880,
8569,
2546,
17698,
1007,
1063,
20865,
17698,
999,
1027,
19701,
1025,
22017,
20898,
2001,
4215,
573... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java | RollingSink.closeCurrentPartFile | private void closeCurrentPartFile() throws Exception {
if (isWriterOpen) {
writer.close();
isWriterOpen = false;
}
if (currentPartPath != null) {
Path inProgressPath = getInProgressPathFor(currentPartPath);
Path pendingPath = getPendingPathFor(currentPartPath);
fs.rename(inProgressPath, pendingPath);
LOG.debug("Moving in-progress bucket {} to pending file {}", inProgressPath, pendingPath);
this.bucketState.pendingFiles.add(currentPartPath.toString());
}
} | java | private void closeCurrentPartFile() throws Exception {
if (isWriterOpen) {
writer.close();
isWriterOpen = false;
}
if (currentPartPath != null) {
Path inProgressPath = getInProgressPathFor(currentPartPath);
Path pendingPath = getPendingPathFor(currentPartPath);
fs.rename(inProgressPath, pendingPath);
LOG.debug("Moving in-progress bucket {} to pending file {}", inProgressPath, pendingPath);
this.bucketState.pendingFiles.add(currentPartPath.toString());
}
} | [
"private",
"void",
"closeCurrentPartFile",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isWriterOpen",
")",
"{",
"writer",
".",
"close",
"(",
")",
";",
"isWriterOpen",
"=",
"false",
";",
"}",
"if",
"(",
"currentPartPath",
"!=",
"null",
")",
"{",
"Pa... | Closes the current part file.
<p>This moves the current in-progress part file to a pending file and adds it to the list
of pending files in our bucket state. | [
"Closes",
"the",
"current",
"part",
"file",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java#L503-L516 | train | Close the current part file. | [
30522,
2797,
11675,
2485,
10841,
14343,
3372,
19362,
24475,
9463,
1006,
1007,
11618,
6453,
1063,
2065,
1006,
2003,
15994,
26915,
1007,
1063,
3213,
1012,
2485,
1006,
1007,
1025,
2003,
15994,
26915,
1027,
6270,
1025,
1065,
2065,
1006,
2783,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/wrapper/HadoopOutputCollector.java | HadoopOutputCollector.collect | @Override
public void collect(final KEY key, final VALUE val) throws IOException {
this.outTuple.f0 = key;
this.outTuple.f1 = val;
this.flinkCollector.collect(outTuple);
} | java | @Override
public void collect(final KEY key, final VALUE val) throws IOException {
this.outTuple.f0 = key;
this.outTuple.f1 = val;
this.flinkCollector.collect(outTuple);
} | [
"@",
"Override",
"public",
"void",
"collect",
"(",
"final",
"KEY",
"key",
",",
"final",
"VALUE",
"val",
")",
"throws",
"IOException",
"{",
"this",
".",
"outTuple",
".",
"f0",
"=",
"key",
";",
"this",
".",
"outTuple",
".",
"f1",
"=",
"val",
";",
"this... | Use the wrapped Flink collector to collect a key-value pair for Flink.
@param key the key to collect
@param val the value to collect
@throws IOException unexpected of key or value in key-value pair. | [
"Use",
"the",
"wrapped",
"Flink",
"collector",
"to",
"collect",
"a",
"key",
"-",
"value",
"pair",
"for",
"Flink",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/wrapper/HadoopOutputCollector.java#L54-L59 | train | Collect the key and value pair into the output stream. | [
30522,
1030,
2058,
15637,
2270,
11675,
8145,
1006,
2345,
3145,
3145,
1010,
2345,
3643,
11748,
1007,
11618,
22834,
10288,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.setDestinationProvider | public WebServiceTemplateBuilder setDestinationProvider(
DestinationProvider destinationProvider) {
Assert.notNull(destinationProvider, "DestinationProvider must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors, this.internalCustomizers, this.customizers,
this.messageSenders, this.marshaller, this.unmarshaller,
destinationProvider, this.transformerFactoryClass, this.messageFactory);
} | java | public WebServiceTemplateBuilder setDestinationProvider(
DestinationProvider destinationProvider) {
Assert.notNull(destinationProvider, "DestinationProvider must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors, this.internalCustomizers, this.customizers,
this.messageSenders, this.marshaller, this.unmarshaller,
destinationProvider, this.transformerFactoryClass, this.messageFactory);
} | [
"public",
"WebServiceTemplateBuilder",
"setDestinationProvider",
"(",
"DestinationProvider",
"destinationProvider",
")",
"{",
"Assert",
".",
"notNull",
"(",
"destinationProvider",
",",
"\"DestinationProvider must not be null\"",
")",
";",
"return",
"new",
"WebServiceTemplateBui... | Set the {@link DestinationProvider} to use. Typically, either this property is set,
or {@link #setDefaultUri(String)}, but not both.
@param destinationProvider the destination provider to be used on operations that
do not have a URI parameter.
@return a new builder instance.
@see WebServiceTemplate#setDestinationProvider(DestinationProvider) | [
"Set",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L457-L464 | train | Sets the destination provider. | [
30522,
2270,
4773,
8043,
7903,
12870,
8737,
13806,
8569,
23891,
2099,
2275,
6155,
13770,
3508,
21572,
17258,
2121,
1006,
7688,
21572,
17258,
2121,
7688,
21572,
17258,
2121,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
7688,
21572,
17258,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/RouteResult.java | RouteResult.queryParam | public String queryParam(String name) {
List<String> values = queryParams.get(name);
return (values == null) ? null : values.get(0);
} | java | public String queryParam(String name) {
List<String> values = queryParams.get(name);
return (values == null) ? null : values.get(0);
} | [
"public",
"String",
"queryParam",
"(",
"String",
"name",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"queryParams",
".",
"get",
"(",
"name",
")",
";",
"return",
"(",
"values",
"==",
"null",
")",
"?",
"null",
":",
"values",
".",
"get",
"(",
... | Extracts the first matching param in {@code queryParams}.
@return {@code null} if there's no match | [
"Extracts",
"the",
"first",
"matching",
"param",
"in",
"{",
"@code",
"queryParams",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/RouteResult.java#L100-L103 | train | Get the value of the query parameter with the given name. | [
30522,
2270,
5164,
23032,
28689,
2213,
1006,
5164,
2171,
1007,
1063,
2862,
1026,
5164,
1028,
5300,
1027,
23032,
28689,
5244,
1012,
2131,
1006,
2171,
1007,
1025,
2709,
1006,
5300,
1027,
1027,
19701,
1007,
1029,
19701,
1024,
5300,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java | ConnectTableDescriptor.registerTableSource | @Override
public void registerTableSource(String name) {
Preconditions.checkNotNull(name);
TableSource<?> tableSource = TableFactoryUtil.findAndCreateTableSource(this);
tableEnv.registerTableSource(name, tableSource);
} | java | @Override
public void registerTableSource(String name) {
Preconditions.checkNotNull(name);
TableSource<?> tableSource = TableFactoryUtil.findAndCreateTableSource(this);
tableEnv.registerTableSource(name, tableSource);
} | [
"@",
"Override",
"public",
"void",
"registerTableSource",
"(",
"String",
"name",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"name",
")",
";",
"TableSource",
"<",
"?",
">",
"tableSource",
"=",
"TableFactoryUtil",
".",
"findAndCreateTableSource",
"(",
"t... | Searches for the specified table source, configures it accordingly, and registers it as
a table under the given name.
@param name table name to be registered in the table environment | [
"Searches",
"for",
"the",
"specified",
"table",
"source",
"configures",
"it",
"accordingly",
"and",
"registers",
"it",
"as",
"a",
"table",
"under",
"the",
"given",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java#L57-L62 | train | Registers a table source. | [
30522,
1030,
2058,
15637,
2270,
11675,
4236,
10880,
6499,
3126,
3401,
1006,
5164,
2171,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
2171,
1007,
1025,
7251,
8162,
3401,
1026,
1029,
1028,
7251,
8162,
3401,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.sub | public static <T> List<T> sub(Collection<T> collection, int start, int end) {
return sub(collection, start, end, 1);
} | java | public static <T> List<T> sub(Collection<T> collection, int start, int end) {
return sub(collection, start, end, 1);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"sub",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"sub",
"(",
"collection",
",",
"start",
",",
"end",
",",
"1",
")",
";",
... | 截取集合的部分
@param <T> 集合元素类型
@param collection 被截取的数组
@param start 开始位置(包含)
@param end 结束位置(不包含)
@return 截取后的数组,当开始位置超过最大时,返回null | [
"截取集合的部分"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L876-L878 | train | Returns a list of objects starting from the start and ending from the given collection. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
4942,
1006,
3074,
1026,
1056,
1028,
3074,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
2709,
4942,
1006,
3074,
1010,
2707,
1010,
2203,
1010,
1015,
1007,
1025,
1065,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisProducer.java | FlinkKinesisProducer.flushSync | private void flushSync() throws Exception {
while (producer.getOutstandingRecordsCount() > 0) {
producer.flush();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
LOG.warn("Flushing was interrupted.");
break;
}
}
} | java | private void flushSync() throws Exception {
while (producer.getOutstandingRecordsCount() > 0) {
producer.flush();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
LOG.warn("Flushing was interrupted.");
break;
}
}
} | [
"private",
"void",
"flushSync",
"(",
")",
"throws",
"Exception",
"{",
"while",
"(",
"producer",
".",
"getOutstandingRecordsCount",
"(",
")",
">",
"0",
")",
"{",
"producer",
".",
"flush",
"(",
")",
";",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"500",
")... | A reimplementation of {@link KinesisProducer#flushSync()}.
This implementation releases the block on flushing if an interruption occurred. | [
"A",
"reimplementation",
"of",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisProducer.java#L402-L412 | train | Flushes the underlying output stream. | [
30522,
2797,
11675,
13862,
6508,
12273,
1006,
1007,
11618,
6453,
1063,
2096,
1006,
3135,
1012,
2131,
12166,
5794,
4667,
2890,
27108,
5104,
3597,
16671,
1006,
1007,
1028,
1014,
1007,
1063,
3135,
1012,
13862,
1006,
1007,
1025,
3046,
1063,
116... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/sharding/dml/ShardingOrPredicateFiller.java | ShardingOrPredicateFiller.buildCondition | public OrCondition buildCondition(final OrPredicateSegment sqlSegment, final SQLStatement sqlStatement) {
OrCondition result = createOrCondition(sqlSegment, sqlStatement);
createEncryptOrPredicateFiller().fill(sqlSegment, sqlStatement);
return result;
} | java | public OrCondition buildCondition(final OrPredicateSegment sqlSegment, final SQLStatement sqlStatement) {
OrCondition result = createOrCondition(sqlSegment, sqlStatement);
createEncryptOrPredicateFiller().fill(sqlSegment, sqlStatement);
return result;
} | [
"public",
"OrCondition",
"buildCondition",
"(",
"final",
"OrPredicateSegment",
"sqlSegment",
",",
"final",
"SQLStatement",
"sqlStatement",
")",
"{",
"OrCondition",
"result",
"=",
"createOrCondition",
"(",
"sqlSegment",
",",
"sqlStatement",
")",
";",
"createEncryptOrPred... | Build condition.
@param sqlSegment SQL segment
@param sqlStatement SQL statement
@return or condition | [
"Build",
"condition",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/sharding/dml/ShardingOrPredicateFiller.java#L66-L70 | train | Build condition. | [
30522,
2270,
2030,
8663,
20562,
3857,
8663,
20562,
1006,
2345,
2030,
28139,
16467,
3366,
21693,
4765,
29296,
3366,
21693,
4765,
1010,
2345,
29296,
9153,
18532,
4765,
29296,
9153,
18532,
4765,
1007,
1063,
2030,
8663,
20562,
2765,
1027,
3443,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/plandump/PlanJSONDumpGenerator.java | PlanJSONDumpGenerator.compilePlanToJSON | private void compilePlanToJSON(List<DumpableNode<?>> nodes, PrintWriter writer) {
// initialization to assign node ids
this.nodeIds = new HashMap<DumpableNode<?>, Integer>();
this.nodeCnt = 0;
// JSON header
writer.print("{\n\t\"nodes\": [\n\n");
// Generate JSON for plan
for (int i = 0; i < nodes.size(); i++) {
visit(nodes.get(i), writer, i == 0);
}
// JSON Footer
writer.println("\n\t]\n}");
} | java | private void compilePlanToJSON(List<DumpableNode<?>> nodes, PrintWriter writer) {
// initialization to assign node ids
this.nodeIds = new HashMap<DumpableNode<?>, Integer>();
this.nodeCnt = 0;
// JSON header
writer.print("{\n\t\"nodes\": [\n\n");
// Generate JSON for plan
for (int i = 0; i < nodes.size(); i++) {
visit(nodes.get(i), writer, i == 0);
}
// JSON Footer
writer.println("\n\t]\n}");
} | [
"private",
"void",
"compilePlanToJSON",
"(",
"List",
"<",
"DumpableNode",
"<",
"?",
">",
">",
"nodes",
",",
"PrintWriter",
"writer",
")",
"{",
"// initialization to assign node ids",
"this",
".",
"nodeIds",
"=",
"new",
"HashMap",
"<",
"DumpableNode",
"<",
"?",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plandump/PlanJSONDumpGenerator.java#L131-L146 | train | Compile the plan to JSON. | [
30522,
2797,
11675,
4012,
22090,
24759,
21634,
22578,
2239,
1006,
2862,
1026,
15653,
3085,
3630,
3207,
1026,
1029,
1028,
1028,
14164,
1010,
6140,
15994,
3213,
1007,
1063,
1013,
1013,
3988,
3989,
2000,
23911,
13045,
8909,
2015,
2023,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.keyManager | public SslContextBuilder keyManager(InputStream keyCertChainInputStream, InputStream keyInputStream,
String keyPassword) {
X509Certificate[] keyCertChain;
PrivateKey key;
try {
keyCertChain = SslContext.toX509Certificates(keyCertChainInputStream);
} catch (Exception e) {
throw new IllegalArgumentException("Input stream not contain valid certificates.", e);
}
try {
key = SslContext.toPrivateKey(keyInputStream, keyPassword);
} catch (Exception e) {
throw new IllegalArgumentException("Input stream does not contain valid private key.", e);
}
return keyManager(key, keyPassword, keyCertChain);
} | java | public SslContextBuilder keyManager(InputStream keyCertChainInputStream, InputStream keyInputStream,
String keyPassword) {
X509Certificate[] keyCertChain;
PrivateKey key;
try {
keyCertChain = SslContext.toX509Certificates(keyCertChainInputStream);
} catch (Exception e) {
throw new IllegalArgumentException("Input stream not contain valid certificates.", e);
}
try {
key = SslContext.toPrivateKey(keyInputStream, keyPassword);
} catch (Exception e) {
throw new IllegalArgumentException("Input stream does not contain valid private key.", e);
}
return keyManager(key, keyPassword, keyCertChain);
} | [
"public",
"SslContextBuilder",
"keyManager",
"(",
"InputStream",
"keyCertChainInputStream",
",",
"InputStream",
"keyInputStream",
",",
"String",
"keyPassword",
")",
"{",
"X509Certificate",
"[",
"]",
"keyCertChain",
";",
"PrivateKey",
"key",
";",
"try",
"{",
"keyCertCh... | Identifying certificate for this host. {@code keyCertChainInputStream} and {@code keyInputStream} may
be {@code null} for client contexts, which disables mutual authentication.
@param keyCertChainInputStream an input stream for an X.509 certificate chain in PEM format
@param keyInputStream an input stream for a PKCS#8 private key in PEM format
@param keyPassword the password of the {@code keyInputStream}, or {@code null} if it's not
password-protected | [
"Identifying",
"certificate",
"for",
"this",
"host",
".",
"{",
"@code",
"keyCertChainInputStream",
"}",
"and",
"{",
"@code",
"keyInputStream",
"}",
"may",
"be",
"{",
"@code",
"null",
"}",
"for",
"client",
"contexts",
"which",
"disables",
"mutual",
"authenticatio... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L284-L299 | train | Key manager method. | [
30522,
2270,
7020,
22499,
10111,
18413,
8569,
23891,
2099,
3145,
24805,
4590,
1006,
20407,
25379,
3145,
17119,
10649,
8113,
2378,
18780,
21422,
1010,
20407,
25379,
3145,
2378,
18780,
21422,
1010,
5164,
3145,
15194,
18351,
1007,
1063,
1060,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java | SortUtil.maxNormalizedKey | public static void maxNormalizedKey(MemorySegment target, int offset, int numBytes) {
//write max value.
for (int i = 0; i < numBytes; i++) {
target.put(offset + i, (byte) -1);
}
} | java | public static void maxNormalizedKey(MemorySegment target, int offset, int numBytes) {
//write max value.
for (int i = 0; i < numBytes; i++) {
target.put(offset + i, (byte) -1);
}
} | [
"public",
"static",
"void",
"maxNormalizedKey",
"(",
"MemorySegment",
"target",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"//write max value.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numBytes",
";",
"i",
"++",
")",
"{",
"target",... | Max unsigned byte is -1. | [
"Max",
"unsigned",
"byte",
"is",
"-",
"1",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/SortUtil.java#L49-L54 | train | Write max normalized key to memory segment. | [
30522,
2270,
10763,
11675,
4098,
12131,
9067,
3550,
14839,
1006,
3638,
3366,
21693,
4765,
4539,
1010,
20014,
16396,
1010,
20014,
15903,
17250,
2015,
1007,
1063,
1013,
1013,
4339,
4098,
3643,
1012,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateTime.java | DateTime.offset | public DateTime offset(DateField datePart, int offset) {
final Calendar cal = toCalendar();
cal.add(datePart.getValue(), offset);
DateTime dt = mutable ? this : ObjectUtil.clone(this);
return dt.setTimeInternal(cal.getTimeInMillis());
} | java | public DateTime offset(DateField datePart, int offset) {
final Calendar cal = toCalendar();
cal.add(datePart.getValue(), offset);
DateTime dt = mutable ? this : ObjectUtil.clone(this);
return dt.setTimeInternal(cal.getTimeInMillis());
} | [
"public",
"DateTime",
"offset",
"(",
"DateField",
"datePart",
",",
"int",
"offset",
")",
"{",
"final",
"Calendar",
"cal",
"=",
"toCalendar",
"(",
")",
";",
"cal",
".",
"add",
"(",
"datePart",
".",
"getValue",
"(",
")",
",",
"offset",
")",
";",
"DateTim... | 调整日期和时间<br>
如果此对象为可变对象,返回自身,否则返回新对象,设置是否可变对象见{@link #setMutable(boolean)}
@param datePart 调整的部分 {@link DateField}
@param offset 偏移量,正数为向后偏移,负数为向前偏移
@return 如果此对象为可变对象,返回自身,否则返回新对象 | [
"调整日期和时间<br",
">",
"如果此对象为可变对象,返回自身,否则返回新对象,设置是否可变对象见",
"{",
"@link",
"#setMutable",
"(",
"boolean",
")",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateTime.java#L194-L200 | train | Add the specified offset to this date. | [
30522,
2270,
3058,
7292,
16396,
1006,
3058,
3790,
3058,
19362,
2102,
1010,
20014,
16396,
1007,
1063,
2345,
8094,
10250,
1027,
2000,
9289,
10497,
2906,
1006,
1007,
1025,
10250,
1012,
5587,
1006,
3058,
19362,
2102,
1012,
2131,
10175,
5657,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java | ConditionMessage.andCondition | public Builder andCondition(Class<? extends Annotation> condition,
Object... details) {
Assert.notNull(condition, "Condition must not be null");
return andCondition("@" + ClassUtils.getShortName(condition), details);
} | java | public Builder andCondition(Class<? extends Annotation> condition,
Object... details) {
Assert.notNull(condition, "Condition must not be null");
return andCondition("@" + ClassUtils.getShortName(condition), details);
} | [
"public",
"Builder",
"andCondition",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"condition",
",",
"Object",
"...",
"details",
")",
"{",
"Assert",
".",
"notNull",
"(",
"condition",
",",
"\"Condition must not be null\"",
")",
";",
"return",
"andConditio... | Return a new builder to construct a new {@link ConditionMessage} based on the
instance and a new condition outcome.
@param condition the condition
@param details details of the condition
@return a {@link Builder} builder
@see #andCondition(String, Object...)
@see #forCondition(Class, Object...) | [
"Return",
"a",
"new",
"builder",
"to",
"construct",
"a",
"new",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java#L109-L113 | train | Add an and condition to the result. | [
30522,
2270,
12508,
1998,
8663,
20562,
1006,
2465,
1026,
1029,
8908,
5754,
17287,
3508,
1028,
4650,
1010,
4874,
1012,
1012,
1012,
4751,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
4650,
1010,
1000,
4650,
2442,
2025,
2022,
19701,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/internal/PlatformDependent.java | PlatformDependent.hashCodeAsciiSafe | static int hashCodeAsciiSafe(byte[] bytes, int startPos, int length) {
int hash = HASH_CODE_ASCII_SEED;
final int remainingBytes = length & 7;
final int end = startPos + remainingBytes;
for (int i = startPos - 8 + length; i >= end; i -= 8) {
hash = PlatformDependent0.hashCodeAsciiCompute(getLongSafe(bytes, i), hash);
}
switch(remainingBytes) {
case 7:
return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)))
* HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3));
case 6:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2));
case 5:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1));
case 4:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos));
case 3:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1));
case 2:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos));
case 1:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]);
default:
return hash;
}
} | java | static int hashCodeAsciiSafe(byte[] bytes, int startPos, int length) {
int hash = HASH_CODE_ASCII_SEED;
final int remainingBytes = length & 7;
final int end = startPos + remainingBytes;
for (int i = startPos - 8 + length; i >= end; i -= 8) {
hash = PlatformDependent0.hashCodeAsciiCompute(getLongSafe(bytes, i), hash);
}
switch(remainingBytes) {
case 7:
return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)))
* HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3));
case 6:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2));
case 5:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1));
case 4:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos));
case 3:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1));
case 2:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos));
case 1:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]);
default:
return hash;
}
} | [
"static",
"int",
"hashCodeAsciiSafe",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
")",
"{",
"int",
"hash",
"=",
"HASH_CODE_ASCII_SEED",
";",
"final",
"int",
"remainingBytes",
"=",
"length",
"&",
"7",
";",
"final",
"int",
... | Package private for testing purposes only! | [
"Package",
"private",
"for",
"testing",
"purposes",
"only!"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent.java#L1237-L1267 | train | This method is a utility method that is used to compute the hash code of a byte array of bytes in ASCII. | [
30522,
10763,
20014,
23325,
16044,
3022,
6895,
14268,
7959,
1006,
24880,
1031,
1033,
27507,
1010,
20014,
2707,
6873,
2015,
1010,
20014,
3091,
1007,
1063,
20014,
23325,
1027,
23325,
1035,
3642,
1035,
2004,
6895,
2072,
1035,
6534,
1025,
2345,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.