JCK feedback on "Strings in Switch" proposal

Bruce Chapman brucechapman at paradise.net.nz
Wed May 20 02:26:58 PDT 2009


Dmitry Miltsov wrote:
> Hello,
>
> The JCK engineers have reviewed the "Strings in switch" proposal
> and found one issue to clarify.
>
> "14.11 The switch Statement" states:
> ------------------------------------------------------------------
> ...
> Otherwise, execution continues by comparing the value of the
> Expression with each case constant. Then there is a choice:
> * If one of the case constants is equal to the value of the
> expression, then we say that the case matches ...
> ------------------------------------------------------------------
>
> It would be good to clarify what "equal" means in case of the
> String values. It would be useful to mention that in this case
> the result of comparison will be "expression.equals(constant)",
> not "expression == constant" as for other types.
>   
But if expressed exactly like that, it implies that expression will be 
evaluated repeatedly until a match is found, whereas I would expect it 
to be evaluated once.

Bruce
> We have no special comments on testability of this feature.
> The JCK team will develop conformance tests for it.
>
> Thanks,
> Dmitry Miltsov, JCK engineer
>
>
>   




More information about the coin-dev mailing list