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 66173 - LineDiff claims that an empty file is equal to a non-empty file
Summary: LineDiff claims that an empty file is equal to a non-empty file
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: NB JUnit (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: ehucka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-06 21:59 UTC by Jan Lahoda
Modified: 2009-09-29 22:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The fix. (873 bytes, patch)
2005-10-06 22:00 UTC, Jan Lahoda
Details | Diff
The test. (1.71 KB, text/plain)
2005-10-06 22:01 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2005-10-06 21:59:42 UTC
[current sources]

The LineDiff.diff(File first, File second, File diff) considers (content of)
first == (content of) second is the first file is empty.

This causes tests that (incorrectly) produce empty output file to pass even in
case they should fail.

I am attaching:
-fix for this problem. Please note that the fix compares the length of the
internal lists of lines, which should be IMO correct with respect to the
ignoreEmptyLines option. But, it would be nice if a test for the
"ignoreEmptyLines" existed to prove it.
-a test for the LineDiff that tests for this problem. Should be placed in
"nbjunit/test/unit/src/org/netbeans/junit/diff"
Comment 1 Jan Lahoda 2005-10-06 22:00:52 UTC
Created attachment 25624 [details]
The fix.
Comment 2 Jan Lahoda 2005-10-06 22:01:41 UTC
Created attachment 25625 [details]
The test.
Comment 3 Jan Lahoda 2005-10-10 11:15:16 UTC
Rising to P1: it seems like a huge problem to me.
Comment 4 ehucka 2005-10-10 12:07:29 UTC
Honzo, thank you for your fix and test.