Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 268557 - "Field has already been declared" false positive for classes with @property annotations
"Field has already been declared" false positive for classes with @property a...
Product: php
Classification: Unclassified
Component: Editor
All All
: P3 with 1 vote (vote)
: 8.2
Assigned To: junichi11
Depends on:
  Show dependency treegraph
Reported: 2016-10-17 12:19 UTC by josef.sabl
Modified: 2016-12-15 12:10 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT

screenshot of a bug (5.74 KB, image/png)
2016-10-17 12:19 UTC, josef.sabl
another screenshot of a bug (62.35 KB, image/png)
2016-10-25 20:27 UTC, rogozhka

Note You need to log in before you can comment on or make changes to this bug.
Description josef.sabl 2016-10-17 12:19:11 UTC
Created attachment 162526 [details]
screenshot of a bug

IDE marks property as errorneus with error "Field has already been declared" when the field is annotated with @property:

 * @property-read string $foo
class Test

	protected $foo; //<== this field gets the error although it is not redeclared

	public function __get($name)
		if ($name === 'foo') {
			return $this->foo;
Comment 1 rogozhka 2016-10-25 20:27:53 UTC
Created attachment 162632 [details]
another screenshot of a bug
Comment 2 junichi11 2016-11-06 06:13:08 UTC
Thanks for reporting!
Comment 3 junichi11 2016-11-08 02:00:52 UTC

Comment 4 junichi11 2016-11-08 02:22:16 UTC
When this fix will be available in the dev build, the comment for it is added here. Then, could you verify it in the dev version?

Comment 5 Tomas Mysik 2016-11-08 09:24:41 UTC
Thanks for the fix, Junichi!
Comment 6 Quality Engineering 2016-11-09 09:02:30 UTC
Integrated into 'main-silver', will be available in build *201611090620* on (upload may still be in progress)

User: Junichi Yamamoto <>
Log: #268557 - "Field has already been declared" false positive for classes with @property annotations
Comment 7 Tomas Mysik 2016-11-15 08:14:56 UTC
Please, could anyone verify the fix so it can be part of the patch for NB 8.2? Thanks.
Comment 8 Tomas Mysik 2016-11-24 10:49:23 UTC
Verified. Thanks!

Product Version: NetBeans IDE Dev (Build 20161115-b27d497872f5)
Java: 1.8.0_111; Java HotSpot(TM) 64-Bit Server VM 25.111-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_111-b14
System: Linux version 4.8.0-27-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 9 Tomas Mysik 2016-12-03 14:07:56 UTC
Transplanted to the releases repo branch release82:

Comment 10 amobilia 2016-12-15 12:10:45 UTC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo