diff options
author | Niko Stotz | 2019-11-18 20:11:53 +0000 |
---|---|---|
committer | Noopur Gupta | 2019-11-27 05:43:50 +0000 |
commit | 36c093525af6238c6fefac3d88ff37a4d6e3559f (patch) | |
tree | d688c6a48bb6917a26edbc56e2c74c9515088683 | |
parent | 5550281aef563a9cce3601ba9a9d6ca19118fd67 (diff) | |
download | eclipse.platform.text-36c093525af6238c6fefac3d88ff37a4d6e3559f.tar.gz eclipse.platform.text-36c093525af6238c6fefac3d88ff37a4d6e3559f.tar.xz eclipse.platform.text-36c093525af6238c6fefac3d88ff37a4d6e3559f.zip |
bug 552984 - added annotation code mining label sanitation
Change-Id: Ie0748e35ab29ddeb2698413f9fa974a35d09cff4
Signed-off-by: Niko Stotz <eclipse@nikostotz.de>
-rw-r--r-- | org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java index 2453a30a111..9e9407a465e 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMining.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 Altran Netherlands B.V. and others. +# * Copyright (c) 2018 Altran Netherlands B.V. and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -48,11 +48,15 @@ public class AnnotationCodeMining extends LineHeaderCodeMining { super(lineNumber, document, provider, action); this.annotationAccess= annotationAccess; - setLabel(annotation.getText()); + setLabel(sanitizeLabel(annotation.getText())); this.annotation= annotation; } + private static String sanitizeLabel(String label) { + return label.replace('\r', ' ').replace('\n', ' '); + } + @Override @SuppressWarnings("null") public Point draw(GC gc, StyledText textWidget, Color color, int x, int y) { |