Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Stornelli2019-06-11 11:45:20 -0400
committerJonah Graham2019-06-11 15:15:29 -0400
commit0b9b9890ee1bce79eed3a8b4d876e18ddff9be65 (patch)
tree444658511be9d8f9b53ce80f2cdaee5e8aa733c1
parentf3e8387a8e9bfa580181938b9e2a314499d2dd83 (diff)
downloadorg.eclipse.cdt-0b9b9890ee1bce79eed3a8b4d876e18ddff9be65.tar.gz
org.eclipse.cdt-0b9b9890ee1bce79eed3a8b4d876e18ddff9be65.tar.xz
org.eclipse.cdt-0b9b9890ee1bce79eed3a8b4d876e18ddff9be65.zip
Bug 548138 - Fix override method with implementation
Change-Id: Icbea4fe97e8f3b481ea187f905661c8adcc7cc06 Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
-rwxr-xr-xcore/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/overridemethods/OverrideMethodsRefactoringTest.java32
-rw-r--r--core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/overridemethods/Method.java3
3 files changed, 33 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/overridemethods/OverrideMethodsRefactoringTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/overridemethods/OverrideMethodsRefactoringTest.java
index 7002675e29..9147c8b2a5 100755
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/overridemethods/OverrideMethodsRefactoringTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/overridemethods/OverrideMethodsRefactoringTest.java
@@ -640,4 +640,36 @@ public class OverrideMethodsRefactoringTest extends RefactoringTestBase {
selectedMethods = new String[] { "baseFunc(void *)const" };
assertRefactoringSuccess();
}
+
+ //A.h
+ //class Base {
+ //public:
+ // virtual ~Base();
+ // virtual void baseFunc() const {
+ // }
+ //};
+ //class X: public Base {
+ //public:
+ // X();
+ // /*$*//*$$*/
+ //};
+ //====================
+ //class Base {
+ //public:
+ // virtual ~Base();
+ // virtual void baseFunc() const {
+ // }
+ //};
+ //class X: public Base {
+ //public:
+ // X();
+ // virtual void baseFunc() const;
+ //};
+ //
+ //inline void X::baseFunc() const {
+ //}
+ public void testWithHeaderOnlyImpl_Bug548138() throws Exception {
+ selectedMethods = new String[] { "baseFunc()const" };
+ assertRefactoringSuccess();
+ }
}
diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
index 7b3fb4f05b..819d5ad39e 100644
--- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
+++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
-Bundle-Version: 6.5.0.qualifier
+Bundle-Version: 6.5.100.qualifier
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/overridemethods/Method.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/overridemethods/Method.java
index 7da8987a12..9a92f39f46 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/overridemethods/Method.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/overridemethods/Method.java
@@ -137,9 +137,6 @@ public class Method {
return null;
IASTDeclarator declarator = (IASTDeclarator) declaration.getParent();
- IASTNode parent = declarator.getParent();
- if (!(parent instanceof IASTSimpleDeclaration))
- return null;
/**
* We can't just copy the original nodes here but we need to create a new node. We can't do it

Back to the top