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 25783 - Probably mixing up of line-breaks across platforms when mounting an smb-share from Windows on a Macintosh
Summary: Probably mixing up of line-breaks across platforms when mounting an smb-share...
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: Macintosh Mac OS X
: P3 blocker with 1 vote (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-18 15:45 UTC by Peter Werno
Modified: 2007-09-26 09:14 UTC (History)
0 users

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 Peter Werno 2002-07-18 15:45:47 UTC
This is what I've mailed to the nbdev - list before. It pretty much explains what I came 
across:

--------------------------------
Hello List,

here is what I've tumbled across:

I have downloaded some .java-files on a WINDOWS-machine to a Windows-share (i.e. 
they *should* be with windows (<cr><lf>) linebreaks).

I am then mounting this share using the samba-client to my Mac (Mac OS X 10.1.5) and 
can VIEW the files in Netbeans on the Mac just fine.

HOWEVER:
Once I SAVE the file (i.e. after having changed something), the last couple of lines get 
REPEATED.

Example: (EmptyClass.java) AFTER saving

--------snip--------
package my.package.name;

public class EmptyClass {
   /**
    * Some comment
    */

   public EmptyClass() {
       System.out.println("Hello World");
   }
}

orld");
   }
}
--------snip--------

From the top of my head I would believe that maybe the code that SAVES the file gets 
confused by the different LINE-BREAK-types on the two systems, and as the Mac has 
only 1 char (<cr>), it stops saving after LESS characters than it should and doesn't send 
an "EOF" to delete the rest??!!

In case you ask why I'm using this strange multi-platform-approach:
The code is stored in a VSS Repository and I was not able to check it out to anything but 
a windows share, so this would be the most convenient method for me!
Why am I not using NetBeans on the Windows machine?? -> Performance :-)

Regards,

Peter
--------------------------------
Comment 1 Svata Dedic 2002-07-19 06:53:07 UTC
Hmm... maybe there's also bug in MacOS' JDK (?) File.getOutputStream()
(which is used for writing out editor contents) is supposed to
truncate the file to zero length.
The linebreak style used when saving is supposed to be the same as on
the first line break in the file, will investigate.

Comment 2 Marek Grummich 2002-07-22 10:49:52 UTC
Set target milestone to TBD
Comment 3 Tomas Hurka 2002-08-13 18:48:07 UTC
Peter,
I was not able to reproduce it with Windows (with \r\n 
linebreaks) files. Can you, please try to copy your Windows files 
from your samba-mounted disk to local disk and try it once more?
Thanks.
Comment 4 Peter Werno 2002-08-14 08:51:29 UTC
Hello Tomas,

I have tried it with copying the (Windows-)Files to local 
directory. Both produce basically the same error with a 
small difference:

When the file is on a mounted Samba-Share and I change it 
from the IDE running in Mac OS X, the file gets appended a 
few additional characters. If I then close and reopen the 
file in the IDE, I can SEE this additional text.

Doing the same thing with a copy on the local file system, 
it still adds these additional chars, but if I close & 
reopen the files, I do NOT see them ... (hmmmmm) (actually 
only a "rough/quick" testing ...)

Which OS have you tried to reproduce this on? I currently 
have no access to a Linux machine to check if it worked 
there. I am running the IDE on Mac OS X which has a VSS-
Share mounted from a Win2K Server (actually, which version 
of Windows / Samba have you mounted the shares from when 
testing?)

It could well be that this is a problem with Apple's JDK 
(as Svatopuk Dedic mentioned) I haven't done any 
investigations into this (so little time :-) but if I find 
a few minutes I will try and post the results here!

Regards,

Peter
Comment 5 Tomas Hurka 2002-08-14 09:10:10 UTC
>Doing the same thing with a copy on the local file system, 
>it still adds these additional chars, but if I close & 
>reopen the files, I do NOT see them ... (hmmmmm) (actually 
>only a "rough/quick" testing ...)
I am sorry, but I don't understand it. How do you know that additional
characters were added if you did not see them?

>Which OS have you tried to reproduce this on? 
Mac OS X 10.1.5, with Java 1.3.1Update. 

>actually, which version of Windows / Samba have you mounted the
shares from when 
>testing?
I did not test it with Samba-mounted directory. I had Windows files on
my local disk and I was not able to reproduce your problem. Therefore
I asked you to try it on local disk to find out if samba is involved
in the problem or not.
Comment 6 Svata Dedic 2003-01-14 10:02:56 UTC
Seems to work for us -- I also tried to access the file on a SMB share
(although from Linux) with no strange things happening.