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 118653 - yaml file will be truncated after editing on NB editor
Summary: yaml file will be truncated after editing on NB editor
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-12 05:43 UTC by Masaki Katakai
Modified: 2008-01-30 05:37 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test data (814 bytes, application/octet-stream)
2007-10-12 05:45 UTC, Masaki Katakai
Details
IDE log file: but I could not see any exception here (8.17 KB, application/octet-stream)
2007-10-15 12:33 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2007-10-12 05:43:33 UTC
Product Version: NetBeans IDE Dev (Build 200710090000)
Java: 1.6.0_03
SunOS 5.11; eucJP-open; ja_JP (nb)

Please try the following steps, it seems that the contents in yaml file
have been changed after the saving.

1. unzip test.zip (will be attached)
2. rename 01_basics.yml.1 to 01_basics.yml
3. create ruby on rails project, project encoding is UTF-8
4. open it on NetBeans Editor
5. delete one line and undo
6. save

The size of the original file is 25650 bytes, but now 11530 bytes.
The file contains UTF-8 characters.

% ls -l 01_basics.yml*
-rw-r--r-- 1 katakai staff 11530 2007-10-12 13:31 01_basics.yml
-rw-r--r-- 1 katakai staff 25650 2007-10-12 13:31 01_basics.yml.1
%
Comment 1 Masaki Katakai 2007-10-12 05:45:00 UTC
Created attachment 50772 [details]
test data
Comment 2 Martin Schovanek 2007-10-12 10:14:46 UTC
Data-lost => P1

Reproducible (randomly) with similar text in a .jsp as well, probably a issue in languages module.

Reassign to Hanz for for evaluation.
Comment 3 Daniel Prusa 2007-10-12 11:39:51 UTC
I am not able to reproduce it. When a line is deleted and undo is applied, the file content is unchanged and save is
disabled, so I have tried to delete a line and save, but without success.
It can be editor related issue, what about changing 01_basic.yml to 01_basic.txt, is it reproducible for text file
variant of the file?
Comment 4 Martin Schovanek 2007-10-12 12:03:03 UTC
Yes, is reproducible with .txt file as well.

to reproduce:
-------------
1) create a new .txt
2) replace it content by content from 01_basics.yml.1
3) save it and check the file on disc
NOTE: the file looks OK
4) type something on the end of the file
5) save it and check the file on disc
ERROR: the latest change does not appear in the file
Comment 5 Daniel Prusa 2007-10-12 12:49:49 UTC
Still not reproducible in my case, may be random.
Ccing Mila and Vita, pherhaps they could help with the evaluation.
Comment 6 Daniel Prusa 2007-10-15 09:53:33 UTC
reassining to editor
Comment 7 Vitezslav Stejskal 2007-10-15 11:13:06 UTC
I'm looking into it.
Comment 8 Vitezslav Stejskal 2007-10-15 12:23:25 UTC
Well, I'm still not sure what actually happened, but it does not seem to be an encoding issue. The 01_basics.yml is
basically a cut-off version of 01_basics.yml.1. So, for some reason only the beginning of the file was saved. But this
beginning also contains japanese characters and they look ok AFAICT. Did you guys get any exceptions? Can you attach a
log file from the IDE session when you saved the file? Thanks
Comment 9 Masaki Katakai 2007-10-15 12:33:54 UTC
Created attachment 50937 [details]
IDE log file: but I could not see any exception here
Comment 10 Tomas Zezula 2007-10-15 15:42:00 UTC
Fixed in trunk.

Checking in src/org/netbeans/api/queries/FileEncodingQuery.java;
/cvs/projects/queries/src/org/netbeans/api/queries/FileEncodingQuery.java,v  <--  FileEncodingQuery.java
new revision: 1.7; previous revision: 1.6
done
Checking in test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java;
/cvs/projects/queries/test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java,v  <--  FileEncodingQueryTest.java
new revision: 1.5; previous revision: 1.4
done
RCS file: /cvs/projects/queries/test/unit/src/org/netbeans/api/queries/data/longUnicode.txt,v
done
Checking in test/unit/src/org/netbeans/api/queries/data/longUnicode.txt;
/cvs/projects/queries/test/unit/src/org/netbeans/api/queries/data/longUnicode.txt,v  <--  longUnicode.txt
initial revision: 1.1
done
Comment 11 Martin Schovanek 2007-10-16 09:30:02 UTC
Verified in a custom build, cannot reproduce any more.

