UtilMisc.toMap wierdness

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

UtilMisc.toMap wierdness

Walter Vaughan
Help!

Is there a limit to the number of items that can be used with
UtilMisc.toMap? When we give it more than 7 pairs it fails to compile.
We can mix and match what pairs we give and it works, it just won't work with
more than 7 pairs.

Thanks

--
Walter


Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

cjhowe
UtilMisc.java toMap only takes six name/value pairs.
If you're needing more just follow the convention used
in the sixth toMap method and recompile.

--- Walter Vaughan <[hidden email]> wrote:

> Help!
>
> Is there a limit to the number of items that can be
> used with
> UtilMisc.toMap? When we give it more than 7 pairs it
> fails to compile.
> We can mix and match what pairs we give and it
> works, it just won't work with
> more than 7 pairs.
>
> Thanks
>
> --
> Walter
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

Jacques Le Roux
Administrator
In reply to this post by Walter Vaughan
This is due to Java limitation in arguments number. You may create your own toMap() method in UtilMisc.Java...

Jacques
 
----- Original Message -----
From: "Walter Vaughan" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, August 31, 2006 5:03 PM
Subject: UtilMisc.toMap wierdness


> Help!
>
> Is there a limit to the number of items that can be used with
> UtilMisc.toMap? When we give it more than 7 pairs it fails to compile.
> We can mix and match what pairs we give and it works, it just won't work with
> more than 7 pairs.
>
> Thanks
>
> --
> Walter
>
Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

Andrew Sykes
In reply to this post by Walter Vaughan
Walter,

just use the normal java method to add more...

myMap.put("key",value);

- Andrew

On Thu, 2006-08-31 at 11:03 -0400, Walter Vaughan wrote:

> Help!
>
> Is there a limit to the number of items that can be used with
> UtilMisc.toMap? When we give it more than 7 pairs it fails to compile.
> We can mix and match what pairs we give and it works, it just won't work with
> more than 7 pairs.
>
> Thanks
>
> --
> Walter
>
>
--
Kind Regards
Andrew Sykes <[hidden email]>
Sykes Development Ltd
http://www.sykesdevelopment.com

Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

Walter Vaughan
In reply to this post by Jacques Le Roux
Jacques Le Roux wrote:

> This is due to Java limitation in arguments number. You may create your own toMap() method in UtilMisc.Java...

Thanks everyone...

As complete newbies in "OFBiz think" it seemed impossible that there was a hard
coded upper limit. Of course two of the guys want to rewrite it so that it would
accept 1 to infinity-1 number of arguments.

We'll save that for an other day...

--
Walter
Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

David E Jones-2

This isn't really a weird thing, they are just java methods and when  
calling a java method you have to have a fixed set of parameters  
going in. I guess if you're not used to java then it might seem funny.

-David


On Aug 31, 2006, at 1:04 PM, Walter Vaughan wrote:

> Jacques Le Roux wrote:
>
>> This is due to Java limitation in arguments number. You may create  
>> your own toMap() method in UtilMisc.Java...
>
> Thanks everyone...
>
> As complete newbies in "OFBiz think" it seemed impossible that  
> there was a hard coded upper limit. Of course two of the guys want  
> to rewrite it so that it would accept 1 to infinity-1 number of  
> arguments.
>
> We'll save that for an other day...
>
> --
> Walter

Reply | Threaded
Open this post in threaded view
|

Re: UtilMisc.toMap wierdness

cjhowe
In reply to this post by Walter Vaughan
actually, it does already.  the 7th toMap method
accepts an even object array and returns the map. I
would test it though.  It looks to skip the Object[0].
 

--- Walter Vaughan <[hidden email]> wrote:

> Jacques Le Roux wrote:
>
> > This is due to Java limitation in arguments
> number. You may create your own toMap() method in
> UtilMisc.Java...
>
> Thanks everyone...
>
> As complete newbies in "OFBiz think" it seemed
> impossible that there was a hard
> coded upper limit. Of course two of the guys want to
> rewrite it so that it would
> accept 1 to infinity-1 number of arguments.
>
> We'll save that for an other day...
>
> --
> Walter
>

Reply | Threaded
Open this post in threaded view
|

RE: UtilMisc.toMap wierdness

Vinay Agarwal
I have extensively used "UtilMisc.toMap(new Object[] {key1, val1, key2,
val2, ...})" version of the function to create maps with large number of
parameters. It works well.

Regards,
Vinay Agarwal


-----Original Message-----
From: Chris Howe [mailto:[hidden email]]
Sent: Thursday, August 31, 2006 12:56 PM
To: [hidden email]
Subject: Re: UtilMisc.toMap wierdness

actually, it does already.  the 7th toMap method accepts an even object
array and returns the map. I would test it though.  It looks to skip the
Object[0].
 

--- Walter Vaughan <[hidden email]> wrote:

> Jacques Le Roux wrote:
>
> > This is due to Java limitation in arguments
> number. You may create your own toMap() method in UtilMisc.Java...
>
> Thanks everyone...
>
> As complete newbies in "OFBiz think" it seemed impossible that there
> was a hard coded upper limit. Of course two of the guys want to
> rewrite it so that it would accept 1 to infinity-1 number of
> arguments.
>
> We'll save that for an other day...
>
> --
> Walter
>


Reply | Threaded
Open this post in threaded view
|

RE: UtilMisc.toMap wierdness

cjhowe
In reply to this post by Walter Vaughan
Thanks Vinay!  Saved me from testing it out myself :)
I'm always looking for ways to limit the kinds of
hammers I keep around when all I have actually are
nails (always looking to butcher metaphors as well)

--- Vinay Agarwal <[hidden email]> wrote:

> I have extensively used "UtilMisc.toMap(new Object[]
> {key1, val1, key2,
> val2, ...})" version of the function to create maps
> with large number of
> parameters. It works well.
>
> Regards,
> Vinay Agarwal
>
>
> -----Original Message-----
> From: Chris Howe [mailto:[hidden email]]
> Sent: Thursday, August 31, 2006 12:56 PM
> To: [hidden email]
> Subject: Re: UtilMisc.toMap wierdness
>
> actually, it does already.  the 7th toMap method
> accepts an even object
> array and returns the map. I would test it though.
> It looks to skip the
> Object[0].
>  
>
> --- Walter Vaughan <[hidden email]>
> wrote:
>
> > Jacques Le Roux wrote:
> >
> > > This is due to Java limitation in arguments
> > number. You may create your own toMap() method in
> UtilMisc.Java...
> >
> > Thanks everyone...
> >
> > As complete newbies in "OFBiz think" it seemed
> impossible that there
> > was a hard coded upper limit. Of course two of the
> guys want to
> > rewrite it so that it would accept 1 to infinity-1
> number of
> > arguments.
> >
> > We'll save that for an other day...
> >
> > --
> > Walter
> >
>
>
>