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 254909 - "Introduce Function" breaks unformatted code
Summary: "Introduce Function" breaks unformatted code
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: PC Solaris
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-01 14:16 UTC by soldatov
Modified: 2015-09-02 05:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
source file (120 bytes, text/plain)
2015-09-01 14:16 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2015-09-01 14:16:14 UTC
Created attachment 155804 [details]
source file

"Introduce Function" breaks unformatted code (in attached file I used 2 spaces in order to indent a code block)

Scenario:
- Open attached file
- Select 9th line ("x = x * x;")
- Press Alt-Shift-M ("Introduce Function" action)
- Press Refactor button
==> broken code
Comment 1 soldatov 2015-09-01 14:17:16 UTC
class A {
public:
  A(););  // <--     broken line
    void function();

private:
  int x;
};

void A::function(){
    x = x * x;
}

A::A() {
  function();
}

int main(int argc, char** argv) {
  return 0;
}
Comment 2 Alexander Simon 2015-09-01 15:39:51 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/9a58522bcbec
Comment 3 Quality Engineering 2015-09-02 05:16:16 UTC
Integrated into 'main-silver', will be available in build *201509020320* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9a58522bcbec
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #254909 "Introduce Function" breaks unformatted code