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 268557 - "Field has already been declared" false positive for classes with @property annotations
Summary: "Field has already been declared" false positive for classes with @property a...
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
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
Exception Reporter:


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

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
Fixed.

http://hg.netbeans.org/web-main/rev/a8c4bffd0d08

Thanks.
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?

Thanks.
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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a8c4bffd0d08
User: Junichi Yamamoto <junichi11@netbeans.org>
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:

http://hg.netbeans.org/releases/rev/920e646e98b0

Thanks.
Comment 10 amobilia 2016-12-15 12:10:45 UTC
82patch1-verified