A core calculus for Java exceptions