Shevek (shevek) wrote,
Shevek
shevek

[javac] /home/shevek/.../TreeModel.java:142: unreachable statement
[javac] assert false : "Should never have gotten here.";


I know.

If I remove it, I will probably screw up while maintaining the code, and suddenly make it possible to get there. But then I have no assert. Sensible suggestions appreciated.

Update: It's ugly, but: Make the function non-void, make all return points explicit, and make this location be a default return without a value. Then at least I'd get a "Needs return statement" error. I do not intend to do this. Other suggestions appreciated.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments