Detect constant, but initialized fields with dataflowanalysis
Either
const int i;
if (true) i = 2; // allowed
else i = 3; // allowed
i = 7; // not allowed
... or
const int i = 7; // allowed
i = 2; // not allowed
Either
const int i;
if (true) i = 2; // allowed
else i = 3; // allowed
i = 7; // not allowed
... or
const int i = 7; // allowed
i = 2; // not allowed