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 237766 - Removing white spaces on save doesn't work
Summary: Removing white spaces on save doesn't work
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P2 normal with 1 vote (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 237748 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-29 15:32 UTC by mwitzmann
Modified: 2013-11-19 12:22 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
netbeans problem white spaces (162.24 KB, image/png)
2013-10-31 12:10 UTC, mwitzmann
Details
Dummy project with 2 broken files (1.79 KB, application/zip)
2013-11-12 13:35 UTC, thorstenr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mwitzmann 2013-10-29 15:32:44 UTC
Hello,

after updating the mac to maverick and installing netbeans 7.4 I have the problem, that netbeans creates white spaces mostly at the end of the file. I found some information about setting up remove trailing white spaces on save for all languages from "all lines" but this doesn't seem to work.

Is there any other solution for this problem?

I really like working with netbeans, but this problem would make me quit working with it.

Hope that one of you will have a solution.
Comment 1 Stanislav Aubrecht 2013-10-31 11:21:07 UTC
Please provide exact steps to reproduce and reopen. I don't get any extra white space in a Java file in


Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
Comment 2 mwitzmann 2013-10-31 11:50:49 UTC
1. Start netbeans and create a new project with external source (FTP Server)
2. Open a file (e.g. .php-file), make changes and save it.
3. Reopen it and you can see white space at the end of the line.
4. When you remove it and save it again, it will be added again at the end of the file.

This problem doesn't occur every time, sometimes you can work several hours, but when it occurs, it won't disappear until I restart the system.

I also tried to uninstall java and netbeans and re-installed it. Without success.
I installed earlier version of netbeans to, but without success.
It occurs since I updated the system to maverick.  Before that, netbeans ran without problems.

What I just try is to run netbeans on a new created user account.


Java: Java Standard Edition Version 7 Update 45 (Build 1.7.0_45-b18)
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
System: Mac OS X version 10.9
Comment 3 mwitzmann 2013-10-31 12:10:29 UTC
Created attachment 141740 [details]
netbeans problem white spaces
Comment 4 Ondrej Brejla 2013-10-31 14:05:26 UTC
So it's not just a problem of 7.4, right? Can you test it with some other file types? E.g. javascript, simple html, etc? Because I think that there is no special handling of for php files.
Comment 5 mwitzmann 2013-10-31 14:17:42 UTC
It also occurs in js-, html-, css-files e.g.
Comment 6 Ondrej Brejla 2013-10-31 14:20:31 UTC
Well, I thought that ;) Thanks. So reassigning to CSL for evaluation.
Comment 7 mwitzmann 2013-11-04 13:20:19 UTC
Are there any news about the problem?
Comment 8 thorstenr 2013-11-04 14:14:44 UTC
We have the same problem here. 2 iMac and 1 Macbook, started right after the Mavericks upgrade.

Netbeans currently corrupts every kind of file that we use (CSS, HTML, YML, PHP) which makes working with it impossible for the time being.

We noticed that it only happens with network shares (tried to mount them as SMB, AFP and CIFS, no luck).
Comment 9 mwitzmann 2013-11-04 14:31:31 UTC
You are right! I also work with it in a network and have this problem. At home I work local and it works fine.
Comment 10 mwitzmann 2013-11-11 08:21:16 UTC
Any Suggestions so far?
Comment 11 Jiri Prox 2013-11-12 10:03:33 UTC
Unfortunately we still cannot reproduce it. Can someone provide exact steps to reproduce it from scratch? (project configuration, file encoding, etc..) sample project is welcomed
Comment 12 Miloslav Metelka 2013-11-12 10:40:50 UTC
(In reply to mwitzmann from comment #5)
> It also occurs in js-, html-, css-files e.g.

Could you please attach the problematic file so that we can analyze what the binary codes of the problematic characters are? Thanks.
Comment 13 Jiri Prox 2013-11-12 13:06:39 UTC
*** Bug 237748 has been marked as a duplicate of this bug. ***
Comment 14 mariondorsett 2013-11-12 13:26:12 UTC
Here's a JING video I made that shows how I setup a new project on the network share, saved the NB metadata to my local, and then created a few files and you can  see the null characters appear in TextWrangler after saving the file in NB.

http://screencast.com/t/hOe0AZ4Vm
Comment 15 thorstenr 2013-11-12 13:35:18 UTC
Created attachment 142096 [details]
Dummy project with 2 broken files

I just attached a dummy project with two broken files.
There are a bunch of 0x00's thrown in randomly. The CSS-File has it appended at the end and the PHP-File has it in the middle (which was new to me too..).

Using the default theme in Netbeans 7.4, you can actually see a small red dot next to the semicolon in line 5 of test.php.

Steps to reproduce it with this project:
1. New -> PHP-File -> foo.php
2. Append $foo = 'bar'; at the end of the file
3. CMD+S to save the current file
4. CMD+W to close the current active tab
5. CMD+SHIFT+T to re-open the last closed tab
6. Select the line with $foo = 'bar'; and remove it (CMD+SHIFT+LEFT/RIGHT)
7. Save, CMD+W, CMD+SHIFT+T
8. Type $foo = 'bar'; again and by now the file will be broken.
Comment 16 webzb 2013-11-12 15:50:01 UTC
I think that is not a Netbeans problem, Aptana Studio has the same problem. Maybe a java problem?
Comment 17 stormmage 2013-11-12 20:56:36 UTC
This appears to be a bug with the SMB2 implementation in Mavericks.  Files on older network shares have a null character appended to the files.  Changing the protocol on the mount URL from smb:// to cifs:// seems to fix the issue according to this blog:

http://cammodude.blogspot.com/2013/10/os-x-109-mavericks-workaround-for-smb.html
Comment 18 mariondorsett 2013-11-12 22:29:42 UTC
Didn't change anything for me.

I changed my connection to cifs://
Restarted
Opened NB
Created a new PHP file
Made an edit to the file
And still got the null characters
Comment 19 mariondorsett 2013-11-12 23:25:13 UTC
I can replicate the null characters in Komodo Edit and Aptana Studio, so this doesn't appear to be a Netbeans specific issue, and is probably related to the NAS/SMB issue.

I forced the smb1 connection but it made no difference.  Even if I eject the shares, and reconnect with cifs:// and create, modify and save a file, it's still corrupted.

It looks like Apple is going to have to resolve this, unless someone can come up with a viable workaround.
Comment 20 webzb 2013-11-15 08:55:25 UTC
Testing AFP and seems all ok...
Comment 21 Milutin Kristofic 2013-11-19 12:22:54 UTC
Am I sorry, there is not much that netbeans can help with this scenario. I hope apple will fix it.