This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 142428 - There is possibility to create two or more getters/setters with the same name.
Summary: There is possibility to create two or more getters/setters with the same name.
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks: 150234
  Show dependency tree
 
Reported: 2008-07-31 15:24 UTC by Victoria Zhukovskaya
Modified: 2016-09-22 17:37 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
screenshot (55.86 KB, image/png)
2008-07-31 15:25 UTC, Victoria Zhukovskaya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Victoria Zhukovskaya 2008-07-31 15:24:36 UTC
There is possibility to create two or more getters/setters with the same name.

1. Create PHP Class file
2. Add private two members with the same name - no syntax error, it is fatal error. I check  that eclipse does not
highlited it too.
  but I'm not shure that these variables shoud be colored with different colors. It looks strange. 
3. Invoke creation of getter or setter.

See that there are two variables too. And as result we can create two getters and/or two setters.
Will be good catch this situation. Or one misteke of a php-developer can invoke another mistake.

 
I'm not sure is the defect or enhancement.

see attachment
Comment 1 Victoria Zhukovskaya 2008-07-31 15:25:17 UTC
Created attachment 66181 [details]
screenshot
Comment 2 Petr Pisl 2008-07-31 15:32:06 UTC
This is a request to provide hint. I don't think that this is bug in generating getters and setters.
Comment 3 rmatous 2008-07-31 16:28:59 UTC
We have more urgent problems, I think
Comment 4 Filip Zamboj 2010-09-15 12:26:13 UTC
batch reassigning
Comment 5 Ondrej Brejla 2012-12-19 15:16:06 UTC
Duplicate filed declaration should be handled by error hint.

Still valid.

Product Version: NetBeans IDE Dev (Build 20121219-edfdb450404e)
Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02
Runtime: Java(TM) SE Runtime Environment 1.6.0_26-b03
System: Linux version 3.5.0-19-generic running on i386; UTF-8; cs_CZ (nb)
Comment 6 amobilia 2016-09-22 17:37:57 UTC
Hi,
This doesn't occurs anymore on the 8.2 rc version (dev 201609210002) : the second declaratin of the var is displayed as an error (Field "$var" has already been declared)
Feel free to reopen the ticket if the problem isn't solved on your configuration.

Regards