Search code examples
javasuppress-warningsunreachable-code

Java: How to @SuppressWarnings unreachable code?


Sometimes when you are debugging, you have unreachable code fragment. Is there anyway to suppress the warning?


Solution

  • The only way to do this on any compiler is @SuppressWarnings("all").

    If you're using Eclipse, try @SuppressWarnings("unused").