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 b8c5bcf4d67..3f1718df93f 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 3e1f1aeebb2..e0034f70ce9 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 d0dcb436066..b0e86e557b0 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) {