diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMStringSetTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMStringSetTests.java index 9d3431b5c61..cb50bdd7c27 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMStringSetTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMStringSetTests.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.pdom.tests; import java.io.File; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTagIndexTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTagIndexTests.java index 47a00535717..c735691e987 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTagIndexTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTagIndexTests.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.pdom.tests; import java.io.File; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IBindingTagger.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IBindingTagger.java index 57df74e5e39..1829adb1465 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IBindingTagger.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IBindingTagger.java @@ -8,24 +8,24 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.core.dom.ast.tag; import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IBinding; /** - * Implementations are contributed with the org.eclipse.cdt.core.tagger extension-point. The implementation is - * responsible for populating the tag's data using a given input binding. + * Implementations are contributed with the org.eclipse.cdt.core.tagger extension-point. + * The implementation is responsible for populating the tag's data using a given input binding. * * @see #process(ITagWriter, IBinding, IASTName) * @since 5.5 */ public interface IBindingTagger { /** - * Examines the given input binding to decide if a tag should be created. Use the given tagWriter to - * create data if needed. Return the tag if one was created and null otherwise. A tagger (as identified by - * it's unique id string) is allowed to create only one tag for each binding. + * Examines the given input binding to decide if a tag should be created. Use the given + * tagWriter to create data if needed. Return the tag if one was created and null otherwise. + * A tagger (as identified by it's unique id string) is allowed to create only one tag for each + * binding. * * @param tagWriter * the writer to use for creating new tags diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITag.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITag.java index 027b4afd928..a51c712281a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITag.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITag.java @@ -8,13 +8,13 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.core.dom.ast.tag; /** - * Tags are used to annotate {@link ITagReader}'s with extra information. They are created by implementations - * of {@link IBindingTagger} which are contributed using the org.eclipse.cdt.core.tagger extension point. The - * base tag interface is read-only, it is extended by the writable {@link IWritableTag}. + * Tags are used to annotate {@link ITagReader}'s with extra information. They are created by + * implementations of {@link IBindingTagger} which are contributed using + * the org.eclipse.cdt.core.tagger extension point. The base tag interface is read-only, it is + * extended by the writable {@link IWritableTag}. * * @see IBindingTagger * @see ITagReader @@ -25,20 +25,21 @@ public interface ITag { /** A constant that is returned to indicate a read failure. */ public static final int FAIL = -1; - /** Return the number of bytes in the tag's data payload. */ + /** Returns the number of bytes in the tag's data payload. */ public int getDataLen(); - /** Return the globally unique id of the tagger that created the receiver. */ + /** Returns the globally unique id of the tagger that created the receiver. */ public String getTaggerId(); - /** Return the byte from the specified offset or {@link #FAIL} on failure. */ + /** Returns the byte from the specified offset or {@link #FAIL} on failure. */ public int getByte(int offset); /** - * Return the specified number of bytes from the specified offset. Specify len of -1 to read all bytes - * from the specified offset to the end of the payload. Return null if the given range is not valid. This - * would be expected if the version of the contributor has changed in a way that changes the structure of - * the data that it stores. Contributors must be able to deal with that case. + * Returns the specified number of bytes from the specified offset. Specify {@code len} of -1 + * to read all bytes from the specified offset to the end of the payload. Returns null if + * the given range is not valid. This would be expected if the version of the contributor has + * changed in a way that changes the structure of the data that it stores. Contributors must be + * able to deal with that case. */ public byte[] getBytes(int offset, int len); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagReader.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagReader.java index fd7ca0bae91..96d272b3966 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagReader.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagReader.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.core.dom.ast.tag; /** @@ -20,16 +19,17 @@ package org.eclipse.cdt.core.dom.ast.tag; */ public interface ITagReader { /** - * Look for a tag for the receiver, returns null if there is no such tag. + * Looks for a tag for the receiver, returns null if there is no such tag. * * @param id - * A string that uniquely identifies the tag to be returned. This value was provided by the - * contributor when the tag was created (see {@link ITagWriter#createTag(String, int)}). + * A string that uniquely identifies the tag to be returned. This value was provided + * by the contributor when the tag was created + * (see {@link ITagWriter#createTag(String, int)}). */ public ITag getTag(String id); /** - * Return all tags known to the receiver. Does not return null. + * Returns all tags known to the receiver. Does not return null. */ public Iterable getTags(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagService.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagService.java index 237fc4830ca..31a4ad384fc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagService.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagService.java @@ -8,14 +8,13 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.core.dom.ast.tag; import org.eclipse.cdt.core.dom.ast.IBinding; /** - * Provides ITagReaders for specific bindings. The kind of the reader will vary based on the kind of the input - * binding. + * Provides ITagReaders for specific bindings. The kind of the reader will vary based on the kind + * of the input binding. * * @see ITag * @see ITagReader @@ -23,8 +22,8 @@ import org.eclipse.cdt.core.dom.ast.IBinding; */ public interface ITagService { /** - * Finds or creates a tag reader for the specified binding or null if a reader cannot be associated with - * this binding. + * Finds or creates a tag reader for the specified binding or null if a reader cannot be + * associated with this binding. * * @param binding * could be null diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagWriter.java index f77deac8ff4..50c39180436 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagWriter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/ITagWriter.java @@ -20,20 +20,20 @@ package org.eclipse.cdt.core.dom.ast.tag; */ public interface ITagWriter { /** - * Create and return a new tag for the receiver. E.g., if this writer is associated with a persistent - * binding, then returned tag will read and write from the PDOM database. + * Creates and returns a new tag for the receiver. E.g., if this writer is associated with + * a persistent binding, then returned tag will read and write from the PDOM database. * * @param id - * A string that uniquely identifies the tag to be returned. This value will be used by the - * contributor when to find the tag (see {@link ITagReader#getTag(String)}). + * A string that uniquely identifies the tag to be returned. This value will be used + * by the contributor when to find the tag (see {@link ITagReader#getTag(String)}). * @param len * The number of bytes that should be allocated to store the tag's data. */ public IWritableTag createTag(String id, int len); /** - * Sets the receiver's tags to only the ones provided. Deletes existing tags that are not in the argument - * list. + * Sets the receiver's tags to only the ones provided. Deletes existing tags that are not in + * the argument list. */ public boolean setTags(Iterable tags); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IWritableTag.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IWritableTag.java index adf1d8b169d..cf790cd2190 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IWritableTag.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/tag/IWritableTag.java @@ -8,12 +8,12 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.core.dom.ast.tag; /** - * Tags are used to annotate {@link ITagWriter}'s with extra information. They are created by implementations - * of {@link IBindingTagger} which are contributed using the org.eclipse.cdt.core.tagger extension point. + * Tags are used to annotate {@link ITagWriter}'s with extra information. They are created by + * implementations of {@link IBindingTagger} which are contributed using + * the org.eclipse.cdt.core.tagger extension point. * * @see IBindingTagger * @see ITagReader @@ -21,13 +21,13 @@ package org.eclipse.cdt.core.dom.ast.tag; * @since 5.5 */ public interface IWritableTag extends ITag { - /** Write the given byte to the given offset in the tag. Return true if successful and false otherwise. */ + /** Writes the given byte to the given offset in the tag. Returns {@code true} if successful. */ public boolean putByte(int offset, byte data); /** - * Write the argument buffer into the receiver's payload starting at the specified offset. Write the - * specified number of bytes or the full buffer when len is -1. Return true if successful and false - * otherwise. + * Writes the argument buffer into the receiver's payload starting at the specified offset. + * Writes the specified number of bytes or the full buffer when {@code len} is -1. Returns + * {@code true} if successful. */ public boolean putBytes(int offset, byte data[], int len); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/NonCachedTaggable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/NonCachedTaggable.java index 8683da41bd5..7d0a812b86e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/NonCachedTaggable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/NonCachedTaggable.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.dom.ast.tag; import org.eclipse.cdt.core.dom.ast.IASTDeclarator; @@ -47,7 +46,7 @@ public class NonCachedTaggable implements ITagReader, ITagWriter { @Override public boolean setTags(Iterable tags) { - // this non-caching implementation has nothing to set, the tags will be regenerated + // This non-caching implementation has nothing to set, the tags will be regenerated // when they are queried return true; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/Tag.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/Tag.java index 7b9430de292..99c18d217a7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/Tag.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/Tag.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.dom.ast.tag; import org.eclipse.cdt.core.dom.ast.tag.ITag; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java index 57c29d8f523..8579ed9db37 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagManager.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.dom.ast.tag; import java.util.HashMap; @@ -29,6 +28,7 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; public class TagManager { + private static final String EXTENSION_POINT = "tagger"; //$NON-NLS-1$ private static TagManager INSTANCE; private Map taggers; @@ -43,14 +43,12 @@ public class TagManager { taggers = loadExtensions(); } - private static final String ExtensionPoint = "tagger"; //$NON-NLS-1$ - private static Map loadExtensions() { Map taggers = new HashMap(); - // load the extensions + // Load the extensions IConfigurationElement[] elements = Platform.getExtensionRegistry() - .getConfigurationElementsFor(CCorePlugin.PLUGIN_ID, ExtensionPoint); + .getConfigurationElementsFor(CCorePlugin.PLUGIN_ID, EXTENSION_POINT); for (IConfigurationElement element : elements) { TaggerDescriptor desc = new TaggerDescriptor(element); taggers.put(desc.getId(), desc); @@ -60,8 +58,8 @@ public class TagManager { } /** - * Provide an opportunity for the specified tagger to process the given values. The tagger will only run - * if its enablement expression returns true for the arguments. + * Provides an opportunity for the specified tagger to process the given values. The tagger will + * only run if its enablement expression returns true for the arguments. */ public ITag process(String taggerId, ITagWriter tagWriter, IBinding binding, IASTName ast) { TaggerDescriptor desc = taggers.get(taggerId); @@ -72,7 +70,7 @@ public class TagManager { return tagger == null ? null : tagger.process(tagWriter, binding, ast); } - /** Provide an opportunity for all enabled taggers to process the given values. */ + /** Provides an opportunity for all enabled taggers to process the given values. */ public Iterable process(ITagWriter tagWriter, IBinding binding, IASTName ast) { List tags = new LinkedList(); for (TaggerDescriptor desc : taggers.values()) { @@ -87,7 +85,7 @@ public class TagManager { return tags; } - /** Add or remove tags from the destination to ensure that it has the same tag information as the source. */ + /** Adds or removes tags from the destination to ensure that it has the same tag information as the source. */ public void syncTags(IPDOMBinding dst, IBinding src) { // don't try to copy any tags when there are no contributors to this extension point if (dst == null || taggers.isEmpty()) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagService.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagService.java index ca22dc92ab2..c09acbac421 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagService.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TagService.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.dom.ast.tag; import org.eclipse.cdt.core.dom.ast.IBinding; @@ -17,16 +16,17 @@ import org.eclipse.cdt.core.dom.ast.tag.ITagService; public class TagService implements ITagService { /** - * First gives the IBinding instance a chance to convert itself, by calling IAdaptable#getAdapter( - * ITagReader.class ) on the binding. If the binding doesn't provide an implementation then a simple, - * in-memory, non-cached implementation is created and returned. + * First gives the IBinding instance a chance to convert itself, by calling + * IAdaptable#getAdapter(ITagReader.class) on the binding. If the binding doesn't provide + * an implementation then a simple, in-memory, non-cached implementation is created and + * returned. */ @Override public ITagReader findTagReader(IBinding binding) { if (binding == null) return null; - // let the binding adapt to its own tag reader + // Let the binding adapt to its own tag reader ITagReader tagReader = (ITagReader) binding.getAdapter(ITagReader.class); if (tagReader != null) return tagReader; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TaggerDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TaggerDescriptor.java index f408e887801..a18cb7ac155 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TaggerDescriptor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/ast/tag/TaggerDescriptor.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.dom.ast.tag; import java.util.Arrays; @@ -33,9 +32,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; /** - * Internal container for extensions of org.eclipse.cdt.core.tagger. The implementation of the tagger is - * instantiated only after checking the enablement expression (if present) for the specified binding. This - * avoids activating the contributing plugin until it is actually needed. + * Internal container for extensions of org.eclipse.cdt.core.tagger. The implementation of + * the tagger is instantiated only after checking the enablement expression (if present) for + * the specified binding. This avoids activating the contributing plugin until it is actually + * needed. */ public class TaggerDescriptor { private static final String Attr_LocalId = "local-id"; //$NON-NLS-1$ @@ -52,10 +52,10 @@ public class TaggerDescriptor { private static final String VAR_LANGUAGEID = "languageId"; //$NON-NLS-1$ /** - * An empty implementation of the tagger used as a placeholder in descriptors that are unable to load the - * contributed class. + * An empty implementation of the tagger used as a placeholder in descriptors that are unable + * to load the contributed class. */ - private static final IBindingTagger NullTagger = new IBindingTagger() { + private static final IBindingTagger NULL_TAGGER = new IBindingTagger() { @Override public ITag process(ITagWriter tagWriter, IBinding binding, IASTName ast) { return null; @@ -97,8 +97,8 @@ public class TaggerDescriptor { // there must be a valid local id if (localId == null) { String extId = element.getDeclaringExtension().getSimpleIdentifier(); - CCorePlugin - .log("Invalid extension " + globalId + '.' + extId + " must provide tagger's local-id"); //$NON-NLS-1$ //$NON-NLS-2$ + CCorePlugin.log("Invalid extension " + globalId + '.' + extId //$NON-NLS-1$ + + " must provide tagger's local-id"); //$NON-NLS-1$ return null; } @@ -109,8 +109,8 @@ public class TaggerDescriptor { // make sure the local id has real content if (localId.isEmpty()) { String extId = element.getDeclaringExtension().getSimpleIdentifier(); - CCorePlugin - .log("Invalid extension " + globalId + '.' + extId + " must provide value for tagger's local-id"); //$NON-NLS-1$ //$NON-NLS-2$ + CCorePlugin.log("Invalid extension " + globalId + '.' + extId //$NON-NLS-1$ + + " must provide value for tagger's local-id"); //$NON-NLS-1$ return null; } @@ -121,12 +121,12 @@ public class TaggerDescriptor { } private boolean matches(ITranslationUnit tu) { - // if the enablement expression is missing or structurally invalid, then return immediately + // If the enablement expression is missing or structurally invalid, then return immediately if (fStatus != null) return fStatus.booleanValue(); - // if there is no tu, then the enablement expression cannot be evaluated, assume that all taggers - // are needed + // If there is no tu, then the enablement expression cannot be evaluated, assume that all + // taggers are needed if (tu == null) return true; @@ -171,7 +171,7 @@ public class TaggerDescriptor { CCorePlugin.log("Error in class attribute of " + id, e); //$NON-NLS-1$ // mark the tagger with an empty implementation to prevent future load attempts - tagger = NullTagger; + tagger = NULL_TAGGER; } } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java index 403516e53a8..1a3adf30e78 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java @@ -344,7 +344,7 @@ public class CPPVisitor extends ASTQueries { if (inScope == null) return false; - IBinding pb= names[names.length-2].resolvePreBinding(); + IBinding pb= names[names.length - 2].resolvePreBinding(); if (pb instanceof IProblemBinding) return false; @@ -930,11 +930,11 @@ public class CPPVisitor extends ASTQueries { if (name instanceof ICPPASTQualifiedName) { IASTName[] names = ((ICPPASTQualifiedName) name).getNames(); if (names.length >= 2) { - IBinding b= names[names.length-2].resolvePreBinding(); + IBinding b= names[names.length - 2].resolvePreBinding(); if (b instanceof IType) { IType classType= getNestedType((IType) b, TDEF); if (classType instanceof ICPPClassType) { - final char[] dtorName = names[names.length-1].getLookupKey(); + final char[] dtorName = names[names.length - 1].getLookupKey(); final char[] className = ((ICPPClassType) classType).getNameCharArray(); return CharArrayUtils.equals(dtorName, className); } @@ -1303,7 +1303,7 @@ public class CPPVisitor extends ASTQueries { IASTName name = findInnermostDeclarator(fnDeclarator).getName(); if (name instanceof ICPPASTQualifiedName) { IASTName[] ns = ((ICPPASTQualifiedName) name).getNames(); - name = ns[ns.length -1]; + name = ns[ns.length - 1]; } return getContainingScope(name); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java index 29c316206de..e579274828d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java @@ -1006,9 +1006,9 @@ public abstract class AbstractIndexerTask extends PDOMWriter { IASTTranslationUnit ast= createAST(lang, codeReader, scanInfo, isSource, fASTOptions, ctx, pm); fStatistics.fParsingTime += System.currentTimeMillis() - start; if (ast != null) { - // Give the new AST-TU a chance to recognize its translation unit before it is written + // Give the new AST a chance to recognize its translation unit before it is written // to the index. - ((ASTTranslationUnit)ast).setOriginatingTranslationUnit((ITranslationUnit)tu); + ((ASTTranslationUnit) ast).setOriginatingTranslationUnit((ITranslationUnit) tu); writeToIndex(lang.getLinkageID(), ast, codeReader, ctx, pm); } } catch (CoreException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java index 1ff1729dd34..bbe90bf06f2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java @@ -69,13 +69,14 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding if (adapter.isAssignableFrom(PDOMBinding.class)) return this; - // Any PDOMBinding can have a persistent tag. These tags should be deleted when the PDOMBinding - // is deleted. However, PDOMBinding's don't get deleted, so there is no way to trigger deleting - // of the tags. If the implementation is changed so that PDOMBindings do get deleted, then call: - // PDOMTagIndex.setTags( getPDOM(), pdomBinding.record, Collections.emptyList() ); + // Any PDOMBinding can have a persistent tag. These tags should be deleted when + // the PDOMBinding is deleted. However, PDOMBinding's don't get deleted, so there is no way + // to trigger deleting of the tags. If the implementation is changed so that PDOMBindings + // do get deleted, then it should call: + // PDOMTagIndex.setTags(getPDOM(), pdomBinding.record, Collections.emptyList()); // to clear out all tags for the binding. if (adapter.isAssignableFrom(ITagReader.class)) - return new PDOMTaggable( getPDOM(), getRecord() ); + return new PDOMTaggable(getPDOM(), getRecord()); return null; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java index 1105005b8fa..c5fbc320bb5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java @@ -99,9 +99,9 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { getPDOM().putCachedResult(inputBinding, pdomBinding); } - // Synchronize the tags associated with the persistent binding to match the set that is - // associated with the input binding. - TagManager.getInstance().syncTags( pdomBinding, inputBinding ); + // Synchronize the tags associated with the persistent binding to match the set that + // is associated with the input binding. + TagManager.getInstance().syncTags(pdomBinding, inputBinding); return pdomBinding; } @@ -114,9 +114,10 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants { pdomBinding.update(this, fromBinding); - // Update the tags based on the tags from the new binding. This was in PDOMBinding.update, but - // I found that not all subclasses (e.g., PDOMCPPFunction) call the parent implementation. - TagManager.getInstance().syncTags( pdomBinding, fromBinding ); + // Update the tags based on the tags from the new binding. This cannot be done in + // PDOMBinding.update, because not all subclasses (e.g., PDOMCPPFunction) call + // the superclass implementation. + TagManager.getInstance().syncTags(pdomBinding, fromBinding); } return pdomBinding; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java index a9a3b1d1ed9..0f1c7b116a1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java @@ -362,9 +362,9 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { addImplicitMethods(pdomBinding, (ICPPClassType) binding, fromName); } - // Synchronize the tags associated with the persistent binding to match the set that is - // associated with the input binding. - TagManager.getInstance().syncTags( pdomBinding, inputBinding ); + // Synchronize the tags associated with the persistent binding to match + // the set that is associated with the input binding. + TagManager.getInstance().syncTags(pdomBinding, inputBinding); } } catch (DOMException e) { throw new CoreException(Util.createStatus(e)); @@ -378,8 +378,9 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants { pdomBinding.update(this, fromBinding); - // Update the tags based on the tags from the new binding. This was in PDOMBinding.update, but - // I found that not all subclasses (e.g., PDOMCPPFunction) call the parent implementation. + // Update the tags based on the tags from the new binding. This cannot be done in + // PDOMBinding.update, because not all subclasses (e.g., PDOMCPPFunction) call + // the superclass implementation. TagManager.getInstance().syncTags(pdomBinding, fromBinding); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/BTreeIterable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/BTreeIterable.java index 53740f13331..c5774014f73 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/BTreeIterable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/tag/BTreeIterable.java @@ -8,7 +8,6 @@ * Contributors: * Andrew Eidsness - Initial implementation */ - package org.eclipse.cdt.internal.core.pdom.tag; import java.util.Collections; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java index b5fc7a7384f..8db644358f2 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java @@ -208,7 +208,7 @@ public class CCorePlugin extends Plugin { /** * @noreference This field is not intended to be referenced by clients. */ - public CDTLogWriter cdtLog = null; + public CDTLogWriter cdtLog; private volatile CProjectDescriptionManager fNewCProjectDescriptionManager;