Files
2026Technology-Competition/data/demo-pmd/src/com/demo/errorprone/extra/CallSuperDemo.java
T
范智鹏 3c390cfa90 feat: demo-pmd 样本工程入库 + Windows spawn cmd EINVAL 修复 + 实测报告清理
- data/demo-pmd 全量入库(26 源文件 + pom/mvnw/lib/reports),.gitignore 排除 target/
- 归档 demo-pmd 实测覆盖率报告(279/279 全覆盖)至 reports/
- 删除 4 份覆盖率报告中的后续建议/实测进度总览(全部实测已收官)
- 修复 Windows spawn .cmd/.bat EINVAL(auxClasspath.ts 经 cmd.exe /d /s /c 间接执行)
2026-08-26 22:04:47 +08:00

36 lines
920 B
Java
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.
// ============================================================
// PMD 演示样例 — CallSuperFirst / CallSuperLast
// 使用 android.app.Activity 生命周期方法
// ============================================================
package com.demo.errorprone.extra;
import android.app.Activity;
import android.os.Bundle;
// 165 CallSuperFirstonCreate 应首先调用 super.onCreate
class MissingSuperFirst extends Activity {
@Override
protected void onCreate(Bundle bundle) {
foo(); // 未先调用 super.onCreate
}
void foo() {
}
}
// 166 CallSuperLastonPause 应最后调用 super.onPause
class MissingSuperLast extends Activity {
@Override
protected void onPause() {
foo(); // 未最后调用 super.onPause
}
void foo() {
}
}
class CallSuperMain {
public static void main(String[] args) {
System.out.println("demo call super");
}
}