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 151026 - Bad handling of \u000a (new line)
Summary: Bad handling of \u000a (new line)
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
: 154524 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-22 15:02 UTC by rloschmann
Modified: 2009-02-19 22:57 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
source code patch for NB 6.5 (1.34 KB, patch)
2008-10-22 18:30 UTC, Marian Petras
Details | Diff
source code patch (to be verified) (3.37 KB, patch)
2008-12-02 16:18 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rloschmann 2008-10-22 15:02:59 UTC
When editing properties files with key/value pairs containing new line escapes :

Dialogue.Chargement.Fichier=The file:\u000a{0}\u000ais not a valid database file

the saved properties become :

Dialogue.Chargement.Fichier=The file:
{0}
is not a valid database file

So the properties file gets corrupted.

Noticed this bug since version 6.0 of netbeans. The properties editor of netbeans 5.5.X is correct.
Comment 1 Marian Petras 2008-10-22 18:23:01 UTC
NB 5.5.x:

    TEXT EDITOR
    -- works correctly:

               Dialogue.Chargement.Fichier=The file:\u000a{0}\u000ais not a valid database file

    TABLE EDITOR
    -- Unicode-sequences are skipped,
       i.e. sequences \u000a are not displayed:

               | Dialogue.Chargement.Fichier   | The file:{0}is not a valid database file   |

           When the user clicks inside the cell with the value to start editing it, only "{0}" is displayed.
           It is not possible to modify the value by editing the cell contents.


NB 6.0, NB 6.1, NB 6.5 RC1:
    Both the plain text editor and the table editor are badly broken - they interpret the \u000a sequences
    as if there was a real new-line character.

    TEXT EDITOR:

               Dialogue.Chargement.Fichier=The file:
               {0}
               is not a valid database file

    TABLE EDITOR:

               | Dialogue.Chargement.Fichier   | The file:                   |
               | {0}                           |                             |
               | is                            | not a valid database file   |
Comment 2 Marian Petras 2008-10-22 18:28:58 UTC
I can simply change the behaviour to that of NB 5.5.x - see the attached source code patch.
Comment 3 Marian Petras 2008-10-22 18:30:55 UTC
Created attachment 72488 [details]
source code patch for NB 6.5
Comment 4 Marian Mirilovic 2008-10-23 09:13:44 UTC
This isn't stopper for NB 6.5 - we can fix it into the patch 1 - if all agree.
Comment 5 Marian Petras 2008-10-23 18:00:59 UTC
I just committed (pushed) the patch.

Changeset Id:
f6a1fcd62456
(http://hg.netbeans.org/main/rev/f6a1fcd62456)
Comment 6 Quality Engineering 2008-10-24 04:11:31 UTC
Integrated into 'main-golden', will be available in build *200810240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f6a1fcd62456
User: Marian Petras <mpetras@netbeans.org>
Log: partially fixed bug #151026 - "Bad handling of \u000a (new line)" - behaviour changed back to that of NB 5.5.x
Comment 7 rbalada 2008-11-19 16:06:38 UTC
Mariane,

this issue seems to be fixed. Would you please update about it's resolution status?
Comment 8 Marian Petras 2008-11-19 18:19:16 UTC
It is "fixed" by making it work the same as it works in NB 5.5.
I am just working on a proper fix.
Comment 9 pgebauer 2008-11-24 09:31:02 UTC
The issue didn't pass the nomination process by nomination cut-off date. It has been marked as 65fixes2-candidate.
Comment 10 Marian Petras 2008-12-02 16:18:27 UTC
Created attachment 74432 [details]
source code patch (to be verified)
Comment 11 Marian Petras 2008-12-02 16:22:47 UTC
I added a second patch. The first patch just reverts the behaviour to the pre-6.0 times, the second patch (to be applied
in addition to the first patch) further improves editing of strings with Unicode sequences.
Comment 12 Marian Petras 2008-12-02 16:23:52 UTC
When verifying this bug, please also verify that bug #98512 is still fixed.
Comment 13 Alexey Butenko 2008-12-04 11:03:00 UTC
*** Issue 154524 has been marked as a duplicate of this issue. ***
Comment 14 Alexey Butenko 2008-12-08 11:18:18 UTC
I've integrated attached fix into trunk
Changeset id:
918b988098b8
Comment 15 kaa 2008-12-16 18:30:38 UTC
The line:
Dialogue.Chargement.Fichier=The file:\u000a{0}\u000ais not a valid database file
looks ok in properties editor and properties table editor.

Product Version: NetBeans IDE Dev (Build 200812150750)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
Comment 16 pslechta 2008-12-18 15:10:47 UTC
The fix was ported into release65_fixes repository.

http://hg.netbeans.org/release65_fixes/rev/029aa89054c3
http://hg.netbeans.org/release65_fixes/rev/ede4bf93b77e
Comment 17 kaa 2009-01-22 16:29:15 UTC
re-verified with 65patch2