Példa

public static void main( String[] args ){
int number = 0;
try {
number = Integer.parseInt( args[ 0 ] );
} finally {
System.out.println( "finally clause" ); //$NON-NLS-1$
if ( number == 0 ) {
throw new IllegalArgumentException( "Bad argument" ); //$NON-NLS-1$
}
}
}

Megoldás
Helyezze át a throw utasítást a finally blokkon kívülre.

public static void main( String[] args ){
int number = 0;
try {
number = Integer.parseInt( args[ 0 ] );
} finally {
System.out.println( "finally clause" ); //$NON-NLS-1$
}

if ( number == 0 ) {
throw new IllegalArgumentException( "Bad argument" ); //$NON-NLS-1$
}
}