Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry BLIND2016-08-12 18:10:30 +0000
committerThierry BLIND2016-08-12 18:10:30 +0000
commit12ef37a2a001eebd8bbc7bc60d0c28eb26d7b3de (patch)
tree6343d9de74da0517e54a78c58ccfa225f9f67241
parent4cf7c8abc5c8e305a7020452025b0ac7abd1fc7f (diff)
downloadorg.eclipse.dltk.core-12ef37a2a001eebd8bbc7bc60d0c28eb26d7b3de.tar.gz
org.eclipse.dltk.core-12ef37a2a001eebd8bbc7bc60d0c28eb26d7b3de.tar.xz
org.eclipse.dltk.core-12ef37a2a001eebd8bbc7bc60d0c28eb26d7b3de.zip
Bug 499613 - StringIndexOutOfBoundsException thrown by class
ScriptSourceHover Change-Id: Iec4afbe5fa33b8c37ca160023091b283f80c9a1b Signed-off-by: Thierry BLIND <thierryblind@msn.com>
-rw-r--r--core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/hover/ScriptSourceHover.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/hover/ScriptSourceHover.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/hover/ScriptSourceHover.java
index c49df08c0..6f7f13e0c 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/hover/ScriptSourceHover.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/internal/ui/text/hover/ScriptSourceHover.java
@@ -50,25 +50,18 @@ public class ScriptSourceHover extends AbstractScriptEditorTextHover implements
if (source == null)
return null;
- // source = removeLeadingComments(source);
- String delim = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
String[] sourceLines = Strings.convertIntoLines(source);
- String firstLine = sourceLines[0];
- if (!Character.isWhitespace(firstLine.charAt(0)))
- sourceLines[0] = ""; //$NON-NLS-1$
-
- if (!Character.isWhitespace(firstLine.charAt(0)))
- sourceLines[0] = firstLine;
+ if (sourceLines == null)
+ return null;
+ // source = removeLeadingComments(source);
+ String delim = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
source = Strings.concatenate(sourceLines, delim);
return source;
-
} catch (ModelException ex) {
}
}
-
return null;
}

Back to the top