@Test public void testThrowingCheckedException() throws CheckedException1, CheckedException2 { assertEquals(0, StaticUsingArgs.throwingCheckedException(0, "foo")); try { StaticUsingArgs.throwingCheckedException(1, "bar"); } catch (CheckedException1 e) { } try { StaticUsingArgs.throwingCheckedException(2, "baz"); } catch (CheckedException2 e) { } }
@Privileged static int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } }
StaticUsingArgs { @Privileged static int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } } }
StaticUsingArgs { @Privileged static int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } } private  StaticUsingArgs(); }
StaticUsingArgs { @Privileged static int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } } private  StaticUsingArgs();  }
StaticUsingArgs { @Privileged static int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } } private  StaticUsingArgs();   }