repo stringclasses 11
values | path stringlengths 41 214 | func_name stringlengths 7 82 | original_string stringlengths 77 11.9k | language stringclasses 1
value | code stringlengths 77 11.9k | code_tokens listlengths 22 1.57k | docstring stringlengths 2 2.27k | docstring_tokens listlengths 1 352 | sha stringclasses 11
values | url stringlengths 129 319 | partition stringclasses 1
value | summary stringlengths 7 191 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/FromElementsFunction.java | FromElementsFunction.checkCollection | public static <OUT> void checkCollection(Collection<OUT> elements, Class<OUT> viewedAs) {
for (OUT elem : elements) {
if (elem == null) {
throw new IllegalArgumentException("The collection contains a null element");
}
if (!viewedAs.isAssignableFrom(elem.getClass())) {
throw new IllegalArgumentExcept... | java | public static <OUT> void checkCollection(Collection<OUT> elements, Class<OUT> viewedAs) {
for (OUT elem : elements) {
if (elem == null) {
throw new IllegalArgumentException("The collection contains a null element");
}
if (!viewedAs.isAssignableFrom(elem.getClass())) {
throw new IllegalArgumentExcept... | [
"public",
"static",
"<",
"OUT",
">",
"void",
"checkCollection",
"(",
"Collection",
"<",
"OUT",
">",
"elements",
",",
"Class",
"<",
"OUT",
">",
"viewedAs",
")",
"{",
"for",
"(",
"OUT",
"elem",
":",
"elements",
")",
"{",
"if",
"(",
"elem",
"==",
"null"... | Verifies that all elements in the collection are non-null, and are of the given class, or
a subclass thereof.
@param elements The collection to check.
@param viewedAs The class to which the elements must be assignable to.
@param <OUT> The generic type of the collection to be checked. | [
"Verifies",
"that",
"all",
"elements",
"in",
"the",
"collection",
"are",
"non",
"-",
"null",
"and",
"are",
"of",
"the",
"given",
"class",
"or",
"a",
"subclass",
"thereof",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/FromElementsFunction.java#L220-L231 | train | Checks that the elements in the collection are all subclasses of the given class. | [
30522,
2270,
10763,
1026,
2041,
1028,
11675,
4638,
26895,
18491,
1006,
3074,
1026,
2041,
1028,
3787,
1010,
2465,
1026,
2041,
1028,
7021,
3022,
1007,
1063,
2005,
1006,
2041,
3449,
6633,
1024,
3787,
1007,
1063,
2065,
1006,
3449,
6633,
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... |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getFinalParameters | public Set<String> getFinalParameters() {
Set<String> setFinalParams = Collections.newSetFromMap(
new ConcurrentHashMap<String, Boolean>());
setFinalParams.addAll(finalParameters);
return setFinalParams;
} | java | public Set<String> getFinalParameters() {
Set<String> setFinalParams = Collections.newSetFromMap(
new ConcurrentHashMap<String, Boolean>());
setFinalParams.addAll(finalParameters);
return setFinalParams;
} | [
"public",
"Set",
"<",
"String",
">",
"getFinalParameters",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"setFinalParams",
"=",
"Collections",
".",
"newSetFromMap",
"(",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
"Boolean",
">",
"(",
")",
")",
";",
"setFi... | Get the set of parameters marked final.
@return final parameter set. | [
"Get",
"the",
"set",
"of",
"parameters",
"marked",
"final",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2669-L2674 | train | Returns the final parameters. | [
30522,
2270,
2275,
1026,
5164,
1028,
2131,
16294,
2389,
28689,
22828,
2015,
1006,
1007,
1063,
2275,
1026,
5164,
1028,
2275,
16294,
2389,
28689,
5244,
1027,
6407,
1012,
2739,
3388,
19699,
5358,
2863,
2361,
1006,
2047,
16483,
14949,
22444,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/io/file/Tailer.java | Tailer.start | public void start(boolean async) {
// 初始读取
try {
this.readTail();
} catch (IOException e) {
throw new IORuntimeException(e);
}
final LineReadWatcher lineReadWatcher = new LineReadWatcher(this.randomAccessFile, this.charset, this.lineHandler);
final ScheduledFuture<?> scheduledFuture = this.e... | java | public void start(boolean async) {
// 初始读取
try {
this.readTail();
} catch (IOException e) {
throw new IORuntimeException(e);
}
final LineReadWatcher lineReadWatcher = new LineReadWatcher(this.randomAccessFile, this.charset, this.lineHandler);
final ScheduledFuture<?> scheduledFuture = this.e... | [
"public",
"void",
"start",
"(",
"boolean",
"async",
")",
"{",
"// 初始读取\r",
"try",
"{",
"this",
".",
"readTail",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"IORuntimeException",
"(",
"e",
")",
";",
"}",
"final",
"L... | 开始监听
@param async 是否异步执行 | [
"开始监听"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/Tailer.java#L107-L131 | train | Start the read thread. | [
30522,
2270,
11675,
2707,
1006,
22017,
20898,
2004,
6038,
2278,
1007,
1063,
1013,
1013,
100,
100,
100,
100,
3046,
1063,
2023,
1012,
3191,
14162,
1006,
1007,
1025,
1065,
4608,
1006,
22834,
10288,
24422,
1041,
1007,
1063,
5466,
2047,
22834,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/ExecutorUtils.java | ExecutorUtils.gracefulShutdown | public static void gracefulShutdown(long timeout, TimeUnit unit, ExecutorService... executorServices) {
for (ExecutorService executorService: executorServices) {
executorService.shutdown();
}
boolean wasInterrupted = false;
final long endTime = unit.toMillis(timeout) + System.currentTimeMillis();
long tim... | java | public static void gracefulShutdown(long timeout, TimeUnit unit, ExecutorService... executorServices) {
for (ExecutorService executorService: executorServices) {
executorService.shutdown();
}
boolean wasInterrupted = false;
final long endTime = unit.toMillis(timeout) + System.currentTimeMillis();
long tim... | [
"public",
"static",
"void",
"gracefulShutdown",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
",",
"ExecutorService",
"...",
"executorServices",
")",
"{",
"for",
"(",
"ExecutorService",
"executorService",
":",
"executorServices",
")",
"{",
"executorService",
".",... | Gracefully shutdown the given {@link ExecutorService}. The call waits the given timeout that
all ExecutorServices terminate. If the ExecutorServices do not terminate in this time,
they will be shut down hard.
@param timeout to wait for the termination of all ExecutorServices
@param unit of the timeout
@param executorS... | [
"Gracefully",
"shutdown",
"the",
"given",
"{",
"@link",
"ExecutorService",
"}",
".",
"The",
"call",
"waits",
"the",
"given",
"timeout",
"that",
"all",
"ExecutorServices",
"terminate",
".",
"If",
"the",
"ExecutorServices",
"do",
"not",
"terminate",
"in",
"this",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ExecutorUtils.java#L44-L77 | train | Gracefully shuts down all the ExecutorServices in the given timeout. | [
30522,
2270,
10763,
11675,
19415,
14235,
2102,
7698,
1006,
2146,
2051,
5833,
1010,
2051,
19496,
2102,
3131,
1010,
4654,
8586,
16161,
22573,
2099,
7903,
2063,
1012,
1012,
1012,
4654,
8586,
16161,
22573,
2099,
7903,
2229,
1007,
1063,
2005,
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... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.setHandshakeFailure | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause, boolean closeInbound,
boolean notify, boolean alwaysFlushAndClose) {
try {
// Release all resources such as internal buffers that SSLEngine
// is managing.
outbou... | java | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause, boolean closeInbound,
boolean notify, boolean alwaysFlushAndClose) {
try {
// Release all resources such as internal buffers that SSLEngine
// is managing.
outbou... | [
"private",
"void",
"setHandshakeFailure",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
",",
"boolean",
"closeInbound",
",",
"boolean",
"notify",
",",
"boolean",
"alwaysFlushAndClose",
")",
"{",
"try",
"{",
"// Release all resources such as internal buff... | Notify all the handshake futures about the failure during the handshake. | [
"Notify",
"all",
"the",
"handshake",
"futures",
"about",
"the",
"failure",
"during",
"the",
"handshake",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L1766-L1798 | train | Set the handshake failure flag. | [
30522,
2797,
11675,
6662,
29560,
20459,
12879,
12502,
5397,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5466,
3085,
3426,
1010,
22017,
20898,
2485,
2378,
15494,
1010,
22017,
20898,
2025,
8757,
1010,
22017,
20898,
2467,
10258,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/hashtable/BinaryHashPartition.java | BinaryHashPartition.insertIntoBuildBuffer | final int insertIntoBuildBuffer(BinaryRow record) throws IOException {
this.buildSideRecordCounter++;
if (isInMemory()) {
final long pointer = this.buildSideWriteBuffer.getCurrentPointer();
int skip = this.buildSideSerializer.serializeToPages(record, this.buildSideWriteBuffer);
if (isInMemory()) {
lon... | java | final int insertIntoBuildBuffer(BinaryRow record) throws IOException {
this.buildSideRecordCounter++;
if (isInMemory()) {
final long pointer = this.buildSideWriteBuffer.getCurrentPointer();
int skip = this.buildSideSerializer.serializeToPages(record, this.buildSideWriteBuffer);
if (isInMemory()) {
lon... | [
"final",
"int",
"insertIntoBuildBuffer",
"(",
"BinaryRow",
"record",
")",
"throws",
"IOException",
"{",
"this",
".",
"buildSideRecordCounter",
"++",
";",
"if",
"(",
"isInMemory",
"(",
")",
")",
"{",
"final",
"long",
"pointer",
"=",
"this",
".",
"buildSideWrite... | Inserts the given object into the current buffer. This method returns a pointer that
can be used to address the written record in this partition, if it is in-memory.
The returned pointers have no expressiveness in the case where the partition is spilled.
@param record The object to be written to the partition.
@return... | [
"Inserts",
"the",
"given",
"object",
"into",
"the",
"current",
"buffer",
".",
"This",
"method",
"returns",
"a",
"pointer",
"that",
"can",
"be",
"used",
"to",
"address",
"the",
"written",
"record",
"in",
"this",
"partition",
"if",
"it",
"is",
"in",
"-",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashPartition.java#L243-L262 | train | Insert a binary row into the build buffer. | [
30522,
2345,
20014,
19274,
18447,
16429,
19231,
18939,
16093,
7512,
1006,
12441,
10524,
2501,
1007,
11618,
22834,
10288,
24422,
1063,
2023,
1012,
16473,
18688,
8586,
8551,
3597,
16671,
2121,
1009,
1009,
1025,
2065,
1006,
2003,
2378,
4168,
530... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/web/context/WebServerPortFileWriter.java | WebServerPortFileWriter.getPortFile | protected File getPortFile(ApplicationContext applicationContext) {
String namespace = getServerNamespace(applicationContext);
if (StringUtils.isEmpty(namespace)) {
return this.file;
}
String name = this.file.getName();
String extension = StringUtils.getFilenameExtension(this.file.getName());
name = name... | java | protected File getPortFile(ApplicationContext applicationContext) {
String namespace = getServerNamespace(applicationContext);
if (StringUtils.isEmpty(namespace)) {
return this.file;
}
String name = this.file.getName();
String extension = StringUtils.getFilenameExtension(this.file.getName());
name = name... | [
"protected",
"File",
"getPortFile",
"(",
"ApplicationContext",
"applicationContext",
")",
"{",
"String",
"namespace",
"=",
"getServerNamespace",
"(",
"applicationContext",
")",
";",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"namespace",
")",
")",
"{",
"return... | Return the actual port file that should be written for the given application
context. The default implementation builds a file from the source file and the
application context namespace if available.
@param applicationContext the source application context
@return the file that should be written | [
"Return",
"the",
"actual",
"port",
"file",
"that",
"should",
"be",
"written",
"for",
"the",
"given",
"application",
"context",
".",
"The",
"default",
"implementation",
"builds",
"a",
"file",
"from",
"the",
"source",
"file",
"and",
"the",
"application",
"contex... | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java#L106-L124 | train | Get the port file. | [
30522,
5123,
5371,
2131,
6442,
8873,
2571,
1006,
4646,
8663,
18209,
4646,
8663,
18209,
1007,
1063,
5164,
3415,
15327,
1027,
4152,
2121,
23062,
14074,
23058,
1006,
4646,
8663,
18209,
1007,
1025,
2065,
1006,
5164,
21823,
4877,
1012,
2003,
663... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-cache/src/main/java/cn/hutool/cache/impl/FIFOCache.java | FIFOCache.pruneCache | @Override
protected int pruneCache() {
int count = 0;
CacheObj<K, V> first = null;
// 清理过期对象并找出链表头部元素(先入元素)
Iterator<CacheObj<K, V>> values = cacheMap.values().iterator();
while (values.hasNext()) {
CacheObj<K, V> co = values.next();
if (co.isExpired()) {
values.remove();
count++;... | java | @Override
protected int pruneCache() {
int count = 0;
CacheObj<K, V> first = null;
// 清理过期对象并找出链表头部元素(先入元素)
Iterator<CacheObj<K, V>> values = cacheMap.values().iterator();
while (values.hasNext()) {
CacheObj<K, V> co = values.next();
if (co.isExpired()) {
values.remove();
count++;... | [
"@",
"Override",
"protected",
"int",
"pruneCache",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"CacheObj",
"<",
"K",
",",
"V",
">",
"first",
"=",
"null",
";",
"// 清理过期对象并找出链表头部元素(先入元素)\r",
"Iterator",
"<",
"CacheObj",
"<",
"K",
",",
"V",
">",
">",
... | 先进先出的清理策略<br>
先遍历缓存清理过期的缓存对象,如果清理后还是满的,则删除第一个缓存对象 | [
"先进先出的清理策略<br",
">",
"先遍历缓存清理过期的缓存对象,如果清理后还是满的,则删除第一个缓存对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cache/src/main/java/cn/hutool/cache/impl/FIFOCache.java#L51-L76 | train | Override the pruneCache method to remove expired cache objects. | [
30522,
1030,
2058,
15637,
5123,
20014,
10975,
9816,
3540,
5403,
1006,
1007,
1063,
20014,
4175,
1027,
1014,
1025,
17053,
16429,
3501,
1026,
1047,
1010,
1058,
1028,
2034,
1027,
19701,
1025,
1013,
1013,
1903,
100,
100,
100,
100,
100,
100,
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... |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/InternalJSONUtil.java | InternalJSONUtil.propertyPut | protected static JSONObject propertyPut(JSONObject jsonObject, Object key, Object value) {
String keyStr = Convert.toStr(key);
String[] path = StrUtil.split(keyStr, StrUtil.DOT);
int last = path.length - 1;
JSONObject target = jsonObject;
for (int i = 0; i < last; i += 1) {
String segment = path[i];
... | java | protected static JSONObject propertyPut(JSONObject jsonObject, Object key, Object value) {
String keyStr = Convert.toStr(key);
String[] path = StrUtil.split(keyStr, StrUtil.DOT);
int last = path.length - 1;
JSONObject target = jsonObject;
for (int i = 0; i < last; i += 1) {
String segment = path[i];
... | [
"protected",
"static",
"JSONObject",
"propertyPut",
"(",
"JSONObject",
"jsonObject",
",",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"String",
"keyStr",
"=",
"Convert",
".",
"toStr",
"(",
"key",
")",
";",
"String",
"[",
"]",
"path",
"=",
"StrUtil",... | 将Property的键转化为JSON形式<br>
用于识别类似于:com.luxiaolei.package.hutool这类用点隔开的键
@param jsonObject JSONObject
@param key 键
@param value 值
@return JSONObject | [
"将Property的键转化为JSON形式<br",
">",
"用于识别类似于:com",
".",
"luxiaolei",
".",
"package",
".",
"hutool这类用点隔开的键"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/InternalJSONUtil.java#L191-L207 | train | Convenience method for creating a new JSONObject with a single property. | [
30522,
5123,
10763,
1046,
3385,
16429,
20614,
3200,
18780,
1006,
1046,
3385,
16429,
20614,
1046,
3385,
16429,
20614,
1010,
4874,
3145,
1010,
4874,
3643,
1007,
1063,
5164,
6309,
16344,
1027,
10463,
1012,
2000,
3367,
2099,
1006,
3145,
1007,
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... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/symmetric/RC4.java | RC4.encrypt | public byte[] encrypt(String message, Charset charset) throws CryptoException {
return crypt(StrUtil.bytes(message, charset));
} | java | public byte[] encrypt(String message, Charset charset) throws CryptoException {
return crypt(StrUtil.bytes(message, charset));
} | [
"public",
"byte",
"[",
"]",
"encrypt",
"(",
"String",
"message",
",",
"Charset",
"charset",
")",
"throws",
"CryptoException",
"{",
"return",
"crypt",
"(",
"StrUtil",
".",
"bytes",
"(",
"message",
",",
"charset",
")",
")",
";",
"}"
] | 加密
@param message 消息
@param charset 编码
@return 密文
@throws CryptoException key长度小于5或者大于255抛出此异常 | [
"加密"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/symmetric/RC4.java#L49-L51 | train | Encrypts the given string using the given charset. | [
30522,
2270,
24880,
1031,
1033,
4372,
26775,
22571,
2102,
1006,
5164,
4471,
1010,
25869,
13462,
25869,
13462,
1007,
11618,
19888,
8913,
2595,
24422,
1063,
2709,
19888,
1006,
2358,
22134,
4014,
1012,
27507,
1006,
4471,
1010,
25869,
13462,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/ConverterRegistry.java | ConverterRegistry.getDefaultConverter | @SuppressWarnings("unchecked")
public <T> Converter<T> getDefaultConverter(Type type) {
return (null == defaultConverterMap) ? null : (Converter<T>) defaultConverterMap.get(type);
} | java | @SuppressWarnings("unchecked")
public <T> Converter<T> getDefaultConverter(Type type) {
return (null == defaultConverterMap) ? null : (Converter<T>) defaultConverterMap.get(type);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Converter",
"<",
"T",
">",
"getDefaultConverter",
"(",
"Type",
"type",
")",
"{",
"return",
"(",
"null",
"==",
"defaultConverterMap",
")",
"?",
"null",
":",
"(",
"Converter",
"<",... | 获得默认转换器
@param <T> 转换的目标类型(转换器转换到的类型)
@param type 类型
@return 转换器 | [
"获得默认转换器"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/ConverterRegistry.java#L158-L161 | train | Returns the default converter for the given type. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
1026,
1056,
1028,
10463,
2121,
1026,
1056,
1028,
2131,
3207,
7011,
11314,
8663,
16874,
2121,
1006,
2828,
2828,
1007,
1063,
2709,
1006,
19701,
1027,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/crf/crfpp/Node.java | Node.calcExpectation | public void calcExpectation(double[] expected, double Z, int size)
{
double c = Math.exp(alpha + beta - cost - Z);
for (int i = 0; fVector.get(i) != -1; i++)
{
int idx = fVector.get(i) + y;
expected[idx] += c;
}
for (Path p : lpath)
{
... | java | public void calcExpectation(double[] expected, double Z, int size)
{
double c = Math.exp(alpha + beta - cost - Z);
for (int i = 0; fVector.get(i) != -1; i++)
{
int idx = fVector.get(i) + y;
expected[idx] += c;
}
for (Path p : lpath)
{
... | [
"public",
"void",
"calcExpectation",
"(",
"double",
"[",
"]",
"expected",
",",
"double",
"Z",
",",
"int",
"size",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"exp",
"(",
"alpha",
"+",
"beta",
"-",
"cost",
"-",
"Z",
")",
";",
"for",
"(",
"int",
"i"... | 计算节点期望
@param expected 输出期望
@param Z 规范化因子
@param size 标签个数 | [
"计算节点期望"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/crfpp/Node.java#L80-L92 | train | Calculate the expectation for this class. | [
30522,
2270,
11675,
10250,
3401,
2595,
5051,
25572,
3508,
1006,
3313,
1031,
1033,
3517,
1010,
3313,
1062,
1010,
20014,
2946,
1007,
1063,
3313,
1039,
1027,
8785,
1012,
4654,
2361,
1006,
6541,
1009,
8247,
1011,
3465,
1011,
1062,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.intersection | public static <T> Collection<T> intersection(Collection<T> coll1, Collection<T> coll2) {
final ArrayList<T> list = new ArrayList<>();
if (isNotEmpty(coll1) && isNotEmpty(coll2)) {
final Map<T, Integer> map1 = countMap(coll1);
final Map<T, Integer> map2 = countMap(coll2);
final Set<T> elts = newHashSet... | java | public static <T> Collection<T> intersection(Collection<T> coll1, Collection<T> coll2) {
final ArrayList<T> list = new ArrayList<>();
if (isNotEmpty(coll1) && isNotEmpty(coll2)) {
final Map<T, Integer> map1 = countMap(coll1);
final Map<T, Integer> map2 = countMap(coll2);
final Set<T> elts = newHashSet... | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"intersection",
"(",
"Collection",
"<",
"T",
">",
"coll1",
",",
"Collection",
"<",
"T",
">",
"coll2",
")",
"{",
"final",
"ArrayList",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<>"... | 两个集合的交集<br>
针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最少的个数<br>
例如:集合1:[a, b, c, c, c],集合2:[a, b, c, c]<br>
结果:[a, b, c, c],此结果中只保留了两个c
@param <T> 集合元素类型
@param coll1 集合1
@param coll2 集合2
@return 交集的集合,返回 {@link ArrayList} | [
"两个集合的交集<br",
">",
"针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最少的个数<br",
">",
"例如:集合1:",
"[",
"a",
"b",
"c",
"c",
"c",
"]",
",集合2:",
"[",
"a",
"b",
"c",
"c",
"]",
"<br",
">",
"结果:",
"[",
"a",
"b",
"c",
"c",
"]",
",此结果中只保留了两个c"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L128-L143 | train | Returns the intersection of the two collections. | [
30522,
2270,
10763,
1026,
1056,
1028,
3074,
1026,
1056,
1028,
6840,
1006,
3074,
1026,
1056,
1028,
8902,
2140,
2487,
1010,
3074,
1026,
1056,
1028,
8902,
2140,
2475,
1007,
1063,
2345,
9140,
9863,
1026,
1056,
1028,
2862,
1027,
2047,
9140,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/typeutils/runtime/PojoSerializerSnapshot.java | PojoSerializerSnapshot.constructReconfiguredPojoSerializer | private static <T> PojoSerializer<T> constructReconfiguredPojoSerializer(
PojoSerializer<T> originalNewPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> registeredSerializerSnapshots,
IntermediateCompatibilityResult<T> pre... | java | private static <T> PojoSerializer<T> constructReconfiguredPojoSerializer(
PojoSerializer<T> originalNewPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> registeredSerializerSnapshots,
IntermediateCompatibilityResult<T> pre... | [
"private",
"static",
"<",
"T",
">",
"PojoSerializer",
"<",
"T",
">",
"constructReconfiguredPojoSerializer",
"(",
"PojoSerializer",
"<",
"T",
">",
"originalNewPojoSerializer",
",",
"IntermediateCompatibilityResult",
"<",
"T",
">",
"fieldSerializerCompatibility",
",",
"Li... | Creates a reconfigured version of the {@link PojoSerializer}.
@param originalNewPojoSerializer the original new {@link PojoSerializer} to create a reconfigured version of.
@param fieldSerializerCompatibility compatibility of preexisting fields' serializers.
@param registeredSerializerSnapshots snapshot of previous reg... | [
"Creates",
"a",
"reconfigured",
"version",
"of",
"the",
"{",
"@link",
"PojoSerializer",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L433-L456 | train | Construct a reconfigured pojo serializer. | [
30522,
2797,
10763,
1026,
1056,
1028,
13433,
19929,
11610,
28863,
1026,
1056,
1028,
9570,
2890,
8663,
8873,
27390,
2098,
6873,
19929,
11610,
28863,
1006,
13433,
19929,
11610,
28863,
1026,
1056,
1028,
2434,
2638,
2860,
6873,
19929,
11610,
2886... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/interactions/touch/TouchActions.java | TouchActions.longPress | public TouchActions longPress(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this;
} | java | public TouchActions longPress(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this;
} | [
"public",
"TouchActions",
"longPress",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"LongPressAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of long press gestures.
@param onElement The {@link WebElement} to long press
@return self | [
"Allows",
"the",
"execution",
"of",
"long",
"press",
"gestures",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L143-L148 | train | Long press the touch screen. | [
30522,
2270,
3543,
18908,
8496,
2146,
20110,
1006,
4773,
12260,
3672,
2028,
16930,
4765,
1007,
1063,
2065,
1006,
3543,
18182,
999,
1027,
19701,
1007,
1063,
2895,
1012,
5587,
18908,
3258,
1006,
2047,
2146,
20110,
18908,
3258,
1006,
3543,
181... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RpcUtils.java | RpcUtils.terminateRpcServices | public static void terminateRpcServices(
Time timeout,
RpcService... rpcServices) throws InterruptedException, ExecutionException, TimeoutException {
final Collection<CompletableFuture<?>> terminationFutures = new ArrayList<>(rpcServices.length);
for (RpcService service : rpcServices) {
if (service != nul... | java | public static void terminateRpcServices(
Time timeout,
RpcService... rpcServices) throws InterruptedException, ExecutionException, TimeoutException {
final Collection<CompletableFuture<?>> terminationFutures = new ArrayList<>(rpcServices.length);
for (RpcService service : rpcServices) {
if (service != nul... | [
"public",
"static",
"void",
"terminateRpcServices",
"(",
"Time",
"timeout",
",",
"RpcService",
"...",
"rpcServices",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"final",
"Collection",
"<",
"CompletableFuture",
"<",
"... | Shuts the given rpc services down and waits for their termination.
@param rpcServices to shut down
@param timeout for this operation
@throws InterruptedException if the operation has been interrupted
@throws ExecutionException if a problem occurred
@throws TimeoutException if a timeout occurred | [
"Shuts",
"the",
"given",
"rpc",
"services",
"down",
"and",
"waits",
"for",
"their",
"termination",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcUtils.java#L102-L114 | train | Terminate all the rpc services. | [
30522,
2270,
10763,
11675,
20320,
14536,
6169,
2121,
7903,
2229,
1006,
2051,
2051,
5833,
1010,
1054,
15042,
8043,
7903,
2063,
1012,
1012,
1012,
1054,
15042,
8043,
7903,
2229,
1007,
11618,
7153,
10288,
24422,
1010,
7781,
10288,
24422,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/io/IoUtil.java | IoUtil.copy | public static long copy(Reader reader, Writer writer, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
char[] buffer = new char[bufferSize];
long size = 0;
int readSize;
if (null != streamProgress) {
streamProgress.start();
}
try {
while ((readSize = reader.read(buffe... | java | public static long copy(Reader reader, Writer writer, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
char[] buffer = new char[bufferSize];
long size = 0;
int readSize;
if (null != streamProgress) {
streamProgress.start();
}
try {
while ((readSize = reader.read(buffe... | [
"public",
"static",
"long",
"copy",
"(",
"Reader",
"reader",
",",
"Writer",
"writer",
",",
"int",
"bufferSize",
",",
"StreamProgress",
"streamProgress",
")",
"throws",
"IORuntimeException",
"{",
"char",
"[",
"]",
"buffer",
"=",
"new",
"char",
"[",
"bufferSize"... | 将Reader中的内容复制到Writer中
@param reader Reader
@param writer Writer
@param bufferSize 缓存大小
@param streamProgress 进度处理器
@return 传输的byte数
@throws IORuntimeException IO异常 | [
"将Reader中的内容复制到Writer中"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L100-L123 | train | Copies the contents of the specified reader to the specified writer. | [
30522,
2270,
10763,
2146,
6100,
1006,
8068,
8068,
1010,
3213,
3213,
1010,
20014,
17698,
5332,
4371,
1010,
5460,
21572,
17603,
4757,
5460,
21572,
17603,
4757,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
25869,
1031,
1033,
17698,
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... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.contains | @PublicEvolving
public boolean contains(ConfigOption<?> configOption) {
synchronized (this.confData){
// first try the current key
if (this.confData.containsKey(configOption.key())) {
return true;
}
else if (configOption.hasFallbackKeys()) {
// try the fallback keys
for (FallbackKey fallbackK... | java | @PublicEvolving
public boolean contains(ConfigOption<?> configOption) {
synchronized (this.confData){
// first try the current key
if (this.confData.containsKey(configOption.key())) {
return true;
}
else if (configOption.hasFallbackKeys()) {
// try the fallback keys
for (FallbackKey fallbackK... | [
"@",
"PublicEvolving",
"public",
"boolean",
"contains",
"(",
"ConfigOption",
"<",
"?",
">",
"configOption",
")",
"{",
"synchronized",
"(",
"this",
".",
"confData",
")",
"{",
"// first try the current key",
"if",
"(",
"this",
".",
"confData",
".",
"containsKey",
... | Checks whether there is an entry for the given config option.
@param configOption The configuration option
@return <tt>true</tt> if a valid (current or deprecated) key of the config option is stored,
<tt>false</tt> otherwise | [
"Checks",
"whether",
"there",
"is",
"an",
"entry",
"for",
"the",
"given",
"config",
"option",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L727-L746 | train | Checks if the configuration options contain the given key. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
22017,
20898,
3397,
1006,
9530,
8873,
3995,
16790,
1026,
1029,
1028,
9530,
8873,
3995,
16790,
1007,
1063,
25549,
1006,
2023,
1012,
9530,
2546,
2850,
2696,
1007,
1063,
1013,
1013,
2034,
3046,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-crypto/src/main/java/cn/hutool/crypto/digest/DigestUtil.java | DigestUtil.sha256 | public static byte[] sha256(String data, String charset) {
return new Digester(DigestAlgorithm.SHA256).digest(data, charset);
} | java | public static byte[] sha256(String data, String charset) {
return new Digester(DigestAlgorithm.SHA256).digest(data, charset);
} | [
"public",
"static",
"byte",
"[",
"]",
"sha256",
"(",
"String",
"data",
",",
"String",
"charset",
")",
"{",
"return",
"new",
"Digester",
"(",
"DigestAlgorithm",
".",
"SHA256",
")",
".",
"digest",
"(",
"data",
",",
"charset",
")",
";",
"}"
] | 计算SHA-256摘要值
@param data 被摘要数据
@param charset 编码
@return SHA-256摘要
@since 3.0.8 | [
"计算SHA",
"-",
"256摘要值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/DigestUtil.java#L255-L257 | train | Returns the SHA256 digest of the given data. | [
30522,
2270,
10763,
24880,
1031,
1033,
21146,
17788,
2575,
1006,
5164,
2951,
1010,
5164,
25869,
13462,
1007,
1063,
2709,
2047,
17886,
2121,
1006,
17886,
2389,
20255,
8939,
2213,
1012,
21146,
17788,
2575,
1007,
1012,
17886,
1006,
2951,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/UserFacingListState.java | UserFacingListState.get | @Override
public Iterable<T> get() throws Exception {
Iterable<T> original = originalState.get();
return original != null ? original : emptyState;
} | java | @Override
public Iterable<T> get() throws Exception {
Iterable<T> original = originalState.get();
return original != null ? original : emptyState;
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"get",
"(",
")",
"throws",
"Exception",
"{",
"Iterable",
"<",
"T",
">",
"original",
"=",
"originalState",
".",
"get",
"(",
")",
";",
"return",
"original",
"!=",
"null",
"?",
"original",
":",
"emptyS... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/UserFacingListState.java#L43-L47 | train | Returns the original state. | [
30522,
1030,
2058,
15637,
2270,
2009,
6906,
3468,
1026,
1056,
1028,
2131,
1006,
1007,
11618,
6453,
1063,
2009,
6906,
3468,
1026,
1056,
1028,
2434,
1027,
23728,
12259,
1012,
2131,
1006,
1007,
1025,
2709,
2434,
999,
1027,
19701,
1029,
2434,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java | DateTimeUtils.subtractMonths | public static int subtractMonths(int date0, int date1) {
if (date0 < date1) {
return -subtractMonths(date1, date0);
}
// Start with an estimate.
// Since no month has more than 31 days, the estimate is <= the true value.
int m = (date0 - date1) / 31;
for (;;) {
int date2 = addMonths(date1, m);
if (... | java | public static int subtractMonths(int date0, int date1) {
if (date0 < date1) {
return -subtractMonths(date1, date0);
}
// Start with an estimate.
// Since no month has more than 31 days, the estimate is <= the true value.
int m = (date0 - date1) / 31;
for (;;) {
int date2 = addMonths(date1, m);
if (... | [
"public",
"static",
"int",
"subtractMonths",
"(",
"int",
"date0",
",",
"int",
"date1",
")",
"{",
"if",
"(",
"date0",
"<",
"date1",
")",
"{",
"return",
"-",
"subtractMonths",
"(",
"date1",
",",
"date0",
")",
";",
"}",
"// Start with an estimate.",
"// Since... | Finds the number of months between two dates, each represented as the
number of days since the epoch. | [
"Finds",
"the",
"number",
"of",
"months",
"between",
"two",
"dates",
"each",
"represented",
"as",
"the",
"number",
"of",
"days",
"since",
"the",
"epoch",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java#L1107-L1125 | train | Subtracts the months from the given date. | [
30522,
2270,
10763,
20014,
4942,
6494,
6593,
9629,
7898,
1006,
20014,
3058,
2692,
1010,
20014,
3058,
2487,
1007,
1063,
2065,
1006,
3058,
2692,
1026,
3058,
2487,
1007,
1063,
2709,
1011,
4942,
6494,
6593,
9629,
7898,
1006,
3058,
2487,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ByteBufUtil.java | ByteBufUtil.indexOf | public static int indexOf(ByteBuf needle, ByteBuf haystack) {
// TODO: maybe use Boyer Moore for efficiency.
int attempts = haystack.readableBytes() - needle.readableBytes() + 1;
for (int i = 0; i < attempts; i++) {
if (equals(needle, needle.readerIndex(),
hays... | java | public static int indexOf(ByteBuf needle, ByteBuf haystack) {
// TODO: maybe use Boyer Moore for efficiency.
int attempts = haystack.readableBytes() - needle.readableBytes() + 1;
for (int i = 0; i < attempts; i++) {
if (equals(needle, needle.readerIndex(),
hays... | [
"public",
"static",
"int",
"indexOf",
"(",
"ByteBuf",
"needle",
",",
"ByteBuf",
"haystack",
")",
"{",
"// TODO: maybe use Boyer Moore for efficiency.",
"int",
"attempts",
"=",
"haystack",
".",
"readableBytes",
"(",
")",
"-",
"needle",
".",
"readableBytes",
"(",
")... | Returns the reader index of needle in haystack, or -1 if needle is not in haystack. | [
"Returns",
"the",
"reader",
"index",
"of",
"needle",
"in",
"haystack",
"or",
"-",
"1",
"if",
"needle",
"is",
"not",
"in",
"haystack",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L210-L221 | train | Gets the index of needle in haystack. | [
30522,
2270,
10763,
20014,
5950,
11253,
1006,
24880,
8569,
2546,
12201,
1010,
24880,
8569,
2546,
29051,
2696,
3600,
1007,
1063,
1013,
1013,
28681,
2080,
1024,
2672,
2224,
23456,
5405,
2005,
8122,
1012,
20014,
4740,
1027,
29051,
2696,
3600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/web/servlet/AbstractFilterRegistrationBean.java | AbstractFilterRegistrationBean.setDispatcherTypes | public void setDispatcherTypes(DispatcherType first, DispatcherType... rest) {
this.dispatcherTypes = EnumSet.of(first, rest);
} | java | public void setDispatcherTypes(DispatcherType first, DispatcherType... rest) {
this.dispatcherTypes = EnumSet.of(first, rest);
} | [
"public",
"void",
"setDispatcherTypes",
"(",
"DispatcherType",
"first",
",",
"DispatcherType",
"...",
"rest",
")",
"{",
"this",
".",
"dispatcherTypes",
"=",
"EnumSet",
".",
"of",
"(",
"first",
",",
"rest",
")",
";",
"}"
] | Convenience method to {@link #setDispatcherTypes(EnumSet) set dispatcher types}
using the specified elements.
@param first the first dispatcher type
@param rest additional dispatcher types | [
"Convenience",
"method",
"to",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java#L172-L174 | train | Sets the dispatcher types. | [
30522,
2270,
11675,
2275,
10521,
4502,
10649,
15010,
10374,
1006,
18365,
15010,
5051,
2034,
1010,
18365,
15010,
5051,
1012,
1012,
1012,
2717,
1007,
1063,
2023,
1012,
18365,
15010,
10374,
1027,
4372,
18163,
3388,
1012,
1997,
1006,
2034,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/tokenizer/lexical/AbstractLexicalAnalyzer.java | AbstractLexicalAnalyzer.combineWords | private static void combineWords(String[] wordNet, int start, int end, CoreDictionary.Attribute[] attributeArray, CoreDictionary.Attribute value)
{
if (start + 1 != end) // 小优化,如果只有一个词,那就不需要合并,直接应用新属性
{
StringBuilder sbTerm = new StringBuilder();
for (int j = start; j < end... | java | private static void combineWords(String[] wordNet, int start, int end, CoreDictionary.Attribute[] attributeArray, CoreDictionary.Attribute value)
{
if (start + 1 != end) // 小优化,如果只有一个词,那就不需要合并,直接应用新属性
{
StringBuilder sbTerm = new StringBuilder();
for (int j = start; j < end... | [
"private",
"static",
"void",
"combineWords",
"(",
"String",
"[",
"]",
"wordNet",
",",
"int",
"start",
",",
"int",
"end",
",",
"CoreDictionary",
".",
"Attribute",
"[",
"]",
"attributeArray",
",",
"CoreDictionary",
".",
"Attribute",
"value",
")",
"{",
"if",
... | 将连续的词语合并为一个
@param wordNet 词图
@param start 起始下标(包含)
@param end 结束下标(不包含)
@param value 新的属性 | [
"将连续的词语合并为一个"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L710-L724 | train | Combine words. | [
30522,
2797,
10763,
11675,
11506,
22104,
1006,
5164,
1031,
1033,
2773,
7159,
1010,
20014,
2707,
1010,
20014,
2203,
1010,
4563,
29201,
3258,
5649,
1012,
17961,
1031,
1033,
17961,
2906,
9447,
1010,
4563,
29201,
3258,
5649,
1012,
17961,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getMultipart | public static MultipartFormData getMultipart(ServletRequest request, UploadSetting uploadSetting) throws IORuntimeException {
final MultipartFormData formData = new MultipartFormData(uploadSetting);
try {
formData.parseRequest(request);
} catch (IOException e) {
throw new IORuntimeException(e);
}
... | java | public static MultipartFormData getMultipart(ServletRequest request, UploadSetting uploadSetting) throws IORuntimeException {
final MultipartFormData formData = new MultipartFormData(uploadSetting);
try {
formData.parseRequest(request);
} catch (IOException e) {
throw new IORuntimeException(e);
}
... | [
"public",
"static",
"MultipartFormData",
"getMultipart",
"(",
"ServletRequest",
"request",
",",
"UploadSetting",
"uploadSetting",
")",
"throws",
"IORuntimeException",
"{",
"final",
"MultipartFormData",
"formData",
"=",
"new",
"MultipartFormData",
"(",
"uploadSetting",
")"... | 获得multipart/form-data 表单内容<br>
包括文件和普通表单数据<br>
在同一次请求中,此方法只能被执行一次!
@param request {@link ServletRequest}
@param uploadSetting 上传文件的设定,包括最大文件大小、保存在内存的边界大小、临时目录、扩展名限定等
@return MultiPart表单
@throws IORuntimeException IO异常
@since 4.0.2 | [
"获得multipart",
"/",
"form",
"-",
"data",
"表单内容<br",
">",
"包括文件和普通表单数据<br",
">",
"在同一次请求中,此方法只能被执行一次!"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L258-L267 | train | Gets a MultipartFormData object from the given request. | [
30522,
2270,
10763,
4800,
19362,
24475,
2953,
26876,
6790,
2131,
12274,
7096,
11514,
8445,
1006,
14262,
2615,
7485,
2890,
15500,
5227,
1010,
2039,
11066,
21678,
2075,
2039,
11066,
21678,
2075,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
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/corpus/document/sentence/Sentence.java | Sentence.text | public String text(String delimiter)
{
if (delimiter == null) delimiter = "";
StringBuilder sb = new StringBuilder(size() * 3);
for (IWord word : this)
{
if (word instanceof CompoundWord)
{
for (Word child : ((CompoundWord) word).innerList)
... | java | public String text(String delimiter)
{
if (delimiter == null) delimiter = "";
StringBuilder sb = new StringBuilder(size() * 3);
for (IWord word : this)
{
if (word instanceof CompoundWord)
{
for (Word child : ((CompoundWord) word).innerList)
... | [
"public",
"String",
"text",
"(",
"String",
"delimiter",
")",
"{",
"if",
"(",
"delimiter",
"==",
"null",
")",
"delimiter",
"=",
"\"\"",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"size",
"(",
")",
"*",
"3",
")",
";",
"for",
"(",
"IW... | 原始文本形式(无标注,raw text)
@param delimiter 词语之间的分隔符
@return | [
"原始文本形式(无标注,raw",
"text)"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java#L291-L312 | train | Text method. | [
30522,
2270,
5164,
3793,
1006,
5164,
3972,
27605,
3334,
1007,
1063,
2065,
1006,
3972,
27605,
3334,
1027,
1027,
19701,
1007,
3972,
27605,
3334,
1027,
1000,
1000,
1025,
5164,
8569,
23891,
2099,
24829,
1027,
2047,
5164,
8569,
23891,
2099,
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... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.registerTypeWithKryoSerializer | public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
config.registerTypeWithKryoSerializer(type, serializer);
} | java | public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
config.registerTypeWithKryoSerializer(type, serializer);
} | [
"public",
"<",
"T",
"extends",
"Serializer",
"<",
"?",
">",
"&",
"Serializable",
">",
"void",
"registerTypeWithKryoSerializer",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"T",
"serializer",
")",
"{",
"config",
".",
"registerTypeWithKryoSerializer",
"(",
"type",... | Registers the given type with a Kryo Serializer.
<p>Note that the serializer instance must be serializable (as defined by
java.io.Serializable), because it may be distributed to the worker nodes
by java serialization.
@param type
The class of the types serialized with the given serializer.
@param serializer
The seria... | [
"Registers",
"the",
"given",
"type",
"with",
"a",
"Kryo",
"Serializer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L582-L584 | train | Register a serializer with the KryoSerializer. | [
30522,
2270,
1026,
1056,
8908,
7642,
17629,
1026,
1029,
1028,
1004,
7642,
21335,
3468,
1028,
11675,
4236,
13874,
24415,
21638,
7677,
8043,
4818,
17629,
1006,
2465,
1026,
1029,
1028,
2828,
1010,
1056,
7642,
17629,
1007,
1063,
9530,
8873,
229... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/operators/DeltaIteration.java | DeltaIteration.closeWith | public DataSet<ST> closeWith(DataSet<ST> solutionSetDelta, DataSet<WT> newWorkset) {
return new DeltaIterationResultSet<ST, WT>(initialSolutionSet.getExecutionEnvironment(),
initialSolutionSet.getType(), initialWorkset.getType(), this, solutionSetDelta, newWorkset, keys, maxIterations);
} | java | public DataSet<ST> closeWith(DataSet<ST> solutionSetDelta, DataSet<WT> newWorkset) {
return new DeltaIterationResultSet<ST, WT>(initialSolutionSet.getExecutionEnvironment(),
initialSolutionSet.getType(), initialWorkset.getType(), this, solutionSetDelta, newWorkset, keys, maxIterations);
} | [
"public",
"DataSet",
"<",
"ST",
">",
"closeWith",
"(",
"DataSet",
"<",
"ST",
">",
"solutionSetDelta",
",",
"DataSet",
"<",
"WT",
">",
"newWorkset",
")",
"{",
"return",
"new",
"DeltaIterationResultSet",
"<",
"ST",
",",
"WT",
">",
"(",
"initialSolutionSet",
... | Closes the delta iteration. This method defines the end of the delta iteration's function.
@param solutionSetDelta The delta for the solution set. The delta will be merged into the solution set at the end of
each iteration.
@param newWorkset The new workset (feedback data set) that will be fed back to the next iterati... | [
"Closes",
"the",
"delta",
"iteration",
".",
"This",
"method",
"defines",
"the",
"end",
"of",
"the",
"delta",
"iteration",
"s",
"function",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java#L94-L97 | train | Close the delta iteration result set. | [
30522,
2270,
2951,
13462,
1026,
2358,
1028,
2485,
24415,
1006,
2951,
13462,
1026,
2358,
1028,
7300,
3388,
9247,
2696,
1010,
2951,
13462,
1026,
1059,
2102,
1028,
2047,
9316,
3388,
1007,
1063,
2709,
2047,
7160,
21646,
3370,
6072,
11314,
13462... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/dictionary/CustomDictionary.java | CustomDictionary.updateAttributeIfExist | private static boolean updateAttributeIfExist(String key, CoreDictionary.Attribute attribute, TreeMap<String, CoreDictionary.Attribute> map, TreeMap<Integer, CoreDictionary.Attribute> rewriteTable)
{
int wordID = CoreDictionary.getWordID(key);
CoreDictionary.Attribute attributeExisted;
if (w... | java | private static boolean updateAttributeIfExist(String key, CoreDictionary.Attribute attribute, TreeMap<String, CoreDictionary.Attribute> map, TreeMap<Integer, CoreDictionary.Attribute> rewriteTable)
{
int wordID = CoreDictionary.getWordID(key);
CoreDictionary.Attribute attributeExisted;
if (w... | [
"private",
"static",
"boolean",
"updateAttributeIfExist",
"(",
"String",
"key",
",",
"CoreDictionary",
".",
"Attribute",
"attribute",
",",
"TreeMap",
"<",
"String",
",",
"CoreDictionary",
".",
"Attribute",
">",
"map",
",",
"TreeMap",
"<",
"Integer",
",",
"CoreDi... | 如果已经存在该词条,直接更新该词条的属性
@param key 词语
@param attribute 词语的属性
@param map 加载期间的map
@param rewriteTable
@return 是否更新了 | [
"如果已经存在该词条",
"直接更新该词条的属性"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L230-L255 | train | Update attribute if exist. | [
30522,
2797,
10763,
22017,
20898,
10651,
19321,
3089,
8569,
2618,
29323,
9048,
3367,
1006,
5164,
3145,
1010,
4563,
29201,
3258,
5649,
1012,
17961,
17961,
1010,
3392,
2863,
2361,
1026,
5164,
1010,
4563,
29201,
3258,
5649,
1012,
17961,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-common/src/main/java/org/apache/flink/table/descriptors/Schema.java | Schema.field | public Schema field(String fieldName, TypeInformation<?> fieldType) {
field(fieldName, TypeStringUtils.writeTypeInfo(fieldType));
return this;
} | java | public Schema field(String fieldName, TypeInformation<?> fieldType) {
field(fieldName, TypeStringUtils.writeTypeInfo(fieldType));
return this;
} | [
"public",
"Schema",
"field",
"(",
"String",
"fieldName",
",",
"TypeInformation",
"<",
"?",
">",
"fieldType",
")",
"{",
"field",
"(",
"fieldName",
",",
"TypeStringUtils",
".",
"writeTypeInfo",
"(",
"fieldType",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a field with the field name and the type information. Required.
This method can be called multiple times. The call order of this method defines
also the order of the fields in a row.
@param fieldName the field name
@param fieldType the type information of the field | [
"Adds",
"a",
"field",
"with",
"the",
"field",
"name",
"and",
"the",
"type",
"information",
".",
"Required",
".",
"This",
"method",
"can",
"be",
"called",
"multiple",
"times",
".",
"The",
"call",
"order",
"of",
"this",
"method",
"defines",
"also",
"the",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Schema.java#L76-L79 | train | Create a new field with the given name and type information. | [
30522,
2270,
8040,
28433,
2492,
1006,
5164,
2492,
18442,
1010,
2828,
2378,
14192,
30524,
2492,
13874,
1007,
1007,
1025,
2709,
2023,
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,
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/cookie/ServerCookieEncoder.java | ServerCookieEncoder.encode | public String encode(Cookie cookie) {
final String name = checkNotNull(cookie, "cookie").name();
final String value = cookie.value() != null ? cookie.value() : "";
validateCookie(name, value);
StringBuilder buf = stringBuilder();
if (cookie.wrap()) {
addQuoted(buf,... | java | public String encode(Cookie cookie) {
final String name = checkNotNull(cookie, "cookie").name();
final String value = cookie.value() != null ? cookie.value() : "";
validateCookie(name, value);
StringBuilder buf = stringBuilder();
if (cookie.wrap()) {
addQuoted(buf,... | [
"public",
"String",
"encode",
"(",
"Cookie",
"cookie",
")",
"{",
"final",
"String",
"name",
"=",
"checkNotNull",
"(",
"cookie",
",",
"\"cookie\"",
")",
".",
"name",
"(",
")",
";",
"final",
"String",
"value",
"=",
"cookie",
".",
"value",
"(",
")",
"!=",... | Encodes the specified cookie into a Set-Cookie header value.
@param cookie the cookie
@return a single Set-Cookie header value | [
"Encodes",
"the",
"specified",
"cookie",
"into",
"a",
"Set",
"-",
"Cookie",
"header",
"value",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cookie/ServerCookieEncoder.java#L90-L129 | train | Encode a Cookie object into a String. | [
30522,
2270,
5164,
4372,
16044,
1006,
17387,
17387,
1007,
1063,
2345,
5164,
2171,
1027,
4638,
17048,
11231,
3363,
1006,
17387,
1010,
1000,
17387,
1000,
1007,
1012,
2171,
1006,
1007,
1025,
2345,
5164,
3643,
1027,
17387,
1012,
3643,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java | CloudFoundryCustomContextPathExample.servletWebServerFactory | @Bean
public TomcatServletWebServerFactory servletWebServerFactory() {
return new TomcatServletWebServerFactory() {
@Override
protected void prepareContext(Host host,
ServletContextInitializer[] initializers) {
super.prepareContext(host, initializers);
StandardContext child = new StandardContext(... | java | @Bean
public TomcatServletWebServerFactory servletWebServerFactory() {
return new TomcatServletWebServerFactory() {
@Override
protected void prepareContext(Host host,
ServletContextInitializer[] initializers) {
super.prepareContext(host, initializers);
StandardContext child = new StandardContext(... | [
"@",
"Bean",
"public",
"TomcatServletWebServerFactory",
"servletWebServerFactory",
"(",
")",
"{",
"return",
"new",
"TomcatServletWebServerFactory",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"prepareContext",
"(",
"Host",
"host",
",",
"ServletContextInitialize... | tag::configuration[] | [
"tag",
"::",
"configuration",
"[]"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java#L48-L67 | train | Creates a TomcatServletWebServerFactory. | [
30522,
1030,
14068,
2270,
3419,
19588,
2121,
2615,
7485,
8545,
5910,
2121,
6299,
21450,
14262,
2615,
7485,
8545,
5910,
2121,
6299,
21450,
1006,
1007,
1063,
2709,
2047,
3419,
19588,
2121,
2615,
7485,
8545,
5910,
2121,
6299,
21450,
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... |
looly/hutool | hutool-dfa/src/main/java/cn/hutool/dfa/WordTree.java | WordTree.matchAll | public List<String> matchAll(String text, int limit, boolean isDensityMatch, boolean isGreedMatch) {
if(null == text){
return null;
}
List<String> findedWords = new ArrayList<String>();
WordTree current = this;
int length = text.length();
StringBuilder wordBuffer;//存放查找到的字符缓存。完整出现一个词时加到findedWords中,否则... | java | public List<String> matchAll(String text, int limit, boolean isDensityMatch, boolean isGreedMatch) {
if(null == text){
return null;
}
List<String> findedWords = new ArrayList<String>();
WordTree current = this;
int length = text.length();
StringBuilder wordBuffer;//存放查找到的字符缓存。完整出现一个词时加到findedWords中,否则... | [
"public",
"List",
"<",
"String",
">",
"matchAll",
"(",
"String",
"text",
",",
"int",
"limit",
",",
"boolean",
"isDensityMatch",
",",
"boolean",
"isGreedMatch",
")",
"{",
"if",
"(",
"null",
"==",
"text",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<"... | 找出所有匹配的关键字<br>
密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab]<br>
贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab]
@param text 被检查的文本
@param limit 限制匹配个数
@param isDensityMatch 是否使用密集匹配原则
@param isGreedMatch 是否使用贪婪匹配(最长匹配)原则
@return 匹配的词列表 | [
"找出所有匹配的关键字<br",
">",
"密集匹配原则:假如关键词有",
"ab",
"b,文本是abab,将匹配",
"[",
"ab",
"b",
"ab",
"]",
"<br",
">",
"贪婪匹配(最长匹配)原则:假如关键字a",
"ab,最长匹配将匹配",
"[",
"a",
"ab",
"]"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-dfa/src/main/java/cn/hutool/dfa/WordTree.java#L157-L210 | train | Match all words in text | [
30522,
2270,
2862,
1026,
5164,
1028,
2674,
8095,
1006,
5164,
3793,
1010,
20014,
5787,
1010,
22017,
20898,
2003,
4181,
17759,
18900,
2818,
1010,
22017,
20898,
2003,
28637,
22117,
4017,
2818,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
3793,
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... |
SeleniumHQ/selenium | java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java | HttpCommandProcessor.getOutputStreamWriter | protected Writer getOutputStreamWriter(HttpURLConnection conn) throws IOException {
return new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), UTF_8));
} | java | protected Writer getOutputStreamWriter(HttpURLConnection conn) throws IOException {
return new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), UTF_8));
} | [
"protected",
"Writer",
"getOutputStreamWriter",
"(",
"HttpURLConnection",
"conn",
")",
"throws",
"IOException",
"{",
"return",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"conn",
".",
"getOutputStream",
"(",
")",
",",
"UTF_8",
")",
")",
";",
... | for testing | [
"for",
"testing"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/com/thoughtworks/selenium/HttpCommandProcessor.java#L152-L154 | train | Get the output stream writer. | [
30522,
5123,
3213,
2131,
5833,
18780,
21422,
15994,
1006,
8299,
3126,
22499,
10087,
7542,
9530,
2078,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
2047,
17698,
2098,
15994,
1006,
2047,
27852,
25379,
15994,
1006,
9530,
2078,
1012,
2131,
5833,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/CipherSuiteConverter.java | CipherSuiteConverter.isJ2OCached | static boolean isJ2OCached(String key, String value) {
return value.equals(j2o.get(key));
} | java | static boolean isJ2OCached(String key, String value) {
return value.equals(j2o.get(key));
} | [
"static",
"boolean",
"isJ2OCached",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"value",
".",
"equals",
"(",
"j2o",
".",
"get",
"(",
"key",
")",
")",
";",
"}"
] | Tests if the specified key-value pair has been cached in Java-to-OpenSSL cache. | [
"Tests",
"if",
"the",
"specified",
"key",
"-",
"value",
"pair",
"has",
"been",
"cached",
"in",
"Java",
"-",
"to",
"-",
"OpenSSL",
"cache",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L132-L134 | train | Checks if the value is the same as the one in the cache. | [
30522,
10763,
22017,
20898,
2003,
3501,
2475,
24755,
7690,
1006,
5164,
3145,
1010,
5164,
3643,
1007,
1063,
2709,
3643,
1012,
19635,
1006,
1046,
2475,
2080,
1012,
2131,
1006,
3145,
1007,
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,
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/StreamProjection.java | StreamProjection.projectTupleX | @SuppressWarnings("unchecked")
public <OUT extends Tuple> SingleOutputStreamOperator<OUT> projectTupleX() {
SingleOutputStreamOperator<OUT> projOperator = null;
switch (fieldIndexes.length) {
case 1: projOperator = (SingleOutputStreamOperator<OUT>) projectTuple1(); break;
case 2: projOperator = (SingleOutpu... | java | @SuppressWarnings("unchecked")
public <OUT extends Tuple> SingleOutputStreamOperator<OUT> projectTupleX() {
SingleOutputStreamOperator<OUT> projOperator = null;
switch (fieldIndexes.length) {
case 1: projOperator = (SingleOutputStreamOperator<OUT>) projectTuple1(); break;
case 2: projOperator = (SingleOutpu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"OUT",
"extends",
"Tuple",
">",
"SingleOutputStreamOperator",
"<",
"OUT",
">",
"projectTupleX",
"(",
")",
"{",
"SingleOutputStreamOperator",
"<",
"OUT",
">",
"projOperator",
"=",
"null",
";",
"sw... | Chooses a projectTupleX according to the length of
{@link org.apache.flink.streaming.api.datastream.StreamProjection#fieldIndexes}.
@return The projected DataStream.
@see org.apache.flink.api.java.operators.ProjectOperator.Projection | [
"Chooses",
"a",
"projectTupleX",
"according",
"to",
"the",
"length",
"of",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"streaming",
".",
"api",
".",
"datastream",
".",
"StreamProjection#fieldIndexes",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/StreamProjection.java#L89-L124 | train | Project the tuples into a single output stream operator. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
1026,
2041,
8908,
10722,
10814,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
2041,
1028,
2622,
8525,
19386,
1006,
1007,
1063,
2309,
5833,
18780,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/BackendConnection.java | BackendConnection.getConnections | public List<Connection> getConnections(final ConnectionMode connectionMode, final String dataSourceName, final int connectionSize) throws SQLException {
if (stateHandler.isInTransaction()) {
return getConnectionsWithTransaction(connectionMode, dataSourceName, connectionSize);
} else {
... | java | public List<Connection> getConnections(final ConnectionMode connectionMode, final String dataSourceName, final int connectionSize) throws SQLException {
if (stateHandler.isInTransaction()) {
return getConnectionsWithTransaction(connectionMode, dataSourceName, connectionSize);
} else {
... | [
"public",
"List",
"<",
"Connection",
">",
"getConnections",
"(",
"final",
"ConnectionMode",
"connectionMode",
",",
"final",
"String",
"dataSourceName",
",",
"final",
"int",
"connectionSize",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"stateHandler",
".",
"isIn... | Get connections of current thread datasource.
@param connectionMode connection mode
@param dataSourceName data source name
@param connectionSize size of connections to be get
@return connections
@throws SQLException SQL exception | [
"Get",
"connections",
"of",
"current",
"thread",
"datasource",
"."
] | 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/BackendConnection.java#L137-L143 | train | Gets the connections. | [
30522,
2270,
2862,
1026,
4434,
1028,
2131,
8663,
2638,
22014,
1006,
2345,
4434,
5302,
3207,
4434,
5302,
3207,
1010,
2345,
5164,
2951,
6499,
3126,
27524,
14074,
1010,
2345,
20014,
7264,
4697,
1007,
11618,
29296,
10288,
24422,
1063,
2065,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getFieldValues | public static <T> List<T> getFieldValues(Iterable<?> collection, final String fieldName, final Class<T> elementType) {
List<Object> fieldValues = getFieldValues(collection, fieldName);
return Convert.toList(elementType, fieldValues);
} | java | public static <T> List<T> getFieldValues(Iterable<?> collection, final String fieldName, final Class<T> elementType) {
List<Object> fieldValues = getFieldValues(collection, fieldName);
return Convert.toList(elementType, fieldValues);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getFieldValues",
"(",
"Iterable",
"<",
"?",
">",
"collection",
",",
"final",
"String",
"fieldName",
",",
"final",
"Class",
"<",
"T",
">",
"elementType",
")",
"{",
"List",
"<",
"Object",
">",
... | 获取给定Bean列表中指定字段名对应字段值的列表<br>
列表元素支持Bean与Map
@param <T> 元素类型
@param collection Bean集合或Map集合
@param fieldName 字段名或map的键
@param elementType 元素类型类
@return 字段值列表
@since 4.5.6 | [
"获取给定Bean列表中指定字段名对应字段值的列表<br",
">",
"列表元素支持Bean与Map"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1197-L1200 | train | Gets the field values of a collection. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
2131,
3790,
10175,
15808,
1006,
2009,
6906,
3468,
1026,
1029,
1028,
3074,
1010,
2345,
5164,
30524,
2709,
10463,
1012,
2000,
9863,
1006,
5783,
13874,
1010,
2492,
10175,
15808,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/ErrorPacket.java | ErrorPacket.fromBytes | public void fromBytes(byte[] data) {
int index = 0;
// 1. read field count
this.fieldCount = data[0];
index++;
// 2. read error no.
this.errorNumber = ByteHelper.readUnsignedShortLittleEndian(data, index);
index += 2;
// 3. read marker
this.sqlStat... | java | public void fromBytes(byte[] data) {
int index = 0;
// 1. read field count
this.fieldCount = data[0];
index++;
// 2. read error no.
this.errorNumber = ByteHelper.readUnsignedShortLittleEndian(data, index);
index += 2;
// 3. read marker
this.sqlStat... | [
"public",
"void",
"fromBytes",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"index",
"=",
"0",
";",
"// 1. read field count",
"this",
".",
"fieldCount",
"=",
"data",
"[",
"0",
"]",
";",
"index",
"++",
";",
"// 2. read error no.",
"this",
".",
"errorNu... | <pre>
VERSION 4.1
Bytes Name
----- ----
1 field_count, always = 0xff
2 errno
1 (sqlstate marker), always '#'
5 sqlstate (5 characters)
n message
... | [
"<pre",
">",
"VERSION",
"4",
".",
"1",
"Bytes",
"Name",
"-----",
"----",
"1",
"field_count",
"always",
"=",
"0xff",
"2",
"errno",
"1",
"(",
"sqlstate",
"marker",
")",
"always",
"#",
"5",
"sqlstate",
"(",
"5",
"characters",
")",
"n",
"message"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/ErrorPacket.java#L29-L46 | train | Reads the CRASS from byte array. | [
30522,
2270,
11675,
2013,
3762,
4570,
1006,
24880,
1031,
1033,
2951,
1007,
1063,
20014,
5950,
1027,
1014,
1025,
1013,
1013,
1015,
1012,
3191,
2492,
4175,
2023,
1012,
2492,
3597,
16671,
1027,
2951,
1031,
1014,
1033,
1025,
5950,
1009,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.putStringNormalizedKey | public static void putStringNormalizedKey(
BinaryString value, MemorySegment target, int offset, int numBytes) {
final int limit = offset + numBytes;
final int end = value.getSizeInBytes();
for (int i = 0; i < end && offset < limit; i++) {
target.put(offset++, value.getByte(i));
}
for (int i = offset; ... | java | public static void putStringNormalizedKey(
BinaryString value, MemorySegment target, int offset, int numBytes) {
final int limit = offset + numBytes;
final int end = value.getSizeInBytes();
for (int i = 0; i < end && offset < limit; i++) {
target.put(offset++, value.getByte(i));
}
for (int i = offset; ... | [
"public",
"static",
"void",
"putStringNormalizedKey",
"(",
"BinaryString",
"value",
",",
"MemorySegment",
"target",
",",
"int",
"offset",
",",
"int",
"numBytes",
")",
"{",
"final",
"int",
"limit",
"=",
"offset",
"+",
"numBytes",
";",
"final",
"int",
"end",
"... | UTF-8 supports bytes comparison. | [
"UTF",
"-",
"8",
"supports",
"bytes",
"comparison",
"."
] | 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#L74-L85 | train | Put a binary string into a MemorySegment. | [
30522,
2270,
10763,
11675,
8509,
18886,
3070,
12131,
9067,
3550,
14839,
1006,
12441,
3367,
4892,
3643,
1010,
3638,
3366,
21693,
4765,
4539,
1010,
20014,
16396,
1010,
20014,
15903,
17250,
2015,
1007,
1063,
2345,
20014,
5787,
1027,
16396,
1009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/taskmanager/Task.java | Task.transitionState | private boolean transitionState(ExecutionState currentState, ExecutionState newState, Throwable cause) {
if (STATE_UPDATER.compareAndSet(this, currentState, newState)) {
if (cause == null) {
LOG.info("{} ({}) switched from {} to {}.", taskNameWithSubtask, executionId, currentState, newState);
} else {
L... | java | private boolean transitionState(ExecutionState currentState, ExecutionState newState, Throwable cause) {
if (STATE_UPDATER.compareAndSet(this, currentState, newState)) {
if (cause == null) {
LOG.info("{} ({}) switched from {} to {}.", taskNameWithSubtask, executionId, currentState, newState);
} else {
L... | [
"private",
"boolean",
"transitionState",
"(",
"ExecutionState",
"currentState",
",",
"ExecutionState",
"newState",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"STATE_UPDATER",
".",
"compareAndSet",
"(",
"this",
",",
"currentState",
",",
"newState",
")",
")",
... | Try to transition the execution state from the current state to the new state.
@param currentState of the execution
@param newState of the execution
@param cause of the transition change or null
@return true if the transition was successful, otherwise false | [
"Try",
"to",
"transition",
"the",
"execution",
"state",
"from",
"the",
"current",
"state",
"to",
"the",
"new",
"state",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L962-L974 | train | Transition the state of the task. | [
30522,
2797,
22017,
20898,
22166,
12259,
1006,
22679,
12259,
14731,
12259,
1010,
22679,
12259,
2739,
12259,
1010,
5466,
3085,
3426,
1007,
1063,
2065,
1006,
2110,
1035,
10651,
2099,
1012,
12826,
29560,
3388,
1006,
2023,
1010,
14731,
12259,
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/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java | OrcBatchReader.readField | private static void readField(Object[] vals, int fieldIdx, TypeDescription schema, ColumnVector vector, int childCount) {
// check the type of the vector to decide how to read it.
switch (schema.getCategory()) {
case BOOLEAN:
if (vector.noNulls) {
readNonNullLongColumn(vals, fieldIdx, (LongColumnVector... | java | private static void readField(Object[] vals, int fieldIdx, TypeDescription schema, ColumnVector vector, int childCount) {
// check the type of the vector to decide how to read it.
switch (schema.getCategory()) {
case BOOLEAN:
if (vector.noNulls) {
readNonNullLongColumn(vals, fieldIdx, (LongColumnVector... | [
"private",
"static",
"void",
"readField",
"(",
"Object",
"[",
"]",
"vals",
",",
"int",
"fieldIdx",
",",
"TypeDescription",
"schema",
",",
"ColumnVector",
"vector",
",",
"int",
"childCount",
")",
"{",
"// check the type of the vector to decide how to read it.",
"switch... | Reads a vector of data into an array of objects.
@param vals The array that needs to be filled.
@param fieldIdx If the vals array is an array of Row, the index of the field that needs to be filled.
Otherwise a -1 must be passed and the data is directly filled into the array.
@param schema The schema of the vector to r... | [
"Reads",
"a",
"vector",
"of",
"data",
"into",
"an",
"array",
"of",
"objects",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L158-L274 | train | Read a field from the given vector. | [
30522,
2797,
10763,
11675,
3191,
3790,
1006,
4874,
1031,
1033,
11748,
2015,
1010,
20014,
2492,
3593,
2595,
1010,
21189,
2229,
23235,
3258,
8040,
28433,
1010,
5930,
3726,
16761,
9207,
1010,
20014,
2775,
3597,
16671,
1007,
1063,
1013,
1013,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/StreamGraph.java | StreamGraph.addVirtualPartitionNode | public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) {
if (virtualPartitionNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual partition node with id " + virtualId);
}
virtualPartitionNodes.put(virtualId,
new Tuple2<... | java | public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) {
if (virtualPartitionNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual partition node with id " + virtualId);
}
virtualPartitionNodes.put(virtualId,
new Tuple2<... | [
"public",
"void",
"addVirtualPartitionNode",
"(",
"Integer",
"originalId",
",",
"Integer",
"virtualId",
",",
"StreamPartitioner",
"<",
"?",
">",
"partitioner",
")",
"{",
"if",
"(",
"virtualPartitionNodes",
".",
"containsKey",
"(",
"virtualId",
")",
")",
"{",
"th... | Adds a new virtual node that is used to connect a downstream vertex to an input with a
certain partitioning.
<p>When adding an edge from the virtual node to a downstream node the connection will be made
to the original node, but with the partitioning given here.
@param originalId ID of the node that should be connect... | [
"Adds",
"a",
"new",
"virtual",
"node",
"that",
"is",
"used",
"to",
"connect",
"a",
"downstream",
"vertex",
"to",
"an",
"input",
"with",
"a",
"certain",
"partitioning",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L347-L355 | train | Add a virtual partition node to the partition graph. | [
30522,
2270,
11675,
5587,
21663,
26302,
14277,
8445,
22753,
3630,
3207,
1006,
16109,
2434,
3593,
1010,
16109,
7484,
30524,
19362,
3775,
3508,
3630,
6155,
1012,
3397,
14839,
1006,
7484,
3593,
1007,
1007,
1063,
5466,
2047,
6206,
9153,
17389,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-gelly/src/main/java/org/apache/flink/graph/library/clustering/TriangleListingBase.java | TriangleListingBase.setSortTriangleVertices | public TriangleListingBase<K, VV, EV, R> setSortTriangleVertices(boolean sortTriangleVertices) {
this.sortTriangleVertices.set(sortTriangleVertices);
return this;
} | java | public TriangleListingBase<K, VV, EV, R> setSortTriangleVertices(boolean sortTriangleVertices) {
this.sortTriangleVertices.set(sortTriangleVertices);
return this;
} | [
"public",
"TriangleListingBase",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"R",
">",
"setSortTriangleVertices",
"(",
"boolean",
"sortTriangleVertices",
")",
"{",
"this",
".",
"sortTriangleVertices",
".",
"set",
"(",
"sortTriangleVertices",
")",
";",
"return",
"this",... | Normalize the triangle listing such that for each result (K0, K1, K2)
the vertex IDs are sorted K0 < K1 < K2.
@param sortTriangleVertices whether to output each triangle's vertices in sorted order
@return this | [
"Normalize",
"the",
"triangle",
"listing",
"such",
"that",
"for",
"each",
"result",
"(",
"K0",
"K1",
"K2",
")",
"the",
"vertex",
"IDs",
"are",
"sorted",
"K0",
"<",
"K1",
"<",
"K2",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/clustering/TriangleListingBase.java#L63-L67 | train | Sets whether the triangle list should be sorted. | [
30522,
2270,
9546,
9863,
2075,
15058,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1010,
1054,
1028,
4520,
11589,
18886,
5654,
20414,
8743,
23522,
1006,
22017,
20898,
4066,
18886,
5654,
20414,
8743,
23522,
1007,
1063,
2023,
1012,
30524,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java | IdcardUtil.getGenderByIdCard | public static int getGenderByIdCard(String idCard) {
Assert.notBlank(idCard);
final int len = idCard.length();
if(len < CHINA_ID_MIN_LENGTH) {
throw new IllegalArgumentException("ID Card length must be 15 or 18");
}
if (len == CHINA_ID_MIN_LENGTH) {
idCard = convert15To18(idCard);
}
cha... | java | public static int getGenderByIdCard(String idCard) {
Assert.notBlank(idCard);
final int len = idCard.length();
if(len < CHINA_ID_MIN_LENGTH) {
throw new IllegalArgumentException("ID Card length must be 15 or 18");
}
if (len == CHINA_ID_MIN_LENGTH) {
idCard = convert15To18(idCard);
}
cha... | [
"public",
"static",
"int",
"getGenderByIdCard",
"(",
"String",
"idCard",
")",
"{",
"Assert",
".",
"notBlank",
"(",
"idCard",
")",
";",
"final",
"int",
"len",
"=",
"idCard",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"<",
"CHINA_ID_MIN_LENGTH",
")",
... | 根据身份编号获取性别,只支持15或18位身份证号码
@param idCard 身份编号
@return 性别(1: 男,0: 女) | [
"根据身份编号获取性别,只支持15或18位身份证号码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java#L480-L498 | train | Gets the Gender By Card. | [
30522,
2270,
10763,
20014,
2131,
6914,
4063,
3762,
3593,
11522,
1006,
5164,
8909,
11522,
1007,
1063,
20865,
1012,
2025,
28522,
8950,
1006,
8909,
11522,
1007,
1025,
2345,
20014,
18798,
1027,
8909,
11522,
1012,
3091,
1006,
1007,
1025,
2065,
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/utility/TextUtility.java | TextUtility.long2char | public static char[] long2char(long x)
{
char[] c = new char[4];
c[0] = (char) (x >> 48);
c[1] = (char) (x >> 32);
c[2] = (char) (x >> 16);
c[3] = (char) (x);
return c;
} | java | public static char[] long2char(long x)
{
char[] c = new char[4];
c[0] = (char) (x >> 48);
c[1] = (char) (x >> 32);
c[2] = (char) (x >> 16);
c[3] = (char) (x);
return c;
} | [
"public",
"static",
"char",
"[",
"]",
"long2char",
"(",
"long",
"x",
")",
"{",
"char",
"[",
"]",
"c",
"=",
"new",
"char",
"[",
"4",
"]",
";",
"c",
"[",
"0",
"]",
"=",
"(",
"char",
")",
"(",
"x",
">>",
"48",
")",
";",
"c",
"[",
"1",
"]",
... | 转换long型为char数组
@param x | [
"转换long型为char数组"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L539-L547 | train | long2char This is a utility method to convert a long to a char array. | [
30522,
2270,
10763,
25869,
1031,
1033,
2146,
2475,
7507,
2099,
1006,
2146,
1060,
1007,
1063,
25869,
1031,
1033,
1039,
1027,
2047,
25869,
1031,
1018,
1033,
1025,
1039,
1031,
1014,
1033,
1027,
1006,
25869,
1007,
1006,
1060,
1028,
1028,
4466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/BoundedPriorityQueue.java | BoundedPriorityQueue.offer | @Override
public boolean offer(E e) {
if(size() >= capacity) {
E head = peek();
if (this.comparator().compare(e, head) <= 0){
return true;
}
//当队列满时,就要淘汰顶端队列
poll();
}
return super.offer(e);
} | java | @Override
public boolean offer(E e) {
if(size() >= capacity) {
E head = peek();
if (this.comparator().compare(e, head) <= 0){
return true;
}
//当队列满时,就要淘汰顶端队列
poll();
}
return super.offer(e);
} | [
"@",
"Override",
"public",
"boolean",
"offer",
"(",
"E",
"e",
")",
"{",
"if",
"(",
"size",
"(",
")",
">=",
"capacity",
")",
"{",
"E",
"head",
"=",
"peek",
"(",
")",
";",
"if",
"(",
"this",
".",
"comparator",
"(",
")",
".",
"compare",
"(",
"e",
... | 加入元素,当队列满时,淘汰末尾元素
@param e 元素
@return 加入成功与否 | [
"加入元素,当队列满时,淘汰末尾元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/BoundedPriorityQueue.java#L60-L71 | train | offer method. | [
30522,
1030,
2058,
30524,
1026,
1027,
1014,
1007,
1063,
2709,
2995,
1025,
1065,
1013,
1013,
100,
100,
100,
100,
100,
1989,
100,
100,
100,
100,
100,
100,
100,
100,
8554,
1006,
1007,
1025,
1065,
2709,
3565,
1012,
3749,
1006,
1041,
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-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/TPCHQuery3.java | TPCHQuery3.main | public static void main(String[] args) throws Exception {
final ParameterTool params = ParameterTool.fromArgs(args);
if (!params.has("lineitem") && !params.has("customer") && !params.has("orders")) {
System.err.println(" This program expects data from the TPC-H benchmark as input data.");
System.err.printl... | java | public static void main(String[] args) throws Exception {
final ParameterTool params = ParameterTool.fromArgs(args);
if (!params.has("lineitem") && !params.has("customer") && !params.has("orders")) {
System.err.println(" This program expects data from the TPC-H benchmark as input data.");
System.err.printl... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"final",
"ParameterTool",
"params",
"=",
"ParameterTool",
".",
"fromArgs",
"(",
"args",
")",
";",
"if",
"(",
"!",
"params",
".",
"has",
"(",
"\"lineitem... | ************************************************************************* | [
"*************************************************************************"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/TPCHQuery3.java#L86-L177 | train | Main method to run the TPC - H benchmark. | [
30522,
2270,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
11618,
6453,
1063,
2345,
16381,
3406,
4747,
11498,
5244,
1027,
16381,
3406,
4747,
1012,
2013,
2906,
5620,
1006,
12098,
5620,
1007,
1025,
2065,
1006,
999,
11498,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/typeutils/runtime/PojoSerializer.java | PojoSerializer.snapshotConfiguration | @Override
public PojoSerializerSnapshot<T> snapshotConfiguration() {
return buildSnapshot(
clazz,
registeredClasses,
registeredSerializers,
fields,
fieldSerializers,
subclassSerializerCache);
} | java | @Override
public PojoSerializerSnapshot<T> snapshotConfiguration() {
return buildSnapshot(
clazz,
registeredClasses,
registeredSerializers,
fields,
fieldSerializers,
subclassSerializerCache);
} | [
"@",
"Override",
"public",
"PojoSerializerSnapshot",
"<",
"T",
">",
"snapshotConfiguration",
"(",
")",
"{",
"return",
"buildSnapshot",
"(",
"clazz",
",",
"registeredClasses",
",",
"registeredSerializers",
",",
"fields",
",",
"fieldSerializers",
",",
"subclassSerialize... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L577-L586 | train | Creates a snapshot of the configuration of the object. | [
30522,
1030,
2058,
15637,
2270,
13433,
19929,
11610,
28863,
2015,
2532,
4523,
12326,
1026,
1056,
1028,
20057,
12326,
8663,
8873,
27390,
3370,
1006,
1007,
1063,
2709,
16473,
2532,
4523,
12326,
1006,
18856,
10936,
2480,
1010,
5068,
26266,
2229,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sampling/BernoulliSampler.java | BernoulliSampler.sample | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T current = null;
@Override
public boolean hasNext() {
if (current == null) {
current = getNextSampledElement();
}
return current != null;
... | java | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T current = null;
@Override
public boolean hasNext() {
if (current == null) {
current = getNextSampledElement();
}
return current != null;
... | [
"@",
"Override",
"public",
"Iterator",
"<",
"T",
">",
"sample",
"(",
"final",
"Iterator",
"<",
"T",
">",
"input",
")",
"{",
"if",
"(",
"fraction",
"==",
"0",
")",
"{",
"return",
"emptyIterable",
";",
"}",
"return",
"new",
"SampledIterator",
"<",
"T",
... | Sample the input elements, for each input element, take a Bernoulli trail for sampling.
@param input Elements to be sampled.
@return The sampled result which is lazy computed upon input elements. | [
"Sample",
"the",
"input",
"elements",
"for",
"each",
"input",
"element",
"take",
"a",
"Bernoulli",
"trail",
"for",
"sampling",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/sampling/BernoulliSampler.java#L82-L144 | train | Sample an iterator of elements from the input. | [
30522,
1030,
2058,
15637,
2270,
2009,
6906,
4263,
1026,
1056,
1028,
7099,
1006,
2345,
2009,
6906,
4263,
1026,
1056,
1028,
7953,
1007,
1063,
2065,
1006,
12884,
1027,
1027,
1014,
1007,
1063,
2709,
4064,
21646,
3085,
1025,
1065,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java | KeyedStream.timeWindow | public WindowedStream<T, KEY, TimeWindow> timeWindow(Time size) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return window(TumblingProcessingTimeWindows.of(size));
} else {
return window(TumblingEventTimeWindows.of(size));
}
} | java | public WindowedStream<T, KEY, TimeWindow> timeWindow(Time size) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return window(TumblingProcessingTimeWindows.of(size));
} else {
return window(TumblingEventTimeWindows.of(size));
}
} | [
"public",
"WindowedStream",
"<",
"T",
",",
"KEY",
",",
"TimeWindow",
">",
"timeWindow",
"(",
"Time",
"size",
")",
"{",
"if",
"(",
"environment",
".",
"getStreamTimeCharacteristic",
"(",
")",
"==",
"TimeCharacteristic",
".",
"ProcessingTime",
")",
"{",
"return"... | Windows this {@code KeyedStream} into tumbling time windows.
<p>This is a shortcut for either {@code .window(TumblingEventTimeWindows.of(size))} or
{@code .window(TumblingProcessingTimeWindows.of(size))} depending on the time characteristic
set using
{@link org.apache.flink.streaming.api.environment.StreamExecutionEnv... | [
"Windows",
"this",
"{",
"@code",
"KeyedStream",
"}",
"into",
"tumbling",
"time",
"windows",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L611-L617 | train | Create a time window stream. | [
30522,
2270,
3332,
2098,
21422,
1026,
1056,
1010,
3145,
1010,
2051,
11101,
5004,
1028,
2051,
11101,
5004,
1006,
2051,
2946,
1007,
1063,
2065,
1006,
4044,
1012,
4152,
25379,
7292,
7507,
22648,
3334,
6553,
1006,
1007,
1027,
1027,
2051,
7507,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/jdbc/DataSourceInitializer.java | DataSourceInitializer.initSchema | public void initSchema() {
List<Resource> scripts = getScripts("spring.datasource.data",
this.properties.getData(), "data");
if (!scripts.isEmpty()) {
if (!isEnabled()) {
logger.debug("Initialization disabled (not running data scripts)");
return;
}
String username = this.properties.getDataUsern... | java | public void initSchema() {
List<Resource> scripts = getScripts("spring.datasource.data",
this.properties.getData(), "data");
if (!scripts.isEmpty()) {
if (!isEnabled()) {
logger.debug("Initialization disabled (not running data scripts)");
return;
}
String username = this.properties.getDataUsern... | [
"public",
"void",
"initSchema",
"(",
")",
"{",
"List",
"<",
"Resource",
">",
"scripts",
"=",
"getScripts",
"(",
"\"spring.datasource.data\"",
",",
"this",
".",
"properties",
".",
"getData",
"(",
")",
",",
"\"data\"",
")",
";",
"if",
"(",
"!",
"scripts",
... | Initialize the schema if necessary.
@see DataSourceProperties#getData() | [
"Initialize",
"the",
"schema",
"if",
"necessary",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java#L113-L125 | train | Initialize the schema. | [
30522,
2270,
11675,
1999,
12762,
5403,
2863,
1006,
1007,
1063,
2862,
1026,
7692,
1028,
14546,
1027,
4152,
23235,
2015,
1006,
1000,
3500,
1012,
2951,
6499,
3126,
3401,
1012,
2951,
1000,
1010,
2023,
1012,
5144,
1012,
2131,
2850,
2696,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.copy | public static long copy(InputStream in, OutputStream out, int bufferSize) throws IORuntimeException {
return copy(in, out, bufferSize, null);
} | java | public static long copy(InputStream in, OutputStream out, int bufferSize) throws IORuntimeException {
return copy(in, out, bufferSize, null);
} | [
"public",
"static",
"long",
"copy",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"int",
"bufferSize",
")",
"throws",
"IORuntimeException",
"{",
"return",
"copy",
"(",
"in",
",",
"out",
",",
"bufferSize",
",",
"null",
")",
";",
"}"
] | 拷贝流
@param in 输入流
@param out 输出流
@param bufferSize 缓存大小
@return 传输的byte数
@throws IORuntimeException IO异常 | [
"拷贝流"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L146-L148 | train | Copies the contents of the input stream to the output stream using the default encoding. | [
30522,
2270,
10763,
2146,
6100,
1006,
20407,
25379,
1999,
1010,
27852,
25379,
2041,
1010,
20014,
17698,
5332,
4371,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
6100,
1006,
1999,
1010,
2041,
1010,
17698,
5332,
4371,
1010,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java | CharsetUtil.charset | public static Charset charset(String charsetName) throws UnsupportedCharsetException{
return StrUtil.isBlank(charsetName) ? Charset.defaultCharset() : Charset.forName(charsetName);
} | java | public static Charset charset(String charsetName) throws UnsupportedCharsetException{
return StrUtil.isBlank(charsetName) ? Charset.defaultCharset() : Charset.forName(charsetName);
} | [
"public",
"static",
"Charset",
"charset",
"(",
"String",
"charsetName",
")",
"throws",
"UnsupportedCharsetException",
"{",
"return",
"StrUtil",
".",
"isBlank",
"(",
"charsetName",
")",
"?",
"Charset",
".",
"defaultCharset",
"(",
")",
":",
"Charset",
".",
"forNam... | 转换为Charset对象
@param charsetName 字符集,为空则返回默认字符集
@return Charset
@throws UnsupportedCharsetException 编码不支持 | [
"转换为Charset对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java#L37-L39 | train | Returns the charset for the given name. | [
30522,
2270,
10763,
25869,
13462,
25869,
13462,
1006,
5164,
25869,
13462,
18442,
1007,
11618,
4895,
6342,
9397,
15613,
7507,
22573,
2618,
2595,
24422,
1063,
2709,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
25869,
13462,
18442,
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... |
networknt/light-4j | client/src/main/java/com/networknt/client/oauth/OauthHelper.java | OauthHelper.populateCCToken | public static Result<Jwt> populateCCToken(final Jwt jwt) {
boolean isInRenewWindow = jwt.getExpire() - System.currentTimeMillis() < jwt.getTokenRenewBeforeExpired();
logger.trace("isInRenewWindow = " + isInRenewWindow);
//if not in renew window, return the current jwt.
if(!isInRenewWindo... | java | public static Result<Jwt> populateCCToken(final Jwt jwt) {
boolean isInRenewWindow = jwt.getExpire() - System.currentTimeMillis() < jwt.getTokenRenewBeforeExpired();
logger.trace("isInRenewWindow = " + isInRenewWindow);
//if not in renew window, return the current jwt.
if(!isInRenewWindo... | [
"public",
"static",
"Result",
"<",
"Jwt",
">",
"populateCCToken",
"(",
"final",
"Jwt",
"jwt",
")",
"{",
"boolean",
"isInRenewWindow",
"=",
"jwt",
".",
"getExpire",
"(",
")",
"-",
"System",
".",
"currentTimeMillis",
"(",
")",
"<",
"jwt",
".",
"getTokenRenew... | populate/renew jwt info to the give jwt object.
based on the expire time of the jwt, to determine if need to renew jwt or not.
to avoid modifying class member which will case thread-safe problem, move this method from Http2Client to this helper class.
@param jwt the given jwt needs to renew or populate
@return When suc... | [
"populate",
"/",
"renew",
"jwt",
"info",
"to",
"the",
"give",
"jwt",
"object",
".",
"based",
"on",
"the",
"expire",
"time",
"of",
"the",
"jwt",
"to",
"determine",
"if",
"need",
"to",
"renew",
"jwt",
"or",
"not",
".",
"to",
"avoid",
"modifying",
"class"... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/oauth/OauthHelper.java#L565-L584 | train | Populate a jwt with a token. | [
30522,
2270,
10763,
2765,
1026,
1046,
26677,
1028,
3769,
9869,
9468,
18715,
2368,
1006,
2345,
1046,
26677,
1046,
26677,
1007,
1063,
22017,
20898,
2003,
2378,
7389,
7974,
11101,
5004,
1027,
1046,
26677,
1012,
2131,
10288,
20781,
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/monitor/remote/DbRemoteConfigLoader.java | DbRemoteConfigLoader.destroy | @Override
public void destroy() {
executor.shutdownNow();
try {
dataSource.close();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} | java | @Override
public void destroy() {
executor.shutdownNow();
try {
dataSource.close();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} | [
"@",
"Override",
"public",
"void",
"destroy",
"(",
")",
"{",
"executor",
".",
"shutdownNow",
"(",
")",
";",
"try",
"{",
"dataSource",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"e",
".",... | 销毁 | [
"销毁"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/monitor/remote/DbRemoteConfigLoader.java#L242-L250 | train | Destroy the managed data source. | [
30522,
1030,
2058,
15637,
2270,
11675,
6033,
1006,
1007,
1063,
4654,
8586,
16161,
2099,
1012,
3844,
7698,
19779,
1006,
1007,
1025,
3046,
1063,
2951,
6499,
3126,
3401,
1012,
30524,
2131,
7834,
3736,
3351,
1006,
1007,
1010,
1041,
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-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Boolean.parseBoolean(argument);
} | java | public boolean getBoolean(String key, boolean defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Boolean.parseBoolean(argument);
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Boolean",
".",
"p... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L110-L115 | train | Returns the value of the property as a boolean. | [
30522,
2270,
22017,
20898,
2131,
5092,
9890,
2319,
1006,
5164,
3145,
1010,
22017,
20898,
12398,
10175,
5657,
1007,
1063,
5164,
6685,
1027,
2131,
21572,
4842,
3723,
1006,
3145,
1010,
19701,
1007,
1025,
2709,
6685,
1027,
1027,
19701,
1029,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSink.java | StreamingFileSink.forRowFormat | public static <IN> StreamingFileSink.RowFormatBuilder<IN, String> forRowFormat(
final Path basePath, final Encoder<IN> encoder) {
return new StreamingFileSink.RowFormatBuilder<>(basePath, encoder, new DateTimeBucketAssigner<>());
} | java | public static <IN> StreamingFileSink.RowFormatBuilder<IN, String> forRowFormat(
final Path basePath, final Encoder<IN> encoder) {
return new StreamingFileSink.RowFormatBuilder<>(basePath, encoder, new DateTimeBucketAssigner<>());
} | [
"public",
"static",
"<",
"IN",
">",
"StreamingFileSink",
".",
"RowFormatBuilder",
"<",
"IN",
",",
"String",
">",
"forRowFormat",
"(",
"final",
"Path",
"basePath",
",",
"final",
"Encoder",
"<",
"IN",
">",
"encoder",
")",
"{",
"return",
"new",
"StreamingFileSi... | Creates the builder for a {@code StreamingFileSink} with row-encoding format.
@param basePath the base path where all the buckets are going to be created as sub-directories.
@param encoder the {@link Encoder} to be used when writing elements in the buckets.
@param <IN> the type of incoming elements
@return The builder ... | [
"Creates",
"the",
"builder",
"for",
"a",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSink.java#L152-L155 | train | Create a builder for a row format. | [
30522,
2270,
10763,
1026,
1999,
1028,
11058,
8873,
4244,
19839,
1012,
5216,
14192,
4017,
8569,
23891,
2099,
1026,
1999,
1010,
5164,
1028,
2005,
10524,
14192,
4017,
1006,
2345,
4130,
2918,
15069,
1010,
2345,
4372,
16044,
2099,
1026,
1999,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/BooleanUtil.java | BooleanUtil.xor | public static Boolean xor(Boolean... array) {
if (ArrayUtil.isEmpty(array)) {
throw new IllegalArgumentException("The Array must not be empty !");
}
final boolean[] primitive = Convert.convert(boolean[].class, array);
return Boolean.valueOf(xor(primitive));
} | java | public static Boolean xor(Boolean... array) {
if (ArrayUtil.isEmpty(array)) {
throw new IllegalArgumentException("The Array must not be empty !");
}
final boolean[] primitive = Convert.convert(boolean[].class, array);
return Boolean.valueOf(xor(primitive));
} | [
"public",
"static",
"Boolean",
"xor",
"(",
"Boolean",
"...",
"array",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"array",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The Array must not be empty !\"",
")",
";",
"}",
"final",
... | 对Boolean数组取异或
<pre>
BooleanUtil.xor(new Boolean[] { Boolean.TRUE, Boolean.TRUE }) = Boolean.FALSE
BooleanUtil.xor(new Boolean[] { Boolean.FALSE, Boolean.FALSE }) = Boolean.FALSE
BooleanUtil.xor(new Boolean[] { Boolean.TRUE, Boolean.FALSE }) = Boolean.TRUE
</pre>
@param array {@code Boolean} 数组
@return 异或为真取{@code ... | [
"对Boolean数组取异或"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/BooleanUtil.java#L429-L435 | train | XOR two boolean arrays. | [
30522,
2270,
10763,
22017,
20898,
1060,
2953,
1006,
22017,
20898,
1012,
1012,
1012,
9140,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
9140,
1007,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/KeyMap.java | KeyMap.getLongestChainLength | int getLongestChainLength() {
int maxLen = 0;
for (Entry<?, ?> entry : table) {
int thisLen = 0;
while (entry != null) {
thisLen++;
entry = entry.next;
}
maxLen = Math.max(maxLen, thisLen);
}
return maxLen;
} | java | int getLongestChainLength() {
int maxLen = 0;
for (Entry<?, ?> entry : table) {
int thisLen = 0;
while (entry != null) {
thisLen++;
entry = entry.next;
}
maxLen = Math.max(maxLen, thisLen);
}
return maxLen;
} | [
"int",
"getLongestChainLength",
"(",
")",
"{",
"int",
"maxLen",
"=",
"0",
";",
"for",
"(",
"Entry",
"<",
"?",
",",
"?",
">",
"entry",
":",
"table",
")",
"{",
"int",
"thisLen",
"=",
"0",
";",
"while",
"(",
"entry",
"!=",
"null",
")",
"{",
"thisLen... | For testing only: Gets the length of the longest overflow chain.
This method has linear complexity.
@return The length of the longest overflow chain. | [
"For",
"testing",
"only",
":",
"Gets",
"the",
"length",
"of",
"the",
"longest",
"overflow",
"chain",
".",
"This",
"method",
"has",
"linear",
"complexity",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L435-L448 | train | Returns the length of the longest chain. | [
30522,
20014,
2131,
10052,
4355,
24925,
20554,
13159,
2705,
1006,
1007,
1063,
20014,
4098,
7770,
1027,
1014,
1025,
2005,
1006,
4443,
1026,
1029,
1010,
1029,
1028,
4443,
1024,
2795,
1007,
1063,
20014,
2023,
7770,
1027,
1014,
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... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java | SM2.sign | public byte[] sign(byte[] data, byte[] id) {
lock.lock();
final SM2Signer signer = getSigner();
try {
CipherParameters param = new ParametersWithRandom(getCipherParameters(KeyType.PrivateKey));
if (id != null) {
param = new ParametersWithID(param, id);
}
signer.init(true, param);
signe... | java | public byte[] sign(byte[] data, byte[] id) {
lock.lock();
final SM2Signer signer = getSigner();
try {
CipherParameters param = new ParametersWithRandom(getCipherParameters(KeyType.PrivateKey));
if (id != null) {
param = new ParametersWithID(param, id);
}
signer.init(true, param);
signe... | [
"public",
"byte",
"[",
"]",
"sign",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"id",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"final",
"SM2Signer",
"signer",
"=",
"getSigner",
"(",
")",
";",
"try",
"{",
"CipherParameters",
"param",
... | 用私钥对信息生成数字签名
@param data 加密数据
@param id 可以为null,若为null,则默认withId为字节数组:"1234567812345678".getBytes()
@return 签名 | [
"用私钥对信息生成数字签名"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java#L182-L198 | train | Creates a signature using the specified private key. | [
30522,
2270,
24880,
1031,
1033,
3696,
1006,
24880,
1031,
1033,
2951,
1010,
24880,
1031,
1033,
8909,
1007,
1063,
5843,
1012,
5843,
1006,
1007,
1025,
2345,
15488,
2475,
5332,
10177,
2099,
3696,
2121,
1027,
4152,
23773,
2121,
1006,
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... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java | MultipartFormData.getFile | public UploadFile getFile(String paramName) {
UploadFile[] values = getFiles(paramName);
if ((values != null) && (values.length > 0)) {
return values[0];
}
return null;
} | java | public UploadFile getFile(String paramName) {
UploadFile[] values = getFiles(paramName);
if ((values != null) && (values.length > 0)) {
return values[0];
}
return null;
} | [
"public",
"UploadFile",
"getFile",
"(",
"String",
"paramName",
")",
"{",
"UploadFile",
"[",
"]",
"values",
"=",
"getFiles",
"(",
"paramName",
")",
";",
"if",
"(",
"(",
"values",
"!=",
"null",
")",
"&&",
"(",
"values",
".",
"length",
">",
"0",
")",
")... | 获取上传的文件
@param paramName 文件参数名称
@return 上传的文件, 如果无为null | [
"获取上传的文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartFormData.java#L167-L173 | train | Gets the value of the
UploadFile parameter with the given name. | [
30522,
2270,
2039,
11066,
8873,
2571,
2131,
8873,
2571,
1006,
5164,
11498,
2213,
18442,
1007,
1063,
2039,
11066,
8873,
2571,
1031,
1033,
5300,
1027,
2131,
8873,
4244,
1006,
11498,
2213,
18442,
1007,
1025,
2065,
1006,
1006,
5300,
999,
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... |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java | ByteArrayMethods.nextPowerOf2 | public static long nextPowerOf2(long num) {
final long highBit = Long.highestOneBit(num);
return (highBit == num) ? num : highBit << 1;
} | java | public static long nextPowerOf2(long num) {
final long highBit = Long.highestOneBit(num);
return (highBit == num) ? num : highBit << 1;
} | [
"public",
"static",
"long",
"nextPowerOf2",
"(",
"long",
"num",
")",
"{",
"final",
"long",
"highBit",
"=",
"Long",
".",
"highestOneBit",
"(",
"num",
")",
";",
"return",
"(",
"highBit",
"==",
"num",
")",
"?",
"num",
":",
"highBit",
"<<",
"1",
";",
"}"... | Returns the next number greater or equal num that is power of 2. | [
"Returns",
"the",
"next",
"number",
"greater",
"or",
"equal",
"num",
"that",
"is",
"power",
"of",
"2",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java#L29-L32 | train | Returns the next power of 2 of the given number. | [
30522,
2270,
10763,
2146,
2279,
11452,
11253,
2475,
1006,
2146,
16371,
2213,
1007,
1063,
2345,
2146,
2152,
16313,
1027,
2146,
1012,
3284,
5643,
16313,
1006,
16371,
2213,
1007,
1025,
2709,
1006,
2152,
16313,
1027,
1027,
16371,
2213,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.isAllAssignableFrom | public static boolean isAllAssignableFrom(Class<?>[] types1, Class<?>[] types2) {
if (ArrayUtil.isEmpty(types1) && ArrayUtil.isEmpty(types2)) {
return true;
}
if (null == types1 || null == types2) {
// 任何一个为null不相等(之前已判断两个都为null的情况)
return false;
}
if (types1.length != types2.length) {
re... | java | public static boolean isAllAssignableFrom(Class<?>[] types1, Class<?>[] types2) {
if (ArrayUtil.isEmpty(types1) && ArrayUtil.isEmpty(types2)) {
return true;
}
if (null == types1 || null == types2) {
// 任何一个为null不相等(之前已判断两个都为null的情况)
return false;
}
if (types1.length != types2.length) {
re... | [
"public",
"static",
"boolean",
"isAllAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"types1",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types2",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"types1",
")",
"&&",
"ArrayUtil",
".",
"isE... | 比较判断types1和types2两组类,如果types1中所有的类都与types2对应位置的类相同,或者是其父类或接口,则返回<code>true</code>
@param types1 类组1
@param types2 类组2
@return 是否相同、父类或接口 | [
"比较判断types1和types2两组类,如果types1中所有的类都与types2对应位置的类相同,或者是其父类或接口,则返回<code",
">",
"true<",
"/",
"code",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L554-L581 | train | Checks if all the types in the given array are assignable from all the types in the given array. | [
30522,
2270,
10763,
22017,
20898,
18061,
25816,
5332,
16989,
3468,
19699,
5358,
1006,
2465,
1026,
1029,
1028,
1031,
1033,
4127,
2487,
1010,
2465,
1026,
1029,
1028,
1031,
1033,
4127,
2475,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
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... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static File generate(String content, int width, int height, File targetFile) {
final BufferedImage image = generate(content, width, height);
ImgUtil.write(image, targetFile);
return targetFile;
} | java | public static File generate(String content, int width, int height, File targetFile) {
final BufferedImage image = generate(content, width, height);
ImgUtil.write(image, targetFile);
return targetFile;
} | [
"public",
"static",
"File",
"generate",
"(",
"String",
"content",
",",
"int",
"width",
",",
"int",
"height",
",",
"File",
"targetFile",
")",
"{",
"final",
"BufferedImage",
"image",
"=",
"generate",
"(",
"content",
",",
"width",
",",
"height",
")",
";",
"... | 生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param width 宽度
@param height 高度
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件 | [
"生成二维码到文件,二维码图片格式取决于文件的扩展名"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L76-L80 | train | Generates a image of the specified content and writes it to the specified file. | [
30522,
2270,
10763,
5371,
9699,
1006,
5164,
4180,
1010,
20014,
9381,
1010,
20014,
4578,
1010,
5371,
4539,
8873,
2571,
1007,
1063,
2345,
17698,
2098,
9581,
3351,
3746,
1027,
9699,
1006,
4180,
1010,
9381,
1010,
4578,
1007,
1025,
10047,
27920,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ByteToMessageDecoder.java | ByteToMessageDecoder.decodeRemovalReentryProtection | final void decodeRemovalReentryProtection(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
throws Exception {
decodeState = STATE_CALLING_CHILD_DECODE;
try {
decode(ctx, in, out);
} finally {
boolean removePending = decodeState == STATE_HANDLER_REMOVED... | java | final void decodeRemovalReentryProtection(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
throws Exception {
decodeState = STATE_CALLING_CHILD_DECODE;
try {
decode(ctx, in, out);
} finally {
boolean removePending = decodeState == STATE_HANDLER_REMOVED... | [
"final",
"void",
"decodeRemovalReentryProtection",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"in",
",",
"List",
"<",
"Object",
">",
"out",
")",
"throws",
"Exception",
"{",
"decodeState",
"=",
"STATE_CALLING_CHILD_DECODE",
";",
"try",
"{",
"decode",
"(",... | Decode the from one {@link ByteBuf} to an other. This method will be called till either the input
{@link ByteBuf} has nothing to read when return from this method or till nothing was read from the input
{@link ByteBuf}.
@param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belo... | [
"Decode",
"the",
"from",
"one",
"{",
"@link",
"ByteBuf",
"}",
"to",
"an",
"other",
".",
"This",
"method",
"will",
"be",
"called",
"till",
"either",
"the",
"input",
"{",
"@link",
"ByteBuf",
"}",
"has",
"nothing",
"to",
"read",
"when",
"return",
"from",
... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java#L498-L510 | train | Decode removal protection. | [
30522,
2345,
11675,
21933,
4063,
6633,
7103,
20974,
12129,
11129,
21572,
26557,
3508,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
24880,
8569,
2546,
1999,
1010,
2862,
1026,
4874,
1028,
2041,
1007,
11618,
6453,
1063,
21933,
6155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/algorithm/MaxHeap.java | MaxHeap.toList | public List<E> toList()
{
ArrayList<E> list = new ArrayList<E>(queue.size());
while (!queue.isEmpty())
{
list.add(0, queue.poll());
}
return list;
} | java | public List<E> toList()
{
ArrayList<E> list = new ArrayList<E>(queue.size());
while (!queue.isEmpty())
{
list.add(0, queue.poll());
}
return list;
} | [
"public",
"List",
"<",
"E",
">",
"toList",
"(",
")",
"{",
"ArrayList",
"<",
"E",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"E",
">",
"(",
"queue",
".",
"size",
"(",
")",
")",
";",
"while",
"(",
"!",
"queue",
".",
"isEmpty",
"(",
")",
")",
"{... | 转为有序列表,自毁性操作
@return | [
"转为有序列表,自毁性操作"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/MaxHeap.java#L88-L97 | train | Get a list of all the tokens in this sequence. | [
30522,
2270,
2862,
1026,
1041,
1028,
2000,
9863,
1006,
1007,
1063,
9140,
9863,
1026,
1041,
1028,
2862,
1027,
2047,
9140,
9863,
1026,
1041,
1028,
1006,
24240,
1012,
2946,
1006,
1007,
1007,
1025,
2096,
1006,
999,
24240,
1012,
2003,
6633,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/handler/BeanListHandler.java | BeanListHandler.create | public static <E> BeanListHandler<E> create(Class<E> beanType) {
return new BeanListHandler<E>(beanType);
} | java | public static <E> BeanListHandler<E> create(Class<E> beanType) {
return new BeanListHandler<E>(beanType);
} | [
"public",
"static",
"<",
"E",
">",
"BeanListHandler",
"<",
"E",
">",
"create",
"(",
"Class",
"<",
"E",
">",
"beanType",
")",
"{",
"return",
"new",
"BeanListHandler",
"<",
"E",
">",
"(",
"beanType",
")",
";",
"}"
] | 创建一个 BeanListHandler对象
@param <E> 处理对象类型
@param beanType Bean类型
@return BeanListHandler对象 | [
"创建一个",
"BeanListHandler对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/BeanListHandler.java#L26-L28 | train | Creates a new instance of the BeanListHandler class. | [
30522,
2270,
10763,
1026,
1041,
1028,
14068,
9863,
11774,
3917,
1026,
1041,
1028,
3443,
1006,
2465,
1026,
1041,
1028,
14068,
13874,
1007,
1063,
2709,
2047,
14068,
9863,
11774,
3917,
1026,
1041,
1028,
1006,
14068,
13874,
1007,
1025,
1065,
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... |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2BitWriter.java | Bzip2BitWriter.writeUnary | void writeUnary(ByteBuf out, int value) {
if (value < 0) {
throw new IllegalArgumentException("value: " + value + " (expected 0 or more)");
}
while (value-- > 0) {
writeBoolean(out, true);
}
writeBoolean(out, false);
} | java | void writeUnary(ByteBuf out, int value) {
if (value < 0) {
throw new IllegalArgumentException("value: " + value + " (expected 0 or more)");
}
while (value-- > 0) {
writeBoolean(out, true);
}
writeBoolean(out, false);
} | [
"void",
"writeUnary",
"(",
"ByteBuf",
"out",
",",
"int",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"value: \"",
"+",
"value",
"+",
"\" (expected 0 or more)\"",
")",
";",
"}",
"while",
"(",... | Writes a zero-terminated unary number to the output {@link ByteBuf}.
Example of the output for value = 6: {@code 1111110}
@param value The number of {@code 1} to write | [
"Writes",
"a",
"zero",
"-",
"terminated",
"unary",
"number",
"to",
"the",
"output",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BitWriter.java#L80-L88 | train | Write a single unary integer to the given byte buffer. | [
30522,
11675,
4339,
9521,
2854,
1006,
24880,
8569,
2546,
2041,
1010,
20014,
3643,
1007,
1063,
2065,
1006,
3643,
1026,
1014,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1000,
3643,
1024,
1000,
1009,
3643,
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... |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/StatementExecutor.java | StatementExecutor.init | public void init(final SQLRouteResult routeResult) throws SQLException {
setSqlStatement(routeResult.getSqlStatement());
getExecuteGroups().addAll(obtainExecuteGroups(routeResult.getRouteUnits()));
cacheStatements();
} | java | public void init(final SQLRouteResult routeResult) throws SQLException {
setSqlStatement(routeResult.getSqlStatement());
getExecuteGroups().addAll(obtainExecuteGroups(routeResult.getRouteUnits()));
cacheStatements();
} | [
"public",
"void",
"init",
"(",
"final",
"SQLRouteResult",
"routeResult",
")",
"throws",
"SQLException",
"{",
"setSqlStatement",
"(",
"routeResult",
".",
"getSqlStatement",
"(",
")",
")",
";",
"getExecuteGroups",
"(",
")",
".",
"addAll",
"(",
"obtainExecuteGroups",... | Initialize executor.
@param routeResult route result
@throws SQLException SQL exception | [
"Initialize",
"executor",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/StatementExecutor.java#L62-L66 | train | Initialize the class. | [
30522,
2270,
11675,
1999,
4183,
1006,
2345,
29296,
22494,
3334,
2229,
11314,
2799,
6072,
11314,
1007,
11618,
29296,
10288,
24422,
1063,
4520,
4160,
4877,
12259,
3672,
1006,
2799,
6072,
11314,
1012,
4152,
4160,
4877,
12259,
3672,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.freeSlot | public int freeSlot(AllocationID allocationId, Throwable cause) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Free slot {}.", taskSlot, cause);
} else {
LOG.info("Free slot {}.", taskSlot);
... | java | public int freeSlot(AllocationID allocationId, Throwable cause) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Free slot {}.", taskSlot, cause);
} else {
LOG.info("Free slot {}.", taskSlot);
... | [
"public",
"int",
"freeSlot",
"(",
"AllocationID",
"allocationId",
",",
"Throwable",
"cause",
")",
"throws",
"SlotNotFoundException",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"allocationId",
")",
";",
"if",
"(",
"taskSlot"... | Tries to free the slot. If the slot is empty it will set the state of the task slot to free
and return its index. If the slot is not empty, then it will set the state of the task slot
to releasing, fail all tasks and return -1.
@param allocationId identifying the task slot to be freed
@param cause to fail the tasks wi... | [
"Tries",
"to",
"free",
"the",
"slot",
".",
"If",
"the",
"slot",
"is",
"empty",
"it",
"will",
"set",
"the",
"state",
"of",
"the",
"task",
"slot",
"to",
"free",
"and",
"return",
"its",
"index",
".",
"If",
"the",
"slot",
"is",
"not",
"empty",
"then",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L301-L352 | train | Free the specified slot. | [
30522,
2270,
20014,
2489,
14540,
4140,
1006,
16169,
3593,
16169,
3593,
1010,
5466,
3085,
3426,
1007,
11618,
10453,
17048,
14876,
8630,
10288,
24422,
1063,
4638,
5498,
2102,
1006,
1007,
1025,
8518,
10994,
8518,
10994,
1027,
2131,
10230,
5705,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java | ConfigurationPropertiesReportEndpoint.configureObjectMapper | protected void configureObjectMapper(ObjectMapper mapper) {
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(MapperFeature.USE_STD_BEAN_NAMING, true);
mapper.setSerializationInclusion(Include.NON_NULL);
applyConfigurationPropertiesFilter(mapper);
applySerializationModifier(m... | java | protected void configureObjectMapper(ObjectMapper mapper) {
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(MapperFeature.USE_STD_BEAN_NAMING, true);
mapper.setSerializationInclusion(Include.NON_NULL);
applyConfigurationPropertiesFilter(mapper);
applySerializationModifier(m... | [
"protected",
"void",
"configureObjectMapper",
"(",
"ObjectMapper",
"mapper",
")",
"{",
"mapper",
".",
"configure",
"(",
"SerializationFeature",
".",
"FAIL_ON_EMPTY_BEANS",
",",
"false",
")",
";",
"mapper",
".",
"configure",
"(",
"MapperFeature",
".",
"USE_STD_BEAN_N... | Configure Jackson's {@link ObjectMapper} to be used to serialize the
{@link ConfigurationProperties @ConfigurationProperties} objects into a {@link Map}
structure.
@param mapper the object mapper | [
"Configure",
"Jackson",
"s",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java#L173-L179 | train | Configure the given object mapper. | [
30522,
5123,
11675,
9530,
8873,
27390,
8780,
2497,
20614,
2863,
18620,
1006,
4874,
2863,
18620,
4949,
4842,
1007,
1063,
4949,
4842,
1012,
9530,
8873,
27390,
2063,
1006,
7642,
3989,
7959,
4017,
5397,
1012,
8246,
1035,
2006,
1035,
4064,
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-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java | DualInputOperator.getOperatorInfo | @Override
@SuppressWarnings("unchecked")
public BinaryOperatorInformation<IN1, IN2, OUT> getOperatorInfo() {
return (BinaryOperatorInformation<IN1, IN2, OUT>) this.operatorInfo;
} | java | @Override
@SuppressWarnings("unchecked")
public BinaryOperatorInformation<IN1, IN2, OUT> getOperatorInfo() {
return (BinaryOperatorInformation<IN1, IN2, OUT>) this.operatorInfo;
} | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"BinaryOperatorInformation",
"<",
"IN1",
",",
"IN2",
",",
"OUT",
">",
"getOperatorInfo",
"(",
")",
"{",
"return",
"(",
"BinaryOperatorInformation",
"<",
"IN1",
",",
"IN2",
",",
"OUT... | Gets the information about the operators input/output types. | [
"Gets",
"the",
"information",
"about",
"the",
"operators",
"input",
"/",
"output",
"types",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputOperator.java#L100-L104 | train | Returns the binary operator information. | [
30522,
1030,
2058,
15637,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
12441,
25918,
8844,
2378,
14192,
3370,
1026,
1999,
2487,
1010,
1999,
2475,
1010,
2041,
1028,
2131,
25918,
8844,
2378,
14876,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/EnumUtil.java | EnumUtil.getNameFieldMap | public static Map<String, Object> getNameFieldMap(Class<? extends Enum<?>> clazz, String fieldName) {
final Enum<?>[] enums = clazz.getEnumConstants();
if (null == enums) {
return null;
}
final Map<String, Object> map = MapUtil.newHashMap(enums.length);
for (Enum<?> e : enums) {
map.put(e.name(),... | java | public static Map<String, Object> getNameFieldMap(Class<? extends Enum<?>> clazz, String fieldName) {
final Enum<?>[] enums = clazz.getEnumConstants();
if (null == enums) {
return null;
}
final Map<String, Object> map = MapUtil.newHashMap(enums.length);
for (Enum<?> e : enums) {
map.put(e.name(),... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getNameFieldMap",
"(",
"Class",
"<",
"?",
"extends",
"Enum",
"<",
"?",
">",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"final",
"Enum",
"<",
"?",
">",
"[",
"]",
"enums",
"=",
"... | 获得枚举名对应指定字段值的Map<br>
键为枚举名,值为字段值
@param clazz 枚举类
@param fieldName 字段名,最终调用getXXX方法
@return 枚举名对应指定字段值的Map | [
"获得枚举名对应指定字段值的Map<br",
">",
"键为枚举名,值为字段值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java#L186-L196 | train | Gets the name field map. | [
30522,
2270,
10763,
4949,
1026,
5164,
1010,
4874,
1028,
2131,
18442,
3790,
2863,
2361,
1006,
2465,
1026,
1029,
8908,
4372,
2819,
1026,
1029,
1028,
1028,
18856,
10936,
2480,
1010,
5164,
2492,
18442,
1007,
1063,
2345,
4372,
2819,
1026,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/corpus/document/sentence/Sentence.java | Sentence.translateLabels | public Sentence translateLabels()
{
for (IWord word : wordList)
{
word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
if (word instanceof CompoundWord)
{
for (Word child : ((CompoundWord) word).innerList)
{
... | java | public Sentence translateLabels()
{
for (IWord word : wordList)
{
word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
if (word instanceof CompoundWord)
{
for (Word child : ((CompoundWord) word).innerList)
{
... | [
"public",
"Sentence",
"translateLabels",
"(",
")",
"{",
"for",
"(",
"IWord",
"word",
":",
"wordList",
")",
"{",
"word",
".",
"setLabel",
"(",
"PartOfSpeechTagDictionary",
".",
"translate",
"(",
"word",
".",
"getLabel",
"(",
")",
")",
")",
";",
"if",
"(",... | 按照 PartOfSpeechTagDictionary 指定的映射表将词语词性翻译过去
@return | [
"按照",
"PartOfSpeechTagDictionary",
"指定的映射表将词语词性翻译过去"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java#L149-L163 | train | Translate the label of the words in the sentence. | [
30522,
2270,
6251,
17637,
20470,
9050,
1006,
1007,
1063,
2005,
1006,
1045,
18351,
2773,
1024,
2773,
9863,
1007,
1063,
2773,
1012,
2275,
20470,
2884,
1006,
2112,
11253,
13102,
4402,
10143,
8490,
29201,
3258,
5649,
1012,
17637,
1006,
2773,
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-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.fromCsvReader | public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
return new GraphCsvReader(verticesPath, edgesPath, context);
} | java | public static GraphCsvReader fromCsvReader(String verticesPath, String edgesPath, ExecutionEnvironment context) {
return new GraphCsvReader(verticesPath, edgesPath, context);
} | [
"public",
"static",
"GraphCsvReader",
"fromCsvReader",
"(",
"String",
"verticesPath",
",",
"String",
"edgesPath",
",",
"ExecutionEnvironment",
"context",
")",
"{",
"return",
"new",
"GraphCsvReader",
"(",
"verticesPath",
",",
"edgesPath",
",",
"context",
")",
";",
... | Creates a Graph from a CSV file of vertices and a CSV file of edges.
@param verticesPath path to a CSV file with the Vertex data.
@param edgesPath path to a CSV file with the Edge data
@param context the Flink execution environment.
@return An instance of {@link org.apache.flink.graph.GraphCsvReader},
on which calling... | [
"Creates",
"a",
"Graph",
"from",
"a",
"CSV",
"file",
"of",
"vertices",
"and",
"a",
"CSV",
"file",
"of",
"edges",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L391-L393 | train | Creates a new Graph from CSV files. | [
30522,
2270,
10763,
10629,
6169,
12229,
9648,
2099,
2013,
6169,
12229,
9648,
2099,
1006,
5164,
18984,
15069,
1010,
5164,
7926,
15069,
1010,
7781,
2368,
21663,
2239,
3672,
6123,
1007,
1063,
2709,
2047,
10629,
6169,
12229,
9648,
2099,
1006,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readLines | public static <T extends Collection<String>> T readLines(URL url, Charset charset, T collection) throws IORuntimeException {
InputStream in = null;
try {
in = url.openStream();
return IoUtil.readLines(in, charset, collection);
} catch (IOException e) {
throw new IORuntimeException(e);
} finally ... | java | public static <T extends Collection<String>> T readLines(URL url, Charset charset, T collection) throws IORuntimeException {
InputStream in = null;
try {
in = url.openStream();
return IoUtil.readLines(in, charset, collection);
} catch (IOException e) {
throw new IORuntimeException(e);
} finally ... | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"String",
">",
">",
"T",
"readLines",
"(",
"URL",
"url",
",",
"Charset",
"charset",
",",
"T",
"collection",
")",
"throws",
"IORuntimeException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
... | 从文件中读取每一行数据
@param <T> 集合类型
@param url 文件的URL
@param charset 字符集
@param collection 集合
@return 文件中的每行内容的集合
@throws IORuntimeException IO异常
@since 3.1.1 | [
"从文件中读取每一行数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2276-L2286 | train | Reads the contents of the specified URL into the specified collection. | [
30522,
2270,
10763,
1026,
1056,
8908,
3074,
1026,
5164,
1028,
1028,
1056,
3191,
12735,
1006,
24471,
2140,
24471,
2140,
1010,
25869,
13462,
25869,
13462,
1010,
1056,
3074,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
20407,
25379,
1999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/query/KvStateLocationRegistry.java | KvStateLocationRegistry.notifyKvStateRegistered | public void notifyKvStateRegistered(
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
KvStateID kvStateId,
InetSocketAddress kvStateServerAddress) {
KvStateLocation location = lookupTable.get(registrationName);
if (location == null) {
// First registration for this ... | java | public void notifyKvStateRegistered(
JobVertexID jobVertexId,
KeyGroupRange keyGroupRange,
String registrationName,
KvStateID kvStateId,
InetSocketAddress kvStateServerAddress) {
KvStateLocation location = lookupTable.get(registrationName);
if (location == null) {
// First registration for this ... | [
"public",
"void",
"notifyKvStateRegistered",
"(",
"JobVertexID",
"jobVertexId",
",",
"KeyGroupRange",
"keyGroupRange",
",",
"String",
"registrationName",
",",
"KvStateID",
"kvStateId",
",",
"InetSocketAddress",
"kvStateServerAddress",
")",
"{",
"KvStateLocation",
"location"... | Notifies the registry about a registered KvState instance.
@param jobVertexId JobVertexID the KvState instance belongs to
@param keyGroupRange Key group range the KvState instance belongs to
@param registrationName Name under which the KvState has been registered
@param kvStateId ID of the registered KvState instance
... | [
"Notifies",
"the",
"registry",
"about",
"a",
"registered",
"KvState",
"instance",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/query/KvStateLocationRegistry.java#L89-L126 | train | Notifies the KvState instance that a KvState has been registered. | [
30522,
2270,
11675,
2025,
8757,
2243,
15088,
12259,
2890,
24063,
6850,
1006,
3105,
16874,
10288,
3593,
3105,
16874,
10288,
3593,
1010,
3145,
17058,
24388,
2063,
3145,
17058,
24388,
2063,
1010,
5164,
8819,
18442,
1010,
24888,
9153,
2618,
3593,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.forEach | public static <K, V> void forEach(Map<K, V> map, KVConsumer<K, V> kvConsumer) {
int index = 0;
for (Entry<K, V> entry : map.entrySet()) {
kvConsumer.accept(entry.getKey(), entry.getValue(), index);
index++;
}
} | java | public static <K, V> void forEach(Map<K, V> map, KVConsumer<K, V> kvConsumer) {
int index = 0;
for (Entry<K, V> entry : map.entrySet()) {
kvConsumer.accept(entry.getKey(), entry.getValue(), index);
index++;
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"forEach",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"KVConsumer",
"<",
"K",
",",
"V",
">",
"kvConsumer",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"Entry",
"<",
"K",
",",... | 循环遍历Map,使用{@link KVConsumer} 接受遍历的每条数据,并针对每条数据做处理
@param <K> Key类型
@param <V> Value类型
@param map {@link Map}
@param kvConsumer {@link KVConsumer} 遍历的每条数据处理器 | [
"循环遍历Map,使用",
"{",
"@link",
"KVConsumer",
"}",
"接受遍历的每条数据,并针对每条数据做处理"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2270-L2276 | train | Iterates over the given map and calls the given KVConsumer for each entry. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
11675,
18921,
6776,
1006,
4949,
1026,
1047,
1010,
1058,
1028,
4949,
1010,
24888,
8663,
23545,
2099,
1026,
1047,
1010,
1058,
1028,
24888,
8663,
23545,
2099,
1007,
1063,
20014,
5950,
1027,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java | BeanCopier.beanToMap | @SuppressWarnings({ "rawtypes", "unchecked" })
private void beanToMap(Object bean, Map targetMap) {
final Collection<PropDesc> props = BeanUtil.getBeanDesc(bean.getClass()).getProps();
final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : ... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
private void beanToMap(Object bean, Map targetMap) {
final Collection<PropDesc> props = BeanUtil.getBeanDesc(bean.getClass()).getProps();
final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : ... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"void",
"beanToMap",
"(",
"Object",
"bean",
",",
"Map",
"targetMap",
")",
"{",
"final",
"Collection",
"<",
"PropDesc",
">",
"props",
"=",
"BeanUtil",
".",
"getBeanD... | 对象转Map
@param bean bean对象
@param targetMap 目标的Map
@return Map
@since 4.1.22 | [
"对象转Map"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L152-L190 | train | Handles the creation of a map from a bean to a map. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1063,
1000,
6315,
13874,
2015,
1000,
1010,
1000,
4895,
5403,
18141,
1000,
1065,
1007,
2797,
11675,
14068,
20389,
9331,
1006,
4874,
14068,
1010,
4949,
4539,
2863,
2361,
1007,
1063,
2345,
3074,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.stringToBytes | public static ByteBuffer stringToBytes(String s) {
return Unpooled.wrappedBuffer(s.getBytes(StandardCharsets.UTF_8)).nioBuffer();
} | java | public static ByteBuffer stringToBytes(String s) {
return Unpooled.wrappedBuffer(s.getBytes(StandardCharsets.UTF_8)).nioBuffer();
} | [
"public",
"static",
"ByteBuffer",
"stringToBytes",
"(",
"String",
"s",
")",
"{",
"return",
"Unpooled",
".",
"wrappedBuffer",
"(",
"s",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
")",
".",
"nioBuffer",
"(",
")",
";",
"}"
] | Convert the given string to a byte buffer. The resulting buffer can be
converted back to the same string through {@link #bytesToString(ByteBuffer)}. | [
"Convert",
"the",
"given",
"string",
"to",
"a",
"byte",
"buffer",
".",
"The",
"resulting",
"buffer",
"can",
"be",
"converted",
"back",
"to",
"the",
"same",
"string",
"through",
"{"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java#L71-L73 | train | Converts a string to a ByteBuffer. | [
30522,
2270,
10763,
24880,
8569,
12494,
5164,
3406,
3762,
4570,
1006,
5164,
1055,
1007,
1063,
2709,
4895,
16869,
2098,
1012,
5058,
8569,
12494,
1006,
1055,
1012,
2131,
3762,
4570,
1006,
3115,
7507,
22573,
3215,
1012,
21183,
2546,
1035,
1022... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.encode | void encode(ByteBuf out) {
// Create optimised selector list and Huffman tables
generateHuffmanOptimisationSeeds();
for (int i = 3; i >= 0; i--) {
optimiseSelectorsAndHuffmanTables(i == 0);
}
assignHuffmanCodeSymbols();
// Write out the tables and the block d... | java | void encode(ByteBuf out) {
// Create optimised selector list and Huffman tables
generateHuffmanOptimisationSeeds();
for (int i = 3; i >= 0; i--) {
optimiseSelectorsAndHuffmanTables(i == 0);
}
assignHuffmanCodeSymbols();
// Write out the tables and the block d... | [
"void",
"encode",
"(",
"ByteBuf",
"out",
")",
"{",
"// Create optimised selector list and Huffman tables",
"generateHuffmanOptimisationSeeds",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"3",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"optimiseSelectorsAndHu... | Encodes and writes the block data. | [
"Encodes",
"and",
"writes",
"the",
"block",
"data",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanStageEncoder.java#L362-L373 | train | Encode the C ++ record set into the given output buffer. | [
30522,
11675,
4372,
16044,
1006,
24880,
8569,
2546,
2041,
1007,
1063,
1013,
1013,
3443,
23569,
27605,
6924,
27000,
2862,
1998,
21301,
2386,
7251,
9699,
6979,
4246,
2386,
7361,
3775,
15630,
10708,
13089,
2015,
1006,
1007,
1025,
2005,
1006,
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 | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.newRedirectDnsServerStream | protected DnsServerAddressStream newRedirectDnsServerStream(
@SuppressWarnings("unused") String hostname, List<InetSocketAddress> nameservers) {
DnsServerAddressStream cached = authoritativeDnsServerCache().get(hostname);
if (cached == null || cached.size() == 0) {
// If there is... | java | protected DnsServerAddressStream newRedirectDnsServerStream(
@SuppressWarnings("unused") String hostname, List<InetSocketAddress> nameservers) {
DnsServerAddressStream cached = authoritativeDnsServerCache().get(hostname);
if (cached == null || cached.size() == 0) {
// If there is... | [
"protected",
"DnsServerAddressStream",
"newRedirectDnsServerStream",
"(",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"String",
"hostname",
",",
"List",
"<",
"InetSocketAddress",
">",
"nameservers",
")",
"{",
"DnsServerAddressStream",
"cached",
"=",
"authoritativeDns... | Creates a new {@link DnsServerAddressStream} to following a redirected DNS query. By overriding this
it provides the opportunity to sort the name servers before following a redirected DNS query.
@param hostname the hostname.
@param nameservers The addresses of the DNS servers which are used in the event of a redirect.... | [
"Creates",
"a",
"new",
"{",
"@link",
"DnsServerAddressStream",
"}",
"to",
"following",
"a",
"redirected",
"DNS",
"query",
".",
"By",
"overriding",
"this",
"it",
"provides",
"the",
"opportunity",
"to",
"sort",
"the",
"name",
"servers",
"before",
"following",
"a... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L477-L487 | train | Creates a new DNS server stream for a redirect. | [
30522,
5123,
1040,
3619,
8043,
26061,
14141,
8303,
21422,
2047,
5596,
7442,
6593,
2094,
3619,
8043,
14028,
25379,
1006,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
15171,
1000,
1007,
5164,
3677,
18442,
1010,
2862,
1026,
1999,
8454,
7432,
129... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/FileUtils.java | FileUtils.readFile | public static String readFile(File file, String charsetName) throws IOException {
byte[] bytes = readAllBytes(file.toPath());
return new String(bytes, charsetName);
} | java | public static String readFile(File file, String charsetName) throws IOException {
byte[] bytes = readAllBytes(file.toPath());
return new String(bytes, charsetName);
} | [
"public",
"static",
"String",
"readFile",
"(",
"File",
"file",
",",
"String",
"charsetName",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"readAllBytes",
"(",
"file",
".",
"toPath",
"(",
")",
")",
";",
"return",
"new",
"String",
"("... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L105-L108 | train | Read the contents of the file into a String. | [
30522,
2270,
10763,
5164,
3191,
8873,
2571,
1006,
5371,
5371,
1010,
5164,
25869,
13462,
18442,
1007,
11618,
22834,
10288,
24422,
1063,
24880,
1031,
1033,
27507,
1027,
3191,
8095,
3762,
4570,
1006,
5371,
1012,
2327,
8988,
1006,
1007,
1007,
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/web/embedded/undertow/UndertowReactiveWebServerFactory.java | UndertowReactiveWebServerFactory.addBuilderCustomizers | @Override
public void addBuilderCustomizers(UndertowBuilderCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
this.builderCustomizers.addAll(Arrays.asList(customizers));
} | java | @Override
public void addBuilderCustomizers(UndertowBuilderCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
this.builderCustomizers.addAll(Arrays.asList(customizers));
} | [
"@",
"Override",
"public",
"void",
"addBuilderCustomizers",
"(",
"UndertowBuilderCustomizer",
"...",
"customizers",
")",
"{",
"Assert",
".",
"notNull",
"(",
"customizers",
",",
"\"Customizers must not be null\"",
")",
";",
"this",
".",
"builderCustomizers",
".",
"addA... | Add {@link UndertowBuilderCustomizer}s that should be used to customize the
Undertow {@link io.undertow.Undertow.Builder Builder}.
@param customizers the customizers to add | [
"Add",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactory.java#L322-L326 | train | Add customizers to the builder. | [
30522,
1030,
2058,
15637,
2270,
11675,
5587,
8569,
23891,
29006,
20389,
17629,
2015,
1006,
2104,
18790,
8569,
23891,
29006,
20389,
17629,
1012,
1012,
1012,
7661,
17629,
2015,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
7661,
17629,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/TransitionSystem.java | TransitionSystem.transform | Action transform(int act)
{
if (act == 0)
{
return ActionFactory.make_shift();
}
else if (act < 1 + L)
{
return ActionFactory.make_left_arc(act - 1);
}
else if (act < 1 + 2 * L)
{
return ActionFactory.make_right_arc(... | java | Action transform(int act)
{
if (act == 0)
{
return ActionFactory.make_shift();
}
else if (act < 1 + L)
{
return ActionFactory.make_left_arc(act - 1);
}
else if (act < 1 + 2 * L)
{
return ActionFactory.make_right_arc(... | [
"Action",
"transform",
"(",
"int",
"act",
")",
"{",
"if",
"(",
"act",
"==",
"0",
")",
"{",
"return",
"ActionFactory",
".",
"make_shift",
"(",
")",
";",
"}",
"else",
"if",
"(",
"act",
"<",
"1",
"+",
"L",
")",
"{",
"return",
"ActionFactory",
".",
"... | 转换动作id为动作
@param act 动作类型的依存关系id
@return 动作 | [
"转换动作id为动作"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/TransitionSystem.java#L185-L204 | train | Transform an int to an action. | [
30522,
2895,
10938,
1006,
20014,
2552,
1007,
1063,
2065,
1006,
2552,
1027,
1027,
1014,
1007,
1063,
2709,
2895,
21450,
1012,
2191,
1035,
5670,
1006,
1007,
1025,
1065,
2842,
2065,
1006,
2552,
1026,
1015,
1009,
1048,
1007,
1063,
2709,
2895,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/XmlUtil.java | XmlUtil.readObjectFromXml | @SuppressWarnings("unchecked")
public static <T> T readObjectFromXml(InputSource source) throws IOException {
Object result = null;
XMLDecoder xmldec = null;
try {
xmldec = new XMLDecoder(source);
result = xmldec.readObject();
} finally {
IoUtil.close(xmldec);
}
return (T) result;
} | java | @SuppressWarnings("unchecked")
public static <T> T readObjectFromXml(InputSource source) throws IOException {
Object result = null;
XMLDecoder xmldec = null;
try {
xmldec = new XMLDecoder(source);
result = xmldec.readObject();
} finally {
IoUtil.close(xmldec);
}
return (T) result;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"readObjectFromXml",
"(",
"InputSource",
"source",
")",
"throws",
"IOException",
"{",
"Object",
"result",
"=",
"null",
";",
"XMLDecoder",
"xmldec",
"=",
"null",
";",
... | 从XML中读取对象 Reads serialized object from the XML file.
@param <T> 对象类型
@param source {@link InputSource}
@return 对象
@throws IOException IO异常
@since 3.2.0 | [
"从XML中读取对象",
"Reads",
"serialized",
"object",
"from",
"the",
"XML",
"file",
"."
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L199-L210 | train | Reads a
Object object from an XML input stream. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
1028,
1056,
3191,
16429,
20614,
19699,
5358,
2595,
19968,
1006,
20407,
8162,
3401,
3120,
1007,
11618,
22834,
10288,
24422,
1063,
4874,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/XmlUtil.java | XmlUtil.appendChild | public static Element appendChild(Node node, String tagName) {
Document doc = (node instanceof Document) ? (Document) node : node.getOwnerDocument();
Element child = doc.createElement(tagName);
node.appendChild(child);
return child;
} | java | public static Element appendChild(Node node, String tagName) {
Document doc = (node instanceof Document) ? (Document) node : node.getOwnerDocument();
Element child = doc.createElement(tagName);
node.appendChild(child);
return child;
} | [
"public",
"static",
"Element",
"appendChild",
"(",
"Node",
"node",
",",
"String",
"tagName",
")",
"{",
"Document",
"doc",
"=",
"(",
"node",
"instanceof",
"Document",
")",
"?",
"(",
"Document",
")",
"node",
":",
"node",
".",
"getOwnerDocument",
"(",
")",
... | 在已有节点上创建子节点
@param node 节点
@param tagName 标签名
@return 子节点
@since 4.0.9 | [
"在已有节点上创建子节点"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L777-L782 | train | Append a child to a node. | [
30522,
2270,
10763,
5783,
10439,
10497,
19339,
1006,
13045,
13045,
1010,
5164,
6415,
18442,
1007,
1063,
6254,
9986,
1027,
1006,
13045,
6013,
11253,
6254,
1007,
1029,
1006,
6254,
1007,
13045,
1024,
13045,
1012,
2131,
12384,
2121,
3527,
24894,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getBeLong64 | public final long getBeLong64(final int pos) {
final int position = origin + pos;
if (pos + 7 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
+ (pos < 0 ? pos : (pos + 7)));
byte[] buf =... | java | public final long getBeLong64(final int pos) {
final int position = origin + pos;
if (pos + 7 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
+ (pos < 0 ? pos : (pos + 7)));
byte[] buf =... | [
"public",
"final",
"long",
"getBeLong64",
"(",
"final",
"int",
"pos",
")",
"{",
"final",
"int",
"position",
"=",
"origin",
"+",
"pos",
";",
"if",
"(",
"pos",
"+",
"7",
">=",
"limit",
"||",
"pos",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException... | Return 64-bit signed long from buffer. (big-endian)
@see mysql-5.6.10/include/myisampack.h - mi_sint8korr | [
"Return",
"64",
"-",
"bit",
"signed",
"long",
"from",
"buffer",
".",
"(",
"big",
"-",
"endian",
")"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L855-L866 | train | Gets a long from the buffer starting at the given position in the buffer as an unsigned long. | [
30522,
2270,
2345,
2146,
2131,
8671,
5063,
21084,
1006,
2345,
20014,
13433,
2015,
1007,
1063,
2345,
20014,
2597,
1027,
4761,
1009,
13433,
2015,
1025,
2065,
1006,
13433,
2015,
1009,
1021,
1028,
1027,
5787,
1064,
1064,
13433,
2015,
1026,
1014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ZipUtil.java | ZipUtil.unzip | public static File unzip(String zipFilePath, String outFileDir) throws UtilException {
return unzip(zipFilePath, outFileDir, DEFAULT_CHARSET);
} | java | public static File unzip(String zipFilePath, String outFileDir) throws UtilException {
return unzip(zipFilePath, outFileDir, DEFAULT_CHARSET);
} | [
"public",
"static",
"File",
"unzip",
"(",
"String",
"zipFilePath",
",",
"String",
"outFileDir",
")",
"throws",
"UtilException",
"{",
"return",
"unzip",
"(",
"zipFilePath",
",",
"outFileDir",
",",
"DEFAULT_CHARSET",
")",
";",
"}"
] | 解压,默认UTF-8编码
@param zipFilePath 压缩文件的路径
@param outFileDir 解压到的目录
@return 解压的目录
@throws UtilException IO异常 | [
"解压,默认UTF",
"-",
"8编码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L345-L347 | train | Unzip a file into a file system. | [
30522,
2270,
10763,
5371,
4895,
5831,
2361,
1006,
5164,
14101,
8873,
2571,
15069,
1010,
5164,
2041,
8873,
3709,
4313,
1007,
11618,
21183,
9463,
2595,
24422,
1063,
2709,
4895,
5831,
2361,
1006,
14101,
8873,
2571,
15069,
1010,
2041,
8873,
370... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RowUtil.java | RowUtil.writeRow | public static void writeRow(Row row, Iterable<?> rowData, StyleSet styleSet, boolean isHeader) {
int i = 0;
Cell cell;
for (Object value : rowData) {
cell = row.createCell(i);
CellUtil.setCellValue(cell, value, styleSet, isHeader);
i++;
}
} | java | public static void writeRow(Row row, Iterable<?> rowData, StyleSet styleSet, boolean isHeader) {
int i = 0;
Cell cell;
for (Object value : rowData) {
cell = row.createCell(i);
CellUtil.setCellValue(cell, value, styleSet, isHeader);
i++;
}
} | [
"public",
"static",
"void",
"writeRow",
"(",
"Row",
"row",
",",
"Iterable",
"<",
"?",
">",
"rowData",
",",
"StyleSet",
"styleSet",
",",
"boolean",
"isHeader",
")",
"{",
"int",
"i",
"=",
"0",
";",
"Cell",
"cell",
";",
"for",
"(",
"Object",
"value",
":... | 写一行数据
@param row 行
@param rowData 一行的数据
@param styleSet 单元格样式集,包括日期等样式
@param isHeader 是否为标题行 | [
"写一行数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/RowUtil.java#L76-L84 | train | Write a row. | [
30522,
2270,
10763,
11675,
3213,
5004,
1006,
5216,
5216,
1010,
2009,
6906,
3468,
1026,
1029,
1028,
5216,
2850,
2696,
1010,
6782,
3388,
6782,
3388,
1010,
22017,
20898,
2003,
4974,
2121,
1007,
1063,
20014,
1045,
1027,
1014,
1025,
3526,
3526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RestServerEndpoint.java | RestServerEndpoint.shutDownInternal | protected CompletableFuture<Void> shutDownInternal() {
synchronized (lock) {
CompletableFuture<?> channelFuture = new CompletableFuture<>();
if (serverChannel != null) {
serverChannel.close().addListener(finished -> {
if (finished.isSuccess()) {
channelFuture.complete(null);
} else {
... | java | protected CompletableFuture<Void> shutDownInternal() {
synchronized (lock) {
CompletableFuture<?> channelFuture = new CompletableFuture<>();
if (serverChannel != null) {
serverChannel.close().addListener(finished -> {
if (finished.isSuccess()) {
channelFuture.complete(null);
} else {
... | [
"protected",
"CompletableFuture",
"<",
"Void",
">",
"shutDownInternal",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"CompletableFuture",
"<",
"?",
">",
"channelFuture",
"=",
"new",
"CompletableFuture",
"<>",
"(",
")",
";",
"if",
"(",
"serverChannel",... | Stops this REST server endpoint.
@return Future which is completed once the shut down has been finished. | [
"Stops",
"this",
"REST",
"server",
"endpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java#L329-L403 | train | Shuts down the server channel and all child channels. | [
30522,
30524,
1027,
2047,
4012,
10814,
10880,
11263,
11244,
1026,
1028,
1006,
1007,
1025,
2065,
1006,
8241,
26058,
999,
1027,
19701,
1007,
1063,
8241,
26058,
1012,
2485,
1006,
1007,
1012,
5587,
9863,
24454,
1006,
2736,
1011,
1028,
1063,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Http2ConnectionHandler.java | Http2ConnectionHandler.exceptionCaught | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (getEmbeddedHttp2Exception(cause) != null) {
// Some exception in the causality chain is an Http2Exception - handle it.
onError(ctx, false, cause);
} else {
sup... | java | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (getEmbeddedHttp2Exception(cause) != null) {
// Some exception in the causality chain is an Http2Exception - handle it.
onError(ctx, false, cause);
} else {
sup... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"if",
"(",
"getEmbeddedHttp2Exception",
"(",
"cause",
")",
"!=",
"null",
")",
"{",
"// Some exception in the causal... | Handles {@link Http2Exception} objects that were thrown from other handlers. Ignores all other exceptions. | [
"Handles",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L553-L561 | train | Override exceptionCaught to handle Http2Exception. | [
30522,
1030,
2058,
15637,
2270,
11675,
6453,
3540,
18533,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5466,
3085,
3426,
1007,
11618,
6453,
1063,
2065,
1006,
2131,
6633,
8270,
5732,
11039,
25856,
2475,
10288,
24422,
1006,
3426,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/RandomUtil.java | RandomUtil.randomEleSet | public static <T> Set<T> randomEleSet(Collection<T> collection, int count) {
ArrayList<T> source = new ArrayList<>(new HashSet<>(collection));
if (count > source.size()) {
throw new IllegalArgumentException("Count is larger than collection distinct size !");
}
final HashSet<T> result = new HashSet<T>(... | java | public static <T> Set<T> randomEleSet(Collection<T> collection, int count) {
ArrayList<T> source = new ArrayList<>(new HashSet<>(collection));
if (count > source.size()) {
throw new IllegalArgumentException("Count is larger than collection distinct size !");
}
final HashSet<T> result = new HashSet<T>(... | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"randomEleSet",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"int",
"count",
")",
"{",
"ArrayList",
"<",
"T",
">",
"source",
"=",
"new",
"ArrayList",
"<>",
"(",
"new",
"HashSet",
"<>",
... | 随机获得列表中的一定量的不重复元素,返回Set
@param <T> 元素类型
@param collection 列表
@param count 随机取出的个数
@return 随机元素
@throws IllegalArgumentException 需要的长度大于给定集合非重复总数 | [
"随机获得列表中的一定量的不重复元素,返回Set"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L330-L343 | train | Returns a random set of elements from the given collection. | [
30522,
2270,
10763,
1026,
1056,
1028,
2275,
1026,
1056,
1028,
6721,
26741,
3388,
1006,
3074,
1026,
1056,
1028,
3074,
1010,
20014,
4175,
1007,
1063,
9140,
9863,
1026,
1056,
1028,
3120,
1027,
2047,
9140,
9863,
1026,
1028,
1006,
2047,
23325,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-api-java/src/main/java/org/apache/flink/table/api/StreamQueryConfig.java | StreamQueryConfig.withIdleStateRetentionTime | public StreamQueryConfig withIdleStateRetentionTime(Time minTime, Time maxTime) {
if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
throw new IllegalArgumentException(
"Difference between minTime: " + minTime.toString(... | java | public StreamQueryConfig withIdleStateRetentionTime(Time minTime, Time maxTime) {
if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
throw new IllegalArgumentException(
"Difference between minTime: " + minTime.toString(... | [
"public",
"StreamQueryConfig",
"withIdleStateRetentionTime",
"(",
"Time",
"minTime",
",",
"Time",
"maxTime",
")",
"{",
"if",
"(",
"maxTime",
".",
"toMilliseconds",
"(",
")",
"-",
"minTime",
".",
"toMilliseconds",
"(",
")",
"<",
"300000",
"&&",
"!",
"(",
"max... | Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
was not updated, will be retained.
State will never be cleared until it was idle for less than the minimum time and will never
be kept if it was idle for more than the maximum time.
<p>When new data arrives for previously cleane... | [
"Specifies",
"a",
"minimum",
"and",
"a",
"maximum",
"time",
"interval",
"for",
"how",
"long",
"idle",
"state",
"i",
".",
"e",
".",
"state",
"which",
"was",
"not",
"updated",
"will",
"be",
"retained",
".",
"State",
"will",
"never",
"be",
"cleared",
"until... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/StreamQueryConfig.java#L62-L73 | train | Sets the idle state retention time. | [
30522,
2270,
5460,
4226,
2854,
8663,
8873,
2290,
2007,
3593,
4244,
12259,
13465,
4765,
3258,
7292,
1006,
2051,
12927,
14428,
1010,
2051,
4098,
7292,
1007,
1063,
2065,
1006,
4098,
7292,
1012,
3419,
8591,
5562,
8663,
5104,
1006,
1007,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.getAlgorithmAfterWith | public static String getAlgorithmAfterWith(String algorithm) {
Assert.notNull(algorithm, "algorithm must be not null !");
int indexOfWith = StrUtil.lastIndexOfIgnoreCase(algorithm, "with");
if (indexOfWith > 0) {
algorithm = StrUtil.subSuf(algorithm, indexOfWith + "with".length());
}
if ("ECDSA".equa... | java | public static String getAlgorithmAfterWith(String algorithm) {
Assert.notNull(algorithm, "algorithm must be not null !");
int indexOfWith = StrUtil.lastIndexOfIgnoreCase(algorithm, "with");
if (indexOfWith > 0) {
algorithm = StrUtil.subSuf(algorithm, indexOfWith + "with".length());
}
if ("ECDSA".equa... | [
"public",
"static",
"String",
"getAlgorithmAfterWith",
"(",
"String",
"algorithm",
")",
"{",
"Assert",
".",
"notNull",
"(",
"algorithm",
",",
"\"algorithm must be not null !\"",
")",
";",
"int",
"indexOfWith",
"=",
"StrUtil",
".",
"lastIndexOfIgnoreCase",
"(",
"algo... | 获取用于密钥生成的算法<br>
获取XXXwithXXX算法的后半部分算法,如果为ECDSA或SM2,返回算法为EC
@param algorithm XXXwithXXX算法
@return 算法 | [
"获取用于密钥生成的算法<br",
">",
"获取XXXwithXXX算法的后半部分算法,如果为ECDSA或SM2,返回算法为EC"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L536-L546 | train | Returns the algorithm after the given string. | [
30522,
2270,
10763,
5164,
2131,
2389,
20255,
8939,
2863,
6199,
2121,
24415,
1006,
5164,
9896,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
9896,
1010,
1000,
9896,
2442,
2022,
2025,
19701,
999,
1000,
1007,
1025,
20014,
5950,
11253,
2441... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AbstractVectorModel.java | AbstractVectorModel.vector | final public Vector vector(K key)
{
Vector vector = storage.get(key);
if (vector == null) return null;
return vector;
} | java | final public Vector vector(K key)
{
Vector vector = storage.get(key);
if (vector == null) return null;
return vector;
} | [
"final",
"public",
"Vector",
"vector",
"(",
"K",
"key",
")",
"{",
"Vector",
"vector",
"=",
"storage",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"vector",
"==",
"null",
")",
"return",
"null",
";",
"return",
"vector",
";",
"}"
] | 获取一个键的向量(键不会被预处理)
@param key 键
@return 向量 | [
"获取一个键的向量(键不会被预处理)"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L42-L47 | train | Get a single record vector from the cache. | [
30522,
2345,
2270,
9207,
9207,
1006,
1047,
3145,
1007,
1063,
9207,
9207,
1027,
5527,
1012,
2131,
1006,
3145,
1007,
1025,
2065,
1006,
9207,
1027,
1027,
19701,
1007,
2709,
19701,
1025,
2709,
9207,
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,
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/util/LambdaUtil.java | LambdaUtil.withContextClassLoader | public static <R, E extends Throwable> R withContextClassLoader(
final ClassLoader cl,
final SupplierWithException<R, E> s) throws E {
try (TemporaryClassLoaderContext tmpCl = new TemporaryClassLoaderContext(cl)) {
return s.get();
}
} | java | public static <R, E extends Throwable> R withContextClassLoader(
final ClassLoader cl,
final SupplierWithException<R, E> s) throws E {
try (TemporaryClassLoaderContext tmpCl = new TemporaryClassLoaderContext(cl)) {
return s.get();
}
} | [
"public",
"static",
"<",
"R",
",",
"E",
"extends",
"Throwable",
">",
"R",
"withContextClassLoader",
"(",
"final",
"ClassLoader",
"cl",
",",
"final",
"SupplierWithException",
"<",
"R",
",",
"E",
">",
"s",
")",
"throws",
"E",
"{",
"try",
"(",
"TemporaryClass... | Runs the given runnable with the given ClassLoader as the thread's
{@link Thread#setContextClassLoader(ClassLoader) context class loader}.
<p>The method will make sure to set the context class loader of the calling thread
back to what it was before after the runnable completed. | [
"Runs",
"the",
"given",
"runnable",
"with",
"the",
"given",
"ClassLoader",
"as",
"the",
"thread",
"s",
"{",
"@link",
"Thread#setContextClassLoader",
"(",
"ClassLoader",
")",
"context",
"class",
"loader",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/LambdaUtil.java#L92-L99 | train | Create a new instance of the class loader with the specified context classloader. | [
30522,
2270,
10763,
1026,
1054,
1010,
1041,
8908,
5466,
3085,
1028,
1054,
2007,
8663,
18209,
26266,
11066,
2121,
1006,
2345,
2465,
11066,
2121,
18856,
1010,
2345,
17024,
24415,
10288,
24422,
1026,
1054,
1010,
1041,
1028,
1055,
1007,
11618,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ArrayUtil.java | ArrayUtil.sub | public static byte[] sub(byte[] array, int start, int end) {
int length = length(array);
if (start < 0) {
start += length;
}
if (end < 0) {
end += length;
}
if (start == length) {
return new byte[0];
}
if (start > end) {
int tmp = start;
start = end;
end = tmp;
}
if... | java | public static byte[] sub(byte[] array, int start, int end) {
int length = length(array);
if (start < 0) {
start += length;
}
if (end < 0) {
end += length;
}
if (start == length) {
return new byte[0];
}
if (start > end) {
int tmp = start;
start = end;
end = tmp;
}
if... | [
"public",
"static",
"byte",
"[",
"]",
"sub",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"length",
"=",
"length",
"(",
"array",
")",
";",
"if",
"(",
"start",
"<",
"0",
")",
"{",
"start",
"+=",
"lengt... | 获取子数组
@param array 数组
@param start 开始位置(包括)
@param end 结束位置(不包括)
@return 新的数组
@since 4.5.2
@see Arrays#copyOfRange(Object[], int, int) | [
"获取子数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1891-L1914 | train | Returns a subrange of the specified range of the specified byte array. | [
30522,
2270,
10763,
24880,
1031,
1033,
4942,
1006,
24880,
1031,
1033,
9140,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
20014,
3091,
1027,
3091,
1006,
9140,
1007,
1025,
2065,
1006,
2707,
1026,
1014,
1007,
1063,
2707,
1009,
1027,
3091,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.exposeHeaders | public CorsConfigBuilder exposeHeaders(final CharSequence... headers) {
for (CharSequence header: headers) {
exposeHeaders.add(header.toString());
}
return this;
} | java | public CorsConfigBuilder exposeHeaders(final CharSequence... headers) {
for (CharSequence header: headers) {
exposeHeaders.add(header.toString());
}
return this;
} | [
"public",
"CorsConfigBuilder",
"exposeHeaders",
"(",
"final",
"CharSequence",
"...",
"headers",
")",
"{",
"for",
"(",
"CharSequence",
"header",
":",
"headers",
")",
"{",
"exposeHeaders",
".",
"add",
"(",
"header",
".",
"toString",
"(",
")",
")",
";",
"}",
... | Specifies the headers to be exposed to calling clients.
During a simple CORS request, only certain response headers are made available by the
browser, for example using:
<pre>
xhr.getResponseHeader(HttpHeaderNames.CONTENT_TYPE);
</pre>
The headers that are available by default are:
<ul>
<li>Cache-Control</li>
<li>Con... | [
"Specifies",
"the",
"headers",
"to",
"be",
"exposed",
"to",
"calling",
"clients",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L176-L181 | train | Expose headers. | [
30522,
2270,
2522,
2869,
8663,
8873,
18259,
19231,
4063,
14451,
4974,
2545,
1006,
2345,
25869,
3366,
4226,
5897,
1012,
1012,
1012,
20346,
2015,
1007,
1063,
2005,
1006,
25869,
3366,
4226,
5897,
20346,
1024,
20346,
2015,
1007,
1063,
14451,
49... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.