此方法不能從該類以外的任何方法中獲得。
不會調用這個方法,或者僅僅通過其他 dead code 進行調用。
例 1:在下面這個類中,doWork() 方法將永遠不會被調用。
public class Dead {
private void doWork() {
System.out.println("doing work");
}
public static void main(String[] args) {
System.out.println("running Dead");
}
}
public class DoubleDead {
private void doTweedledee() {
doTweedledumb();
}
private void doTweedledumb() {
doTweedledee();
}
public static void main(String[] args) {
System.out.println("running DoubleDead");
}
}
[1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3050 CAT II
[2] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3050 CAT II
[3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 561