MCPcopy Create free account
hub / github.com/spotbugs/spotbugs / modify_base_class_var

Method modify_base_class_var

spotbugsTestCases/src/java/MaskMe.java:6–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4 private int cruft = 0;
5
6 public int modify_base_class_var() {
7 // Detector should complain about following base_class_var & cruft
8 try {
9 int base_class_var = Integer.parseInt("1");
10 int cruft = 0;
11
12 if (base_class_var == 1)
13 base_class_var = 3;
14 } catch (NumberFormatException nfe) {
15 base_class_var = 2;
16 cruft = 3;
17 }
18 return base_class_var;
19 }
20
21 public int get_base_class_var() {
22 return base_class_var + cruft;

Callers

nothing calls this directly

Calls 1

parseIntMethod · 0.80

Tested by

no test coverage detected