Files
starRiverProperty/docs/reviews/alibaba-audit-2026-04-24/01-maven-cloudwalk-cloud.md
T
hpd840321 7b2bd307f1 Initial commit: reorganized source tree
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.)
- frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts
- scripts/: build, test-env, tools (Docker Compose, service templates, API parity)
- docs/: AGENTS.md, superpowers specs, architecture docs
- .gitignore: standard Java/Maven exclusions

Moved from legacy maven-*/ root layout to backend/ organized structure.
2026-05-09 09:56:45 +08:00

41 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 01 `maven-cloudwalk-cloud` — 阿里巴巴规范走查(整理版)
**范围**`maven-cloudwalk-cloud/**/*.java`(排除 `target/`),共约 **22** 个源文件。
**性质**:只读静态走查,对照手册常见项;**非** P3C 全量。
## 抽样说明
- 全量阅读非 `package-info` 源文件;重点 **`CloudwalkEventInitializing`(约 361 行)**、`CloudwalkEventManager``EventHandlerMapping``CloudwalkParamsValidateAspect`
- 本模块几乎无 `*Service*` / `*Impl*` / `*Controller*` 典型三层命名。
## 问题清单(节选)
| 严重度 | 位置 | 行(约) | 类别 | 说明 | 建议 |
|--------|------|----------|------|------|------|
| P0 | `cloudwalk-common-event/.../CloudwalkEventManager.java` | 3140 | 空指针 | `getServiceCodeCustomHandlerListMap` 等可能为 null 后链式 `.get` | 判空或早返回 |
| P0 | `cloudwalk-common-event/.../CloudwalkEventInitializing.java` | 178 | 逻辑 | `eventType.getEventClass().getClass().equals(eventClass)` 易永远不匹配 | 改为 `Objects.equals(eventType.getEventClass(), eventClass)` 等与契约一致 |
| P0 | `cloudwalk-common-event/.../handler/EventHandlerMapping.java` | 2830 | 逻辑 | 同上 `getEventClass().getClass()` | 同上 |
| P1 | `.../autoconfig/EventConfiguration.java` | 1121 | Spring | `@EnableConfigurationProperties` 而无 `@Configuration``@Bean` 可能不生效 | 补 `@Configuration` 或核对导入方式 |
| P1 | `.../autoconfig/EventConfiguration.java` | 19 | 命名 | Bean 方法名 `CloudwalkEventInitializing` 首字母大写 | 改为小驼峰 |
| P1 | `CloudwalkEventInitializing.java` | 多处 | 泛型 | `(Class)``(Map)` 等原始类型强转 | 使用带泛型 API 或安全转换工具 |
| P1 | `.../listener/GroupEventListener.java` | 19 | 异常 | `catch (Exception)` 过宽 | 收窄类型 |
| P1 | `.../listener/GroupEventListener.java` | 12 | 日志 | `LoggerFactory.getLogger(CloudwalkEventListener.class)` 与子类不符 | 使用当前类 |
| P1 | `.../service/aop/CloudwalkParamsValidateAspect.java` | 42 | 命名 | `validatePointcat` 疑似 Pointcut 拼写 | 更正命名 |
| P2 | `CloudwalkEventInitializing.java` | 多处 | 魔法值 / 常量命名 | `pattern` 非全大写、`ThreadPoolExecutor` 字面量等 | 提取命名常量 |
| P2 | `.../listener/GroupListnerClassMapping.java` | 类名 | 命名 | `Listner` 拼写错误 | 长期迁移正确拼写 |
| P2 | `.../handler/EventHandlerMapping.java` | 6368 | 封装 | `getHandlerMap` 返回内部可变 Map 引用 | `unmodifiableMap` 或拷贝 |
## 小结
| 级别 | 数量(约) |
|------|------------|
| P0 | 3 |
| P1 | 12 |
| P2 | 15 |
**正向**:未发现空 `catch``System.out`;日志以 Slf4J 为主。
## 后续建议
优先修复 **P0**(事件路由比较与 NPE),再处理 **Spring 配置类元注解****泛型/raw 类型**