Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330872

Summary: [Annotate] Incorrect handling of lines with CR delimiter
Product: [Eclipse Project] Platform Reporter: Alex Bradley <a.bradley>
Component: CVSAssignee: platform-cvs-inbox <platform-cvs-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Screenshot showing incorrect annotations after line 51
none
Patch to AnnotateListener none

Description Alex Bradley CLA 2010-11-22 19:30:05 EST
Build Identifier: M20100909-0800

When a repository file uses the CR ("\r") delimiter, it appears that command-line "cvs annotate" doesn't recognize CR as a newline. Example (see line 51):

$ cvs annotate -r 1.38 PaletteViewer.java 2>/dev/null | grep -n '' | sed -e "s/\\r/<<<CR>>>/g" | tail -n +45 | head -15
45:1.7          (rhudson  10-Mar-03): import org.eclipse.gef.ui.parts.PaletteViewerKeyHandler;
46:1.7          (rhudson  10-Mar-03): import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
47:1.7          (rhudson  10-Mar-03): 
48:1.16         (pshah    25-Mar-03): /**
49:1.16         (pshah    25-Mar-03):  * Graphical viewer for the GEF palette.
50:1.16         (pshah    25-Mar-03):  * 
51:1.17         (pshah    26-Mar-03):  * @author Randy Hudson, Pratik Shah<<<CR>>> */
52:1.7          (rhudson  10-Mar-03): public class PaletteViewer
53:1.7          (rhudson  10-Mar-03): 	extends ScrollingGraphicalViewer
54:1.1          (ebordeau 08-Aug-02): {
55:1.1          (ebordeau 08-Aug-02): 
56:1.7          (rhudson  10-Mar-03): private class PreferenceListener
57:1.7          (rhudson  10-Mar-03): 	implements PropertyChangeListener
58:1.7          (rhudson  10-Mar-03): {
59:1.36         (pshah    17-Jun-04): 	/**

The Eclipse editor does handle CR as a line break. However, in cases like the above, it looks like Eclipse's CVS interface doesn't translate "CR-not-recognized" line numbers into "CR-recognized" line numbers. For PaletteViewer.java revision 1.38 (see Steps to Reproduce), this means annotations are displayed for the wrong lines after line 51.

Reproducible: Always

Steps to Reproduce:
1. Check out org.eclipse.gef project (http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gef/plugins/org.eclipse.gef/?root=Tools_Project) at date 2004/07/01.
2. Open /org.eclipse.gef/src/org/eclipse/gef/ui/palette/PaletteViewer.java in a Java editor.
3. Show annotations for PaletteViewer.java. Annotations are off by one from line 52 on, off by two from line 100 on, etc.
Comment 1 Alex Bradley CLA 2010-11-22 19:41:41 EST
Created attachment 183626 [details]
Screenshot showing incorrect annotations after line 51
Comment 2 Alex Bradley CLA 2010-11-25 21:06:21 EST
Created attachment 183899 [details]
Patch to AnnotateListener

Here is a possible patch to fix the bug.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:13:07 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.

If you have further information on the current state of the bug, please add it. 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.
Comment 4 Eclipse Genie CLA 2022-02-12 11:18:49 EST
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.