Submission: switch (...) instanceof feature (original) (raw)
brucechapman at paradise.net.nz brucechapman at paradise.net.nz
Sun Mar 29 15:47:52 PDT 2009
- Previous message: Submission: switch (...) instanceof feature
- Next message: Submission: switch (...) instanceof feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quoting myself, who looks like they were sending an SMS message
3/ Your synthetic variable gives surprising results if <> appears on the LHS of an assignment operator, because you will assign to the synthetic variable, not the obvious one. Solutions are to only allow identifiers declared "final" (and make the synthetic variable fine) OR don't use a synthetic variable and instead insert the case everywhere the identifier is used (except on LHS of assignment).
should say
3/ Your synthetic variable gives surprising results if <> appears on the LHS of an assignment operator, because you will assign to the synthetic variable, not the obvious one. Solutions are to only allow identifiers declared "final" (and make the synthetic variable final) OR don't use a synthetic variable and instead insert the cast everywhere the identifier is used (except on LHS of assignment).
B :)
- Previous message: Submission: switch (...) instanceof feature
- Next message: Submission: switch (...) instanceof feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]