1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

2004-09-10 Alain Magloire

Remove annoying warnings and prevent the PathEntryManger
	from firing on working Copies.

	* model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
This commit is contained in:
Alain Magloire 2004-09-10 15:48:15 +00:00
parent bae54f4e47
commit 3f14afc110
43 changed files with 1042 additions and 1037 deletions

View file

@ -1,3 +1,10 @@
2004-09-10 Alain Magloire
Remove annoying warnings and prevent the PathEntryManger
from firing on working Copies.
* model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
2004-09-07 Alain Magloire
Part of the uncoming work to supply formatting in CDT

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.filetype.ICFileType;
import org.eclipse.cdt.core.resources.IPathEntryStore;
import org.eclipse.cdt.internal.core.model.APathEntry;
import org.eclipse.cdt.internal.core.model.BatchOperation;
import org.eclipse.cdt.internal.core.model.CModel;
import org.eclipse.cdt.internal.core.model.CModelManager;
@ -368,7 +369,7 @@ public class CoreModel {
*
*/
public static IOutputEntry newOutputEntry(IPath outputPath) {
return newOutputEntry(outputPath, OutputEntry.NO_EXCLUSION_PATTERNS);
return newOutputEntry(outputPath, APathEntry.NO_EXCLUSION_PATTERNS);
}
/**
@ -410,7 +411,7 @@ public class CoreModel {
*
*/
public static ISourceEntry newSourceEntry(IPath sourcePath) {
return newSourceEntry(sourcePath, SourceEntry.NO_EXCLUSION_PATTERNS);
return newSourceEntry(sourcePath, APathEntry.NO_EXCLUSION_PATTERNS);
}
/**
@ -467,7 +468,7 @@ public class CoreModel {
* @return IIncludeEntry
*/
public static IIncludeEntry newIncludeEntry(IPath resourcePath, IPath basePath, IPath includePath, boolean isSystemInclude) {
return newIncludeEntry(resourcePath, basePath, includePath, isSystemInclude, IncludeEntry.NO_EXCLUSION_PATTERNS);
return newIncludeEntry(resourcePath, basePath, includePath, isSystemInclude, APathEntry.NO_EXCLUSION_PATTERNS);
}
/**
@ -540,7 +541,7 @@ public class CoreModel {
* @return
*/
public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue) {
return newMacroEntry(resourcePath, macroName, macroValue, MacroEntry.NO_EXCLUSION_PATTERNS);
return newMacroEntry(resourcePath, macroName, macroValue, APathEntry.NO_EXCLUSION_PATTERNS);
}
/**
@ -589,7 +590,7 @@ public class CoreModel {
* @return
*/
public static IMacroEntry newMacroRefEntry(IPath resourcePath, IPath baseRef, String macroName) {
return new MacroEntry(resourcePath, baseRef, macroName, null, MacroEntry.NO_EXCLUSION_PATTERNS, false);
return new MacroEntry(resourcePath, baseRef, macroName, null, APathEntry.NO_EXCLUSION_PATTERNS, false);
}
/**

View file

@ -23,7 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class ArchiveContainer extends Openable implements IArchiveContainer {
public ArchiveContainer (CProject cProject) {
super (cProject, null, CCorePlugin.getResourceString("CoreModel.ArchiveContainer.Archives"), CElement.C_VCONTAINER); //$NON-NLS-1$
super (cProject, null, CCorePlugin.getResourceString("CoreModel.ArchiveContainer.Archives"), ICElement.C_VCONTAINER); //$NON-NLS-1$
}
public IArchive[] getArchives() throws CModelException {

View file

@ -35,15 +35,14 @@ public class BatchOperation extends CModelOperation {
} catch (CoreException ce) {
if (ce instanceof CModelException) {
throw (CModelException)ce;
} else {
if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
Throwable e= ce.getStatus().getException();
if (e instanceof CModelException) {
throw (CModelException) e;
}
}
throw new CModelException(ce);
}
if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
Throwable e= ce.getStatus().getException();
if (e instanceof CModelException) {
throw (CModelException) e;
}
}
throw new CModelException(ce);
}
}

View file

@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class BinaryContainer extends Openable implements IBinaryContainer {
public BinaryContainer (CProject cProject) {
super (cProject, null, CCorePlugin.getResourceString("CoreModel.BinaryContainer.Binaries"), CElement.C_VCONTAINER); //$NON-NLS-1$
super (cProject, null, CCorePlugin.getResourceString("CoreModel.BinaryContainer.Binaries"), ICElement.C_VCONTAINER); //$NON-NLS-1$
}
public IBinary[] getBinaries() throws CModelException {

View file

@ -214,9 +214,8 @@ public class Buffer implements IBuffer {
public boolean isReadOnly() {
if (this.file == null) {
return (this.flags & F_IS_READ_ONLY) != 0;
} else {
return this.file.isReadOnly();
}
return this.file.isReadOnly();
}
/**

View file

@ -56,10 +56,9 @@ public class BufferManager implements IBufferFactory {
IBuffer buffer= (IBuffer) entry._fValue;
if (buffer.hasUnsavedChanges()) {
return false;
} else {
buffer.close();
return true;
}
buffer.close();
return true;
}
/**
* Returns a new instance of the reciever.

View file

@ -83,11 +83,10 @@ public class CContainerInfo extends OpenableInfo {
if (CoreModel.isValidTranslationUnitName(cproject.getProject(), filename) &&
root.isOnSourceEntry(member)) {
continue;
} else {
if (root.isOnSourceEntry(member)) {
if (CModelManager.getDefault().createBinaryFile((IFile)member) != null) {
continue;
}
}
if (root.isOnSourceEntry(member)) {
if (CModelManager.getDefault().createBinaryFile((IFile)member) != null) {
continue;
}
}
break;

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.core.model.IOpenable;
import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.model.ISourceRange;
import org.eclipse.cdt.core.model.ISourceReference;
import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@ -290,12 +291,12 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
public String toDebugString() {
return getElementName() + " " + getTypeString(getElementType()); //$NON-NLS-1$
return getElementName() + " " + getTypeString(); //$NON-NLS-1$
}
// util
public static String getTypeString(int type) {
switch (type) {
public String getTypeString() {
switch (getElementType()) {
case C_MODEL:
return "CMODEL"; //$NON-NLS-1$
case C_PROJECT:
@ -303,6 +304,9 @@ public abstract class CElement extends PlatformObject implements ICElement {
case C_CCONTAINER:
return "CCONTAINER"; //$NON-NLS-1$
case C_UNIT:
if (this instanceof IWorkingCopy) {
return "WORKING_UNIT"; //$NON-NLS-1$
}
return "TRANSLATION_UNIT"; //$NON-NLS-1$
case C_FUNCTION:
return "C_FUNCTION"; //$NON-NLS-1$

View file

@ -270,15 +270,15 @@ private void insertPositions(ICElement[] elements, boolean isNew) {
* none of the internal calls need to use the locally cached contents
* of the old translation unit.
*/
private boolean isIdentical(CElement e1, CElement e2) {
if (e1 == null ^ e2 == null)
return false;
if (e1 == null)
return true;
return e1.isIdentical(e2);
}
//private boolean isIdentical(CElement e1, CElement e2) {
// if (e1 == null ^ e2 == null)
// return false;
//
// if (e1 == null)
// return true;
//
// return e1.isIdentical(e2);
//}
/**
* Answers true if the elements position has not changed.
* Takes into account additions so that elements following
@ -296,9 +296,8 @@ private boolean isPositionedCorrectly(ICElement element) {
if (oldPrevious == null) {
return newPrevious == null;
} else {
return oldPrevious.equals(newPrevious);
}
return oldPrevious.equals(newPrevious);
}
private void putElementInfo(ICElement element, CElementInfo info) {
this.infos.put(element, info);

View file

@ -64,7 +64,7 @@ import org.eclipse.core.runtime.Platform;
public class CModelManager implements IResourceChangeListener, ICDescriptorListener, IResolverChangeListener {
public static boolean VERBOSE = false;
public static boolean VERBOSE = true;
/**
* Unique handle onto the CModel

View file

@ -336,16 +336,15 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
} catch (CoreException ce) {
if (ce instanceof CModelException) {
throw (CModelException)ce;
} else {
// translate the core exception to a c model exception
if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
Throwable e = ce.getStatus().getException();
if (e instanceof CModelException) {
throw (CModelException) e;
}
}
throw new CModelException(ce);
}
// translate the core exception to a c model exception
if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
Throwable e = ce.getStatus().getException();
if (e instanceof CModelException) {
throw (CModelException) e;
}
}
throw new CModelException(ce);
}
}
@ -379,9 +378,8 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
public ICModel getCModel() {
if (fElementsToProcess == null || fElementsToProcess.length == 0) {
return getParentElement().getCModel();
} else {
return fElementsToProcess[0].getCModel();
}
return fElementsToProcess[0].getCModel();
}
/**

View file

@ -62,9 +62,8 @@ public class CommitWorkingCopyOperation extends CModelOperation {
IWorkspace workspace = resource.getWorkspace();
if (resource.exists()) {
return workspace.getRuleFactory().modifyRule(resource);
} else {
return workspace.getRuleFactory().createRule(resource);
}
return workspace.getRuleFactory().createRule(resource);
}
/**

View file

@ -11,12 +11,13 @@
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.IContainerEntry;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.core.runtime.IPath;
public class ContainerEntry extends PathEntry implements IContainerEntry {
public ContainerEntry(IPath path, boolean isExported) {
super(IContainerEntry.CDT_CONTAINER, path, isExported);
super(IPathEntry.CDT_CONTAINER, path, isExported);
}
public boolean equals(Object obj) {

View file

@ -194,9 +194,9 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
if (projSegment != null && projSegment.equals(project.getName())) { // this
// project
return CoreModel.newSourceEntry(path, exclusionPatterns);
} else { // another project
return CoreModel.newProjectEntry(path, isExported);
}
// another project
return CoreModel.newProjectEntry(path, isExported);
}
case IPathEntry.CDT_OUTPUT :
return CoreModel.newOutputEntry(path, exclusionPatterns);

View file

@ -8,6 +8,7 @@ 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.ICModelStatusConstants;
/**
* This operation deletes a collection of resources and all of their children.
@ -44,6 +45,6 @@ public class DeleteResourceElementsOperation extends MultiOperation {
*/
protected void verify(ICElement element) throws CModelException {
if (element == null || !element.exists())
error(CModelStatus.ELEMENT_DOES_NOT_EXIST, element);
error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element);
}
}

