Something like #warning directive for Java?

debugging, java, preprocessor

Solution

You can use the `//TODO Change this later` Task Tag in eclipse and configure Eclipse to display a compile-time warning for all `TODO`s.

public static void main(String[] args) {
    //TODO Change this line before final build.
    String mode = "DEV"
}

You can see all such Task Tags collectively, in one place by doing `Window > Show View > Markers`.

Note that there are others too, like `FIXME`, `XXX`. By default the priority of a `TODO` tag is `NORMAL` and that of `FIXME` is a `HIGH`.

Problem

In my project I have something like `final boolean Debug.USE_DEBUG_MODE` and I'm then always forgetting to switch it back to `false`. I wonder if I can put something similar to the `#warning` C++ directive so I don't forget to change the code back.

Original source