While we are at it, I often want to create the field, even when the parameter is already used for something else, e.g. our "QAssert.assertNotNull(obj)"-checks.
While we are at it, I often want to create the field, even when the parameter is already used for something else, e.g. our "QAssert.assertNotNull(obj)"-checks.
While we are at it, I often want to create the field, even when the parameter is already used for something else, e.g. our "QAssert.assertNotNull(obj)"-checks.
If the parameter is already used, can't you just use the Introduce Field refactoring?
If we're talking about the list of intentions that shows up on unused parameters, -1: remove the unused parameter is what I usually want to do with it. This happens mostly as a side effect of some refactoring (removing parameters from called methods).
I almost never add a new parameter by manually typing in the method declaration. The "Introduce Parameter" intention that pops on unresolved references is way nicer.
We are talking about the list of intentions that shows up on unused parameters in the constructor... in this case 99% of the time I want to add a field for the parameter, not get rid of it. Elsewhere it's the opposite, but then elsewhere you don't have an intention for create field anyway.
N.
Marcus Brito wrote:
If we're talking about the list of intentions that shows up on unused parameters, -1: remove the unused parameter is what I usually want to do with it. This happens mostly as a side effect of some refactoring (removing parameters from called methods).
I almost never add a new parameter by manually typing in the method declaration. The "Introduce Parameter" intention that pops on unresolved references is way nicer.
Michael Damberger wrote:
+10
While we are at it, I often want to create the field, even when the
parameter is already used for something else, e.g. our
"QAssert.assertNotNull(obj)"-checks.
Tom
+10
Sascha Weinreuter wrote:
>> mostly I want to "create field for parameter" etc.,
>> but not remove ...
+10
Thomas Singer (MoTJ) wrote:
Yes. Yes. Yes. Pleeeeaaaase.
I always feel so stupid having just typed a new parameter, invoking the intention and seeing my parameter gone again.
Some while ago "Create field for parameter" used to be the first intention...
http://www.jetbrains.net/jira/browse/IDEA-620
Thomas Singer (MoTJ) wrote:
If the parameter is already used, can't you just use the Introduce Field
refactoring?
Bas
Fixed.
"Michael Damberger" <michael.damberger@t-online.de> wrote in message
news:6743426.1109108360959.JavaMail.itn@is.intellij.net...
>
>
Don't know, I have not tried - will do next time. But the intention
would be fine, too...
Tom
If we're talking about the list of intentions that shows up on unused parameters, -1: remove the unused parameter is what I usually want to do with it. This happens mostly as a side effect of some refactoring (removing parameters from called methods).
I almost never add a new parameter by manually typing in the method declaration. The "Introduce Parameter" intention that pops on unresolved references is way nicer.
noooooooo :(
We are talking about the list of intentions that shows up on unused
parameters in the constructor... in this case 99% of the time I want
to add a field for the parameter, not get rid of it. Elsewhere it's the
opposite, but then elsewhere you don't have an intention for create
field anyway.
N.
Marcus Brito wrote:
Oh no, broken again in 3341.
Can you please fix it again?