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 25388 - "Conflicts Resolver" displays wrong contents and throws exception.
Summary: "Conflicts Resolver" displays wrong contents and throws exception.
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-08 11:17 UTC by Jiri Kovalsky
Modified: 2003-06-30 17:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Suspicious exception thrown during saving operation. (3.12 KB, text/plain)
2002-07-08 11:20 UTC, Jiri Kovalsky
Details
Picture showing wrong contents in the output pane. (269.04 KB, image/jpeg)
2002-07-08 11:26 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2002-07-08 11:17:58 UTC
Development build #200207080100 of NetBeans 3.4
Windows 2000 with JDK 1.4.1 RC build #15

Description:
============
I produced three merging conflicts and did various
hanky-panky with conflicts resolver. Then I
noticed that I couldn't select one solution of
certain conflict because it's "Accept" button was
disabled although the second solution was chosen.
So I tried to push "OK" button. It asked me "The
file is modified. Do you want to save it ?" and
offered only "OK" button ! I had confirmed it and
the attached exception was thrown.

Steps to reproduce:
===================
1. Create three conflicts: new line, modified lide
and deleted line.
2. Invoke "Resolve Conflicts" on [Merge Conflicts]
file.
3. Try to play with it. Resolve them many times
differently.
4. Watch the ouput pane whether it contains
correct result.
5. Push "OK" button. The exception might be thrown.
Comment 1 Jiri Kovalsky 2002-07-08 11:20:47 UTC
Created attachment 6537 [details]
Suspicious exception thrown during saving operation.
Comment 2 Jiri Kovalsky 2002-07-08 11:26:32 UTC
Created attachment 6538 [details]
Picture showing wrong contents in the output pane.
Comment 3 Martin Entlicher 2002-07-15 15:29:58 UTC
Starting to work on it, trying to reproduce. If it's a real bug, it
seems to me like a P2, since it can make the conflicts resolver
unusable. But after several attempts I was not able to reproduce the
buggy behavior yet.
Comment 4 Martin Entlicher 2002-07-15 17:00:12 UTC
I was able tp reproduce it. The problem occures if one side of the
conflict is empty.
Priority increased to P2, since it can cause data loss.
Comment 5 Martin Entlicher 2002-07-16 13:02:12 UTC
Fixed in the main trunk, both exception and bad conflicts resolution
for ADD and DELETE conflict types.

Diffs:
http://diff.netbeans.org/source/browse/diff/src/org/netbeans/modules/merge/builtin/visualizer/MergeControl.java.diff?r1=1.10&r2=1.11
http://diff.netbeans.org/source/browse/diff/src/org/netbeans/modules/merge/builtin/visualizer/MergeDialogComponent.java.diff?r1=1.13&r2=1.14
http://diff.netbeans.org/source/browse/diff/src/org/netbeans/modules/merge/builtin/visualizer/MergePanel.java.diff?r1=1.19&r2=1.20
http://vcsgeneric.netbeans.org/source/browse/vcsgeneric/profiles/cvsprofiles/src/org/netbeans/modules/vcs/profiles/cvsprofiles/commands/CvsResolveConflicts.java.diff?r1=1.5&r2=1.6

Fix description:
MergeControl:
A special adjustment added for conflicts, that are ADD or DELETE. Line
numbers of these conflicts are different from CHANGE conflicts, there
are zero second lines (e.g. [2, 0, 3, 5] for ADD and [2, 5, 3, 0] for
DELETE).
When a conflict resolves to nothing, we need to unhighlight the next
line, that gets colored by the original highlight.

MergeDialogComponent:
For save confirmation is used NotifyDescriptor.Confirmation instead of
NotifyDescriptor.Message.

MergePanel:
Fix for ArrayIndexOutOfBoundsException.

Milos, can you please review the fix? Thanks.
Comment 6 Martin Entlicher 2002-07-16 13:33:44 UTC
I forgot to say, that the change in CvsResolveConflicts is necessary
to refresh the file after partial conflicts resolution.
Comment 7 Jiri Kovalsky 2002-07-17 12:52:11 UTC
Great, I am glad to confirm it's working fine now. Verified in
development build of NetBeans 4.0 #200207170450.
Comment 8 Milos Kleint 2002-07-17 13:33:04 UTC
the fix seems ok to me. reviewed.
Comment 9 Martin Entlicher 2002-07-17 18:18:38 UTC
The fix was merged into the release34 branch.
Comment 10 Quality Engineering 2003-06-30 17:41:16 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.