Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Setter ==> this.name = name;
Setter ==> this.name = name; [message #83781] Thu, 07 August 2003 09:26 Go to next message
Eclipse UserFriend
Originally posted by: opicasso.videotron.ca

Hi,

On eclipse 2.0 I had the following "Generate setter..." behaviour:

field:
private String name;

generated setter:

public void setName(String name)
{
this.name = name;
}

With eclipse 2.1, with the same field I get:

generated setter:

public void setName(String string)
{
name = string;
}

I prefere the old way of generating setters.

Is it possible to do this in eclipse 2.1 and how?


<code>
Thanks
</code>
Re: Setter ==> this.name = name; [message #83868 is a reply to message #83781] Thu, 07 August 2003 15:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pdrolet.mac.com

Hi,

I initially agreed with you but now that I use Checkclipse, it complains
that this is not a good programming style because this "name" hides the
other "name" property... So I would prefer a simple "s"....

Patrice

Oscar Picasso wrote:

> Hi,
>
> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>
> field:
> private String name;
>
> generated setter:
>
> public void setName(String name)
> {
> this.name = name;
> }
>
> With eclipse 2.1, with the same field I get:
>
> generated setter:
>
> public void setName(String string)
> {
> name = string;
> }
>
> I prefere the old way of generating setters.
>
> Is it possible to do this in eclipse 2.1 and how?
>
>
> <code>
> Thanks
> </code>
>
>
Re: Setter ==> this.name = name; [message #84014 is a reply to message #83781] Fri, 08 August 2003 05:52 Go to previous messageGo to next message
Eclipse UserFriend
This 2.1 behaviour has already be fixed in the 3.0 (it's the same as in
2.0 again). Unfortunatly there's no way to have this in 2.1.

Martin

Oscar Picasso wrote:
> Hi,
>
> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>
> field:
> private String name;
>
> generated setter:
>
> public void setName(String name)
> {
> this.name = name;
> }
>
> With eclipse 2.1, with the same field I get:
>
> generated setter:
>
> public void setName(String string)
> {
> name = string;
> }
>
> I prefere the old way of generating setters.
>
> Is it possible to do this in eclipse 2.1 and how?
>
>
> <code>
> Thanks
> </code>
>
>
Re: Setter ==> this.name = name; [message #84118 is a reply to message #84014] Fri, 08 August 2003 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcorbin.imperitek.com

Martin Aeschlimann wrote:
> This 2.1 behaviour has already be fixed in the 3.0 (it's the same as in
> 2.0 again). Unfortunatly there's no way to have this in 2.1.
>
> Martin
>
> Oscar Picasso wrote:
>
>> Hi,
>> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>>
>> field:
>> private String name;
>>
>> generated setter:
>>
>> public void setName(String name)
>> {
>> this.name = name;
>> }
>>
>> With eclipse 2.1, with the same field I get:
>>
>> generated setter:
>>
>> public void setName(String string)
>> {
>> name = string;
>> }
>>
>> I prefere the old way of generating setters.
>>
>> Is it possible to do this in eclipse 2.1 and how?
>>
>>
>> <code>
>> Thanks
>> </code>
>>
>>
>

Is this configurable in 3.0? I'm running I20030703, and I'm still
seeing the old (stupid) style...
Re: Setter ==> this.name = name; [message #84537 is a reply to message #84118] Mon, 11 August 2003 10:11 Go to previous messageGo to next message
Eclipse UserFriend
I just tried and it's in there: private int fLength ->
public int getLength() {
return fLength;
}

public void setLength(int length) {
fLength= length;
}

I also think it was in there 0703. Please try again or file a bug report
with reproducable steps.

Thanks

Martin

David Corbin wrote:
> Martin Aeschlimann wrote:
>
>> This 2.1 behaviour has already be fixed in the 3.0 (it's the same as
>> in 2.0 again). Unfortunatly there's no way to have this in 2.1.
>>
>> Martin
>>
>> Oscar Picasso wrote:
>>
>>> Hi,
>>> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>>>
>>> field:
>>> private String name;
>>>
>>> generated setter:
>>>
>>> public void setName(String name)
>>> {
>>> this.name = name;
>>> }
>>>
>>> With eclipse 2.1, with the same field I get:
>>>
>>> generated setter:
>>>
>>> public void setName(String string)
>>> {
>>> name = string;
>>> }
>>>
>>> I prefere the old way of generating setters.
>>>
>>> Is it possible to do this in eclipse 2.1 and how?
>>>
>>>
>>> <code>
>>> Thanks
>>> </code>
>>>
>>>
>>
>
> Is this configurable in 3.0? I'm running I20030703, and I'm still
> seeing the old (stupid) style...
>
Re: Setter ==> this.name = name; [message #84867 is a reply to message #84537] Tue, 12 August 2003 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcorbin.imperitek.com

Ah. I think I confused myself. It think I was doing "Create Method
getLength", not actually doing set-getter. OTOH, I think this would
make an excellent enhancment to 'create method' logic (recognizing
getter/setter signatures and just making the method do the right thing)

David

Martin Aeschlimann wrote:
> I just tried and it's in there: private int fLength ->
> public int getLength() {
> return fLength;
> }
>
> public void setLength(int length) {
> fLength= length;
> }
>
> I also think it was in there 0703. Please try again or file a bug report
> with reproducable steps.
>
> Thanks
>
> Martin
>
> David Corbin wrote:
>
>> Martin Aeschlimann wrote:
>>
>>> This 2.1 behaviour has already be fixed in the 3.0 (it's the same as
>>> in 2.0 again). Unfortunatly there's no way to have this in 2.1.
>>>
>>> Martin
>>>
>>> Oscar Picasso wrote:
>>>
>>>> Hi,
>>>> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>>>>
>>>> field:
>>>> private String name;
>>>>
>>>> generated setter:
>>>>
>>>> public void setName(String name)
>>>> {
>>>> this.name = name;
>>>> }
>>>>
>>>> With eclipse 2.1, with the same field I get:
>>>>
>>>> generated setter:
>>>>
>>>> public void setName(String string)
>>>> {
>>>> name = string;
>>>> }
>>>>
>>>> I prefere the old way of generating setters.
>>>>
>>>> Is it possible to do this in eclipse 2.1 and how?
>>>>
>>>>
>>>> <code>
>>>> Thanks
>>>> </code>
>>>>
>>>>
>>>
>>
>> Is this configurable in 3.0? I'm running I20030703, and I'm still
>> seeing the old (stupid) style...
>>
>
Re: Setter ==> this.name = name; [message #85227 is a reply to message #84867] Wed, 13 August 2003 04:34 Go to previous message
Eclipse UserFriend
Good idea, please file a bug report so it does not get lost.

David Corbin wrote:
> Ah. I think I confused myself. It think I was doing "Create Method
> getLength", not actually doing set-getter. OTOH, I think this would
> make an excellent enhancment to 'create method' logic (recognizing
> getter/setter signatures and just making the method do the right thing)
>
> David
>
> Martin Aeschlimann wrote:
>
>> I just tried and it's in there: private int fLength ->
>> public int getLength() {
>> return fLength;
>> }
>>
>> public void setLength(int length) {
>> fLength= length;
>> }
>>
>> I also think it was in there 0703. Please try again or file a bug
>> report with reproducable steps.
>>
>> Thanks
>>
>> Martin
>>
>> David Corbin wrote:
>>
>>> Martin Aeschlimann wrote:
>>>
>>>> This 2.1 behaviour has already be fixed in the 3.0 (it's the same as
>>>> in 2.0 again). Unfortunatly there's no way to have this in 2.1.
>>>>
>>>> Martin
>>>>
>>>> Oscar Picasso wrote:
>>>>
>>>>> Hi,
>>>>> On eclipse 2.0 I had the following "Generate setter..." behaviour:
>>>>>
>>>>> field:
>>>>> private String name;
>>>>>
>>>>> generated setter:
>>>>>
>>>>> public void setName(String name)
>>>>> {
>>>>> this.name = name;
>>>>> }
>>>>>
>>>>> With eclipse 2.1, with the same field I get:
>>>>>
>>>>> generated setter:
>>>>>
>>>>> public void setName(String string)
>>>>> {
>>>>> name = string;
>>>>> }
>>>>>
>>>>> I prefere the old way of generating setters.
>>>>>
>>>>> Is it possible to do this in eclipse 2.1 and how?
>>>>>
>>>>>
>>>>> <code>
>>>>> Thanks
>>>>> </code>
>>>>>
>>>>>
>>>>
>>>
>>> Is this configurable in 3.0? I'm running I20030703, and I'm still
>>> seeing the old (stupid) style...
>>>
>>
>
Previous Topic:Repost: Message-Box: No user-editable completed tasks to delete
Next Topic:Extending javafamily JSP example plug-in to also support SQLJ files
Goto Forum:
  


Current Time: Wed Jul 23 17:35:49 EDT 2025

Powered by FUDForum. Page generated in 0.32977 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top