123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
-
- import org.aspectj.testing.Tester;
-
- /** Bugzilla Bug 34925
- compiler crash on yesterday's rc1 build
- */
- import java.io.*;
-
- public aspect ConvertToUnchecked {
-
- public static void main(String[] args) {
- try {
- Foo foo = new Foo("hello");
- Tester.check(false, "shouldn't get here");
- } catch (PersistenceException pe) {
- }
- }
-
- // convert IOExceptions in Foo to PersistenceException
- pointcut module() : within(Foo);
-
- after() throwing (IOException e) : module() {
- throw new PersistenceException(e);
- }
- declare soft: (IOException): module();
- }
-
- class PersistenceException extends RuntimeException
- {
- Throwable cause;
- public PersistenceException(Throwable cause) {
- this.cause = cause;
- }
- }
-
-
- class Root {
- Root(String s) /*throws IOException*/ {
- }
- }
-
- class Foo extends Root {
- Foo(String s) {
- super(s);
- }
-
- static {
- if (false) {
- getFile();
- throw new IOException("bar");
- }
-
- }
-
- {
- if (false) throw new IOException("bar");
- }
-
- File f = getFile();
-
- static File getFile() throws IOException {
- throw new IOException("bad");
- }
-
-
- public void m() {
- throw new IOException("hi");
- }
- }
|