diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java index bd6709351ef..3e9cce723fd 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java @@ -17,7 +17,6 @@ package org.eclipse.cdt.core.model; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICContainer extends ICElement, IParent, IOpenable { - /** * Returns an array of non-C resources directly contained in this project. * It does not transitively answer non-C resources contained in folders; @@ -97,5 +96,4 @@ public interface ICContainer extends ICElement, IParent, IOpenable { * @return the container with the given name */ ICContainer getCContainer(String name); - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java index d9d56382733..365d9ffeaa0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java @@ -26,7 +26,6 @@ import org.eclipse.core.runtime.IPath; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICElement extends IAdaptable { - /** * IResource from 10-20 */ @@ -296,17 +295,18 @@ public interface ICElement extends IAdaptable { /** * Returns whether this C element exists in the model. * - * @return true if this element exists in the C model + * @return {@code true} if this element exists in the C model */ boolean exists(); /** * Returns the first ancestor of this C element that has the given type. - * Returns null if no such an ancestor can be found. + * Returns {@code null} if no such an ancestor can be found. * This is a handle-only method. * * @param ancestorType the given type - * @return the first ancestor of this C element that has the given type, null if no such an ancestor can be found + * @return the first ancestor of this C element that has the given type, {@code null} if no such + * an ancestor can be found * @since 2.0 */ ICElement getAncestor(int ancestorType); @@ -322,9 +322,7 @@ public interface ICElement extends IAdaptable { * Returns this element's kind encoded as an integer. * This is a handle-only method. * - * @return the kind of element; one of the constants declared in - * ICElement - * @see ICElement + * @return the kind of element; one of the constants declared in {@link ICElement} */ int getElementType(); @@ -336,19 +334,19 @@ public interface ICElement extends IAdaptable { ICModel getCModel(); /** - * Returns the C project this element is contained in, - * or null if this element is not contained in any C project + * Returns the C project this element is contained in, or {@code null} if this element + * is not contained in any C project * - * @return the containing C project, or null if this element is - * not contained in a C project + * @return the containing C project, or {@code null} if this element is + * not contained in a C project */ ICProject getCProject(); /** * Returns the element directly containing this element, - * or null if this element has no parent. + * or {@code null} if this element has no parent. * - * @return the parent element, or null if this element has no parent + * @return the parent element, or {@code null} if this element has no parent */ ICElement getParent(); @@ -360,7 +358,6 @@ public interface ICElement extends IAdaptable { * If this element is included in an external archive, * the path returned is the absolute path to the archive in the file system. * This is a handle-only method. - * */ IPath getPath(); @@ -374,19 +371,19 @@ public interface ICElement extends IAdaptable { /** * Returns the underlying resource that contains - * this element, or null if this element is not contained + * this element, or {@code null} if this element is not contained * in a resource. * - * @return the underlying resource, or null if none + * @return the underlying resource, or {@code null} if none */ IResource getUnderlyingResource(); /** * Returns the Corresponding resource for - * this element, or null if this element does not have + * this element, or {@code null} if this element does not have * a corresponding resource. * - * @return the corresponding resource, or null if none + * @return the corresponding resource, or {@code null} if none */ IResource getResource(); @@ -394,21 +391,20 @@ public interface ICElement extends IAdaptable { * Returns whether this C element is read-only. An element is read-only * if its structure cannot be modified by the C model. * - * @return true if this element is read-only + * @return {@code true} if this element is read-only */ boolean isReadOnly(); /** * Returns whether the structure of this element is known. For example, for a - * translation unit that could not be parsed, false is returned. + * translation unit that could not be parsed, {@code false} is returned. * If the structure of an element is unknown, navigations will return reasonable - * defaults. For example, getChildren will return an empty collection. + * defaults. For example, {@code getChildren} will return an empty collection. *

* Note: This does not imply anything about consistency with the * underlying resource/buffer contents. - *

* - * @return true if the structure of this element is known + * @return {@code true} if the structure of this element is known * @exception CModelException if this element does not exist or if an * exception occurs while accessing its corresponding resource */ @@ -422,7 +418,6 @@ public interface ICElement extends IAdaptable { */ void accept(ICElementVisitor visitor) throws CoreException; - /** * Returns a string representation of this element handle. The format of the * string is not specified; however, the identifier is stable across @@ -430,15 +425,13 @@ public interface ICElement extends IAdaptable { * CoreModel.create(String) method. *

* Some element types, like binaries, do not support handle identifiers and - * return null. + * return {@code null}. *

* - * @return the string handle identifier, or null if the - * element type is not supported + * @return the string handle identifier, or {@code null} if the element type is not supported * @see CoreModel#create(java.lang.String) * * @since 5.0 */ String getHandleIdentifier(); - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplate.java index 8ad362ca102..23e6842f219 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplate.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplate.java @@ -1,14 +1,13 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 QnX Software Systems and others. + * Copyright (c) 2005, 2009 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Qnx Software Systems - initial API and implementation + * QNX Software Systems - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.core.model; /** @@ -18,5 +17,4 @@ package org.eclipse.cdt.core.model; * @noimplement This interface is not intended to be implemented by clients. */ public interface IMethodTemplate extends IMethodTemplateDeclaration, IMethod { - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplateDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplateDeclaration.java index 3067e1c7f85..dbf91a405b6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplateDeclaration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodTemplateDeclaration.java @@ -1,14 +1,13 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 QnX Software Systems and others. + * Copyright (c) 2005, 2009 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Qnx Software Systems - initial API and implementation + * QNX Software Systems - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.core.model; /** @@ -18,5 +17,4 @@ package org.eclipse.cdt.core.model; * @noimplement This interface is not intended to be implemented by clients. */ public interface IMethodTemplateDeclaration extends ITemplate, IMethodDeclaration { - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java index 876b90aec56..5dd8104108b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java @@ -12,12 +12,10 @@ package org.eclipse.cdt.core.model; import java.util.List; - /** * Common protocol for C elements that contain other C elements. */ public interface IParent { - /** * Returns the immediate children of this element. * The children are in no particular order. @@ -34,8 +32,7 @@ public interface IParent { /** * Returns whether this element has one or more immediate children. * This is a convenience method, and may be more efficient than - * testing whether getChildren is an empty array. + * testing whether {@link #getChildren()} returns an empty array. */ boolean hasChildren(); - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java index f721ca3a58e..0883463c1b7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java @@ -21,17 +21,15 @@ package org.eclipse.cdt.core.model; * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. */ - public interface ISourceReference { - /** * Returns the source code associated with this element. *

- * For binary files, this returns the source of the entire translation unit + * For binary files, this returns the source of the entire translation unit * associated with the binary file (if there is one). *

* - * @return the source code, or null if this element has no + * @return the source code, or null if this element has no * associated source code * @exception CModelException if this element does not exist or if an * exception occurs while accessing its corresponding resource @@ -41,11 +39,11 @@ public interface ISourceReference { /** * Returns the source range associated with this element. *

- * For binary files, this returns the range of the entire translation unit + * For binary files, this returns the range of the entire translation unit * associated with the binary file (if there is one). *

* - * @return the source range, or null if if this element has no + * @return the source range, or null if if this element has no * associated source code * @exception CModelException if this element does not exist or if an * exception occurs while accessing its corresponding resource @@ -57,7 +55,7 @@ public interface ISourceReference { * if this member is not declared in a translation unit (for example, a binary type). */ ITranslationUnit getTranslationUnit(); - + /** * Returns whether this element is in active code. Code is inactive when it is hidden * by conditional compilation. diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java index 6f83bf1a5a3..2313be46bfd 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java @@ -12,12 +12,6 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.model; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; - import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElementVisitor; @@ -39,6 +33,12 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.PlatformObject; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; + public abstract class CElement extends PlatformObject implements ICElement { public static final char CEM_ESCAPE = '\\'; public static final char CEM_CPROJECT = '='; @@ -61,9 +61,6 @@ public abstract class CElement extends PlatformObject implements ICElement { fType= type; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) - */ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Object getAdapter(Class adapter) { @@ -248,7 +245,7 @@ public abstract class CElement extends PlatformObject implements ICElement { } @Override - public abstract IResource getResource() ; + public abstract IResource getResource(); protected abstract CElementInfo createElementInfo(); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java index e5ccd2517b8..55a3ef1d2f1 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java @@ -117,9 +117,6 @@ public class CModelBuilder2 implements IContributedModelBuilder { fProgressMonitor= monitor; } - /* - * @see org.eclipse.cdt.core.model.IContributedModelBuilder#parse(boolean) - */ @Override public void parse(boolean quickParseMode) throws Exception { final IIndexManager indexManager= CCorePlugin.getIndexManager(); @@ -865,7 +862,6 @@ public class CModelBuilder2 implements IContributedModelBuilder { final FunctionInfo info; if (declarator instanceof ICPPASTFunctionDeclarator) { - final ICPPASTFunctionDeclarator cppFunctionDeclarator= (ICPPASTFunctionDeclarator) declarator; final IASTName simpleAstName; if (name instanceof ICPPASTQualifiedName) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java index aa051b7a96c..e0267dcfd64 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java @@ -6,17 +6,16 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Rational Software - Initial API and implementation + * Rational Software - Initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.IMethod; public class Method extends MethodDeclaration implements IMethod { - - public Method(ICElement parent, String name){ + + public Method(ICElement parent, String name) { this(parent, name, ICElement.C_METHOD); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java index 30bea0771a7..74481baade4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java @@ -6,17 +6,15 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Rational Software - Initial API and implementation + * Rational Software - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.model; - import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.IMethodTemplate; public class MethodTemplate extends Method implements IMethodTemplate { - protected Template fTemplate; public MethodTemplate(ICElement parent, String name) { @@ -55,34 +53,29 @@ public class MethodTemplate extends Method implements IMethodTemplate { return fTemplate.getNumberOfTemplateParameters(); } - /** - * @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature() - */ /* * The signature in the outline view will be: * The class X followed by its template parameters, * then the scope resolution, then the function name, - * followed by its template parameters, folowed by its + * followed by its template parameters, followed by its * normal parameter list, then a colon then the function's * return type. */ - @Override public String getTemplateSignature() throws CModelException { StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature()); sig.append(this.getParameterClause()); - if(isConst()) + if (isConst()) sig.append(" const"); //$NON-NLS-1$ - if(isVolatile()) + if (isVolatile()) sig.append(" volatile"); //$NON-NLS-1$ - if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ + if ((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ sig.append(" : "); //$NON-NLS-1$ sig.append(this.getReturnType()); } return sig.toString(); } - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java index 5ac310c1370..b6e15a553cc 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java @@ -6,15 +6,11 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Anton Leherbauer (Wind River Systems) + * Markus Schorn - initial API and implementation + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.model.ext; -import java.net.URI; -import java.util.Collections; -import java.util.List; - import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IPositionConverter; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; @@ -39,9 +35,13 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.Region; +import java.net.URI; +import java.util.Collections; +import java.util.List; + abstract class CElementHandle implements ICElementHandle, ISourceReference { - protected static final String[] EMPTY_STRING_ARRAY = new String[0]; - private static final ICElement[] NO_CHILDREN = new ICElement[0]; + protected static final String[] EMPTY_STRING_ARRAY = {}; + private static final ICElement[] NO_CHILDREN = {}; private ICElement fParent; private String fName; @@ -54,15 +54,14 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference { public CElementHandle(ICElement parent, int type, String name) { fParent= parent; fType= type; - // anonymous types are assigned a name in the index, we - // undo this here - if (name.length() > 0 && name.charAt(0)=='{') { + // Anonymous types are assigned a name in the index, we undo this here. + if (name.length() > 0 && name.charAt(0) == '{') { fName= ""; //$NON-NLS-1$ fIndex= name.hashCode(); } else { fName= name; } - fRegion= new Region(0,0); + fRegion= new Region(0, 0); } @Override @@ -78,7 +77,6 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference { return CElement.hashCode(this); } - @Override @SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java index 83c35245dc5..29f126a6bb0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.core.model.ext; @@ -41,7 +41,6 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe fIsConstructor= method instanceof ICPPConstructor; if (!fIsConstructor) fIsDestructor= method.isDestructor(); - } @Override @@ -91,5 +90,4 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe public boolean isDestructor() throws CModelException { return fIsDestructor; } - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodHandle.java index 53398832492..a64a2ba8f34 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodHandle.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodHandle.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - *******************************************************************************/ - + * Markus Schorn - initial API and implementation + *******************************************************************************/ package org.eclipse.cdt.internal.core.model.ext; import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod; @@ -16,7 +15,7 @@ import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.IMethod; public class MethodHandle extends MethodDeclarationHandle implements IMethod { - + public MethodHandle(ICElement parent, ICPPMethod method) { super(parent, ICElement.C_METHOD, method); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java index 3a2759b387a..731a59b0d58 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java @@ -6,15 +6,13 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.core.model.ext; import org.eclipse.cdt.core.model.ISourceRange; public class SourceRange implements ISourceRange { - private int fOffset; private int fLength; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java index d058116b99b..e7e53af8e61 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CElementSet.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -56,8 +56,7 @@ public class CElementSet { if (other.fSet != null) { return false; } - } - else { + } else { if (fSet.size() != other.fSet.size()) { return false; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryAction.java index 1d6c9524dd8..5600b59b51a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryAction.java @@ -19,20 +19,19 @@ import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels; - /** * Action used for the include browser forward / backward buttons */ public class CHHistoryAction extends Action { final static long LABEL_OPTIONS= - CElementLabels.M_PARAMETER_TYPES | - CElementLabels.ALL_FULLY_QUALIFIED | - CElementLabels.TEMPLATE_ARGUMENTS | - CElementLabels.MF_POST_FILE_QUALIFIED; - + CElementLabels.M_PARAMETER_TYPES | + CElementLabels.ALL_FULLY_QUALIFIED | + CElementLabels.TEMPLATE_ARGUMENTS | + CElementLabels.MF_POST_FILE_QUALIFIED; + private CHViewPart fViewPart; private ICElement fElement; - + public CHHistoryAction(CHViewPart viewPart, ICElement element) { super("", AS_RADIO_BUTTON); //$NON-NLS-1$ fViewPart= viewPart; @@ -42,20 +41,16 @@ public class CHHistoryAction extends Action { setText(elementName); setImageDescriptor(getImageDescriptor(element)); } - + private ImageDescriptor getImageDescriptor(ICElement elem) { CElementImageProvider imageProvider= new CElementImageProvider(); ImageDescriptor desc= imageProvider.getBaseImageDescriptor(elem, 0); imageProvider.dispose(); return desc; } - - /* - * @see Action#run() - */ + @Override public void run() { fViewPart.setInput(fElement); - } - + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java index c0984126e93..72a86863a80 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java @@ -17,8 +17,8 @@ import java.util.List; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.StatusDialog; -import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; @@ -84,9 +84,6 @@ public class CHHistoryListAction extends Action { fHistoryList.selectElements(sel); } - /* - * @see Dialog#createDialogArea(Composite) - */ @Override protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); @@ -142,24 +139,17 @@ public class CHHistoryListAction extends Action { return elems.toArray(new ICElement[elems.size()]); } - /* - * @see org.eclipse.jface.window.Window#configureShell(Shell) - */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); // PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, ...); } - /* (non-Javadoc) - * @see org.eclipse.jface.window.Window#create() - */ @Override public void create() { setShellStyle(getShellStyle() | SWT.RESIZE); super.create(); } - } private CHViewPart fView; @@ -169,9 +159,6 @@ public class CHHistoryListAction extends Action { setText(CHMessages.CHHistoryListAction_OpenHistory_label); } - /* - * @see IAction#run() - */ @Override public void run() { ICElement[] historyEntries= CallHierarchyUI.getHistoryEntries(); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java index 663231f1bf9..4d18bea73df 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Patrick Hofer [bug 325799] + * Markus Schorn - initial API and implementation + * Patrick Hofer [bug 325799] *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -24,12 +24,12 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Display; import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels; import org.eclipse.cdt.ui.CElementImageDescriptor; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.internal.ui.viewsupport.AppearanceAwareLabelProvider; import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider; +import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels; import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider; import org.eclipse.cdt.internal.ui.viewsupport.ImageImageDescriptor; @@ -56,8 +56,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { if (node.isInitializer()) { ImageDescriptor desc= CElementImageProvider.getFunctionImageDescriptor(); image= CUIPlugin.getImageDescriptorRegistry().get(desc); - } - else { + } else { ICElement decl= node.getOneRepresentedDeclaration(); if (decl != null) { image= fCLabelProvider.getImage(decl); @@ -82,8 +81,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { fCLabelProvider.setTextFlags(LABEL_OPTIONS_SIMPLE); label= fCLabelProvider.getText(decl); fCLabelProvider.setTextFlags(options); - } - else { + } else { label= fCLabelProvider.getText(decl); if (node.isInitializer()) { label= addInitializerDecoration(label); @@ -111,8 +109,7 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { fCLabelProvider.setTextFlags(LABEL_OPTIONS_SIMPLE); label= fCLabelProvider.getStyledText(decl); fCLabelProvider.setTextFlags(options); - } - else { + } else { label= fCLabelProvider.getStyledText(decl); if (node.isInitializer()) { label= addInitializerDecoration(label); @@ -125,7 +122,6 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { label.setStyle(offset, label.length() - offset, StyledString.COUNTER_STYLER); } - //return label; String decorated= decorateText(label.getString(), element); if (decorated != null) { return StyledCellLabelProvider.styleDecoratedString(decorated, StyledString.DECORATIONS_STYLER, label); @@ -174,7 +170,6 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { return label2; } - @Override public void dispose() { fCLabelProvider.dispose(); @@ -189,16 +184,13 @@ public class CHLabelProvider extends AppearanceAwareLabelProvider { int flags= 0; if (node.isRecursive()) { flags |= CElementImageDescriptor.RECURSIVE_RELATION; - } - else if (fContentProvider.hasChildren(node)) { + } else if (fContentProvider.hasChildren(node)) { if (fContentProvider.getComputeReferencedBy()) { flags |= CElementImageDescriptor.REFERENCED_BY; - } - else { + } else { if (node.isMultiDef()) { flags |= CElementImageDescriptor.RELATES_TO_MULTIPLE; - } - else { + } else { flags |= CElementImageDescriptor.RELATES_TO; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMessages.java index 620ceba59e8..adca3752d8b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMessages.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Sergey Prigogin (Google) + * Markus Schorn - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefChildNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefChildNode.java index 1df96be7972..975c938a028 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefChildNode.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefChildNode.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -18,7 +18,8 @@ import org.eclipse.cdt.core.model.ITranslationUnit; */ public class CHMultiDefChildNode extends CHNode { - public CHMultiDefChildNode(CHMultiDefNode parent, ITranslationUnit fileOfReferences, long timestamp, ICElement decl, int linkageID) { + public CHMultiDefChildNode(CHMultiDefNode parent, ITranslationUnit fileOfReferences, + long timestamp, ICElement decl, int linkageID) { super(parent, fileOfReferences, timestamp, decl, linkageID); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefNode.java index 868e5a8d219..5358756520b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefNode.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHMultiDefNode.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -16,15 +16,15 @@ import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.internal.ui.util.CoreUtility; public class CHMultiDefNode extends CHNode { - private CHNode[] fChildren; - public CHMultiDefNode(CHNode parent, ITranslationUnit tu, long timestamp, ICElement[] elements, int linkageID) { + public CHMultiDefNode(CHNode parent, ITranslationUnit tu, long timestamp, ICElement[] elements, + int linkageID) { super(parent, tu, timestamp, null, linkageID); if (elements.length == 0) { throw new IllegalArgumentException(); } - fHashCode+= elements[0].hashCode(); + fHashCode += elements[0].hashCode(); fChildren= new CHNode[elements.length]; for (int i = 0; i < elements.length; i++) { ICElement element = elements[i]; @@ -65,5 +65,4 @@ public class CHMultiDefNode extends CHNode { final CHMultiDefNode rhs = (CHMultiDefNode) o; return CoreUtility.safeEquals(getOneRepresentedDeclaration(), rhs.getOneRepresentedDeclaration()); } - } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java index 465713bbdfc..4be662972ec 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java @@ -7,7 +7,7 @@ * * Contributors: * Markus Schorn - initial API and implementation - *******************************************************************************/ + *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; import java.util.ArrayList; @@ -27,12 +27,12 @@ import org.eclipse.cdt.internal.ui.util.CoreUtility; /** * Represents a node in the include browser */ -public class CHNode implements IAdaptable { +public class CHNode implements IAdaptable { private CHNode fParent; private ICElement fRepresentedDecl; private ITranslationUnit fFileOfReferences; private List fReferences; - + protected int fHashCode; private long fTimestamp; private boolean fIsRecursive; @@ -44,7 +44,8 @@ public class CHNode implements IAdaptable { /** * Creates a new node for the include browser */ - public CHNode(CHNode parent, ITranslationUnit fileOfReferences, long timestamp, ICElement decl, int linkageID) { + public CHNode(CHNode parent, ITranslationUnit fileOfReferences, long timestamp, ICElement decl, + int linkageID) { fParent= parent; fFileOfReferences= fileOfReferences; fReferences= Collections.emptyList(); @@ -54,7 +55,7 @@ public class CHNode implements IAdaptable { fTimestamp= timestamp; fLinkageID= linkageID; } - + private int computeHashCode() { int hashCode= 1; if (fParent != null) { @@ -64,13 +65,13 @@ public class CHNode implements IAdaptable { hashCode+= fRepresentedDecl.hashCode(); } return hashCode; - } + } @Override public int hashCode() { return fHashCode; } - + @Override public boolean equals(Object o) { if (!(o instanceof CHNode)) { @@ -84,7 +85,7 @@ public class CHNode implements IAdaptable { return CoreUtility.safeEquals(fRepresentedDecl, rhs.fRepresentedDecl); } - + private boolean computeIsRecursive(CHNode parent, ICElement decl) { if (parent == null || decl == null) { return false; @@ -113,11 +114,11 @@ public class CHNode implements IAdaptable { public int getReferenceCount() { return fReferences.size(); } - + public CHReferenceInfo getReference(int idx) { return fReferences.get(idx); } - + public ICElement getRepresentedDeclaration() { return fRepresentedDecl; } @@ -134,11 +135,11 @@ public class CHNode implements IAdaptable { return fRepresentedDecl instanceof IVariableDeclaration || fRepresentedDecl instanceof IEnumerator; } - + public int getFirstReferenceOffset() { return fReferences.isEmpty() ? -1 : getReference(0).getOffset(); } - + public void addReference(CHReferenceInfo info) { switch (fReferences.size()) { case 0: @@ -163,7 +164,7 @@ public class CHNode implements IAdaptable { } return null; } - + public boolean isMultiDef() { return false; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHPinAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHPinAction.java index 3b770e66d62..6bb068dd312 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHPinAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHPinAction.java @@ -17,7 +17,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.cdt.internal.ui.CPluginImages; public class CHPinAction extends Action { - private CHViewPart fView= null; + private CHViewPart fView; /** * Constructs a 'Pin Call Hierarchy view' action. @@ -31,9 +31,6 @@ public class CHPinAction extends Action { fView= view; } - /* - * @see org.eclipse.jface.action.Action#run() - */ @Override public void run() { fView.setPinned(isChecked()); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java index 039319a9de5..32d69d6357a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java @@ -40,7 +40,7 @@ import org.eclipse.cdt.internal.ui.viewsupport.IndexUI; * @since 4.0 */ public class CHQueries { - private static final CHNode[] EMPTY_NODES= new CHNode[0]; + private static final CHNode[] EMPTY_NODES= {}; private CHQueries() {} @@ -63,7 +63,7 @@ public class CHQueries { final String ct = tu.getContentTypeId(); if (ct.equals(CCorePlugin.CONTENT_TYPE_CXXHEADER)) { - // bug 260262: in a header file we need to consider c and c++ + // Bug 260262: in a header file we need to consider C and C++. findCalledBy(callee, ILinkage.C_LINKAGE_ID, index, result); findCalledBy(callee, ILinkage.CPP_LINKAGE_ID, index, result); done= true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java index 12cc688466e..9e020401a6b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -19,6 +19,7 @@ public class CHReferenceInfo { return r1.fOffset - r2.fOffset; } }; + private int fOffset; private int fLength; @@ -26,7 +27,7 @@ public class CHReferenceInfo { fOffset= offset; fLength= length; } - + public int getOffset() { return fOffset; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHViewPart.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHViewPart.java index 9fd2f0163d2..172953b27fb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHViewPart.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHViewPart.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - * Sergey Prigogin (Google) + * Markus Schorn - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -224,9 +224,6 @@ public class CHViewPart extends ViewPart { private void addPartListener() { fPartListener= new IPartListener2() { - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference) - */ @Override public void partActivated(IWorkbenchPartReference partRef) { if (isThisView(partRef)) @@ -236,9 +233,6 @@ public class CHViewPart extends ViewPart { @Override public void partBroughtToTop(IWorkbenchPartReference partRef) { } - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference) - */ @Override public void partClosed(IWorkbenchPartReference partRef) { if (isThisView(partRef)) { @@ -249,16 +243,15 @@ public class CHViewPart extends ViewPart { @Override public void partDeactivated(IWorkbenchPartReference partRef) {} @Override - public void partOpened(IWorkbenchPartReference partRef) { } + public void partOpened(IWorkbenchPartReference partRef) {} @Override - public void partHidden(IWorkbenchPartReference partRef) { } + public void partHidden(IWorkbenchPartReference partRef) {} @Override - public void partVisible(IWorkbenchPartReference partRef) { } + public void partVisible(IWorkbenchPartReference partRef) {} @Override - public void partInputChanged(IWorkbenchPartReference partRef) { } + public void partInputChanged(IWorkbenchPartReference partRef) {} }; getViewSite().getPage().addPartListener(fPartListener); - } @Override @@ -396,7 +389,7 @@ public class CHViewPart extends ViewPart { } private void createActions() { - // action groups + // Action groups fOpenViewActionGroup= new OpenViewActionGroup(this); fOpenViewActionGroup.setSuppressCallHierarchy(true); fOpenViewActionGroup.setSuppressProperties(true); @@ -454,8 +447,7 @@ public class CHViewPart extends ViewPart { public void run() { if (isChecked()) { fTreeViewer.addFilter(fVariableFilter); - } - else { + } else { fTreeViewer.removeFilter(fVariableFilter); } } @@ -472,6 +464,7 @@ public class CHViewPart extends ViewPart { } return 1; } + @Override public int compare(Viewer viewer, Object e1, Object e2) { if (!(e1 instanceof CHNode)) { @@ -591,22 +584,18 @@ public class CHViewPart extends ViewPart { fNavigationNode= null; return; } - - + if (selectedItem.getData().equals(fNavigationNode)) { if (forward && fNavigationDetail < getReferenceCount(fNavigationNode)-1) { fNavigationDetail++; - } - else if (!forward && fNavigationDetail > 0) { + } else if (!forward && fNavigationDetail > 0) { fNavigationDetail--; - } - else { + } else { selectedItem= navigator.getNextSibbling(selectedItem, forward); fNavigationNode= selectedItem == null ? null : (CHNode) selectedItem.getData(); initNavigationDetail(forward); } - } - else { + } else { fNavigationNode= (CHNode) selectedItem.getData(); initNavigationDetail(forward); } @@ -615,8 +604,7 @@ public class CHViewPart extends ViewPart { private void initNavigationDetail(boolean forward) { if (!forward && fNavigationNode != null) { fNavigationDetail= Math.max(0, getReferenceCount(fNavigationNode) -1); - } - else { + } else { fNavigationDetail= 0; } } @@ -625,8 +613,7 @@ public class CHViewPart extends ViewPart { CHNode node= selectionToNode(selection); if (node != null && node == fNavigationNode && node.getReferenceCount() > 0) { fNavigationDetail= (fNavigationDetail + 1) % node.getReferenceCount(); - } - else { + } else { fNavigationDetail= 0; } fNavigationNode= node; @@ -673,8 +660,7 @@ public class CHViewPart extends ViewPart { private void updateSorter() { if (fReferencedByAction.isChecked()) { fTreeViewer.setComparator(fSorterAlphaNumeric); - } - else { + } else { fTreeViewer.setComparator(fSorterReferencePosition); } } @@ -693,16 +679,14 @@ public class CHViewPart extends ViewPart { IWorkingSet workingSet= fWorkingSetFilterUI.getWorkingSet(); if (workingSet == null) { scope= CHMessages.CHViewPart_WorkspaceScope; - } - else { + } else { scope= workingSet.getLabel(); } // format if (fReferencedByAction.isChecked()) { format= CHMessages.CHViewPart_Title_callers; - } - else { + } else { format= CHMessages.CHViewPart_Title_callees; } @@ -761,7 +745,7 @@ public class CHViewPart extends ViewPart { } } - // action groups + // Action groups ISelection selection = getSite().getSelectionProvider().getSelection(); if (OpenViewActionGroup.canActionBeAdded(selection)){ fOpenViewActionGroup.fillContextMenu(menu); @@ -786,16 +770,14 @@ public class CHViewPart extends ViewPart { long timestamp= fNavigationNode.getTimestamp(); if (fNavigationDetail < 0) { fNavigationDetail= 0; - } - else if (fNavigationDetail >= fNavigationNode.getReferenceCount()-1) { + } else if (fNavigationDetail >= fNavigationNode.getReferenceCount()-1) { fNavigationDetail= fNavigationNode.getReferenceCount()-1; } CHReferenceInfo ref= fNavigationNode.getReference(fNavigationDetail); Region region= new Region(ref.getOffset(), ref.getLength()); EditorOpener.open(page, file, region, timestamp); - } - else { + } else { try { EditorOpener.open(page, fNavigationNode.getRepresentedDeclaration()); } catch (CModelException e) { @@ -816,7 +798,6 @@ public class CHViewPart extends ViewPart { } return 0; } - private CHNode selectionToNode(ISelection selection) { if (selection instanceof IStructuredSelection) { @@ -834,7 +815,7 @@ public class CHViewPart extends ViewPart { public Control getPageBook() { return fPagebook; } - + public ICElement getInput() { Object input= fTreeViewer.getInput(); if (input instanceof ICElement) { @@ -852,7 +833,7 @@ public class CHViewPart extends ViewPart { super(CHMessages.CHViewPart_CopyCallHierarchy_label, view, viewer); } } - + /** * Marks the view as pinned. * @@ -861,7 +842,7 @@ public class CHViewPart extends ViewPart { void setPinned(boolean pinned) { fIsPinned= pinned; } - + /** * Indicates whether the Call Hierarchy view is pinned. * diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java index abf26e06653..7e3ca9fe5d6 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java @@ -63,13 +63,13 @@ public class CallHierarchyUI { static final int INDEX_SEARCH_OPTION = IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT | IIndexManager.ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHY; private static final ICElement[] NO_ELEMENTS = {}; - private static boolean sIsJUnitTest= false; + private static boolean sIsJUnitTest; /** * List of the Call Hierarchy views in LRU order, where the most recently used view is at index 0. */ private static List fLRUCallHierarchyViews= new ArrayList(); - private static int fViewCount = 0; + private static int fViewCount; private static final int MAX_HISTORY_SIZE = 10; private static List fHistoryEntries= new ArrayList(MAX_HISTORY_SIZE); @@ -404,7 +404,7 @@ public class CallHierarchyUI { } } if (!viewFoundInPage) { - // find unresolved views + // Find unresolved views IViewReference[] viewReferences= page.getViewReferences(); for (IViewReference curr : viewReferences) { if (CUIPlugin.ID_CALL_HIERARCHY.equals(curr.getId()) && page.equals(curr.getPage())) { @@ -436,5 +436,4 @@ public class CallHierarchyUI { } } } - } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CalledByResult.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CalledByResult.java index d649f3432a1..450cfd74c7d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CalledByResult.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CalledByResult.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallsToResult.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallsToResult.java index c61ee028a7c..293ca063fe9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallsToResult.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallsToResult.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; @@ -26,7 +26,7 @@ public class CallsToResult { Set elementSets = fElementSetsToReferences.keySet(); return elementSets.toArray(new CElementSet[elementSets.size()]); } - + public IIndexName[] getReferences(CElementSet elementSet) { List references= fElementSetsToReferences.get(elementSet); return references.toArray(new IIndexName[references.size()]); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java index acfe4849050..bb534dd6122 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.ui.callhierarchy; import org.eclipse.core.runtime.IAdaptable; @@ -25,7 +24,6 @@ import org.eclipse.cdt.core.model.IVariableDeclaration; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.actions.SelectionDispatchAction; - public class OpenCallHierarchyAction extends SelectionDispatchAction { private ITextEditor fEditor; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java index 64cacf5b783..f08ff16666a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java @@ -61,7 +61,7 @@ public class OpenElementInCallHierarchyAction implements IWorkbenchWindowActionD String message = NLS.bind(CHMessages.OpenElementInCallHierarchyAction_errorNoDefinition, info.getQualifiedTypeName().toString()); MessageDialog.openError(getShell(), title, message); - } else { + } else { CallHierarchyUI.open(fWorkbenchWindow, elements[0]); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java index 3b1dcc323fc..5541421e058 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/ReferenceVisitor.java @@ -6,9 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation - *******************************************************************************/ - + * Markus Schorn - initial API and implementation + *******************************************************************************/ package org.eclipse.cdt.internal.ui.callhierarchy; import java.util.ArrayList; @@ -34,7 +33,7 @@ class ReferenceVisitor extends ASTVisitor { fFileName= fileName; fOffset= offset; - fEndOffset= offset+length; + fEndOffset= offset + length; } public IASTName[] getReferences() {