Fix huge flaw in the Java version that cost 10-11x by collecting stack traces at the creation of each exception.

Fix whitespace errors.