mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics.
This commit is contained in:
parent
383f0d289c
commit
10f7e547a1
17 changed files with 90 additions and 106 deletions
|
@ -10,7 +10,6 @@
|
|||
* Markus Schorn (Wind River Systems)
|
||||
* Anton Leherbauer (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.model;
|
||||
|
||||
import java.net.URI;
|
||||
|
@ -41,7 +40,6 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.core.runtime.PlatformObject;
|
||||
|
||||
public abstract class CElement extends PlatformObject implements ICElement {
|
||||
|
||||
public static final char CEM_ESCAPE = '\\';
|
||||
public static final char CEM_CPROJECT = '=';
|
||||
public static final char CEM_SOURCEROOT = '/';
|
||||
|
@ -51,11 +49,10 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
public static final char CEM_PARAMETER = '(';
|
||||
public static final char CEM_ELEMENTTYPE = '#';
|
||||
|
||||
protected static final CElement[] NO_ELEMENTS = new CElement[0];
|
||||
protected static final CElement[] NO_ELEMENTS = {};
|
||||
|
||||
protected int fType;
|
||||
|
||||
protected ICElement fParent;
|
||||
|
||||
protected String fName;
|
||||
|
||||
protected CElement(ICElement parent, String name, int type) {
|
||||
|
@ -80,7 +77,6 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
return super.getAdapter(adapter);
|
||||
}
|
||||
|
||||
|
||||
// setters
|
||||
|
||||
public void setElementType (int type) {
|
||||
|
@ -123,14 +119,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
@Override
|
||||
public URI getLocationURI() {
|
||||
IResource res = getUnderlyingResource();
|
||||
|
||||
if(res != null) {
|
||||
return res.getLocationURI();
|
||||
}
|
||||
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
return res == null ? null : res.getLocationURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,8 +127,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
try {
|
||||
return getElementInfo() != null;
|
||||
} catch (CModelException e) {
|
||||
// Do not log it, it will fil the .log alarming the user.
|
||||
//CCorePlugin.log(e);
|
||||
// Do not log it, otherwise it would fill the .log alarming the user.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +141,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
*/
|
||||
protected ICElement getSourceElementAtOffset(int offset) throws CModelException {
|
||||
if (this instanceof ISourceReference && this instanceof Parent) {
|
||||
ICElement[] children = ((Parent)this).getChildren();
|
||||
ICElement[] children = ((Parent) this).getChildren();
|
||||
for (ICElement aChild : children) {
|
||||
if (aChild instanceof ISourceReference) {
|
||||
ISourceReference child = (ISourceReference) aChild;
|
||||
|
@ -162,9 +150,9 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
int endPos = startPos + range.getLength();
|
||||
if (offset < endPos && offset >= startPos) {
|
||||
if (child instanceof Parent) {
|
||||
return ((Parent)child).getSourceElementAtOffset(offset);
|
||||
return ((Parent) child).getSourceElementAtOffset(offset);
|
||||
}
|
||||
return (ICElement)child;
|
||||
return (ICElement) child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +173,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
protected ICElement[] getSourceElementsAtOffset(int offset) throws CModelException {
|
||||
if (this instanceof ISourceReference && this instanceof Parent) {
|
||||
ArrayList<Object> list = new ArrayList<Object>();
|
||||
ICElement[] children = ((Parent)this).getChildren();
|
||||
ICElement[] children = ((Parent) this).getChildren();
|
||||
for (ICElement aChild : children) {
|
||||
if (aChild instanceof ISourceReference) {
|
||||
ISourceReference child = (ISourceReference) aChild;
|
||||
|
@ -194,7 +182,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
int endPos = startPos + range.getLength();
|
||||
if (offset < endPos && offset >= startPos) {
|
||||
if (child instanceof Parent) {
|
||||
ICElement[] elements = ((Parent)child).getSourceElementsAtOffset(offset);
|
||||
ICElement[] elements = ((Parent) child).getSourceElementsAtOffset(offset);
|
||||
list.addAll(Arrays.asList(elements));
|
||||
}
|
||||
list.add(child);
|
||||
|
@ -238,7 +226,8 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
public ICProject getCProject() {
|
||||
ICElement current = this;
|
||||
do {
|
||||
if (current instanceof ICProject) return (ICProject) current;
|
||||
if (current instanceof ICProject)
|
||||
return (ICProject) current;
|
||||
} while ((current = current.getParent()) != null);
|
||||
return null;
|
||||
}
|
||||
|
@ -285,7 +274,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
}
|
||||
String lhsName= lhs.getElementName();
|
||||
String rhsName= rhs.getElementName();
|
||||
if( lhsName == null || rhsName == null || lhsName.length() != rhsName.length() ||
|
||||
if (lhsName == null || rhsName == null || lhsName.length() != rhsName.length() ||
|
||||
!lhsName.equals(rhsName)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -311,7 +300,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
|
||||
public CElementInfo getElementInfo (IProgressMonitor monitor) throws CModelException {
|
||||
CModelManager manager = CModelManager.getDefault();
|
||||
CElementInfo info = (CElementInfo)manager.getInfo(this);
|
||||
CElementInfo info = (CElementInfo) manager.getInfo(this);
|
||||
if (info != null) {
|
||||
return info;
|
||||
}
|
||||
|
@ -326,7 +315,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
}
|
||||
|
||||
public String toDebugString() {
|
||||
return getElementName() + " " + getTypeString(); //$NON-NLS-1$
|
||||
return getElementName() + " " + getTypeString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// util
|
||||
|
@ -367,11 +356,11 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
case C_FIELD:
|
||||
return "C_FIELD"; //$NON-NLS-1$
|
||||
case C_METHOD:
|
||||
return "C_METHOD"; //$NON-NLS-1$
|
||||
return "C_METHOD"; //$NON-NLS-1$
|
||||
case C_NAMESPACE:
|
||||
return "C_NAMESPACE"; //$NON-NLS-1$
|
||||
return "C_NAMESPACE"; //$NON-NLS-1$
|
||||
case C_USING:
|
||||
return "C_USING"; //$NON-NLS-1$
|
||||
return "C_USING"; //$NON-NLS-1$
|
||||
case C_VCONTAINER:
|
||||
return "C_CONTAINER"; //$NON-NLS-1$
|
||||
case C_BINARY:
|
||||
|
@ -411,7 +400,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
*/
|
||||
public IOpenable getOpenableParent() {
|
||||
if (fParent instanceof IOpenable) {
|
||||
return (IOpenable)fParent;
|
||||
return (IOpenable) fParent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -426,7 +415,8 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
* if successful, or false if an error is encountered while determining
|
||||
* the structure of this element.
|
||||
*/
|
||||
protected abstract void generateInfos(CElementInfo info, Map<ICElement, CElementInfo> newElements, IProgressMonitor monitor) throws CModelException;
|
||||
protected abstract void generateInfos(CElementInfo info, Map<ICElement, CElementInfo> newElements,
|
||||
IProgressMonitor monitor) throws CModelException;
|
||||
|
||||
/**
|
||||
* Open a <code>IOpenable</code> that is known to be closed (no check for
|
||||
|
@ -441,13 +431,14 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
if (info == null) {
|
||||
info = newElements.get(this);
|
||||
}
|
||||
if (info == null) { // a source ref element could not be opened
|
||||
// close any buffer that was opened for the openable parent
|
||||
if (info == null) {
|
||||
// A source ref element could not be opened.
|
||||
// Close any buffer that was opened for the openable parent.
|
||||
Iterator<ICElement> iterator = newElements.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ICElement element = iterator.next();
|
||||
if (element instanceof Openable) {
|
||||
((Openable)element).closeBuffer();
|
||||
((Openable) element).closeBuffer();
|
||||
}
|
||||
}
|
||||
throw newNotPresentException();
|
||||
|
@ -455,7 +446,6 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
if (!hadTemporaryCache) {
|
||||
manager.putInfos(this, newElements);
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (!hadTemporaryCache) {
|
||||
manager.resetTemporaryCache();
|
||||
|
@ -463,7 +453,6 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see ICElement
|
||||
*/
|
||||
|
@ -519,17 +508,14 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
return Util.combineHashCodes(elem.getElementName().hashCode(), parent.hashCode());
|
||||
}
|
||||
|
||||
/*
|
||||
* Test to see if two objects are identical
|
||||
/**
|
||||
* Checks if two objects are identical
|
||||
* Subclasses should override accordingly
|
||||
*/
|
||||
public boolean isIdentical(CElement otherElement){
|
||||
return this.equals(otherElement);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICElement#accept(org.eclipse.cdt.core.model.ICElementVisitor)
|
||||
*/
|
||||
@Override
|
||||
public void accept(ICElementVisitor visitor) throws CoreException {
|
||||
// Visit me, return right away if the visitor doesn't want to visit my children
|
||||
|
@ -538,15 +524,13 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
|
||||
// If I am a Parent, visit my children
|
||||
if (this instanceof IParent) {
|
||||
ICElement [] children = ((IParent)this).getChildren();
|
||||
for (int i = 0; i < children.length; ++i)
|
||||
ICElement [] children = ((IParent) this).getChildren();
|
||||
for (int i = 0; i < children.length; ++i) {
|
||||
children[i].accept(visitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.cdt.core.model.ICElement#getHandleIdentifier()
|
||||
*/
|
||||
@Override
|
||||
public String getHandleIdentifier() {
|
||||
return getHandleMemento();
|
||||
|
@ -569,7 +553,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
* @param buff the buffer building the memento string
|
||||
*/
|
||||
public void getHandleMemento(StringBuilder buff) {
|
||||
((CElement)getParent()).getHandleMemento(buff);
|
||||
((CElement) getParent()).getHandleMemento(buff);
|
||||
buff.append(getHandleMementoDelimiter());
|
||||
escapeMementoName(buff, getElementName());
|
||||
}
|
||||
|
|
|
@ -82,8 +82,7 @@ public interface IIndex {
|
|||
* index.acquireReadLock();
|
||||
* try {
|
||||
* ....
|
||||
* }
|
||||
* finally {
|
||||
* } finally {
|
||||
* index.releaseReadLock();
|
||||
* }
|
||||
* </pre>
|
||||
|
@ -113,8 +112,7 @@ public interface IIndex {
|
|||
* try {
|
||||
* timestamp= index.getLastWriteAccess();
|
||||
* binding= index.findBinding(...);
|
||||
* }
|
||||
* finally {
|
||||
* } finally {
|
||||
* index.releaseReadLock();
|
||||
* }
|
||||
* ...
|
||||
|
@ -126,8 +124,7 @@ public interface IIndex {
|
|||
* }
|
||||
* String name= binding.getName();
|
||||
* ...
|
||||
* }
|
||||
* finally {
|
||||
* } finally {
|
||||
* index.releaseReadLock();
|
||||
* }
|
||||
*/
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.index;
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
return null;
|
||||
|
||||
if (binding instanceof ICPPSpecialization) {
|
||||
IBinding specialized = ((ICPPSpecialization)binding).getSpecializedBinding();
|
||||
IBinding specialized = ((ICPPSpecialization) binding).getSpecializedBinding();
|
||||
PDOMBinding pdomSpecialized= addBinding(specialized, null);
|
||||
if (pdomSpecialized == null)
|
||||
return null;
|
||||
|
@ -371,11 +371,11 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
}
|
||||
} else if (binding instanceof ICPPConstructor) {
|
||||
if (parent instanceof PDOMCPPClassType || parent instanceof PDOMCPPClassSpecialization) {
|
||||
pdomBinding = new PDOMCPPConstructor(this, parent, (ICPPConstructor)binding);
|
||||
pdomBinding = new PDOMCPPConstructor(this, parent, (ICPPConstructor) binding);
|
||||
}
|
||||
} else if (binding instanceof ICPPMethod) {
|
||||
if (parent instanceof PDOMCPPClassType || parent instanceof PDOMCPPClassSpecialization) {
|
||||
pdomBinding = new PDOMCPPMethod(this, parent, (ICPPMethod)binding);
|
||||
pdomBinding = new PDOMCPPMethod(this, parent, (ICPPMethod) binding);
|
||||
}
|
||||
} else if (binding instanceof ICPPFunction) {
|
||||
pdomBinding = new PDOMCPPFunction(this, parent, (ICPPFunction) binding, true);
|
||||
|
@ -397,7 +397,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
}
|
||||
}
|
||||
} else if (binding instanceof ITypedef) {
|
||||
pdomBinding = new PDOMCPPTypedef(this, parent, (ITypedef)binding);
|
||||
pdomBinding = new PDOMCPPTypedef(this, parent, (ITypedef) binding);
|
||||
}
|
||||
|
||||
if (pdomBinding != null) {
|
||||
|
@ -611,7 +611,8 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
return adaptBinding(null, inputBinding, includeLocal ? FILE_LOCAL_REC_DUMMY : null);
|
||||
}
|
||||
|
||||
private final PDOMBinding adaptBinding(final PDOMNode parent, IBinding inputBinding, long[] fileLocalRecHolder) throws CoreException {
|
||||
private final PDOMBinding adaptBinding(final PDOMNode parent, IBinding inputBinding, long[] fileLocalRecHolder)
|
||||
throws CoreException {
|
||||
if (cannotAdapt(inputBinding)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -639,7 +640,8 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
final Long key = record + CACHE_BASES;
|
||||
PDOMCPPNamespace[] result= (PDOMCPPNamespace[]) getPDOM().getCachedResult(key);
|
||||
if (result == null) {
|
||||
List<PDOMCPPNamespace> nslist = PDOMCPPNamespace.collectInlineNamespaces(getDB(), getLinkage(), record+FIRST_NAMESPACE_CHILD_OFFSET);
|
||||
List<PDOMCPPNamespace> nslist = PDOMCPPNamespace.collectInlineNamespaces(getDB(),
|
||||
getLinkage(), record + FIRST_NAMESPACE_CHILD_OFFSET);
|
||||
if (nslist == null) {
|
||||
result= new PDOMCPPNamespace[0];
|
||||
} else {
|
||||
|
@ -651,9 +653,10 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
}
|
||||
|
||||
/**
|
||||
* Find the equivalent binding, or binding place holder within this PDOM
|
||||
* Finds the equivalent binding, or binding placeholder within this PDOM.
|
||||
*/
|
||||
private final PDOMBinding doAdaptBinding(PDOMNode parent, IBinding binding, long[] fileLocalRecHolder) throws CoreException {
|
||||
private final PDOMBinding doAdaptBinding(PDOMNode parent, IBinding binding, long[] fileLocalRecHolder)
|
||||
throws CoreException {
|
||||
if (parent == null) {
|
||||
parent= adaptOrAddParent(false, binding);
|
||||
}
|
||||
|
@ -935,9 +938,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage#getUsingDirectives()
|
||||
*/
|
||||
@Override
|
||||
public ICPPUsingDirective[] getUsingDirectives(PDOMFile file) throws CoreException {
|
||||
long rec= file.getLastUsingDirectiveRec();
|
||||
|
@ -1025,7 +1025,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
|
|||
public PDOMBinding addTypeBinding(IBinding type) throws CoreException {
|
||||
return addBinding(type, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IType unmarshalType(ITypeMarshalBuffer buffer) throws CoreException {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Sergey Prigogin (Google) - initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Sergey Prigogin (Google) - initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||
|
||||
|
@ -33,7 +33,6 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @see ICPPUsingDeclaration
|
||||
*/
|
||||
class PDOMCPPUsingDeclaration extends PDOMCPPBinding implements ICPPUsingDeclaration {
|
||||
|
||||
private static final int TARGET_BINDING = PDOMCPPBinding.RECORD_SIZE + 0;
|
||||
// Using declarations for functions may have multiple delegates. We model such case
|
||||
// by creating a chain of PDOMCPPUsingDeclaration objects linked by NEXT_DELEGATE field.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||
|
||||
|
@ -67,7 +67,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem
|
|||
@Override
|
||||
public IBinding[] getDelegates() {
|
||||
if (delegates == null) {
|
||||
PDOMNodeLinkedList list= new PDOMNodeLinkedList(getLinkage(), record+TARGET_BINDINGS);
|
||||
PDOMNodeLinkedList list= new PDOMNodeLinkedList(getLinkage(), record+ TARGET_BINDINGS);
|
||||
final List<IBinding> result= new ArrayList<IBinding>();
|
||||
try {
|
||||
list.accept(new IPDOMVisitor() {
|
||||
|
@ -78,6 +78,7 @@ class PDOMCPPUsingDeclarationSpecialization extends PDOMCPPSpecialization implem
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leave(IPDOMNode node) {
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class RefactoringTests extends BaseTestFramework {
|
|||
super.setUp();
|
||||
CCorePlugin.getIndexManager().setIndexerId(cproject, IPDOMManager.ID_FAST_INDEXER);
|
||||
fBufferSize= FileCharSequenceProvider.BUFFER_SIZE;
|
||||
FileCharSequenceProvider.BUFFER_SIZE= 1024*4;
|
||||
FileCharSequenceProvider.BUFFER_SIZE= 1024 * 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,7 +65,7 @@ public class RefactoringTests extends BaseTestFramework {
|
|||
|
||||
protected void assertTotalChanges(int numChanges, int potChanges, int commentCh,
|
||||
Change changes) throws Exception {
|
||||
int count[]= {0,0,0};
|
||||
int count[]= { 0, 0, 0 };
|
||||
if (changes != null) {
|
||||
countChanges(changes, count);
|
||||
}
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
|
@ -21,12 +21,14 @@ import org.eclipse.ltk.core.refactoring.RefactoringStatus;
|
|||
|
||||
public class RenameFunctionTests extends RenameTests {
|
||||
|
||||
public RenameFunctionTests(String name) {
|
||||
public RenameFunctionTests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite(){
|
||||
return suite(true);
|
||||
}
|
||||
|
||||
public static Test suite( boolean cleanup ) {
|
||||
TestSuite suite = new TestSuite(RenameFunctionTests.class);
|
||||
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
|
@ -24,9 +24,11 @@ public class RenameMacroTests extends RenameTests {
|
|||
public RenameMacroTests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite(){
|
||||
return suite(true);
|
||||
}
|
||||
|
||||
public static Test suite( boolean cleanup ) {
|
||||
TestSuite suite = new TestSuite(RenameMacroTests.class);
|
||||
if (cleanup) {
|
||||
|
@ -34,8 +36,7 @@ public class RenameMacroTests extends RenameTests {
|
|||
}
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void testMacroRename() throws Exception {
|
||||
StringWriter writer = new StringWriter();
|
||||
writer.write("#define HALLO x \n"); //$NON-NLS-1$
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
@ -28,9 +27,11 @@ public class RenameTemplatesTests extends RenameTests {
|
|||
public RenameTemplatesTests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite(){
|
||||
return suite(true);
|
||||
}
|
||||
|
||||
public static Test suite( boolean cleanup ) {
|
||||
TestSuite suite = new TestSuite(RenameTemplatesTests.class);
|
||||
if (cleanup) {
|
||||
|
@ -39,7 +40,6 @@ public class RenameTemplatesTests extends RenameTests {
|
|||
return suite;
|
||||
}
|
||||
|
||||
|
||||
public void testClassTemplate() throws Exception {
|
||||
StringWriter writer = new StringWriter();
|
||||
writer.write("template <class Type> \n"); //$NON-NLS-1$
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
|
@ -31,7 +31,6 @@ import org.eclipse.cdt.internal.ui.refactoring.rename.TextSearchWrapper;
|
|||
* @author markus.schorn@windriver.com
|
||||
*/
|
||||
public class RenameTests extends RefactoringTests {
|
||||
|
||||
private static final IProgressMonitor NPM = new NullProgressMonitor();
|
||||
|
||||
public RenameTests(String name) {
|
||||
|
@ -58,7 +57,7 @@ public class RenameTests extends RefactoringTests {
|
|||
return change;
|
||||
}
|
||||
|
||||
fail ("Input check on "+ newName + " failed. "+rs.getEntryMatchingSeverity(RefactoringStatus.ERROR) ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
fail ("Input check on " + newName + " failed. "+rs.getEntryMatchingSeverity(RefactoringStatus.ERROR) ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
//rs.getFirstMessage(RefactoringStatus.ERROR) is not the message displayed in
|
||||
//the UI for renaming a method to a constructor, the first message which is only
|
||||
//a warning is shown in the UI. If you click preview, then the error and the warning
|
||||
|
@ -153,8 +152,7 @@ public class RenameTests extends RefactoringTests {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected IFile importFile(String fileName, String contents)
|
||||
throws Exception {
|
||||
protected IFile importFile(String fileName, String contents) throws Exception {
|
||||
IFile result= super.importFile(fileName, contents);
|
||||
waitForIndexer();
|
||||
return result;
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
@ -38,8 +37,7 @@ public class RenameTypeTests extends RenameTests {
|
|||
}
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void testClassNameConflicts() throws Exception {
|
||||
createCppFwdDecls("cpp_fwd.hh"); //$NON-NLS-1$
|
||||
createCppDefs("cpp_def.hh"); //$NON-NLS-1$
|
||||
|
|
|
@ -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.ui.tests.refactoring.rename;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
@ -28,9 +27,11 @@ public class RenameVariableTests extends RenameTests {
|
|||
public RenameVariableTests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite(){
|
||||
return suite(true);
|
||||
}
|
||||
|
||||
public static Test suite( boolean cleanup ) {
|
||||
TestSuite suite = new TestSuite(RenameVariableTests.class);
|
||||
|
||||
|
|
|
@ -6,20 +6,24 @@
|
|||
* 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.ui.tests.refactoring.rename;
|
||||
|
||||
import org.eclipse.core.runtime.*;
|
||||
import org.eclipse.ltk.core.refactoring.*;
|
||||
import org.eclipse.ltk.core.refactoring.participants.*;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
import org.eclipse.ltk.core.refactoring.Change;
|
||||
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
|
||||
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
|
||||
import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
|
||||
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
|
||||
|
||||
public class TestRenameParticipant extends RenameParticipant {
|
||||
private static Object sElement= null;
|
||||
private static RenameArguments sArguments= null;
|
||||
private static int sConditionCheck= 0;
|
||||
private static int sCreateChange= 0;
|
||||
private static Object sElement;
|
||||
private static RenameArguments sArguments;
|
||||
private static int sConditionCheck;
|
||||
private static int sCreateChange;
|
||||
|
||||
public static int getConditionCheckCount() {
|
||||
return sConditionCheck;
|
||||
|
@ -40,7 +44,8 @@ public class TestRenameParticipant extends RenameParticipant {
|
|||
public static void reset() {
|
||||
sElement= null;
|
||||
sArguments= null;
|
||||
sConditionCheck= sCreateChange= 0;
|
||||
sConditionCheck= 0;
|
||||
sCreateChange= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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.refactoring.rename;
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class CRefactoringMatch {
|
|||
return fFile;
|
||||
}
|
||||
public void setASTInformation(int val) {
|
||||
switch(fAstInformation) {
|
||||
switch (fAstInformation) {
|
||||
case AST_REFERENCE:
|
||||
case AST_REFERENCE_OTHER:
|
||||
case AST_REFEREENCE_CONFLICTING:
|
||||
|
|
|
@ -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.refactoring.rename;
|
||||
|
||||
|
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* Processor adding constructor and destructor to the bindings to be renamed.
|
||||
*/
|
||||
|
|
|
@ -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.refactoring.rename;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue