1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2014-11-21 15:23:10 -08:00
parent 6c9b53ea60
commit 30c61470fb
21 changed files with 149 additions and 180 deletions

View file

@ -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.index.tests;

View file

@ -1972,9 +1972,9 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// typedef int type;
// };
// template <typename> struct foo {};
// template <typename> struct foo {};
// int main() {
// typedef foo<int>::type type; // ERROR HERE: 'foo<int>::type' could not be
// typedef foo<int>::type type;
// }
public void testSpecializationInIndex_367563a() throws Exception {
getBindingFromASTName("type type", 4, ITypedef.class);
@ -1987,7 +1987,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// template <typename> struct foo {};
// int main() {
// typedef foo<int*>::type type; // ERROR HERE: 'foo<int>::type' could not be
// typedef foo<int*>::type type;
// }
public void testSpecializationInIndex_367563b() throws Exception {
getBindingFromASTName("type type", 4, ITypedef.class);
@ -2008,7 +2008,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// template <> struct foo<int> {
// typedef int type;
// };
// typedef foo<remove_const<const int>::type>::type t; // ERROR HERE
// typedef foo<remove_const<const int>::type>::type t;
public void testCurrentInstanceOfClassTemplatePartialSpec_368404() throws Exception {
ITypedef tdef= getBindingFromASTName("type t;", 4, ITypedef.class);
assertEquals("int", ASTTypeUtil.getType(tdef, true));
@ -2452,14 +2452,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
}
// template <class T, class U>
// struct multipliable2
// {
// struct multipliable2 {
// friend T operator *(const U& lhs, const T& rhs);
// };
//
// template <class T>
// struct multipliable1
// {
// struct multipliable1 {
// friend T operator *(const T& lhs, const T& rhs);
// };
@ -2467,8 +2465,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
//
// int foo(overloaded);
//
// int main()
// {
// int main() {
// overloaded c, d;
// foo(c * d);
// }
@ -2477,14 +2474,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
}
// template <class T, class U>
// struct multipliable2
// {
// struct multipliable2 {
// friend T operator *(const U& lhs, const T& rhs);
// };
//
// template <class T>
// struct multipliable1
// {
// struct multipliable1 {
// friend T operator *(const T& lhs, const T& rhs) {}
// };

View file

@ -81,7 +81,7 @@ public abstract class Openable extends Parent implements IOpenable {
Map<ICElement, CElementInfo> newElements, IResource underlyingResource) throws CModelException;
/**
* Close the buffer associated with this element, if any.
* Closes the buffer associated with this element, if any.
*/
protected void closeBuffer() {
if (!hasBuffer()) return; // nothing to do
@ -94,7 +94,7 @@ public abstract class Openable extends Parent implements IOpenable {
}
/**
* This element is being closed. Do any necessary cleanup.
* Does any necessary cleanup when this element is being closed.
*/
@Override
protected void closing(Object info) throws CModelException {
@ -107,13 +107,13 @@ public abstract class Openable extends Parent implements IOpenable {
@Override
public IBuffer getBuffer() throws CModelException {
if (hasBuffer()) {
// ensure element is open
// Ensure element is open.
if (!isOpen()) {
getElementInfo();
}
IBuffer buffer = getBufferManager().getBuffer(this);
if (buffer == null) {
// try to (re)open a buffer
// Try to (re)open a buffer.
buffer = openBuffer(null);
}
return buffer;
@ -122,7 +122,7 @@ public abstract class Openable extends Parent implements IOpenable {
}
/**
* Answers the buffer factory to use for creating new buffers
* Returns the buffer factory to use for creating new buffers.
*/
public IBufferFactory getBufferFactory(){
return getBufferManager().getDefaultBufferFactory();
@ -142,9 +142,7 @@ public abstract class Openable extends Parent implements IOpenable {
protected boolean hasBuffer() {
return false;
}
/**
* @see org.eclipse.cdt.core.model.IOpenable#hasUnsavedChanges()
*/
@Override
public boolean hasUnsavedChanges() throws CModelException{
if (isReadOnly() || !isOpen()) {
@ -154,8 +152,8 @@ public abstract class Openable extends Parent implements IOpenable {
if (buf != null && buf.hasUnsavedChanges()) {
return true;
}
// for roots and projects must check open buffers
// to see if they have an child with unsaved changes
// For roots and projects must check open buffers to see
// if they have an child with unsaved changes.
if (fType == C_MODEL || fType == C_PROJECT) {
Enumeration<IBuffer> openBuffers= getBufferManager().getOpenBuffers();
while (openBuffers.hasMoreElements()) {
@ -182,9 +180,6 @@ public abstract class Openable extends Parent implements IOpenable {
return true;
}
/**
* @see org.eclipse.cdt.core.model.IOpenable#isOpen()
*/
@Override
public boolean isOpen() {
return CModelManager.getDefault().getInfo(this) != null;
@ -197,9 +192,8 @@ public abstract class Openable extends Parent implements IOpenable {
}
/**
* Returns true if this represents a source element.
* Openable source elements have an associated buffer created
* when they are opened.
* Returns true if this represents a source element. Openable source elements have
* an associated buffer created when they are opened.
*/
protected boolean isSourceElement() {
return false;
@ -215,13 +209,10 @@ public abstract class Openable extends Parent implements IOpenable {
@Override
public void makeConsistent(IProgressMonitor monitor, boolean forced) throws CModelException {
// only translation units can be inconsistent
// other openables cannot be inconsistent so default is to do nothing
// Only translation units can be inconsistent.
// Other Openables cannot be inconsistent so default is to do nothing.
}
/**
* @see org.eclipse.cdt.core.model.IOpenable#open(IProgressMonitor)
*/
@Override
public void open(IProgressMonitor pm) throws CModelException {
getElementInfo(pm);
@ -248,9 +239,6 @@ public abstract class Openable extends Parent implements IOpenable {
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.model.CElement#generateInfos(java.lang.Object, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
protected void generateInfos(CElementInfo info, Map<ICElement, CElementInfo> newElements,
IProgressMonitor monitor) throws CModelException {
@ -258,16 +246,16 @@ public abstract class Openable extends Parent implements IOpenable {
System.out.println("OPENING Element ("+ Thread.currentThread()+"): " + this); //$NON-NLS-1$//$NON-NLS-2$
}
// open the parent if necessary
// Open the parent if necessary.
openParent(info, newElements, monitor);
if (monitor != null && monitor.isCanceled())
return;
// puts the info before building the structure so that questions to the handle behave as if the element existed
// (case of compilation units becoming working copies)
// Put the info before building the structure so that questions to the handle behave as if
// the element existed (case of compilation units becoming working copies).
newElements.put(this, info);
// build the structure of the openable (this will open the buffer if needed)
// Build the structure of the Openable (this will open the buffer if needed).
try {
OpenableInfo openableInfo = (OpenableInfo) info;
boolean isStructureKnown = buildStructure(openableInfo, monitor, newElements, getResource());
@ -277,13 +265,10 @@ public abstract class Openable extends Parent implements IOpenable {
throw e;
}
// remove out of sync buffer for this element
// Remove out of sync buffer for this element.
CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
}
/**
* @see org.eclipse.cdt.core.model.IOpenable#save(IProgressMonitor, boolean)
*/
@Override
public void save(IProgressMonitor pm, boolean force) throws CModelException {
IResource res = getResource();
@ -293,7 +278,7 @@ public abstract class Openable extends Parent implements IOpenable {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
}
}
// check also the underlying resource
// Check also the underlying resource.
if (isReadOnly()) {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
}
@ -305,7 +290,7 @@ public abstract class Openable extends Parent implements IOpenable {
}
/**
* Find enclosing package fragment root if any
* Finds enclosing package fragment root if any.
*/
public SourceRoot getSourceRoot() {
ICElement current = this;

View file

@ -54,7 +54,7 @@ public interface ICompositeType extends IBinding, IType {
public IField findField(String name);
/**
* Returns the IScope object that is associated with this composite type
* Returns the IScope object that is associated with this composite type.
*/
public IScope getCompositeScope();
}

View file

@ -137,40 +137,40 @@ public interface IScope {
}
}
public void setPrefixLookup(boolean prefixLookup) {
public final void setPrefixLookup(boolean prefixLookup) {
fPrefixLookup = prefixLookup;
}
public void setResolve(boolean resolve) {
public final void setResolve(boolean resolve) {
fResolve = resolve;
}
public void setIgnorePointOfDeclaration(boolean ignorePointOfDeclaration) {
public final void setIgnorePointOfDeclaration(boolean ignorePointOfDeclaration) {
fIgnorePointOfDeclaration = ignorePointOfDeclaration;
}
public void setLookupKey(char[] key) {
public final void setLookupKey(char[] key) {
fLookupKey= key;
}
public char[] getLookupKey() {
public final char[] getLookupKey() {
return fLookupKey;
}
public IASTNode getLookupPoint() {
public final IASTNode getLookupPoint() {
return fLookupPoint;
}
public boolean isResolve() {
public final boolean isResolve() {
return fResolve;
}
public boolean isPrefixLookup() {
public final boolean isPrefixLookup() {
return fPrefixLookup;
}
public boolean isIgnorePointOfDeclaration() {
public final boolean isIgnorePointOfDeclaration() {
return fIgnorePointOfDeclaration;
}
public IIndexFileSet getIncludedFiles() {
public final IIndexFileSet getIncludedFiles() {
return fTu == null ? IIndexFileSet.EMPTY : fTu.getIndexFileSet();
}
public IIndex getIndex() {
public final IIndex getIndex() {
return fTu == null ? null : fTu.getIndex();
}
public IASTName getLookupName() {
public final IASTName getLookupName() {
return fLookupPointIsName ? (IASTName) fLookupPoint : null;
}
public IASTTranslationUnit getTranslationUnit() {

View file

@ -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.core.dom.ast.cpp;
@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast.cpp;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICPPClassTemplatePartialSpecializationSpecialization extends
ICPPClassTemplatePartialSpecialization, ICPPClassSpecialization {
public interface ICPPClassTemplatePartialSpecializationSpecialization
extends ICPPClassTemplatePartialSpecialization, ICPPClassSpecialization {
}

View file

@ -31,7 +31,7 @@ public interface ICPPTemplateInstance extends ICPPSpecialization {
ICPPTemplateInstance[] EMPTY_TEMPLATE_INSTANCE_ARRAY = {};
/**
* get the template that this was instantiated from
* Returns the template that this instance was instantiated from.
*/
public ICPPTemplateDefinition getTemplateDefinition();
@ -43,7 +43,7 @@ public interface ICPPTemplateInstance extends ICPPSpecialization {
/**
* Explicit specializations are modeled as instances of a template.
* Returns <code>true</code> if this binding is an explicit specialization.
* Returns {@code true} if this binding is an explicit specialization.
* @since 5.2
*/
public boolean isExplicitSpecialization();

View file

@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Yuan Zhang / Beth Tibbitts (IBM Research)
* IBM Rational Software - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Yuan Zhang / Beth Tibbitts (IBM Research)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
@ -31,7 +31,7 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
* C-specific implementation of a translation unit.
*/
public class CASTTranslationUnit extends ASTTranslationUnit implements IASTAmbiguityParent {
private CScope compilationUnit = null;
private CScope compilationUnit;
private final CStructMapper fStructMapper;
public CASTTranslationUnit() {
@ -78,11 +78,6 @@ public class CASTTranslationUnit extends ASTTranslationUnit implements IASTAmbig
return ArrayUtil.removeNulls(IASTName.class, names);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getReferences(org.eclipse.cdt.core.dom.ast.IBinding)
*/
@Override
public IASTName[] getReferences(IBinding binding) {
if (binding instanceof IMacroBinding)
@ -112,7 +107,7 @@ public class CASTTranslationUnit extends ASTTranslationUnit implements IASTAmbig
public ICompositeType mapToASTType(ICompositeType type) {
return fStructMapper.mapToAST(type);
}
@Override
protected IType createType(IASTTypeId typeid) {
return CVisitor.createType(typeid.getAbstractDeclarator());

View file

@ -32,39 +32,33 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
* Implementation of scope for structs and unions.
*/
public class CCompositeTypeScope extends CScope implements ICCompositeTypeScope {
public CCompositeTypeScope( ICASTCompositeTypeSpecifier compTypeSpec ){
super( compTypeSpec, EScopeKind.eClassType);
public CCompositeTypeScope(ICASTCompositeTypeSpecifier compTypeSpec) {
super(compTypeSpec, EScopeKind.eClassType);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.c.ICCompositeTypeScope#getBinding(char[])
*/
@Override
public IBinding getBinding( char[] name ) {
return super.getBinding( NAMESPACE_TYPE_OTHER, name );
public IBinding getBinding(char[] name) {
return super.getBinding(NAMESPACE_TYPE_OTHER, name);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
@Override
public IBinding[] find( String name ) {
CollectNamesAction action = new CollectNamesAction( name.toCharArray() );
getPhysicalNode().accept( action );
public IBinding[] find(String name) {
CollectNamesAction action = new CollectNamesAction(name.toCharArray());
getPhysicalNode().accept(action);
IASTName [] names = action.getNames();
IBinding [] result = null;
IASTName[] names = action.getNames();
IBinding[] result = null;
for (IASTName astName : names) {
IBinding b = astName.resolveBinding();
if( b == null ) continue;
if (b == null) continue;
try {
if( b.getScope() == this )
result = ArrayUtil.append( IBinding.class, result, b );
} catch ( DOMException e ) {
if (b.getScope() == this)
result = ArrayUtil.append(IBinding.class, result, b);
} catch (DOMException e) {
}
}
return ArrayUtil.trim( IBinding.class, result );
return ArrayUtil.trim(IBinding.class, result);
}
@Override
@ -74,7 +68,7 @@ public class CCompositeTypeScope extends CScope implements ICCompositeTypeScope
if (binding instanceof ICompositeType)
return (ICompositeType) binding;
return new CStructure.CStructureProblem(compSpec.getName(), ISemanticProblem.BINDING_NO_CLASS, compSpec.getName().toCharArray() );
return new CStructure.CStructureProblem(compSpec.getName(), ISemanticProblem.BINDING_NO_CLASS, compSpec.getName().toCharArray());
}
@Override

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others.
* Copyright (c) 2004, 2014 IBM Corporation 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
@ -165,13 +165,16 @@ public class CPPASTTranslationUnit extends ASTTranslationUnit implements ICPPAST
super.skippedFile(offset, fileContent);
fScopeMapper.registerAdditionalDirectives(offset, fileContent.getUsingDirectives());
}
// bug 217102: namespace scopes from the index have to be mapped back to the AST.
public IScope mapToASTScope(IIndexScope scope) {
return fScopeMapper.mapToASTScope(scope);
// Namespace scopes from the index have to be mapped back to the AST (bug 217102).
public IScope mapToASTScope(IScope scope) {
if (scope instanceof IIndexScope) {
return fScopeMapper.mapToASTScope((IIndexScope) scope);
}
return scope;
}
// bug 262719: class types from the index have to be mapped back to the AST.
// Class types from the index have to be mapped back to the AST (bug 262719).
public ICPPClassType mapToAST(ICPPClassType binding, IASTNode point) {
return fScopeMapper.mapToAST(binding, point);
}

View file

@ -1,4 +1,4 @@
/*******************************************************************************
/*******************************************************************************
* Copyright (c) 2009, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@ -35,7 +35,8 @@ public class CPPClassTemplatePartialSpecializationSpecialization extends CPPClas
private final ICPPClassTemplate fClassTemplate;
private final ICPPTemplateArgument[] fArguments;
public CPPClassTemplatePartialSpecializationSpecialization(ICPPClassTemplatePartialSpecialization orig, ICPPTemplateParameterMap argumentMap, ICPPClassTemplate template,
public CPPClassTemplatePartialSpecializationSpecialization(ICPPClassTemplatePartialSpecialization orig,
ICPPTemplateParameterMap argumentMap, ICPPClassTemplate template,
ICPPTemplateArgument[] args) throws DOMException {
super(orig, template.getOwner(), argumentMap);
fClassTemplate= template;

View file

@ -41,10 +41,10 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknownScope;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownBinding;
/**
* Helper class for performing the base class lookup. First a directed graph without loops is computed
* to represent the base class hierarchy up to those bases for which the lookup finds matches. Next, from
* these leaves we search for virtual bases that are hidden. With this information the matches are extracted
* from the graph.
* Helper class for performing the base class lookup. First a directed graph without loops is
* computed to represent the base class hierarchy up to those bases for which the lookup finds
* matches. Next, from these leaves we search for virtual bases that are hidden. With this
* information the matches are extracted from the graph.
*/
class BaseClassLookup {
public static void lookupInBaseClasses(LookupData data, ICPPClassScope classScope) {
@ -55,7 +55,7 @@ class BaseClassLookup {
if (classType == null)
return;
final HashMap<IScope, BaseClassLookup> infoMap = new HashMap<IScope, BaseClassLookup>();
final HashMap<IScope, BaseClassLookup> infoMap = new HashMap<>();
BaseClassLookup rootInfo= lookupInBaseClass(data, null, false, classType, infoMap, 0);
if (data.contentAssist) {
rootInfo.collectResultForContentAssist(data);
@ -108,7 +108,7 @@ class BaseClassLookup {
return;
if (fChildren.isEmpty()) {
fChildren= new ArrayList<BaseClassLookup>();
fChildren= new ArrayList<>();
fVirtual= new BitSet();
}
fVirtual.set(fChildren.size(), virtual);
@ -156,7 +156,7 @@ class BaseClassLookup {
if (baseClassScope != null) {
BaseClassLookup info= infoMap.get(baseClassScope);
if (info != null) {
// avoid loops
// Avoid loops.
if (info.getResult() == null) {
data.problem = new ProblemBinding(null, IProblemBinding.SEMANTIC_CIRCULAR_INHERITANCE,
root.getNameCharArray());
@ -204,12 +204,12 @@ class BaseClassLookup {
}
}
} catch (DOMException e) {
// continue the lookup
// Continue the lookup.
}
}
// There is no result in the baseClass itself or we do content assist, we have to examine its
// base-classes
// There is no result in the baseClass itself or we do content assist, we have to examine
// its base classes.
ICPPClassType baseClass= result.getClassType();
if (baseClass != null) {
ICPPBase[] grandBases= ClassTypeHelper.getBases(baseClass, data.getLookupPoint());
@ -217,9 +217,9 @@ class BaseClassLookup {
HashSet<IBinding> grandBaseBindings= null;
BitSet selectedBases= null;
if (grandBases.length > 1) {
grandBaseBindings= new HashSet<IBinding>();
grandBaseBindings= new HashSet<>();
// if we have reachable bases, then ignore the others
// If we have reachable bases, then ignore the others.
selectedBases = selectPreferredBases(data, grandBases);
}
for (int i = 0; i < grandBases.length; i++) {
@ -229,7 +229,7 @@ class BaseClassLookup {
IBinding grandBaseBinding = grandBase.getBaseClass();
if (!(grandBaseBinding instanceof ICPPClassType)) {
// 14.6.2.3 scope is not examined
// 14.6.2.3 scope is not examined.
if (grandBaseBinding instanceof ICPPUnknownBinding) {
if (data.skippedScope == null)
data.skippedScope= root;
@ -247,7 +247,7 @@ class BaseClassLookup {
final IScope grandBaseScope= grandBaseClass.getCompositeScope();
if (grandBaseScope == null || grandBaseScope instanceof ICPPInternalUnknownScope) {
// 14.6.2.3 scope is not examined
// 14.6.2.3 scope is not examined.
if (data.skippedScope == null)
data.skippedScope= root;
continue;
@ -335,7 +335,7 @@ class BaseClassLookup {
}
baseInfo.propagateHiddenAsVirtual();
} else {
// mark to catch recursions
// Mark to catch recursions.
baseInfo= new BaseClassLookup(baseClass, fLookupPoint);
infoMap.put(baseScope, baseInfo);
baseInfo.hideVirtualBases(infoMap, depth);

View file

@ -152,7 +152,8 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
public IBinding[] getBindings(ScopeLookupData lookup) {
try {
if (lookup.getLookupName() instanceof ICPPASTConversionName) {
BindingCollector visitor = new BindingCollector(fBinding.getLinkage(), Keywords.cOPERATOR, CONVERSION_FILTER, true, false, true);
BindingCollector visitor = new BindingCollector(fBinding.getLinkage(),
Keywords.cOPERATOR, CONVERSION_FILTER, true, false, true);
acceptViaCache(fBinding, visitor, true);
return visitor.getBindings();
}
@ -171,10 +172,11 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
return getBindingsViaCache(fBinding, nameChars, IndexFilter.CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE);
}
// prefix lookup
BindingCollector visitor = new BindingCollector(fBinding.getLinkage(), nameChars, IndexFilter.CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE, true, true, !true);
// Prefix lookup.
BindingCollector visitor = new BindingCollector(fBinding.getLinkage(), nameChars,
IndexFilter.CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE, true, true, false);
if (ContentAssistMatcherFactory.getInstance().match(nameChars, fBinding.getNameCharArray())) {
// add the class itself, constructors will be found during the visit
// Add the class itself, constructors will be found during the visit.
visitor.visit((IPDOMNode) getClassNameBinding());
}
acceptViaCache(fBinding, visitor, true);

View file

@ -53,8 +53,8 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Bryan Wilkinson
*/
class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
ICPPClassSpecialization, IPDOMMemberOwner, IPDOMCPPClassType {
class PDOMCPPClassSpecialization extends PDOMCPPSpecialization
implements ICPPClassSpecialization, IPDOMMemberOwner, IPDOMCPPClassType {
private static final int FIRST_BASE = PDOMCPPSpecialization.RECORD_SIZE + 0;
private static final int MEMBERLIST = FIRST_BASE + 4;
private static final int FINAL = MEMBERLIST + PDOMCPPMemberBlock.RECORD_SIZE; // byte
@ -66,11 +66,11 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
protected static final int RECORD_SIZE = FINAL + 1;
private volatile ICPPClassScope fScope;
private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache
private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache.
private final ThreadLocal<Set<IBinding>> fInProgress= new ThreadLocal<Set<IBinding>>() {
@Override
protected Set<IBinding> initialValue() {
return new HashSet<IBinding>();
return new HashSet<>();
}
};
@ -257,7 +257,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
return bases;
try {
List<PDOMCPPBase> list = new ArrayList<PDOMCPPBase>();
List<PDOMCPPBase> list = new ArrayList<>();
for (PDOMCPPBase base = getFirstBase(); base != null; base = base.getNextBase()) {
list.add(base);
}

View file

@ -66,7 +66,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
setKind(classType);
setAnonymous(classType);
setFinal(classType);
// Linked list is initialized by storage being zero'd by malloc
// Linked list is initialized by storage being zero'd by malloc.
}
public PDOMCPPClassType(PDOMLinkage linkage, long bindingRecord) {
@ -304,7 +304,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
public ICPPBase[] getBases() {
Long key= record + PDOMCPPLinkage.CACHE_BASES;
ICPPBase[] bases= (ICPPBase[]) getPDOM().getCachedResult(key);
if (bases != null)
if (bases != null)
return bases;
try {

View file

@ -11,6 +11,32 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.rename;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener2;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.bindings.keys.IKeyLookup;
import org.eclipse.jface.bindings.keys.KeyLookupFactory;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.IViewportListener;
import org.eclipse.jface.text.IWidgetTokenKeeper;
import org.eclipse.jface.text.IWidgetTokenKeeperExtension;
import org.eclipse.jface.text.IWidgetTokenOwner;
import org.eclipse.jface.text.IWidgetTokenOwnerExtension;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.link.LinkedPosition;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.util.Geometry;
import org.eclipse.jface.util.Util;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
@ -45,36 +71,6 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tracker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener2;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.bindings.keys.IKeyLookup;
import org.eclipse.jface.bindings.keys.KeyLookupFactory;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.Geometry;
import org.eclipse.jface.util.Util;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.IViewportListener;
import org.eclipse.jface.text.IWidgetTokenKeeper;
import org.eclipse.jface.text.IWidgetTokenKeeperExtension;
import org.eclipse.jface.text.IWidgetTokenOwner;
import org.eclipse.jface.text.IWidgetTokenOwnerExtension;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.link.LinkedPosition;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
@ -348,10 +344,6 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
});
}
// fPopup.moveBelow(null); // make sure hovers are on top of the info popup
// XXX workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=170774
// fPopup.moveBelow(workbenchShell.getShells()[0]);
UIJob delayJob= new UIJob(display, RenameMessages.RenameInformationPopup_delayJobName) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* Andrew Ferguson (Symbian) - Initial implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text.doctools;
@ -29,7 +29,6 @@ import org.eclipse.cdt.ui.text.contentassist.ICompletionProposalComputer;
import org.eclipse.cdt.ui.text.doctools.IDocCommentOwner;
import org.eclipse.cdt.ui.text.doctools.IDocCommentViewerConfiguration;
abstract class AbstractDocCommentProposalComputer implements ICompletionProposalComputer {
protected abstract IDocCommentViewerConfiguration getConfiguration(IDocCommentOwner owner);
@ -58,15 +57,12 @@ abstract class AbstractDocCommentProposalComputer implements ICompletionProposal
@Override
public void sessionEnded() {
// XXX
}
@Override
public void sessionStarted() {
// XXX
}
private static IResource getResource() {
ITranslationUnit tu= getTranslationUnit();
return tu.getResource();

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.ui.wizards.dialogfields;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@ -144,6 +145,7 @@ public class DialogField {
/**
* Creates a spacer control.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent) {
@ -152,8 +154,8 @@ public class DialogField {
/**
* Creates a spacer control with the given span.
* The composite is assumed to have <code>MGridLayout</code> as
* layout.
* The composite is assumed to have {@link GridLayout} as layout.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent, int span) {

View file

@ -173,6 +173,7 @@ public class ControlFactory {
/**
* Creates a spacer control.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent) {
@ -181,8 +182,8 @@ public class ControlFactory {
/**
* Creates a spacer control with the given span.
* The composite is assumed to have <code>MGridLayout</code> as
* layout.
* The composite is assumed to have {@link GridLayout} as layout.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent, int span) {

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.mi.internal.ui.dialogfields;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@ -153,6 +154,7 @@ public class DialogField {
/**
* Creates a spacer control.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent) {
@ -161,8 +163,8 @@ public class DialogField {
/**
* Creates a spacer control with the given span.
* The composite is assumed to have <code>MGridLayout</code> as
* layout.
* The composite is assumed to have {@link GridLayout} as layout.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent, int span) {

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.internal.ui.dialogfields;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@ -153,6 +154,7 @@ public class DialogField {
/**
* Creates a spacer control.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent) {
@ -161,8 +163,8 @@ public class DialogField {
/**
* Creates a spacer control with the given span.
* The composite is assumed to have <code>MGridLayout</code> as
* layout.
* The composite is assumed to have {@link GridLayout} as layout.
*
* @param parent The parent composite
*/
public static Control createEmptySpace(Composite parent, int span) {