Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330872 - [Annotate] Incorrect handling of lines with CR delimiter
Summary: [Annotate] Incorrect handling of lines with CR delimiter
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 19:30 EST by Alex Bradley CLA
Modified: 2022-02-12 11:18 EST (History)
0 users

See Also:


Attachments
Screenshot showing incorrect annotations after line 51 (54.00 KB, image/png)
2010-11-22 19:41 EST, Alex Bradley CLA
no flags Details
Patch to AnnotateListener (1.50 KB, patch)
2010-11-25 21:06 EST, Alex Bradley CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.