Bug 436878

Summary: White space at begin of marked as changed when not
Product: [Eclipse Project] Platform Reporter: David Balažic <david.balazic>
Component: CompareAssignee: Platform-Compare-Inbox <platform-compare-inbox>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P3 CC: paul-eclipse
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
screenshot of problem
none
screenshot of text compare none

Description David Balažic CLA 2014-06-06 14:35:42 EDT
org.eclipse.compare 3.5.401.v20130709-1308

Eclipse Java EE IDE for Web Developers.
Version: Kepler Service Release 2
Build id: 20140224-0627


I am using subclipse 1.10.5 to access SVN, but the plugin spy says the compare is from eclipse.org.

If I compare a changed file to base revision, sometimes leading white space in a changed line is marked as changed even if it is not. It happens when the end of previous line has also some changes (not all types of changes there make this happen).

For example:

Foo.java
old content:

	if(StringUtils.isEmpty(foo)) {
		bar = new baz("foobar");

new content:

	if(StringUtils.isEmpty(foo)) {//
		bar = new baz("gaga");

Marked as changed are:
 - the last "//" in line 1
 - the leading tabs in line 2
 - the gaga text in line 2

If I just change line 1, then the white space in line 2 is not marked.
Also if I change just line 2, the white space is not marked.

Additionally, it the added characters in line 1 are "xyz" instead of "//", the again the line 2 white space is not marked.

The "logic" seems quite complicated.


It happens both in "Text Compare Mode" as in "Java Source Compare".
To trigger the problem in "Text Compare Mode", add a space to the end of line 1.
Comment 1 Eclipse Genie CLA 2020-05-21 19:28:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 David Balažic CLA 2020-07-07 10:36:35 EDT
This still happens in version:

Eclipse IDE for Enterprise Java Developers (includes Incubating components)

Version: 2020-06 (4.16.0)
Build id: 20200615-1200
Comment 3 David Balažic CLA 2020-07-07 10:38:19 EDT
Created attachment 283528 [details]
screenshot of problem
Comment 4 Paul Pazderski CLA 2020-11-17 14:19:29 EST
(In reply to David  Balažic from comment #0)
> It happens both in "Text Compare Mode" as in "Java Source Compare".
> To trigger the problem in "Text Compare Mode", add a space to the end of
> line 1.

Is this part still true? I could reproduce it but not in Text Compare Mode. Only Java Source Compare.
Comment 5 David Balažic CLA 2020-11-18 10:46:02 EST
Created attachment 284807 [details]
screenshot of text compare

Yes, version:

Eclipse IDE for Enterprise Java Developers (includes Incubating components)

Version: 2020-09 (4.17.0)
Build id: 20200910-1200

see screenshot.

The behavior is as in the original report.

Additionally, in Text mode, the { char at the end of line 1 is marked as changed, even if it is not, as can also be seen on the screenshot.