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.
Summary: | [formatting ]wrong formatting of anonymous functions | ||
---|---|---|---|
Product: | php | Reporter: | Filip Zamboj <fzamboj> |
Component: | Formatting & Indentation | Assignee: | Tomasz Slota <tslota> |
Status: | VERIFIED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Filip Zamboj
2009-11-10 13:16:14 UTC
I understand that the problem is about the unwanted breaks between '}' and ',' the first example has problem with new line after '}' followed by ',' the second example has problem with new line after '}' followed by ';' as well as with closing bracket that is not formatted correctly. Should be below $greet I guess. verified Product Version: NetBeans IDE Dev (Build 091119-840bbe3ddcb3) Java: 1.5.0_17-ea; Java HotSpot(TM) 64-Bit Server VM 1.5.0_17-ea-b01 Integrated into 'main-golden', will be available in build *200911200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/16b27b89909a User: Tomasz Slota <tslota@netbeans.org> Log: #176453 - [formatting ]wrong formatting of anonymous functions I've been asked for a code review. http://hg.netbeans.org/web-main/rev/16b27b89909a 1.24 + if (tokenSequence.token().id() == PHPTokenId.WHITESPACE){ 1.25 + tokenSequence.moveNext(); 1.26 + } 1.27 + 1.28 + PHPTokenId id = tokenSequence.token().id(); the code is potentially errorneous - if the condition on 1.24 is true and then tokenSequence.moveNext() returns false, the subsequent code on 1.28 may fail. I let the decision whether a subsequent fix if necessary or not no Tomasz, but as the fix is now, I CANNOT approve it. I can actually tell that in this case tokenSequence.moveNext() will be always true, but you are right, an explicit check will make the maintenance easier.. I will commit it right away |