Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] exceptions and around

I've softened the exception, but when I run the program the code in the
catch clause is not executed.

Eric Macaulay

----- Original Message -----
From: Ramnivas Laddad <ramnivas@xxxxxxxxx>
To: <aspectj-dev@xxxxxxxxxxx>
Sent: Wednesday, June 02, 2004 11:18 PM
Subject: Re: [aspectj-dev] exceptions and around


> You will need to soften the IOException by adding:
>
> declare soft: IOException: call(void Properties.load(InputStream));
>
> -Ramnivas
>
> --- Eric Macaulay <eeoam@xxxxxxxxx> wrote:
> > I have the following constructor:
> >
> > public Server() {
> >   Properties props = new Properties();
> >   props.load(new FileInputStream("properties"));
> >
> >   new Thread(new HTTPServer(1980)).start();
> > System.out.println("server running...");
> >  }
> >
> > and the following advice:
> >
> > void around(): within(Server) && (call(void
> > Properties.load(InputStream))){
> >    try {
> >     System.out.println("opening properties file ...");
> >     proceed();
> >    }catch(IOException x) {
> >     System.out.println("file does not exist.");
> >    }
> >   }
> >
> > However I'm still getting a compiler error complaining that the
> > IOException has not been handled. Any thoughts?
> >
> >
> > Eric Macaulay
> >
> >
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-dev
>



Back to the top