1

I want to suppress a compiler warning by number. I saw it done by following the line of code with some special comment.

You know Murphy's law? I think this is one case. When I don't need it, I bump all the time over code that has this kind of directive. Loks somehting like

static int num;   //!NLNS201

Now that I need it I cannot find it anywhere.

EDIT: I cannot believe nobody knows what am talking about! I rephrased the question, maybe it was unclear.

ilomambo
  • 8,290
  • 12
  • 57
  • 106
  • There's [`@SuppressWarnings`](https://developer.android.com/reference/java/lang/SuppressWarnings.html), is that what you meant? – Joachim Sauer Jun 06 '12 at 06:38
  • @JoaqchimSauer No, it is not, but I was mistaken. I meant the NON_NLS tags. But those are meant for a different purpose. I am using SuppressWarnings already. Thanks – ilomambo Jun 06 '12 at 06:54

1 Answers1

1

Well, I found it. But it is not what I thought it is.

The $NON-NLS-x tags, are used by Eclipse to suppress only literal strings warning aimed at language internationalization.

I am using instead @SupressWarnings("all") before the variable declaration.

See this post for a good reference on @SuppressWarnings arguments

Community
  • 1
  • 1
ilomambo
  • 8,290
  • 12
  • 57
  • 106