Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Generics - Exception
Generics - Exception [message #73157] Wed, 28 January 2009 09:49 Go to next message
Hitalo is currently offline Hitalo
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 12:04 Go to previous message
Eclipse User
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 12:04 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
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: Thu Aug 28 09:20:22 EDT 2014

Powered by FUDForum. Page generated in 0.02005 seconds