Print

Print


On Jul 27, 2005, at 10:57 AM, Steve Butcher (Steve-O) wrote:

>             String alphabet = state.parameters.getStringWithDefault
> ( p, "aAbBcCdDeEfFgG");

To be forward-compatable with the next version of ECJ, you should write

        String alphabet = state.parameters.getStringWithDefault(
                p, null, "aAbBcCdDeEfFgG");


> However, when MyProblem goes to access the alphabet parameter, it's
> going to want to access it as "eval.problem.alphabet", isn't it?

Only if MyProblem specified the parameter name that way, one of:

        new Parameter("eval.problem.alphabet");
        new Parameter("eval").push("problem").push("alphabet");
        base.push("alphabet");  // assuming base passed in was "eval.problem"

> So can I just name the parameter "eval.problem.alphabet" in the 1st
> line
> of resetNode()

Absolutely.  In reset() you could write:

        new Parameter("eval.problem.alphabet");

Or if you'd like to just use "alphabet" as your parameter, in MyProblem
you can just ignore the base and do:

        new Parameter("alphabet");

Keep in mind that the ONLY function of parameter bases is to provide a
way of handling name-spacing.  In fact you can specify whatever the
heck parameter names you'd like.

Sean