From: Lane S. <la...@op...> - 2004-01-22 18:14:55
|
If you do not correct this, I think it would be really worthwhile to copy/paste this to the developer section of the site if this is true. -Lane Keats wrote: >Sharif, > >I believe there is a minor introspection problem with WM if your method has >a "get(<primitive-type>)" declared before the "get(Object)" method. You >should be able to fix your problem by reordering your methods. For example, >import java.util.Hashtable; >public class CustomMap extends Hashtable { > public Object get(Object key) { > System.out.println("CustomMap.get(Object) called with: " + key); > return super.get(key); > } > public Object get(int key) { > System.out.println("CustomMap.get(int) called with: " + key); > return super.get(new Integer(key)); > } >} > >Works, whereas: >import java.util.Hashtable; >public class CustomMap extends Hashtable { > public Object get(int key) { > System.out.println("CustomMap.get(int) called with: " + key); > return super.get(new Integer(key)); > } > public Object get(Object key) { > System.out.println("CustomMap.get(Object) called with: " + key); > return super.get(key); > } >} > >fails. > >I looked into fixing this a couple of years ago, but for some reason decided >it wasn't worth it. I could look into it again if folks think it's a big >deal. > >Keats > >----- Original Message ----- >From: "Sharif J. Alexandre" <sja...@ya...> >To: <web...@li...> >Sent: Saturday, January 17, 2004 6:31 PM >Subject: [Webmacro-devel] bug or feature? > > > > >>Hi, >> >>I have an object that extends a Hashtable and overloads the get() method >> >> >with > > >>a get(int). When I place this object into a Context, I get an error when >> >> >any > > >>of the entries in that object are accessed. Here's a portion of that >> >> >error: > > >>org.webmacro.PropertyException: Some kind of error occurred processing >> >> >your > > >>request: this indicates a failure in PropertyOperator.java that should be >>reported: attempt to access method public java.lang.Object >>org.dbadmin.util.MyMap.get(int) on object {systemDate=Jan 17, 2004 5:31:47 >>PM} with 1 parameters threw an exception: >>java.lang.IllegalArgumentException: argument type mismatch >> >>I did some digging and found that in engine/PropertyOperatorCache.java a >>MethodAccessor class is defined which only allows one get method (I'm >> >> >using > > >>1.1 final). Is there a reason for this? Shouldn't it be possible to >> >> >include > > >>any object in a Context -- even if it's a subclassed Hashtable? >> >>Thanks, >>Sharif >> >> >>__________________________________ >>Do you Yahoo!? >>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes >>http://hotjobs.sweepstakes.yahoo.com/signingbonus >> >> >>------------------------------------------------------- >>The SF.Net email is sponsored by EclipseCon 2004 >>Premiere Conference on Open Tools Development and Integration >>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >>http://www.eclipsecon.org/osdn >>_______________________________________________ >>Webmacro-devel mailing list >>Web...@li... >>https://lists.sourceforge.net/lists/listinfo/webmacro-devel >> >> >> > > > >------------------------------------------------------- >The SF.Net email is sponsored by EclipseCon 2004 >Premiere Conference on Open Tools Development and Integration >See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >http://www.eclipsecon.org/osdn >_______________________________________________ >Webmacro-devel mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > -- Lane Sharman Just Do IT, Better. 858-755-2868 |