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 250708 - Netbeans does not save Java alignment formatting rules
Summary: Netbeans does not save Java alignment formatting rules
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-25 21:48 UTC by _ gtzabari
Modified: 2015-05-15 02:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2015-02-25 21:48:12 UTC
Product Version: NetBeans IDE Dev (Build 201502230001)
Java: 1.8.0_31; Java HotSpot(TM) 64-Bit Server VM 25.31-b07
Runtime: Java(TM) SE Runtime Environment 1.8.0_31-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\a-gtzabari\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\a-gtzabari\AppData\Local\NetBeans\Cache\dev

This issue might be related to bug #229567.

Repro steps:
1. Open Maven project with "Use project specific options" enabled.
2. Java -> Alignment -> Uncheck "catch" and "finally" checkboxes.
3. Click OK (save settings)
4. Restart Netbeans and reopen project properties.
5. Notice that "catch" and "finally" checkboxes are checked. Furthermore, notice that nb-configuration.xml is not modified by step 2.

Priority = P2 because this involves data loss and I believe it is a regression. This is a blocker for me because my company's commit hooks reject incorrectly formatted files.
Comment 1 Tomas Stupka 2015-02-27 16:02:32 UTC
the project infrastructure takes a few seconds before it flushes the changes into nb-configuration.xml
if the restart (step 4.) comes earlier than that, the changes aren't saved (that's also the only way i was able to reproduce)

please confirm if this is your case or if your changes aren't stored no matter how many time you give NB to store them

thanks
Comment 2 _ gtzabari 2015-02-27 23:56:36 UTC
Tomas,

This issue had something to do with the Import From Other Project feature. It's possible that saving was taking a while, and I was importing from that other project before its settings got saved to disk.

Do you plan to change the implementation so the dialog does not actually close until the settings finish writing to disk?
Comment 3 Tomas Stupka 2015-05-14 10:42:43 UTC
fixed in jet-main #2f08afc1a4ce
Comment 4 Tomas Stupka 2015-05-14 10:51:37 UTC
fixed the reported scenario - changes aren't flushed on disk if restart comes to early

>This issue had something to do with the Import From Other Project feature.
even if the changes aren't persisted, they are held in memory and should be available for subsequent access. For example when importing from other project. 
if this is what happens to you than we have also a different issue (which i wasn't able to reproduce so far). 
please file another issue in such a case and provide the necessary steps to reproduce.

thanks
Comment 5 Quality Engineering 2015-05-15 02:40:29 UTC
Integrated into 'main-silver', will be available in build *201505150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2f08afc1a4ce
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #250708 - Netbeans does not save Java alignment formatting rules