Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-11-08 22:36:18 +0000
committerStephan Herrmann2012-11-08 22:36:18 +0000
commit22f4f42fc8c020485d5d31b48c251c4d923bb483 (patch)
tree94fbe2d9a52c54efb39bcfb5565b2805c1439874 /testplugins
parentf8c960b0d4398db64f2538f555c30083738ab77c (diff)
downloadorg.eclipse.objectteams-22f4f42fc8c020485d5d31b48c251c4d923bb483.tar.gz
org.eclipse.objectteams-22f4f42fc8c020485d5d31b48c251c4d923bb483.tar.xz
org.eclipse.objectteams-22f4f42fc8c020485d5d31b48c251c4d923bb483.zip
Bug 393915 - [dom][refactoring] pull-up with "use the destination type
where possible" throws StackOverflowError - test (modified existing one) & fix - additional advance fix for bug 393932
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java12
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/in/T.java6
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/out/T.java6
3 files changed, 21 insertions, 3 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
index 799a28810..d40262170 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
@@ -122,6 +122,12 @@ public class PullUpTests extends RefactoringTest {
}
private void performPullUp_pass(String[] cuNames, String[] methodNames, String[][] signatures, boolean[] makeAbstract, String[] fieldNames,
boolean deleteAllInSourceType, boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType) throws Exception {
+ performPullUp_pass(cuNames, methodNames, signatures, makeAbstract, fieldNames, deleteAllInSourceType, deleteAllMatchingMethods, targetClassIndex, nameOfDeclaringType, false/*replace*/);
+ }
+ private void performPullUp_pass(String[] cuNames, String[] methodNames, String[][] signatures, boolean[] makeAbstract, String[] fieldNames,
+ boolean deleteAllInSourceType, boolean deleteAllMatchingMethods, int targetClassIndex, String nameOfDeclaringType, boolean replace)
+ throws Exception
+ {
ICompilationUnit[] cus = createCUs(cuNames);
try {
@@ -147,6 +153,9 @@ public class PullUpTests extends RefactoringTest {
if (!methodList.isEmpty())
processor.setDeletedMethods(methodList.toArray(new IMethod[methodList.size()]));
+ if (replace)
+ processor.setReplace(true);
+
RefactoringStatus checkInputResult = ref.checkFinalConditions(new NullProgressMonitor());
assertTrue("precondition was supposed to pass", !checkInputResult.hasError());
performChange(ref, false);
@@ -355,7 +364,8 @@ public class PullUpTests extends RefactoringTest {
new String[]{"foo", "getS1", "getS2"},
new String[][] { new String[0], new String[0], new String[0] },
new boolean[] {false, true, true},
- new String[0], true, true, 0, "RSub");
+ new String[0], true, true, 0, "RSub",
+ true /*replace*/);
}
// Bug 386814 - [refactoring] pull-up should distinguish callouts that can be pull-up vs. abstract decl.
public void testPullUpCallout1() throws Exception {
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/in/T.java
index b2af6c4fc..a890db28c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/in/T.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/in/T.java
@@ -5,9 +5,13 @@ public team class T {
protected class RSub extends RSuper playedBy B {
String getS1() -> get String s;
String getS2() -> String getS();
- void foo()
+ protected void foo()
{
System.out.println(getS1()+getS2());
}
}
+
+ void main(RSub r) {
+ r.foo();
+ }
} \ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/out/T.java
index 3779040ab..03282e163 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/out/T.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/PullUp/testPullUpWithReferenceToCallout2/out/T.java
@@ -5,7 +5,7 @@ public team class T {
protected abstract String getS1();
- void foo()
+ protected void foo()
{
System.out.println(getS1()+getS2());
}
@@ -17,4 +17,8 @@ public team class T {
@Override
protected String getS2() -> String getS();
}
+
+ void main(RSuper r) {
+ r.foo();
+ }
} \ No newline at end of file

Back to the top