mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Merge branch 'master' of ssh://pchuong@git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git into master_bug_353351
This commit is contained in:
commit
be303b5ca2
5 changed files with 8 additions and 293 deletions
|
@ -123,7 +123,7 @@ public class ChangeGenerator extends ASTVisitor {
|
|||
|
||||
public void generateChange(IASTNode rootNode, ASTVisitor pathProvider)
|
||||
throws ProblemRuntimeException {
|
||||
change = new CompositeChange(Messages.ChangeGenerator_compositeChange);
|
||||
change = new CompositeChange(ChangeGeneratorMessages.ChangeGenerator_compositeChange);
|
||||
classifyModifications();
|
||||
rootNode.accept(pathProvider);
|
||||
for (IFile currentFile : changes.keySet()) {
|
||||
|
@ -912,7 +912,7 @@ public class ChangeGenerator extends ASTVisitor {
|
|||
edit = new MultiTextEdit();
|
||||
changes.put(file, edit);
|
||||
}
|
||||
TextEditGroup editGroup = new TextEditGroup(Messages.ChangeGenerator_group);
|
||||
TextEditGroup editGroup = new TextEditGroup(ChangeGeneratorMessages.ChangeGenerator_group);
|
||||
for (List<ASTModification> modifications : getModifications(modifiedNode).values()) {
|
||||
for (ASTModification modification : modifications) {
|
||||
if (modification.getAssociatedEditGroup() != null) {
|
||||
|
|
|
@ -16,15 +16,15 @@ import org.eclipse.osgi.util.NLS;
|
|||
* External strings for the change generator.
|
||||
* @since 5.0
|
||||
*/
|
||||
public class Messages extends NLS {
|
||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.dom.rewrite.changegenerator.messages"; //$NON-NLS-1$
|
||||
public class ChangeGeneratorMessages extends NLS {
|
||||
public static String ChangeGenerator_compositeChange;
|
||||
public static String ChangeGenerator_group;
|
||||
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||
// Initialize resource bundle
|
||||
NLS.initializeMessages(ChangeGeneratorMessages.class.getName(), ChangeGeneratorMessages.class);
|
||||
}
|
||||
|
||||
private Messages() {
|
||||
private ChangeGeneratorMessages() {
|
||||
}
|
||||
}
|
|
@ -615,152 +615,6 @@ void Test::test() {
|
|||
bool b = invalid();
|
||||
}
|
||||
|
||||
//!Extract int constant
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
|
||||
//@.config
|
||||
filename=test.cpp
|
||||
methodname=size
|
||||
|
||||
//@test.h
|
||||
class Test {
|
||||
void test();
|
||||
};
|
||||
|
||||
|
||||
//=
|
||||
class Test {
|
||||
void test();
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
//@test.cpp
|
||||
#include "test.h"
|
||||
|
||||
void Test::test() {
|
||||
int i = /*$*/42/*$$*/;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "test.h"
|
||||
|
||||
int Test::size() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
void Test::test() {
|
||||
int i = size();
|
||||
}
|
||||
|
||||
//!Extract char constant
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
|
||||
//@.config
|
||||
filename=test.cpp
|
||||
methodname=newline
|
||||
|
||||
//@test.h
|
||||
class Test {
|
||||
void test();
|
||||
};
|
||||
|
||||
|
||||
//=
|
||||
class Test {
|
||||
void test();
|
||||
char newline();
|
||||
};
|
||||
|
||||
|
||||
//@test.cpp
|
||||
#include "test.h"
|
||||
|
||||
void Test::test() {
|
||||
char nl = /*$*/'\n'/*$$*/;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "test.h"
|
||||
|
||||
char Test::newline() {
|
||||
return '\n';
|
||||
}
|
||||
|
||||
void Test::test() {
|
||||
char nl = newline();
|
||||
}
|
||||
|
||||
//!Extract boolean true constant
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
|
||||
//@.config
|
||||
filename=test.cpp
|
||||
methodname=valid
|
||||
|
||||
//@test.h
|
||||
class Test {
|
||||
void test();
|
||||
};
|
||||
|
||||
|
||||
//=
|
||||
class Test {
|
||||
void test();
|
||||
bool valid();
|
||||
};
|
||||
|
||||
|
||||
//@test.cpp
|
||||
#include "test.h"
|
||||
|
||||
void Test::test() {
|
||||
bool b = /*$*/true/*$$*/;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "test.h"
|
||||
|
||||
bool Test::valid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Test::test() {
|
||||
bool b = valid();
|
||||
}
|
||||
|
||||
//!Extract boolean false constant
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
|
||||
//@.config
|
||||
filename=test.cpp
|
||||
methodname=invalid
|
||||
|
||||
//@test.h
|
||||
class Test {
|
||||
void test();
|
||||
};
|
||||
//=
|
||||
class Test {
|
||||
void test();
|
||||
bool invalid();
|
||||
};
|
||||
//@test.cpp
|
||||
#include "test.h"
|
||||
|
||||
void Test::test() {
|
||||
bool b = /*$*/false/*$$*/;
|
||||
}
|
||||
//=
|
||||
#include "test.h"
|
||||
|
||||
bool Test::invalid() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Test::test() {
|
||||
bool b = invalid();
|
||||
}
|
||||
//!Extract expression with typedef Bug 331985
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
//@.config
|
||||
|
@ -837,34 +691,3 @@ int main() {
|
|||
|
||||
return i;
|
||||
}
|
||||
//! Extract macro
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
|
||||
//@.config
|
||||
filename=test.cpp
|
||||
methodname=bar
|
||||
|
||||
//@test.cpp
|
||||
#define five 5
|
||||
#define ADD(a, b) a + b
|
||||
|
||||
int main() {
|
||||
int i = five; //comment3
|
||||
i = /*$*/ADD(i, five)/*$$*/;
|
||||
|
||||
return i;
|
||||
}
|
||||
//=
|
||||
#define five 5
|
||||
#define ADD(a, b) a + b
|
||||
|
||||
int bar(int& i) {
|
||||
return ADD(i, five);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int i = five; //comment3
|
||||
i = bar(i);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -2207,7 +2207,6 @@ test::string toXML() {
|
|||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "testString.h"
|
||||
|
||||
|
@ -2224,111 +2223,6 @@ test::string toXML() {
|
|||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//!Bug 248622: Extract function fails to extract several expressions; Selection at the end
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
//@.config
|
||||
filename=Test.cpp
|
||||
methodname=endTag
|
||||
//@testString.h
|
||||
|
||||
namespace test {
|
||||
|
||||
class string {
|
||||
public:
|
||||
friend string operator+(const string& lhs, const string& rhs) {
|
||||
return rhs;
|
||||
}
|
||||
|
||||
string operator+(const string& rhs) { return rhs; }
|
||||
string(char* cp) {}
|
||||
string() {};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//@Test.cpp
|
||||
#include "testString.h"
|
||||
|
||||
test::string toXML() {
|
||||
test::string name;
|
||||
name = "hello";
|
||||
return "<" + name + ">" + /*$*/"</" + name + ">"/*$$*/;
|
||||
}
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "testString.h"
|
||||
|
||||
const char endTag(test::string name) {
|
||||
return "</" + name + ">";
|
||||
}
|
||||
|
||||
test::string toXML() {
|
||||
test::string name;
|
||||
name = "hello";
|
||||
return "<" + name + ">" + endTag(name);
|
||||
}
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//!Bug 248622: Extract function fails to extract several expressions; Selection in the middle
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
//@.config
|
||||
filename=Test.cpp
|
||||
methodname=exp
|
||||
//@testString.h
|
||||
|
||||
namespace test {
|
||||
|
||||
class string {
|
||||
public:
|
||||
friend string operator+(const string& lhs, const string& rhs) {
|
||||
return rhs;
|
||||
}
|
||||
|
||||
string operator+(const string& rhs) { return rhs; }
|
||||
string(char* cp) {}
|
||||
string() {};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//@Test.cpp
|
||||
#include "testString.h"
|
||||
|
||||
test::string toXML() {
|
||||
test::string name;
|
||||
name = "hello";
|
||||
return "<" + name + /*$*/">" + "</"/*$$*/ + name + ">";
|
||||
}
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=
|
||||
#include "testString.h"
|
||||
|
||||
const char exp() {
|
||||
return ">" + "</";
|
||||
}
|
||||
|
||||
test::string toXML() {
|
||||
test::string name;
|
||||
name = "hello";
|
||||
return "<" + name + exp() + name + ">";
|
||||
}
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//!Bug#262000 refactoring "extract function" misinterprets artificial blocks
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
//@.config
|
||||
|
@ -2341,7 +2235,6 @@ int main(int argc, char** argv) {
|
|||
a++;
|
||||
}/*$$*/
|
||||
}
|
||||
|
||||
//=
|
||||
void exp() {
|
||||
int a = 0;
|
||||
|
@ -2353,7 +2246,6 @@ void exp() {
|
|||
int main(int argc, char** argv) {
|
||||
exp();
|
||||
}
|
||||
|
||||
//!Bug#264712 Refactor extract function deletes comments in header
|
||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||
//@.config
|
||||
|
|
Loading…
Add table
Reference in a new issue