[program-java] Re: Java: Annotations

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: "'program-java@xxxxxxxxxxxxx'" <program-java@xxxxxxxxxxxxx>
  • Date: Fri, 22 Oct 2010 08:13:36 -0400

Hi:

Yes I understand the obvious but why would it be used even though the flow of 
the program does indeed execute the line of code in question?

Jim

-----Original Message-----
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Sina Bahram
Sent: October 21, 2010 17:45
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: Java: Annotations

Not sure what you're looking for other than the obvious. It suppresses warnings 
about the variable not being used.

Take care,
Sina

________________________________

From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Corbett, James
Sent: Thursday, October 21, 2010 9:52 AM
To: 'program-java@xxxxxxxxxxxxx'
Subject: [program-java] Java: Annotations


Hey now:

I use Annotations in my EJB projects but I've come across this reference in a 
plain old project "@SuppressWarnings("unused".

What does this really mean aside from the obvious. Snippet to follow.

MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING
                        | SWT.OK);
                dialog.setText(shell.getText());
                @SuppressWarnings("unused")
                boolean resetFocus = false;
                dialog.setMessage(fiResourceBundle
                        .getResourceString("partD.checkInputPartD"));
                dialog.open();

Many thanks.

Jim

James M. Corbett

Programmer / Analyst |
Canada Revenue Agency | Agence du revenue du Canada
875 Heron Rd.
Ottawa, On.
K1A0L5

James.Corbett@xxxxxxxxxxxxx
Telephone | Téléphone: (613) 941-1338
Facsimile | Télécopieur: (613) 941-2261

Government of Canada | Gouvernement du Canada




Other related posts: