Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-02-23 23:32:18 +0000
committerStephan Herrmann2012-02-23 23:32:18 +0000
commitc6dd181becd3f159023ab3daa44ede9d6be39755 (patch)
tree859bb201b91f408497e77ca59e2ee031bbe0d1c1 /testplugins
parent74ba1aaf17fd4359457f6b520c6b318aa8f5b66b (diff)
downloadorg.eclipse.objectteams-c6dd181becd3f159023ab3daa44ede9d6be39755.tar.gz
org.eclipse.objectteams-c6dd181becd3f159023ab3daa44ede9d6be39755.tar.xz
org.eclipse.objectteams-c6dd181becd3f159023ab3daa44ede9d6be39755.zip
Test & fix for Bug 372433 - [refactoring][dom] extract method in a
callin with tunneled base result throws NPE
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java9
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team1.java1
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team2.java2
3 files changed, 11 insertions, 1 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
index 2ff830de4..ccd3c672c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/src/org/eclipse/objectteams/otdt/ui/tests/dom/converter/BaseCallMessageSendTest.java
@@ -41,6 +41,7 @@ import org.eclipse.jdt.core.dom.ExpressionStatement;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.IfStatement;
import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.ReturnStatement;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
@@ -302,4 +303,12 @@ public class BaseCallMessageSendTest extends FileBasedDOMTest
expected, actual);
}
+ // see http://bugs.eclipse.org/372433 - [refactoring][dom] extract method in a callin with tunneled base result throws NPE
+ public void testReturnWithHiddenExpression1() {
+ MethodDeclaration method = _role.getMethods()[1];
+ ReturnStatement returnStatement = (ReturnStatement) method.getBody().statements().get(1);
+
+ assertNull("Return should not show hidden expression: "+returnStatement.getExpression(),
+ returnStatement.getExpression());
+ }
}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team1.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team1.java
index a96bdebc6..67e3c1182 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team1.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team1.java
@@ -14,6 +14,7 @@ public team class Team1
callin void roleMethod1()
{
base.roleMethod1();
+ return; // for testReturnWithHiddenExpression1()
}
callin int roleMethod2()
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team2.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team2.java
index 5af50f584..b765dd998 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team2.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.dom/workspace/DOM_AST/src/basecall/teampkg/Team2.java
@@ -2,7 +2,7 @@ package basecall.teampkg;
import basecall.basepkg.MyClass;
-public team class Team1
+public team class Team2
{
public class Role1<S,T> playedBy MissingBaseclass
{

Back to the top