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 244989 - @public on internal function breaks some references to it
Summary: @public on internal function breaks some references to it
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-10 20:11 UTC by dharkness
Modified: 2014-07-01 02:41 UTC (History)
0 users

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 dharkness 2014-06-10 20:11:47 UTC
Note: While whittling down my code to a small demonstration of the bug, I realized that I had marked a non-public method with "@public". Removing the annotation removes the formatting issue, but I suspect there's still a bug in the JSDoc usage.

In the following code the "@public" annotation causes one reference to the function "foo" to erroneously appear as a global function (and breaks navigation) but not the other. Only the one that access a property of the function's return value.

    (function () {
        /**
         * @public                  // this doesn't belong here
         */
        function foo() {
            return 'foo';
        }

        function bar() {
            return foo().length;    // "foo" has the global variable color
        }

        function baz() {
            return foo();           // this "foo" is fine
        }
    }());

If NetBeans is smart enough to detect that "foo" should not be marked as "@public", it should display a warning on that line.
Comment 1 Vladimir Riha 2014-06-13 07:54:51 UTC
reproducible

Product Version: NetBeans IDE Dev (Build web-main-894-on-20140613)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-29-generic running on i386; UTF-8; en_US (nb)
Comment 2 Martin Fousek 2014-06-20 08:27:42 UTC
I'm afraid that it's an issue in the editor.
Comment 3 Petr Pisl 2014-06-29 22:59:53 UTC
Fixed in web-main
Comment 4 Quality Engineering 2014-07-01 02:41:34 UTC
Integrated into 'main-silver', will be available in build *201407010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f47e17c16af2
User: Petr Pisl <ppisl@netbeans.org>
Log: #244989 - @public on internal function breaks some references to it