View file

@ -47,17 +47,9 @@ public class ElementCache extends OverflowingLRUCache {
try {
if (element.hasUnsavedChanges()) {
return false;
} /*else {
// We must close an entire JarPackageFragmentRoot at once.
if (element instanceof JarPackageFragment) {
JarPackageFragment packageFragment= (JarPackageFragment) element;
JarPackageFragmentRoot root = (JarPackageFragmentRoot) packageFragment.getParent();
root.close();
}*/ else {
element.close();
}
return true;
// }
}
element.close();
return true;
} catch (CModelException npe) {
return false;
}

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.core.model.IEnumeration;
public class Enumeration extends SourceManipulation implements IEnumeration{
public Enumeration(ICElement parent, String name) {
super(parent, name, CElement.C_ENUMERATION);
super(parent, name, ICElement.C_ENUMERATION);
}
protected CElementInfo createElementInfo () {

View file

@ -18,7 +18,7 @@ public class Enumerator extends SourceManipulation implements IEnumerator{
String constantExpression = ""; //$NON-NLS-1$
public Enumerator(ICElement parent, String name) {
super(parent, name, CElement.C_ENUMERATOR);
super(parent, name, ICElement.C_ENUMERATOR);
}
protected CElementInfo createElementInfo () {

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class Field extends VariableDeclaration implements IField {
public Field(ICElement parent, String name) {
super(parent, name, CElement.C_FIELD);
super(parent, name, ICElement.C_FIELD);
}
public boolean isMutable() throws CModelException{

View file

@ -11,6 +11,6 @@ import org.eclipse.cdt.core.model.IFunction;
public class Function extends FunctionDeclaration implements IFunction {
public Function(ICElement parent, String name) {
super(parent, name, CElement.C_FUNCTION);
super(parent, name, ICElement.C_FUNCTION);
}
}

View file

@ -18,7 +18,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
protected String returnType;
public FunctionDeclaration(ICElement parent, String name) {
super(parent, name, CElement.C_FUNCTION_DECLARATION);
super(parent, name, ICElement.C_FUNCTION_DECLARATION);
fParameterTypes= fgEmptyList;
}
@ -28,10 +28,10 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
}
public String getReturnType(){
if (returnType != null)
if (returnType != null) {
return returnType;
else
return ""; //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
}
public void setReturnType(String type){

View file

@ -21,7 +21,7 @@ public class FunctionTemplate extends FunctionDeclaration implements ITemplate{
protected String[] templateParameterTypes;
public FunctionTemplate(ICElement parent, String name) {
super(parent, name, CElement.C_TEMPLATE_FUNCTION);
super(parent, name, ICElement.C_TEMPLATE_FUNCTION);
templateParameterTypes= fgEmptyList;
}

View file

@ -14,7 +14,7 @@ public class Include extends SourceManipulation implements IInclude {
private String fullPath;
public Include(ICElement parent, String name, boolean isStandard) {
super(parent, name, CElement.C_INCLUDE);
super(parent, name, ICElement.C_INCLUDE);
standard = isStandard;
}

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.IIncludeEntry;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@ -22,7 +23,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
public IncludeEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath includePath, boolean isSystemInclude,
IPath[] exclusionPatterns, boolean isExported) {
super(IIncludeEntry.CDT_INCLUDE, basePath, baseRef, resourcePath, exclusionPatterns, isExported);
super(IPathEntry.CDT_INCLUDE, basePath, baseRef, resourcePath, exclusionPatterns, isExported);
this.includePath = (includePath == null) ? Path.EMPTY : includePath;
this.isSystemInclude = isSystemInclude;
}

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.ILibraryEntry;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@ -35,7 +36,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
*/
public LibraryEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath libraryPath, IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath, IPath sourceAttachmentPrefixMapping, boolean isExported) {
super(ILibraryEntry.CDT_LIBRARY, basePath, baseRef, resourcePath, APathEntry.NO_EXCLUSION_PATTERNS, isExported);
super(IPathEntry.CDT_LIBRARY, basePath, baseRef, resourcePath, APathEntry.NO_EXCLUSION_PATTERNS, isExported);
this.libraryPath = (libraryPath == null) ? Path.EMPTY : libraryPath;
this.sourceAttachmentPath = sourceAttachmentPath;
this.sourceAttachmentRootPath = sourceAttachmentRootPath;
@ -144,9 +145,9 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
}
p = loc.append(lib);
return p;
} else {
p = lib;
}
p = lib;
if (!p.isAbsolute()) {
IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath);

View file

@ -11,7 +11,7 @@ import org.eclipse.cdt.core.model.IMacro;
public class Macro extends SourceManipulation implements IMacro {
public Macro(ICElement parent, String name) {
super(parent, name, CElement.C_MACRO);
super(parent, name, ICElement.C_MACRO);
}
public String getIdentifierList() {

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.IMacroEntry;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.core.runtime.IPath;
public class MacroEntry extends APathEntry implements IMacroEntry {
@ -19,7 +20,7 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
String macroValue;
public MacroEntry (IPath path, IPath baseRef, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) {
super(IMacroEntry.CDT_MACRO, null, baseRef, path, exclusionPatterns, isExported);
super(IPathEntry.CDT_MACRO, null, baseRef, path, exclusionPatterns, isExported);
if ( macroName == null) {
throw new IllegalArgumentException("Macro name cannot be null"); //$NON-NLS-1$
}

View file

@ -11,6 +11,6 @@ import org.eclipse.cdt.core.model.IMethod;
public class Method extends MethodDeclaration implements IMethod{
public Method(ICElement parent, String name){
super(parent, name, CElement.C_METHOD);
super(parent, name, ICElement.C_METHOD);
}
}

View file

@ -23,7 +23,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
boolean isDestructor = false;
public MethodDeclaration(ICElement parent, String name){
super(parent, name, CElement.C_METHOD_DECLARATION);
super(parent, name, ICElement.C_METHOD_DECLARATION);
}
public MethodDeclaration(ICElement parent, String name, int type){

View file

@ -21,7 +21,7 @@ public class MethodTemplate extends MethodDeclaration implements ITemplate{
protected String[] templateParameterTypes;
public MethodTemplate(ICElement parent, String name) {
super(parent, name, CElement.C_TEMPLATE_METHOD);
super(parent, name, ICElement.C_TEMPLATE_METHOD);
templateParameterTypes= fgEmptyList;
}

View file

@ -117,10 +117,10 @@ public abstract class MultiOperation extends CModelOperation {
* if there are no renamings specified.
*/
protected String getNewNameFor(ICElement element) {
if (fRenamings != null)
if (fRenamings != null) {
return (String) fRenamings.get(element);
else
return null;
}
return null;
}
/**

View file

@ -11,7 +11,6 @@ package org.eclipse.cdt.internal.core.model;
* Rational Software - Initial API and implementation
***********************************************************************/
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.INamespace;
@ -19,7 +18,7 @@ public class Namespace extends SourceManipulation implements INamespace{
String typeName = ""; //$NON-NLS-1$
public Namespace(ICElement parent, String name) {
super(parent, name, CElement.C_NAMESPACE);
super(parent, name, ICElement.C_NAMESPACE);
}
/*

View file

@ -41,6 +41,7 @@ import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.core.model.IPathEntryContainer;
import org.eclipse.cdt.core.model.IProjectEntry;
import org.eclipse.cdt.core.model.ISourceEntry;
import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.core.model.PathEntryContainerInitializer;
import org.eclipse.cdt.core.resources.IPathEntryStore;
import org.eclipse.cdt.core.resources.IPathEntryStoreListener;
@ -1209,13 +1210,19 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
return true;
}
// project change, traverse children.
} else if (kind == ICElementDelta.ADDED || kind == ICElementDelta.REMOVED) {
}
if (element instanceof IWorkingCopy) {
return false;
}
if (kind == ICElementDelta.ADDED || kind == ICElementDelta.REMOVED) {
return true; // add/remove we validate all paths
}
ICElementDelta[] affectedChildren = delta.getAffectedChildren();
for (int i = 0; i < affectedChildren.length; i++) {
if (processDelta(affectedChildren[i]) == true) {
return true;
if (type == ICElement.C_MODEL || type == ICElement.C_CCONTAINER || type == ICElement.C_PROJECT) {
ICElementDelta[] affectedChildren = delta.getAffectedChildren();
for (int i = 0; i < affectedChildren.length; i++) {
if (processDelta(affectedChildren[i]) == true) {
return true;
}
}
}
return false;

View file

@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.core.model.IProjectEntry;
import org.eclipse.core.runtime.IPath;
@ -17,7 +18,7 @@ import org.eclipse.core.runtime.IPath;
public class ProjectEntry extends PathEntry implements IProjectEntry {
public ProjectEntry(IPath path, boolean isExported) {
super(IProjectEntry.CDT_PROJECT, path, isExported);
super(IPathEntry.CDT_PROJECT, path, isExported);
}
public boolean equals(Object obj) {

View file

@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.core.model.ISourceEntry;
import org.eclipse.core.runtime.IPath;
@ -21,7 +22,7 @@ public class SourceEntry extends APathEntry implements ISourceEntry {
* @param exclusionPatterns
*/
public SourceEntry(IPath sourcePath, IPath[] exclusionPatterns) {
super(ISourceEntry.CDT_SOURCE, null, null, sourcePath, exclusionPatterns, false);
super(IPathEntry.CDT_SOURCE, null, null, sourcePath, exclusionPatterns, false);
}
public boolean equals (Object obj) {

View file

@ -18,7 +18,7 @@ public class TypeDef extends SourceManipulation implements ITypeDef{
String typeName= ""; //$NON-NLS-1$
public TypeDef(ICElement parent, String name) {
super(parent, name, CElement.C_TYPEDEF);
super(parent, name, ICElement.C_TYPEDEF);
}
/**
* Returns the typeName.

View file

@ -19,7 +19,7 @@ public class Using extends SourceManipulation implements IUsing {
boolean directive;
public Using(ICElement parent, String name, boolean isDirective) {
super(parent, name, CElement.C_USING);
super(parent, name, ICElement.C_USING);
directive = isDirective;
}

View file

@ -11,7 +11,7 @@ import org.eclipse.cdt.core.model.IVariable;
public class Variable extends VariableDeclaration implements IVariable {
public Variable(ICElement parent, String name) {
super(parent, name, CElement.C_VARIABLE);
super(parent, name, ICElement.C_VARIABLE);
}
public Variable(ICElement parent, String name, int kind) {

View file

@ -12,7 +12,7 @@ import org.eclipse.cdt.core.model.IVariableDeclaration;
public class VariableDeclaration extends SourceManipulation implements IVariableDeclaration {
public VariableDeclaration(ICElement parent, String name) {
super(parent, name, CElement.C_VARIABLE_DECLARATION);
super(parent, name, ICElement.C_VARIABLE_DECLARATION);
}
public VariableDeclaration(ICElement parent, String name, int type) {

View file

@ -19,7 +19,7 @@ public class VariableTemplate extends Variable implements ITemplate {
protected String[] templateParameterTypes;
public VariableTemplate(ICElement parent, String name) {
super(parent, name, CElement.C_TEMPLATE_VARIABLE);
super(parent, name, ICElement.C_TEMPLATE_VARIABLE);
templateParameterTypes= fgEmptyList;
}

View file

@ -399,9 +399,8 @@ public class LRUCache implements Cloneable {
entry._fSpace = newSpace;
this.fCurrentSpace = newTotal;
return value;
} else {
privateRemoveEntry (entry, false);
}
privateRemoveEntry (entry, false);
}
if (makeSpace(newSpace)) {
privateAdd (key, value, newSpace);
@ -443,9 +442,8 @@ public class LRUCache implements Cloneable {
if (value instanceof ILRUCacheable) {
return ((ILRUCacheable) value).getCacheFootprint();
} else {
return 1;
}
return 1;
}
/**
* Returns a String that represents the value of this object. This method

View file

@ -290,12 +290,11 @@ public abstract class OverflowingLRUCache extends LRUCache {
// thus entry will already be removed if reaching this point.
if (fEntryTable.get(entry._fKey) == null){
return;
} else {
// basic removal
fEntryTable.remove(entry._fKey);
fCurrentSpace -= entry._fSpace;
privateNotifyDeletionFromCache(entry);
}
// basic removal
fEntryTable.remove(entry._fKey);
fCurrentSpace -= entry._fSpace;
privateNotifyDeletionFromCache(entry);
}
}
LRUCacheEntry previous = entry._fPrevious;
@ -346,9 +345,8 @@ public abstract class OverflowingLRUCache extends LRUCache {
fCurrentSpace = newTotal;
fOverflow = 0;
return value;
} else {
privateRemoveEntry (entry, false, false);
}
privateRemoveEntry (entry, false, false);
}
// attempt to make new space