Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Exception softening
Exception softening [message #69979] Thu, 29 March 2007 22:27 Go to next message
Eclipse UserFriend
Originally posted by: amster1981.gmail.com

Hello,

I'm working on project(my diploma thesis) in which i would like to use as
many features as AspectJ and AJDT offers. I'm still learning, but so far,
i really like AspectJ and AJDT very much, it's really great for managing
cross-cutting concerns and i feel that i manage to implement more cleaner
and readable code and with better modularity.

The project is 3-tier app, which uses Java GUI, J2EE patterns, EJB, DAO
and such and postgreSQL DB.

I would like to ask about exception softening, because i'm using it for
example for softening SQLException, so that i'm handling it in aspect in
unified manner and it won't propagate further by throws clause or that i
don't have to write try and catch block in every DAO Operation.

When i declare softening like:
pointcut JavaSQLMethods() : call(* java.sql.*.*(..));

declare soft : SQLException : JavaSQLMethods();

When i run the app, then it does work as it should, i don't have to write
try, catch blocks or throws SQLException in every DAO Operation, but it
keeps showing errors in the editor part of IDE.....is it just my problem
or is it known issue?

Andrej J.
Re: Exception softening [message #69998 is a reply to message #69979] Fri, 30 March 2007 07:30 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Andrej,

Are the errors only appearing in the editor (not in the problems view as
well)? If so, you need to use the AspectJ editor instead of the Java
editor. See here for more info:

http://www.eclipse.org/ajdt/faq.php#q:errors

Regards,

Matt.


Andrej wrote:
> Hello,
>
> I'm working on project(my diploma thesis) in which i would like to use
> as many features as AspectJ and AJDT offers. I'm still learning, but so
> far, i really like AspectJ and AJDT very much, it's really great for
> managing cross-cutting concerns and i feel that i manage to implement
> more cleaner and readable code and with better modularity.
>
> The project is 3-tier app, which uses Java GUI, J2EE patterns, EJB, DAO
> and such and postgreSQL DB.
>
> I would like to ask about exception softening, because i'm using it for
> example for softening SQLException, so that i'm handling it in aspect in
> unified manner and it won't propagate further by throws clause or that i
> don't have to write try and catch block in every DAO Operation.
>
> When i declare softening like:
> pointcut JavaSQLMethods() : call(* java.sql.*.*(..));
>
> declare soft : SQLException : JavaSQLMethods();
>
> When i run the app, then it does work as it should, i don't have to
> write try, catch blocks or throws SQLException in every DAO Operation,
> but it keeps showing errors in the editor part of IDE.....is it just my
> problem or is it known issue?
>
> Andrej J.
>
>
Re: Exception softening [message #70017 is a reply to message #69998] Fri, 30 March 2007 11:12 Go to previous message
Eclipse UserFriend
Originally posted by: amster1981.gmail.com

Hi Matt,

Yes, that was exactly the case, the errors were appearing only in the
editor, not in problems view, so i took a look into FAQ, and i couldn't
find Window > Preferences > Workbench > File Associations in Eclipse 3.2.2
which i'm using. But i think it's in Window > Preferences > General >
Editors > File Associations and there i set AspectJ editor as default for
*.java. That helped and it works nicely.

Thank you.

Kind Regards,
Andrej J.
Re: Exception softening [message #596090 is a reply to message #69979] Fri, 30 March 2007 07:30 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Andrej,

Are the errors only appearing in the editor (not in the problems view as
well)? If so, you need to use the AspectJ editor instead of the Java
editor. See here for more info:

http://www.eclipse.org/ajdt/faq.php#q:errors

Regards,

Matt.


Andrej wrote:
> Hello,
>
> I'm working on project(my diploma thesis) in which i would like to use
> as many features as AspectJ and AJDT offers. I'm still learning, but so
> far, i really like AspectJ and AJDT very much, it's really great for
> managing cross-cutting concerns and i feel that i manage to implement
> more cleaner and readable code and with better modularity.
>
> The project is 3-tier app, which uses Java GUI, J2EE patterns, EJB, DAO
> and such and postgreSQL DB.
>
> I would like to ask about exception softening, because i'm using it for
> example for softening SQLException, so that i'm handling it in aspect in
> unified manner and it won't propagate further by throws clause or that i
> don't have to write try and catch block in every DAO Operation.
>
> When i declare softening like:
> pointcut JavaSQLMethods() : call(* java.sql.*.*(..));
>
> declare soft : SQLException : JavaSQLMethods();
>
> When i run the app, then it does work as it should, i don't have to
> write try, catch blocks or throws SQLException in every DAO Operation,
> but it keeps showing errors in the editor part of IDE.....is it just my
> problem or is it known issue?
>
> Andrej J.
>
>
Re: Exception softening [message #596105 is a reply to message #69998] Fri, 30 March 2007 11:12 Go to previous message
Andrej is currently offline AndrejFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Matt,

Yes, that was exactly the case, the errors were appearing only in the
editor, not in problems view, so i took a look into FAQ, and i couldn't
find Window > Preferences > Workbench > File Associations in Eclipse 3.2.2
which i'm using. But i think it's in Window > Preferences > General >
Editors > File Associations and there i set AspectJ editor as default for
*.java. That helped and it works nicely.

Thank you.

Kind Regards,
Andrej J.
Previous Topic:Exception softening
Next Topic:AJDT 1.5M6 for Eclipse 3.3M6 released
Goto Forum:
  


Current Time: Tue Apr 23 13:43:44 GMT 2024

Powered by FUDForum. Page generated in 0.03332 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top