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 236570 - Code-reformat "Modified Lines Only" corrupts unmodified lines
Summary: Code-reformat "Modified Lines Only" corrupts unmodified lines
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2013-09-30 19:21 UTC by _ gtzabari
Modified: 2016-07-07 20:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2013-09-30 19:21:51 UTC
Product Version: NetBeans IDE Dev (Build 201309270002)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

1. Create a file with the following contents:

package com.vtlr.web.backend.resource;

import com.vtlr.web.CheckReturnValueByDefault;
import com.vtlr.web.NotNullByDefault;

2. Configure Editor -> On Save -> All Languages -> Modified Lines Only (for both reformatting and trailing whitespace)

3. Open the file from #1
4. Hit ALT+CTRL+F (file will be marked as modified but contents should not change).
5. Hit CTRL+S
6. Notice that the first line becomes "@CheckReturnValueByDefault@NotNullByDefault"

Meaning, code-reformat is collapsing the two annotations into a single line. I'm not even sure if the resulting code is legal.
Comment 1 Jiri Prox 2013-10-02 13:28:28 UTC
Comment 2 Martin Balin 2016-07-07 07:31:37 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 3 _ gtzabari 2016-07-07 20:27:32 UTC
Still present in dev build 201607060002.