MOve affinity out of Janag-Lang and add more javadoc
Code analysis