I can't even begin to imagine why this is an issue (as described) but I suspect the easiest thing to do is to grep for // in the code before you compile it (or commit it to your versioning repo). I don't think there's anything in eclipse (if that's what you're using) to help you and I'm almost positive that java has no built in mechanism like the one you're describing in C.