MCPcopy Create free account
hub / github.com/LFYSec/MScan / foo2

Method foo2

src/test/resources/bugfinder/NullDeref3.java:12–25  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

10 }
11
12 Object foo2(Object o) {
13 if (o == null)
14 return o;
15
16 if (o instanceof String)
17 return o;
18
19 // we should flag the o != null test as redundant
20 if (o != null && o instanceof Set)
21 return ((Set) o).iterator();
22
23 // no warning should be generated here
24 return o.getClass();
25 }
26
27 Object bar(Object o) {
28 if (o != null)

Callers

nothing calls this directly

Calls 2

iteratorMethod · 0.65
getClassMethod · 0.65

Tested by

no test coverage detected