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 214939 - Unused "use" statement does not check annotations
Summary: Unused "use" statement does not check annotations
Status: RESOLVED DUPLICATE of bug 212932
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 18:55 UTC by ianfp
Modified: 2012-06-29 06:33 UTC (History)
1 user (show)

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 ianfp 2012-06-28 18:55:56 UTC
I'm using Netbeans 7.2 beta. The ability to detect unused "use" statements is a great new feature, but it has this problem:

Many times, I'll "use" a class as an doc-comment annotation; this is very common in frameworks like Symfony2 and Doctrine. For example:

use JMS\SecurityExtraBundle\Annotation\Secure;

class MyController
{
    /**
     * @Secure(roles="ROLE_ADMIN")
     *  This annotation requires that "Secure" be imported as above.
     */
    public function myAction() { }
}

In this example, the @Secure annotation will not work unless the class is imported, but Netbeans marks the "use" statement as unused.
Comment 1 Ondrej Brejla 2012-06-29 06:33:40 UTC

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