removed multiplied code for exception handling
refactored throwJavaException() and removed useless returns
removed declaration of throwJavaException
Merge pull request #1177 from janstarzy:refactor