chore(瘦身): 摘 13 处零引用私有方法(160 行)与 mapstruct 死依赖
判死的尺子比「生产没调用」更严:private + 无注解 + 非 get/set/is 形态 + 名字在本文件只出现 1 次 + 在全仓 2,074 个跟踪文件(含 tests、mapper XML、两个前端 src)里也只出现 1 次。 tests 里有 57 处 getDeclaredMethod,反射是按名字取方法的,只看调用图会误杀。 同族审计给的是 40 支/450 行,差额那些名字会出现在别处的字符串或日志里,按这个口径不可证死, 所以只搬能证死的 13 处:AppearancePatentTaskService 37、DeleteBrandRunService 31、 QueryAsinTaskService 27、ZiniaoClientImpl 21、PublishWorkbookService 16、 ShopDataCrawlTaskService 9、PatrolDeleteTaskService 9、DedupeTotalDataService 6、 ShopMatchTaskService 4。 mapstruct 判死锚的是包名而不是注解名:本仓的 @Mapper 是 MyBatis-Plus 的 org.apache.ibatis.annotations.Mapper,按注解名判会误杀。依据是 import org.mapstruct 在 main+test 双口径 0,且 target 里没有 *MapperImpl*、generated-sources 0 文件。 验证走独立工作树(与主树同 HEAD d1a3e8a2):改前 mvn -o -q -DskipTests test-compile 出 MVN_RC=0,改后同命令再 0,才按字节搬回;搬回后 git diff --numstat 全是 0 加 / N 删。 主树这些路径在搬之前 0 脏、HEAD 与校验树同点,两条都设了断言。
This commit is contained in:
-37
@@ -2561,11 +2561,6 @@ public class AppearancePatentTaskService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, AppearancePatentResultRowDto> loadPersistedResultRowsForResultRows(
|
||||
Long taskId, List<AppearancePatentResultRowDto> requestedRows) {
|
||||
Set<String> requestedKeys = resultLookupKeysForResultRows(requestedRows);
|
||||
return loadPersistedResultRowsForKeys(taskId, requestedKeys);
|
||||
}
|
||||
|
||||
private Map<String, AppearancePatentResultRowDto> loadPersistedResultRowsForKeys(
|
||||
Long taskId, Set<String> requestedKeys) {
|
||||
@@ -2651,15 +2646,6 @@ public class AppearancePatentTaskService {
|
||||
}
|
||||
}
|
||||
|
||||
private AppearancePatentResultRowDto findPersistedResultRow(
|
||||
AppearancePatentResultRowDto row,
|
||||
Map<String, AppearancePatentResultRowDto> resultMap) {
|
||||
if (row == null || resultMap == null || resultMap.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
AppearancePatentResultRowDto result = resultMap.get(rowKey(row));
|
||||
return result == null ? resultMap.get(legacyRowKey(row)) : result;
|
||||
}
|
||||
|
||||
private void sleepBeforeResultRowsRetry(int attempt) {
|
||||
try {
|
||||
@@ -2683,25 +2669,6 @@ public class AppearancePatentTaskService {
|
||||
}
|
||||
}
|
||||
|
||||
private AppearancePatentResultRowDto findResultRowByAsin(String asin, Map<String, AppearancePatentResultRowDto> resultMap) {
|
||||
String normalizedAsin = normalize(asin).toUpperCase(Locale.ROOT);
|
||||
if (normalizedAsin.isBlank() || resultMap == null || resultMap.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
AppearancePatentResultRowDto fallback = null;
|
||||
for (AppearancePatentResultRowDto row : resultMap.values()) {
|
||||
if (row == null || !normalizedAsin.equals(normalize(row.getAsin()).toUpperCase(Locale.ROOT))) {
|
||||
continue;
|
||||
}
|
||||
if (hasResolvedLlmFields(row) || hasReasonFields(row)) {
|
||||
return row;
|
||||
}
|
||||
if (fallback == null) {
|
||||
fallback = row;
|
||||
}
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
private boolean hasReasonFields(AppearancePatentResultRowDto row) {
|
||||
if (row == null) {
|
||||
@@ -3124,10 +3091,6 @@ public class AppearancePatentTaskService {
|
||||
return transientPayloadStorageService.storeChunkPayloadVersioned(MODULE_TYPE, taskId, scopeHash, chunkIndex, payloadJson);
|
||||
}
|
||||
|
||||
private String storeSharedLlmBatchPayload(Long taskId, String scopeHash, String payloadJson) {
|
||||
requireSharedTransientPayloadStorage("llm batch payload");
|
||||
return transientPayloadStorageService.storeParsedPayloadFast(MODULE_TYPE, taskId, scopeHash, payloadJson, true);
|
||||
}
|
||||
|
||||
private void requireSharedTransientPayloadStorage(String payloadType) {
|
||||
if (!transientPayloadStorageService.isSharedWriteEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user