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 - Source code damaged after CTRL+ALT+F
Summary: Source code damaged after CTRL+ALT+F
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks: 106361
  Show dependency tree
 
Reported: 2007-06-20 18:51 UTC by Lukas Hasik
Modified: 2007-06-29 12:51 UTC (History)
2 users (show)

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 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