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 61482 - Diffing forms shows nonexistent changes
Summary: Diffing forms shows nonexistent changes
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 5.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: diff-issues@utilities
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-27 23:03 UTC by Jesse Glick
Modified: 2005-09-05 09:56 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 Jesse Glick 2005-07-27 23:03:09 UTC
I did some refactorings on a project and then took a look at diffs in cvslite.
It showed a number of changes of the form

Base:
    // Variables declaration - do not modify//GEN-BEGIN:variables

Locally Modified:
    // Variables declaration - do not modify                     

or

    // </editor-fold>//GEN-END:initComponents

vs.

    // </editor-fold>                        

But command-line CVS reported no such differences.
Comment 1 Maros Sandor 2005-07-28 08:06:36 UTC
I believe this is a problem in diff.
Comment 2 _ pkuzel 2005-08-22 12:22:56 UTC
I guess it's unix only.

On Unixes diff takes locally modified version from Document/editor. The document
does not contain guarded block delimiters.

On Windows diff takes disk file ignoring all unsaved changes.

Till now, I have been aware only about LF (Document) vs CRLF (File) problems on
Windows. There is yet another inconsitency - guarded block delimiters.

Possible workaround is to call saveAll() before invoking diff and drop direct
reading from editor Document. 

Any objections?
Comment 3 Martin Entlicher 2005-08-22 13:57:05 UTC
The direct reading from editor Document is not there because of save. The old
VCS did save files in interest before diff was called, therefore this did not
cause any problems.

The reading from document is there because of encoding. We can not read the file
from java.io.File, because we do not know the encoding.
Comment 4 _ pkuzel 2005-09-02 12:23:58 UTC
Recent implementation always reads from file. It works for guarded blocks. 
 
BTW encoding is not taken into account. All files are expected to use platform 
default encoding.  
 
Unfortunatelly it's impossible to rewrite to Documents because there is no 
Document access for secondary files (such as .form). Encoding detection API is 
also missing. I could backport workarounds from tasklist module - explicit 
support for java, xml, properties file formats.