Bug 268332 - CC problem for anonymous functions
CC problem for anonymous functions
Status: VERIFIED FIXED
Product: php
Classification: Unclassified
Component: Editor
8.1
All All
: P3 (vote)
: 8.2
Assigned To: junichi11
issues@php
82patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-04 05:36 UTC by junichi11
Modified: 2016-12-15 12:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
screenshot (48.02 KB, image/png)
2016-10-04 05:36 UTC, junichi11
Details

Note You need to log in before you can comment on or make changes to this bug.
Description junichi11 2016-10-04 05:36:25 UTC
Created attachment 162326 [details]
screenshot

When anonymous functions are used, some LambdaFunctionDeclaration:**() are shown in a CC list.

<?php
$func1 = function(){echo "anonymous function1" . PHP_EOL;};

$func2 = function() {
    return function() {echo "anonymous function2" . PHP_EOL;};
};

my environments:
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_101-b13
System: Linux version 4.4.0-38-generic running on amd64; UTF-8;

Thanks.
Comment 1 Tomas Mysik 2016-10-04 05:55:06 UTC
Note: _Maybe_ it could be similar situation as with anonymous classes - they need to be filtered, see CodeUtils.isSyntheticTypeName() method (and its usages).

Thanks.
Comment 2 junichi11 2016-10-04 11:09:25 UTC
(In reply to Tomas Mysik from comment #1)
> Note: _Maybe_ it could be similar situation as with anonymous classes - they
> need to be filtered, see CodeUtils.isSyntheticTypeName() method (and its
> usages).

I'll try to look at it later.

Thanks!
Comment 3 Tomas Mysik 2016-10-04 11:51:14 UTC
Thanks! However I have no idea how exactly anonymous functions are implemented (not done by me).
Comment 4 junichi11 2016-10-12 01:39:28 UTC
Tomas, your advice was very helpful. Thanks a lot!
Comment 5 Tomas Mysik 2016-10-12 06:45:53 UTC
You are welcome, of course!
Comment 6 junichi11 2016-10-14 03:50:05 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/84a5dff5a88c

Thanks.
Comment 7 Tomas Mysik 2016-10-14 06:33:27 UTC
The patch seems safe to me so marking it as a patch candidate.

Thanks Junichi!
Comment 8 Quality Engineering 2016-10-15 02:13:58 UTC
Integrated into 'main-silver', will be available in build *201610150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/84a5dff5a88c
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #268332 - CC problem for anonymous functions
Comment 9 Tomas Mysik 2016-11-15 08:17:41 UTC
Verified.

Product Version: NetBeans IDE Dev (Build 20161110-5f9acf1b42b8)
Java: 1.8.0_111; Java HotSpot(TM) 64-Bit Server VM 25.111-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_111-b14
System: Linux version 4.8.0-27-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 10 Tomas Mysik 2016-12-03 14:09:01 UTC
Transplanted to the releases repo branch release82:

http://hg.netbeans.org/releases/rev/f1955b1c4d92

Thanks.
Comment 11 amobilia 2016-12-15 12:14:15 UTC
82patch1-verified


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo