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 224534 - Find Usages returns methods with same name from other classes also
Summary: Find Usages returns methods with same name from other classes also
Status: RESOLVED DUPLICATE of bug 218660
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 10:35 UTC by emil
Modified: 2013-01-06 11:17 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description emil 2013-01-06 10:35:57 UTC
To reproduce:
Create New Project - PHP 5.4.
Replace index.php with following:
<?php
class A
{
public function get() {}
}
class B
{
public function get() {}
}
$a = new A();
$b = new B();
$a->get();
$b->get();
?>

Right-click get() in class A and choose Find Usages. (Find Usages checkbox checked, Find Overring Methods unchecked), click Find.

Result:
Usages of get [4 occurrences]
PhpProject1
index.php
      4:  public function get() {}
      8:  public function get() {}
    13:  $a->get();
    14:  $b->get();

Expected result - 2 occurrences - definition in class A and one usage: $a->get();


Product Version = NetBeans IDE 7.2.1 (Build 201210100934)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_23
Runtime = Java HotSpot(TM) Client VM 19.0-b09
Comment 1 Ondrej Brejla 2013-01-06 11:17:39 UTC
It's a well known behavior, because PHP is not strictly typed language. Types can change dynamically in runtime, so we suggest "all possible" methods from method calls and such. So current behavior is intended.

But it should be improved a bit, I know it and enhancement exists for that.

Thanks for catching that!

*** This bug has been marked as a duplicate of bug 218660 ***