more improvements to exceptions thrown by java methods