Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Cannot introduce getSize(0 method tojava.util.Collection

Ah. Makes perfect sense, after the fact.

Thanks, Wes. 

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wes Isberg
Sent: Thursday, March 16, 2006 10:04 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Cannot introduce getSize(0 method
tojava.util.Collection

> I have tried to introduce the method:
> public aspect JstlCollectionWrapper {
> 
>     public int ArrayList.getSize() {

You can't declare a method on a class that is outside ajc's scope.  For
information on what code to include for specific language features, see
the Programming Guide Implementation appendix:

 
http://www.eclipse.org/aspectj/doc/released/progguide/implementation.htm
l

Wes


On Thu, 16 Mar 2006 08:31:41 -0500
 "Stearns, Randy" <RStearns@xxxxxxxxxxxxxxxxxx> wrote:
> I'm trying to get the size of a list in a jsp page:
> <c:out value="Number of modules:
> ${viewableModules.size}"/>
> 
> As JSTL uses java bean properties (i.e. size is accessed as 
> getSize()), this doesn't work:
> 
>
ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V()
> - Could not
> complete request
> javax.servlet.ServletException: An error occurred while evaluating 
> custom action attribute "value" with value "Number of
>  modules: ${viewableModules.size}": The "." operator was supplied with

> an index value of type "java.lang.String" to be a pplied to a List or 
> array, but that value cannot be converted to an integer.
> 
> I have tried to introduce the method:
> public aspect JstlCollectionWrapper {
> 
>     public int ArrayList.getSize() {
>         return size();
>     }
> }
> 
> But it still fails with that same error. Can someone explain what 
> might be wrong?
> 
> Thanks.
> 
> Randy
> 
> ****DISCLAIMER
> The information contained in this e-mail and attachments, if any, is 
> confidential and may be subject to legal privilege.  If you are not 
> the intended recipient, you must not use, copy, distribute or disclose

> the e-mail and its attachment, or any part of its content or take any 
> action in reliance of it.  If you have received this e-mail in error, 
> please e-mail the message back to the sender by replying and then 
> deleting it.  We cannot accept responsibility for loss or damage 
> arising from the use of this e-mail or attachments, and recommend that

> you subject these to your virus checking procedures prior to use

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

****DISCLAIMER
The information contained in this e-mail and attachments, if any, is confidential and may be subject to legal privilege.  If you are not the intended recipient, you must not use, copy, distribute or disclose the e-mail and its attachment, or any part of its content or take any action in reliance of it.  If you have received this e-mail in error, please e-mail the message back to the sender by replying and then deleting it.  We cannot accept responsibility for loss or damage arising from the use of this e-mail or attachments, and recommend that you subject these to your virus checking procedures prior to use


Back to the top