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

Class InheritedField

src/test/resources/dataflow/constprop/alias/InheritedField.java:1–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class InheritedField {
2 public static void main(String[] args) {
3 corner1();
4 corner2();
5 }
6
7 static void corner1() {
8 B b = new B();
9 b.setSuperF(22);
10 int x = b.f;
11 int y = foo(b);
12 }
13
14 static int foo(A a) {
15 return a.f;
16 }
17
18 static void corner2() {
19 A a = new A();
20 a.f = 22;
21 B b = new B();
22 b.f = 33;
23 bar(a);
24 int x = b.f;
25 int y = bar(b);
26 }
27
28 static int bar(A a) {
29 return a.f;
30 }
31
32
33}
34
35class A {
36 int f;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected