Bug 532829 - [CodeMining] Eclipse IDE freezes when refactor is done for
method parameter name

Change-Id: I335ebf9ece550afb083fe63b4deb895963c8f877
Signed-off-by: angelozerr <angelo.zerr@gmail.com>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
index adaa340..ff290e9 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
@@ -186,8 +186,12 @@
 				if (metrics.ascent == fullHeight) {
 					return null;
 				}
-				metrics.width= width;
-				metrics.ascent= fullHeight;
+				/**
+				 * We must create a new GlyphMetrics instance because comparison with similarTo used
+				 * later in StyledText#setStyleRange will compare the same (modified) and won't
+				 * realize an update happened.
+				 */
+				metrics= new GlyphMetrics(fullHeight, 0, width);
 			}
 		} else {
 			metrics= null;
@@ -309,7 +313,12 @@
 				if (metrics.width == fullWidth) {
 					return null;
 				}
-				metrics.width= fullWidth;
+				/**
+				 * We must create a new GlyphMetrics instance because comparison with similarTo used
+				 * later in StyledText#setStyleRange will compare the same (modified) and won't
+				 * realize an update happened.
+				 */
+				metrics= new GlyphMetrics(0, 0, fullWidth);
 			}
 		} else {
 			metrics= null;