mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug Fixing
This commit is contained in:
parent
695c51bc99
commit
a42bdd4da8
2 changed files with 32 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-06-08 Hoda Amer
|
||||||
|
Fixes for bugs 62780, 62783, 62784
|
||||||
|
* refactor/org/eclipse/cdt/internal/corext/refactoring/rename/RenameElementProcessor.java
|
||||||
|
|
||||||
2004-06-08 Alain Magloire
|
2004-06-08 Alain Magloire
|
||||||
|
|
||||||
Fix for bug 65173
|
Fix for bug 65173
|
||||||
|
|
|
@ -587,14 +587,40 @@ public class RenameElementProcessor extends RenameProcessor implements IReferenc
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean eligibleForRefactoring(ICElement element){
|
private boolean isConstructorOrDestructor(IFunctionDeclaration function) throws CModelException{
|
||||||
|
// check declarations
|
||||||
|
if(function instanceof IMethodDeclaration){
|
||||||
|
IMethodDeclaration method = (IMethodDeclaration)function;
|
||||||
|
if((method.isConstructor()) || (method.isDestructor()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// check definitions
|
||||||
|
String returnType = function.getReturnType();
|
||||||
|
if(( returnType == null) || (returnType.length() == 0) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if(getCurrentElementName().startsWith("~"))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean eligibleForRefactoring(ICElement element) throws CModelException{
|
||||||
if((element == null)
|
if((element == null)
|
||||||
|| (!(element instanceof ISourceReference))
|
|| (!(element instanceof ISourceReference))
|
||||||
|| (element instanceof ITranslationUnit)
|
|| (element instanceof ITranslationUnit)
|
||||||
|| (element instanceof IMacro)
|
|| (element instanceof IMacro)
|
||||||
|| (element instanceof IInclude)){
|
|| (element instanceof IInclude)){
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else // disabling renaming of constructors and destructors
|
||||||
|
if(element instanceof IFunctionDeclaration){
|
||||||
|
IFunctionDeclaration function = (IFunctionDeclaration)element;
|
||||||
|
if (isConstructorOrDestructor(function))
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue