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 107490

Summary: Source code damaged after CTRL+ALT+F
Product: javame Reporter: Lukas Hasik <lhasik>
Component: Build SystemAssignee: Adam Sotona <asotona>
Status: VERIFIED FIXED    
Severity: blocker CC: dbalek, tzezula
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 106361    

Description Lukas Hasik 2007-06-20 18:51:21 UTC
Product Version: NetBeans IDE Dev (Build 200706180000) Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 System:
Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: F:\netbeans\userdirs\nb60-0618

-File > New Project > Mobility > Mobile Application
-create new java file in this project
-add a preprocessor block to this file
//#if a
    
    //#else
    
    //#endif

-reformat the code by CTRL+ALT+F
->the result is damaged code
    //#if a
//#
lse
    //#endif

-it is stopper for mobility preprocessor
-of course a workaround is NOT to use automatic text formating
Comment 1 Dusan Balek 2007-06-21 15:15:14 UTC
Untill 'Preprocessor Blocks -> Re-Comment' is called, positions of the Java AST nodes do not correspond to the document
content. Reassigning.
Comment 2 Adam Sotona 2007-06-25 14:03:49 UTC
The problem is in the preprocessign the modified document before parsing.
When the document is opened and manually modified it must not go through JavaFileFilterImplementation.
The data for parsing must be taken directly from the document.
Preprocessor only interfaces between file and document.
Recomment action fixes comments in the docuemnt so then the modified and preprocessed documents are equal.
 
Comment 3 Adam Sotona 2007-06-25 14:18:12 UTC
Tomasi, when filterReader and filterWriter is corectly implementaed and called then filterCharSequence may be should do
nothing?
filterCharSequence is called between modified document and parser and that is wrong.
Comment 4 Peter Pis 2007-06-25 19:30:03 UTC
This issue is showstopper for M10. Please integrate the fix into the trunk and "release60-m10" branch. 
Comment 5 Adam Sotona 2007-06-26 10:06:57 UTC
fixed
Comment 6 Peter Pis 2007-06-28 16:00:51 UTC
Could you please verify this issue for the latest M10 build? Thanks.
Comment 7 Lukas Hasik 2007-06-29 12:51:19 UTC
works in M10 06/28 1431 build