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 204958 - Only Exception classes are shown when using code-completion with the instanceof construct
Summary: Only Exception classes are shown when using code-completion with the instance...
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 20:11 UTC by maghiel
Modified: 2011-11-13 17:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maghiel 2011-11-10 20:11:17 UTC
Steps to reproduce:
Create class:
<?php
class Foo 
{
} 
?>

Create class:
<?php
class Bar
{
    function test($obj)
    {
        if ($obj instanceof |
    }
}
?>

Invoke code-completion using <ctrl>+<space> at |

Result:
Only Exception classes are suggested

Expected result:
All known classes are suggested

---

Another case:

Create class:
<?php
class Foo 
{
} 
?>

Create class:
<?php
class Baz extends Foo
{
}
?>

Create class:
<?php
class Bar
{
    function test(Foo $obj)
    {
        if ($obj instanceof |
    }
}
?>

Result: 
Only Exception classes are suggested

Desired result:
Only Foo and classes inheriting Foo are suggested (in other words: Foo and Baz are suggested)


---

Environment:
Product Version: NetBeans IDE Dev (Build 201111080600)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\maghiel\.netbeans\dev
Cache directory: C:\Users\maghiel\.netbeans\dev\var\cache

---

Let me know if you want me to file an ENHANCEMENT for case 2.
Comment 1 Ondrej Brejla 2011-11-11 08:03:40 UTC
The second case is really enhancement, please, file new issue, thanks.
Comment 2 Ondrej Brejla 2011-11-11 08:15:30 UTC
Sorry, but I really can't reproduce the first case :( I see all classes in my CC window, I can attach a screenshot.
Comment 3 Ondrej Brejla 2011-11-11 08:43:46 UTC
My bad...it's reproducible, but only sometimes :) But I think that I know, where the problem is.
Comment 4 Ondrej Brejla 2011-11-11 14:14:24 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/1342ba7a923f
Comment 5 maghiel 2011-11-11 15:03:29 UTC
Thanks Obrejla!

Will verify as soon as possible.
Comment 6 maghiel 2011-11-11 15:08:57 UTC
Enhancement for second case: http://netbeans.org/bugzilla/show_bug.cgi?id=204996
Comment 7 Quality Engineering 2011-11-12 16:29:22 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/1342ba7a923f
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #204958 - Only Exception classes are shown when using code-completion with the instanceof construct
Comment 8 maghiel 2011-11-13 17:59:35 UTC
Verified fixed in:

Product Version: NetBeans IDE Dev (Build 201111120600)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\maghiel\.netbeans\dev
Cache directory: C:\Users\maghiel\.netbeans\dev\var\cache