Masaki, please can you confirm it.
Comment 12 Masaki Katakai 2007-10-16 12:56:00 UTC
Sure, I'll check.
Comment 13 Masaki Katakai 2007-10-16 13:34:26 UTC
Product Version: NetBeans IDE Dev (Build 200710160000)
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)
Userdir: E:\tmp\nb.200710160000

I tried some other files, it's reproducible for me.

The original issue - 01_basics.yml.1 is now OK.
Will you try 01_basics.yml? It shrunk to 8K from 11K.

This issue was reported from community folk in Japan so
I have the original file. But I could not put it into issuezilla
because it contains personal data. I can still reproduce the
issues with the original file. Please let me know if you need the file.




Comment 14 Tomas Zezula 2007-10-17 09:51:29 UTC
Fixed in trunk.

Checking in src/org/netbeans/api/queries/FileEncodingQuery.java;
/cvs/projects/queries/src/org/netbeans/api/queries/FileEncodingQuery.java,v  <--  FileEncodingQuery.java
new revision: 1.8; previous revision: 1.7
done
Checking in test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java;
/cvs/projects/queries/test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java,v  <--  FileEncodingQueryTest.java
new revision: 1.6; previous revision: 1.5
done
RCS file: /cvs/projects/queries/test/unit/src/org/netbeans/api/queries/data/longUnicode2.txt,v
done
Checking in test/unit/src/org/netbeans/api/queries/data/longUnicode2.txt;
/cvs/projects/queries/test/unit/src/org/netbeans/api/queries/data/longUnicode2.txt,v  <--  longUnicode2.txt
initial revision: 1.1
done

Checking in src/org/netbeans/modules/xml/api/XmlFileEncodingQueryImpl.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/XmlFileEncodingQueryImpl.java,v  <--  XmlFileEncodingQueryImpl.java
new revision: 1.8; previous revision: 1.7
done
Comment 15 Jiri Prox 2007-10-17 11:00:44 UTC
Masaki, please, verify that the fix ok? 
It should be merged also in beta2 branch.
Comment 16 Masaki Katakai 2007-10-17 11:52:14 UTC
The fix has been integrated into #4004. I have verified that these 3 examples can be stored properly on hudson build #4004. 

#4004 : OK
#4003 : FAIL

Comment 17 Martin Schovanek 2007-10-17 12:40:03 UTC
Verified in custom build.

Tomasi, can you please merge it into beta2 branch?
Comment 18 Tomas Zezula 2007-10-17 12:53:30 UTC
OK
Comment 19 Tomas Zezula 2007-10-17 14:18:39 UTC
Integrated into beta2.

Checking in projects/queries/src/org/netbeans/api/queries/FileEncodingQuery.java;
/cvs/projects/queries/src/org/netbeans/api/queries/FileEncodingQuery.java,v  <--  FileEncodingQuery.java
new revision: 1.6.4.1; previous revision: 1.6
done
Checking in projects/queries/test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java;
/cvs/projects/queries/test/unit/src/org/netbeans/api/queries/FileEncodingQueryTest.java,v  <--  FileEncodingQueryTest.java
new revision: 1.4.4.1; previous revision: 1.4
done
Checking in xml/core/src/org/netbeans/modules/xml/api/XmlFileEncodingQueryImpl.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/XmlFileEncodingQueryImpl.java,v  <--  XmlFileEncodingQueryImpl.java
new revision: 1.7.2.1; previous revision: 1.7
done
Comment 20 Martin Schovanek 2007-10-18 13:54:20 UTC
Verified in beta2 build