Parameter declared but never used - I don't want to use it!

I'm not sure that the "Parameter 'x' is declared but never used' is
very helpful - it leaves my code in a state of permanent "yellow"ness
because of this:

void checkStatus(Object o)
{
// do stuff on a timer
}

The object passed in is of no relevance, it is just there to satisfy
the delegate. I can't remove the o, nor can I put o on a line on its
own in the code. Therefore the warning state is a bit pointless.

What do you think?

Simon.

3 comments
Comment actions Permalink

Simon,

We are going change the behaviour so the warning will not appear for
public methods (since they might implement an interface) and methods that
are used for creating delegates.

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Simon Steele" <ssnews@softel.co.uk> wrote in message
news:adbj50pl4iu0mr317tt0485no96t56b1dk@4ax.com...

I'm not sure that the "Parameter 'x' is declared but never used' is
very helpful - it leaves my code in a state of permanent "yellow"ness
because of this:

>

void checkStatus(Object o)
{
// do stuff on a timer
}

>

The object passed in is of no relevance, it is just there to satisfy
the delegate. I can't remove the o, nor can I put o on a line on its
own in the code. Therefore the warning state is a bit pointless.

>

What do you think?

>

Simon.



0
Comment actions Permalink

Could you just have the warning on public methods that do extend an
interface? It seems like a warning would be justified for an arbitrary
public method with an unused parameter.

--Don


"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c3cb9k$ho8$1@is.intellij.net...

Simon,

>

We are going change the behaviour so the warning will not appear for
public methods (since they might implement an interface) and methods that
are used for creating delegates.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Simon Steele" <ssnews@softel.co.uk> wrote in message
news:adbj50pl4iu0mr317tt0485no96t56b1dk@4ax.com...

I'm not sure that the "Parameter 'x' is declared but never used' is
very helpful - it leaves my code in a state of permanent "yellow"ness
because of this:

>

void checkStatus(Object o)
{
// do stuff on a timer
}

>

The object passed in is of no relevance, it is just there to satisfy
the delegate. I can't remove the o, nor can I put o on a line on its
own in the code. Therefore the warning state is a bit pointless.

>

What do you think?

>

Simon.

>
>


0
Comment actions Permalink

Don,

There's a problem since we can't quickly check which public method is
used for creating a delegate.
--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Don Fong" <dfong@cstafford.net> wrote in message
news:c3ce6j$4kv$1@is.intellij.net...

Could you just have the warning on public methods that do extend an
interface? It seems like a warning would be justified for an arbitrary
public method with an unused parameter.

>

--Don

>
>

"Oleg Stepanov (JetBrains)" <Oleg.Stepanov@JetBrains.Com> wrote in message
news:c3cb9k$ho8$1@is.intellij.net...

Simon,

>

We are going change the behaviour so the warning will not appear for
public methods (since they might implement an interface) and methods

that

are used for creating delegates.

>

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Simon Steele" <ssnews@softel.co.uk> wrote in message
news:adbj50pl4iu0mr317tt0485no96t56b1dk@4ax.com...

I'm not sure that the "Parameter 'x' is declared but never used' is
very helpful - it leaves my code in a state of permanent "yellow"ness
because of this:

>

void checkStatus(Object o)
{
// do stuff on a timer
}

>

The object passed in is of no relevance, it is just there to satisfy
the delegate. I can't remove the o, nor can I put o on a line on its
own in the code. Therefore the warning state is a bit pointless.

>

What do you think?

>

Simon.

>
>

>
>


0

Please sign in to leave a comment.