{"record":{"id":"ec49011f9e73c1dc","repo":"chinabugotech/hutool","slug":"task-info-is-not-being-kept","errorCode":null,"errorMessage":"Task info is not being kept!","messagePattern":"Task info is not being kept!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hutool-core/src/main/java/cn/hutool/core/date/StopWatch.java","lineNumber":316,"sourceCode":"\t}\n\n\t/**\n\t * 获取任务数\n\t *\n\t * @return 任务数\n\t */\n\tpublic int getTaskCount() {\n\t\treturn this.taskCount;\n\t}\n\n\t/**\n\t * 获取任务列表\n\t *\n\t * @return 任务列表\n\t */\n\tpublic TaskInfo[] getTaskInfo() {\n\t\tif (null == this.taskList) {\n\t\t\tthrow new UnsupportedOperationException(\"Task info is not being kept!\");\n\t\t}\n\t\treturn this.taskList.toArray(new TaskInfo[0]);\n\t}\n\n\t/**\n\t * 获取任务信息，类似于：\n\t * <pre>\n\t *     StopWatch '[id]': running time = [total] ns\n\t * </pre>\n\t *\n\t * @return 任务信息\n\t */\n\tpublic String shortSummary() {\n\t\treturn shortSummary(null);\n\t}\n\n\t/**\n\t * 获取任务信息，类似于：","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/chinabugotech/hutool/blob/8870454b2a0c29cc6ffd31dcf5667c8ceb2fc442/hutool-core/src/main/java/cn/hutool/core/date/StopWatch.java#L298-L334","documentation":"Error \"Task info is not being kept!\" thrown in chinabugotech/hutool.","triggerScenarios":"Thrown at hutool-core/src/main/java/cn/hutool/core/date/StopWatch.java:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Construct the StopWatch with keepTaskList enabled so task info is retained.","Avoid calling getTaskInfo() when task keeping is disabled."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8870454b2a0c29cc6ffd31dcf5667c8ceb2fc442","analyzedAt":"2026-08-14T04:01:12.892Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}