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 231277

Summary: Netbeans ignores @returns JSDoc tag and inserts it's own guesses
Product: javascript Reporter: Eccenux
Component: EditorAssignee: Petr Hejl <phejl>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Example code
Different use case

Description Eccenux 2013-06-14 13:32:28 UTC
Created attachment 135804 [details]
Example code

I'm defining a function/class and specify @returns with a type for another function with that type but Netbeans insist in ignoring it and shows the type prefixed with _L5 (or _L13 in my other file)... This doesn't seem correct.

Expected:
If @returns (or @return) is specified Netbeans MUST use it.
Comment 1 Vladimir Riha 2013-06-17 06:44:28 UTC
This seems to be fixed, you can try it in Dev build from [1]


[1] http://bits.netbeans.org/netbeans/trunk/nightly/latest/
Comment 2 Petr Pisl 2013-06-24 23:18:06 UTC
I'm closing this issue as fixed. This case works fine in dev build now. Please reopen if doesn't work for you as expected. Thanks.
Comment 3 Eccenux 2013-06-25 01:17:54 UTC
Created attachment 136243 [details]
Different use case

Hi. The previous one was fixed, but another one popped out which was better in previous version. Attaching screen shot of a minimized use case.
Comment 4 gualtiero65 2013-10-25 13:41:54 UTC
Similar situation in NB 7.4 with following code:


/**
 * @param {String} str the string to check, may be null or undefined
 * @returns {Boolean}
 */
function isBlank1 (str) {
	var patt = /^[\s\xa0]*$/;
	return str === undefined || str === null || patt.test(str);
}

/**
 * @param {String} str the string to check, may be null or undefined
 * @returns {Boolean}
 */
function isBlank2 (str) {
	return str === undefined || str === null || /^[\s\xa0]*$/.test(str);
}

The two functions are identical expect for the inlined var.

In the Navigator window I have:

isBlank1(String str) : Boolean
isBlank2(String str) : Boolean|RegExp

The second line not only does not respect my annotation but also it is wrong (function never returns a RegExp)


In the second case (isBlank2) NB ignores the returns annotation and shows in the Navigator window:

isBlank2
Comment 5 Petr Hejl 2016-07-19 14:32:25 UTC
Seems to be fixed in dev build.