lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: [JENKINS] Lucene-Solr-tests-only-3.x - Build # 12908 - Failure
Date Thu, 29 Mar 2012 20:37:57 GMT
I know. The VM specification does not even need to know the Exception type. If you trick the
Java compiler by generics to think the method cannot throw the exception it will simply compile
the code. If the Exception that is thrown is checked that does not matter, the VM will bubble
up until someone catches.

The only known other sneaky way is this:

static void sneakyThrow(Throwable t) {

But less cool, I agree. The third way is our all fried sun.misc.Unsafe:


(needs reflections, as always). Much more uncool.

Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: [] On Behalf Of
> Dawid Weiss
> Sent: Thursday, March 29, 2012 9:21 PM
> To:
> Subject: Re: [JENKINS] Lucene-Solr-tests-only-3.x - Build # 12908 - Failure
> bq. Exploits a weakness in the runtime to throw an arbitrary throwable without
> the traditional declaration.
> This is hardly a weakness; it's part of the JVM spec (or rather: the distinction of
> checked/ unchecked is part of the Java specification not the JVM specification).
> > But it's in my opinion a generics bug in combination with
> > suppresswarnings
> It's an exploit of how generics are (under)specified. Many people think checked
> exceptions are actually a stupid invention, I think it's debatable, some of them
> are really annoying...
> Dawid
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: For additional
> commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message