Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something like #warning directive for Java?

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.

like image 435
Alexander Kulyakhtin Avatar asked May 14 '12 10:05

Alexander Kulyakhtin


People also ask

What means something like?

1. : close to : approximately. It costs something like five dollars. : somewhat or slightly like.

What is someone something like?

​Definitions and Synonyms. phrase. DEFINITIONS1. used for asking about the qualities or features of a person or thing.


1 Answers

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

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.

enter image description here

like image 115
adarshr Avatar answered Oct 27 '22 02:10

adarshr