Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorEmanuel Graf2009-07-13 09:54:38 -0400
committerEmanuel Graf2009-07-13 09:54:38 -0400
commitb9d438c066d3fb07d1333874a584e5d85ba8e0f0 (patch)
treeb6f988dc33cbe34c6c5ff050c9a92396213e6b78 /core
parent89a5a98a46f09fa0fc288f7bbc666093c8eba466 (diff)
downloadorg.eclipse.cdt-b9d438c066d3fb07d1333874a584e5d85ba8e0f0.tar.gz
org.eclipse.cdt-b9d438c066d3fb07d1333874a584e5d85ba8e0f0.tar.xz
org.eclipse.cdt-b9d438c066d3fb07d1333874a584e5d85ba8e0f0.zip
FIXED - bug 282989: Refactor->Implement method option doesn't qualify the name in the method definition with a fully qualified container class name
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282989
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts34
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NamespaceHelper.java4
3 files changed, 37 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts
index b8c5bcf4d6..3f1718df93 100644
--- a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts
+++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts
@@ -713,3 +713,37 @@ void Test::doNothing(void)
+//! Bug 282989 Refactor->Implement method option doesn't qualify the name in the method definition with a fully qualified container class name
+//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
+//@.config
+filename=TestClass.h
+//@TestClass.h
+#ifndef TESTCLASS_H_
+#define TESTCLASS_H_
+
+namespace nspace{
+class TestClass {
+void /*$*/testMethod()/*$$*/;
+};
+}
+
+#endif /* TESTCLASS_H_ */
+
+//=
+#ifndef TESTCLASS_H_
+#define TESTCLASS_H_
+
+namespace nspace{
+class TestClass {
+void testMethod();
+};
+}
+
+inline void nspace::TestClass::testMethod()
+{
+}
+
+
+
+#endif /* TESTCLASS_H_ */
+
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java
index 3e1f1aeebb..e0034f70ce 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/NodeContainer.java
@@ -152,7 +152,7 @@ public class NodeContainer {
.getArrayModifiers();
for (IASTArrayModifier arrayModifier : arrayModifiers) {
((IASTArrayDeclarator) declarator)
- .addArrayModifier(arrayModifier);
+ .addArrayModifier(arrayModifier.copy());
}
} else {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NamespaceHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NamespaceHelper.java
index d0dcb43606..b0e86e557b 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NamespaceHelper.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NamespaceHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -74,7 +74,7 @@ public class NamespaceHelper {
private static boolean checkFileNameAndLocation(final IFile insertFile, final int offset, IASTNode namespace) {
return namespace.getFileLocation().getFileName().endsWith(insertFile.getFullPath().toOSString())
&& offset >= namespace.getNodeLocations()[0].getNodeOffset()
- && offset <= namespace.getNodeLocations()[0].getNodeOffset() + namespace.getNodeLocations()[0].getNodeLength();
+ && offset < namespace.getNodeLocations()[0].getNodeOffset() + namespace.getNodeLocations()[0].getNodeLength();
}
private static IASTName createNameWithTemplates(IASTNode declarationParent) {

Back to the top