Jody Garnett a écrit : > I saw the following comment go by: > >> r30783 | johann.sorel | 2008-06-22 03:41:45 -0700 (Sun, 22 Jun 2008) | >> 1 line >> >> removed parameters lenght check at categorize function creation, this >> makes the factory go crazy. >> > Can you please be more specific? Which factories any why? Chances are > the factories are broken ... > > The diff shows the following check was removed: > >> public CategorizeFunction(List<Expression> parameters, Literal >> fallback) { >> if(parameters == null || parameters.size() <2){ >> throw new IllegalArgumentException("Categorize function must >> have at least 2 parameters : lookup value and the value"); >> } >> this.parameters = parameters; >> this.fallback = fallback; >> } >> > Specifically I am not wanting to support someone creating the function > and changing the parameters afterwords; if there is a factory making > that assumption I want to know about it now; with this new function that > not many people use yet. > > So yeah - what factory was going crazy. > Jody
The check was to make sure the categorize function had at least 2 parameters (minimum requiered for a function of this type). But he factory (I dont remember which one) tryes to create a function with no parameters when she's initialized (looks like it tryes to create a default function object ?), and that raise the IllegalArgumentException. Is it normal , I don't know ? is it an automatic discovery mechanism of the factory ? I added the check code, but it looks like I shouldn't have done it this way, so I removed it. If you can explain me how works the factory system I guess I'll be able to fix the function correctly. regards johann ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel