Replace settings of the project and revise the code accordingly

- Replace org.eclipse.jdt.core.prefs and org.eclipse.jdt.ui.prefs
- Revise code according to formatting rules and warnings
- Add javadoc comments