Bug 188112

Summary: else keyword automatically becomes left-justified in if/else block
Product: java Reporter: forager
Component: EditorAssignee: Dusan Balek <dbalek>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P2 CC: aschild, bhlope, CaptainJim, carlwebman, eugene-71, fjhonda, leonardousta, mhergenrader, mmirilovic, peterhull90, yujb
Version: 6.x   
Target Milestone: 6.x   
Hardware: PC   
OS: Windows Vista   
Whiteboard: 69patch2-verified
Issue Type: DEFECT Exception Report:

Description forager 2010-06-26 13:28:45 UTC
Installed Netbeans 6.9 on two pc's (running XP and Vista64), and on both of them the "if" and "else" blocks do not line up (as I expect them to, anyway). Following completion of the if{} block, pressing Enter places the cursor below the previous "}", but upon completion of the word "else", netbeans seems to reformat the text so that the "else" gets moved to the second position of the line, with the immediate result looking like:

        if{ ...
        }
 else
Comment 1 carlwebman 2010-06-30 20:32:42 UTC
*** Bug 188258 has been marked as a duplicate of this bug. ***
Comment 2 Vitezslav Stejskal 2010-07-09 07:36:14 UTC
What language are you editing (java, php, C/C++, ...)?
Comment 3 forager 2010-07-09 11:06:48 UTC
(In reply to comment #2)
> What language are you editing (java, php, C/C++, ...)?

java only, but in the meantime I've gone back to an older version of Netbeans while the issue was being resolved
Comment 4 eugene-71 2010-07-15 09:31:34 UTC
Same problem, very annoying.
100% reproduceable.
Comment 5 Dusan Balek 2010-10-15 07:00:58 UTC
*** Bug 190840 has been marked as a duplicate of this bug. ***
Comment 6 Marian Mirilovic 2010-10-15 07:32:15 UTC
*** Bug 190887 has been marked as a duplicate of this bug. ***
Comment 7 Marian Mirilovic 2010-10-15 07:33:26 UTC
*** Bug 190974 has been marked as a duplicate of this bug. ***
Comment 8 Dusan Balek 2010-10-15 09:35:21 UTC
Already fixed in the current dev build.
Comment 9 Dusan Balek 2010-10-15 16:39:56 UTC
*** Bug 189810 has been marked as a duplicate of this bug. ***
Comment 10 Marian Mirilovic 2010-10-18 07:33:02 UTC
Dusan, could you prepare patch for NB 6.9 ? I think with current number of duplicates it makes sense to do it, what do you think ?
Comment 11 Dusan Balek 2010-10-19 11:56:32 UTC
Unfortunately, the original patch is part of a huge change and cannot be easily distilled from it. However, the following changeset should fix the problem in 6.9 as well:

http://hg.netbeans.org/jet-main/rev/9d8f64af8b9a
Comment 12 Marian Mirilovic 2010-10-19 12:02:51 UTC
(In reply to comment #11)
> Unfortunately, the original patch is part of a huge change and cannot be easily
> distilled from it. However, the following changeset should fix the problem in
> 6.9 as well:
> 
> http://hg.netbeans.org/jet-main/rev/9d8f64af8b9a

Dusan, thanks a lot for your help. Petr, could you proceed with integration into releases clone ASAP, so we can really start to test it tomorrow morning ?

Thanks a lot.
Comment 13 Petr Suchomel 2010-10-19 15:49:05 UTC
Patched from using jet-main (CS http://hg.netbeans.org/jet-main/rev/9d8f64af8b9a) http://hg.netbeans.org/releases/rev/f8825af2eb66
Comment 14 Dusan Balek 2010-10-21 12:34:52 UTC
*** Bug 188090 has been marked as a duplicate of this bug. ***
Comment 15 Dusan Balek 2010-10-21 12:37:09 UTC
*** Bug 187116 has been marked as a duplicate of this bug. ***
Comment 16 Dusan Balek 2010-10-21 12:38:24 UTC
*** Bug 187694 has been marked as a duplicate of this bug. ***
Comment 17 Jaromir Uhrik 2010-10-22 10:58:55 UTC
Verified in the following build with installed 6.9 Patch 2 plugins:
Product Version: NetBeans IDE 6.9 (Build 201010211515)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.2-b01
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)
Comment 18 Quality Engineering 2010-10-28 02:53:48 UTC
Integrated into 'main-golden', will be available in build *201010280000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8f18410ba01c
User: Dusan Balek <dbalek@netbeans.org>
Log: Fixing bug with reformatting single line containing else keyword - second attempt - see issue #188112.
Comment 19 Dusan Balek 2011-02-04 17:44:39 UTC
*** Bug 195011 has been marked as a duplicate of this bug. ***
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