mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 364943 - java.lang.StringIndexOutOfBoundsException exception observed
This commit is contained in:
parent
b21382f93c
commit
fc0097f131
1 changed files with 7 additions and 6 deletions
|
@ -100,9 +100,11 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
|
|
||||||
protected static class SingletonRule implements ISchedulingRule {
|
protected static class SingletonRule implements ISchedulingRule {
|
||||||
public static final ISchedulingRule INSTANCE = new SingletonRule();
|
public static final ISchedulingRule INSTANCE = new SingletonRule();
|
||||||
|
@Override
|
||||||
public boolean contains(ISchedulingRule rule) {
|
public boolean contains(ISchedulingRule rule) {
|
||||||
return rule == this;
|
return rule == this;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean isConflicting(ISchedulingRule rule) {
|
public boolean isConflicting(ISchedulingRule rule) {
|
||||||
return rule == this;
|
return rule == this;
|
||||||
}
|
}
|
||||||
|
@ -132,6 +134,7 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable#runOnAST(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
* @see org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable#runOnAST(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
|
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
|
||||||
if (ast != null) {
|
if (ast != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -637,12 +640,8 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
|
|
||||||
String[] sourceLines= Strings.convertIntoLines(source);
|
String[] sourceLines= Strings.convertIntoLines(source);
|
||||||
String firstLine= sourceLines[0];
|
String firstLine= sourceLines[0];
|
||||||
if (firstLine.length() > 0 && !Character.isWhitespace(firstLine.charAt(0)))
|
boolean ignoreFirstLine= firstLine.length() > 0 && !Character.isWhitespace(firstLine.charAt(0));
|
||||||
sourceLines[0]= ""; //$NON-NLS-1$
|
Strings.trimIndentation(sourceLines, getTabWidth(), getTabWidth(), !ignoreFirstLine);
|
||||||
Strings.trimIndentation(sourceLines, getTabWidth(), getTabWidth());
|
|
||||||
|
|
||||||
if (!Character.isWhitespace(firstLine.charAt(0)))
|
|
||||||
sourceLines[0]= firstLine;
|
|
||||||
|
|
||||||
source = Strings.concatenate(sourceLines, delim);
|
source = Strings.concatenate(sourceLines, delim);
|
||||||
return source;
|
return source;
|
||||||
|
@ -797,6 +796,7 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
@Override
|
@Override
|
||||||
public IInformationControlCreator getHoverControlCreator() {
|
public IInformationControlCreator getHoverControlCreator() {
|
||||||
return new IInformationControlCreator() {
|
return new IInformationControlCreator() {
|
||||||
|
@Override
|
||||||
public IInformationControl createInformationControl(Shell parent) {
|
public IInformationControl createInformationControl(Shell parent) {
|
||||||
IEditorPart editor= getEditor();
|
IEditorPart editor= getEditor();
|
||||||
int orientation= SWT.NONE;
|
int orientation= SWT.NONE;
|
||||||
|
@ -814,6 +814,7 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
@Override
|
@Override
|
||||||
public IInformationControlCreator getInformationPresenterControlCreator() {
|
public IInformationControlCreator getInformationPresenterControlCreator() {
|
||||||
return new IInformationControlCreator() {
|
return new IInformationControlCreator() {
|
||||||
|
@Override
|
||||||
public IInformationControl createInformationControl(Shell parent) {
|
public IInformationControl createInformationControl(Shell parent) {
|
||||||
IEditorPart editor= getEditor();
|
IEditorPart editor= getEditor();
|
||||||
int orientation= SWT.NONE;
|
int orientation= SWT.NONE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue