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 254173 - PHP implement all abstract methods breaks code for empty class
Summary: PHP implement all abstract methods breaks code for empty class
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 256038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-08-06 12:04 UTC by Avaer
Modified: 2015-11-06 02:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (1.42 KB, patch)
2015-10-30 11:14 UTC, junichi11
Details | Diff
patch for unit tests (15.33 KB, patch)
2015-11-04 17:07 UTC, junichi11
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Avaer 2015-08-06 12:04:39 UTC
Steps to reproduce:
1. Create empty class, extending abstract class with abstract method
2. An empty class is created. Make sure it looks like the following:

class ClassName extends AbstractClassName
{ // Not even one blank line between { and }
}

3. Click on the lightbulb with error marker on the left, click "Implement All Abstract Methods"

Actual result:
Implemented method code appears BEFORE class opening bracket:

class ClassName extends AbstractClassName
protected

function implementedAbstractMethod()
{
    
} {  // Not even one blank line between { and }
}

Expected result:
Method implementation placed between class' { and }

Product Version = NetBeans IDE 8.0.2 (Build 201411102027)
Operating System = Linux version 4.1.3-1-ARCH running on amd64
Java; VM; Vendor = 1.8.0_51
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Comment 1 junichi11 2015-10-30 11:14:15 UTC
Created attachment 157062 [details]
patch
Comment 2 junichi11 2015-10-30 11:17:06 UTC
I've created a patch. Could you please review it? Thanks!
Comment 3 junichi11 2015-10-30 11:22:26 UTC
*** Bug 256038 has been marked as a duplicate of this bug. ***
Comment 4 Tomas Mysik 2015-11-02 14:57:43 UTC
@junichi11: Not sure if a unit test could be added as well - could you please look at it? Thanks.
Comment 5 junichi11 2015-11-03 04:47:46 UTC
(In reply to Tomas Mysik from comment #4)
> @junichi11: Not sure if a unit test could be added as well - could you
> please look at it? Thanks.

Probably, there are no tests for the HintFix in existing tests. But I'll try checking it. Thanks.
Comment 6 junichi11 2015-11-04 04:28:34 UTC
We can add tests for the HintFix. So I'll add them(this time, only for this Hint) later. Thanks.
Comment 7 junichi11 2015-11-04 17:07:10 UTC
Created attachment 157147 [details]
patch for unit tests

I've added tests. Thanks.
Comment 8 Tomas Mysik 2015-11-05 11:48:40 UTC
Patch applied, thanks a lot!

http://hg.netbeans.org/web-main/rev/adeda44ee993
Comment 9 Quality Engineering 2015-11-06 02:29:45 UTC
Integrated into 'main-silver', will be available in build *201511060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/adeda44ee993
User: Tomas Mysik <tmysik@netbeans.org>
Log: #254173 - PHP implement all abstract methods breaks code for empty class

Patch contributed by junichi11@netbeans.org.