From c9909363f9d8cb4c8f7f64997d85892857955dcd Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 27 Nov 2013 17:30:49 -0800 Subject: [PATCH] Cosmetics. --- .../dom/rewrite/DeclarationGenerator.java | 4 ++-- .../ui/text/c/hover/CSourceHover.java | 24 +++---------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/DeclarationGenerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/DeclarationGenerator.java index c59986d92d3..4799e57d048 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/DeclarationGenerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/DeclarationGenerator.java @@ -31,14 +31,14 @@ public abstract class DeclarationGenerator { } /** - * Creates a new {@link IASTDeclSpecifier}DeclSpecifier for a given {@link IType}. + * Creates a new {@link IASTDeclSpecifier} for a given {@link IType}. * @param type the type to describe * @return the generated declaration specifier */ public abstract IASTDeclSpecifier createDeclSpecFromType(IType type); /** - * Creates a new {@link IASTDeclarator}Declarator for a given {@link IType}. + * Creates a new {@link IASTDeclarator} for a given {@link IType}. * @param type the type to describe * @param name the name for the declarator * @return the generated declarator diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java index abcc4421aa3..541357f797e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java @@ -150,9 +150,6 @@ public class CSourceHover extends AbstractCEditorTextHover { fSource= null; } - /* - * @see org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable#runOnAST(IASTTranslationUnit) - */ @Override public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) { if (ast != null) { @@ -389,10 +386,8 @@ public class CSourceHover extends AbstractCEditorTextHover { } String source= buffer.getDocument().get(sourceStart, sourceEnd - sourceStart); return source; - } catch (BadLocationException e) { - // Ignore - should not happen anyway - if (DEBUG) e.printStackTrace(); + CUIPlugin.log(e); } finally { mgr.disconnect(location, LocationKind.LOCATION, fMonitor); } @@ -408,12 +403,10 @@ public class CSourceHover extends AbstractCEditorTextHover { * otherwise {@code null}. */ private String computeHoverForDeclaration(IASTName name) { - ICPPASTDeclarator declarator = - CPPVisitor.findAncestorWithType(name, ICPPASTDeclarator.class); + ICPPASTDeclarator declarator = CPPVisitor.findAncestorWithType(name, ICPPASTDeclarator.class); if (declarator == null) return null; - IASTDeclaration declaration = - CPPVisitor.findAncestorWithType(declarator, IASTDeclaration.class); + IASTDeclaration declaration = CPPVisitor.findAncestorWithType(declarator, IASTDeclaration.class); IASTDeclSpecifier declSpec = null; if (declaration instanceof IASTSimpleDeclaration) { declSpec = ((IASTSimpleDeclaration) declaration).getDeclSpecifier(); @@ -672,9 +665,6 @@ public class CSourceHover extends AbstractCEditorTextHover { super(); } - /* - * @see ITextHover#getHoverInfo(ITextViewer, IRegion) - */ @Override public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { IEditorPart editor = getEditor(); @@ -862,10 +852,6 @@ public class CSourceHover extends AbstractCEditorTextHover { return keywords.contains(name); } - /* - * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator() - * @since 3.0 - */ @Override public IInformationControlCreator getHoverControlCreator() { return new IInformationControlCreator() { @@ -881,10 +867,6 @@ public class CSourceHover extends AbstractCEditorTextHover { }; } - /* - * @see IInformationProviderExtension2#getInformationPresenterControlCreator() - * @since 3.0 - */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return new IInformationControlCreator() {