Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Generics - Exception
Generics - Exception [message #73157] Wed, 28 January 2009 14:49 Go to next message
Hitalo is currently offline HitaloFriend
Messages: 4
Registered: July 2009
Junior Member
Good morning!

I wonder if this is possible?
And if you have any way of doing?
Use "Generics" for exception and the "catch" exception get past ...

public abstract privileged aspect AbstractAspect<C extends Exception> {

abstract pointcut point();

declare soft: C : point();

void around() : point() {
try {
return proceed();
} catch (C e) {
System.out.println(e.getMessage());
}
}

}
Re: Generics - Exception [message #73175 is a reply to message #73157] Wed, 28 January 2009 17:04 Go to previous message
Eclipse UserFriend
Originally posted by: andrew.eisenberg.springsource.com

This is not possible. According to the Java spec, type variables are not
allowed in a catch clause. In this case, AspectJ follows with the Java
spec.

For more information:
http://www.angelikalanger.com/GenericsFAQ/FAQSections/Techni calDetails.html#
FAQ304


On 28/01/09 6:49 AM, in article
f60204f4e04f7e3f2f123caa2a85d845$1@www.eclipse.org, "Hitalo"
<hitalooliveira18@gmail.com> wrote:

>
> Good morning!
>
> I wonder if this is possible?
> And if you have any way of doing?
> Use "Generics" for exception and the "catch" exception get past ...
>
> public abstract privileged aspect AbstractAspect<C extends Exception> {
>
> abstract pointcut point();
>
> declare soft: C : point();
>
> void around() : point() {
> try {
> return proceed();
> } catch (C e) {
> System.out.println(e.getMessage());
> }
> }
>
> }
>
Re: Generics - Exception [message #599615 is a reply to message #73157] Wed, 28 January 2009 17:04 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 77
Registered: July 2009
Member
This is not possible. According to the Java spec, type variables are not
allowed in a catch clause. In this case, AspectJ follows with the Java
spec.

For more information:
http://www.angelikalanger.com/GenericsFAQ/FAQSections/Techni calDetails.html#
FAQ304


On 28/01/09 6:49 AM, in article
f60204f4e04f7e3f2f123caa2a85d845$1@www.eclipse.org, "Hitalo"
<hitalooliveira18@gmail.com> wrote:

>
> Good morning!
>
> I wonder if this is possible?
> And if you have any way of doing?
> Use "Generics" for exception and the "catch" exception get past ...
>
> public abstract privileged aspect AbstractAspect<C extends Exception> {
>
> abstract pointcut point();
>
> declare soft: C : point();
>
> void around() : point() {
> try {
> return proceed();
> } catch (C e) {
> System.out.println(e.getMessage());
> }
> }
>
> }
>
Previous Topic:Generics - Exception
Next Topic:using Ajeer for RCP based on eclipse 3.2.3
Goto Forum:
  


Current Time: Fri Apr 19 01:51:42 GMT 2024

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

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

Back to the top