diff options
author | Stephan Herrmann | 2013-05-18 19:38:48 +0000 |
---|---|---|
committer | Stephan Herrmann | 2013-05-18 19:38:48 +0000 |
commit | 93d91e4d1b9ee8701fffa4333251f1274c55ad22 (patch) | |
tree | cca0fe5708d7ff8dc66ff105d28ae83d814ead48 /org.eclipse.jdt.core/dom/org/eclipse/jdt | |
parent | eb41d584fce7b05c5fc594015358e7f8286bc10b (diff) | |
download | org.eclipse.objectteams-93d91e4d1b9ee8701fffa4333251f1274c55ad22.tar.gz org.eclipse.objectteams-93d91e4d1b9ee8701fffa4333251f1274c55ad22.tar.xz org.eclipse.objectteams-93d91e4d1b9ee8701fffa4333251f1274c55ad22.zip |
Bug 374822 - [refactoring] change method signature in a callin method
should adjust base-calls accordingly
- support searching for base and tsuper message sends
- adapt org.eclipse.jdt.internal.corext.refactoring.code.Invocations
- avoid bad interaction in the InlineCallin refactoring
Diffstat (limited to 'org.eclipse.jdt.core/dom/org/eclipse/jdt')
5 files changed, 56 insertions, 7 deletions
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java index 884cbdaa7..000b73eb5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java @@ -38,7 +38,7 @@ import java.util.List; * @author mkr * @version $Id: BaseCallMessageSend.java 23416 2010-02-03 19:59:31Z stephan $ */ -public class BaseCallMessageSend extends Expression +public class BaseCallMessageSend extends Expression implements Invocation { /** * The "name" structural property of this node type. @@ -116,6 +116,10 @@ public class BaseCallMessageSend extends Expression super(ast); } + public ChildListPropertyDescriptor getArgumentsProperty() { + return ARGUMENTS_PROPERTY; + } + final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java index 0a7b15a4f..b4030c41f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java @@ -45,7 +45,7 @@ import java.util.List; * @author mkr * @version $Id: BaseConstructorInvocation.java 23416 2010-02-03 19:59:31Z stephan $ */ -public class BaseConstructorInvocation extends Statement +public class BaseConstructorInvocation extends Statement implements Invocation { /** * The "arguments" structural property of this node type. @@ -113,6 +113,10 @@ public class BaseConstructorInvocation extends Statement return this.arguments; } + public ChildListPropertyDescriptor getArgumentsProperty() { + return ARGUMENTS_PROPERTY; + } + final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); @@ -180,5 +184,7 @@ public class BaseConstructorInvocation extends Statement return this.ast.getBindingResolver().resolveConstructor(this); } - + public IMethodBinding resolveMethodBinding() { + return resolveConstructorBinding(); + } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Invocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Invocation.java new file mode 100644 index 000000000..51a86d38c --- /dev/null +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Invocation.java @@ -0,0 +1,29 @@ +/********************************************************************** + * This file is part of "Object Teams Development Tooling"-Software + * + * Copyright 2013 GK Software AG, Germany, + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Please visit http://www.eclipse.org/objectteams for updates and contact. + * + * Contributors: + * Stephan Herrmann - Initial API and implementation + **********************************************************************/ +package org.eclipse.jdt.core.dom; + +import java.util.List; + +/** + * Simplify access to all implementing classes (OT-specific method invocations). + * Cf. <code>org.eclipse.jdt.internal.corext.refactoring.code.Invocations</code> + * and <code>org.eclipse.objectteams.otdt.internal.refactoring.adaptor.CorextAdaptor.Invocations</code>. + */ +public interface Invocation { + List getArguments(); + ChildListPropertyDescriptor getArgumentsProperty(); + IMethodBinding resolveMethodBinding(); +} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java index bee92ef24..3bc688342 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java @@ -39,7 +39,7 @@ import java.util.List; * * @author mkr */ -public class TSuperConstructorInvocation extends Statement +public class TSuperConstructorInvocation extends Statement implements Invocation { /** * The "arguments" structural property of this node type. @@ -100,8 +100,12 @@ public class TSuperConstructorInvocation extends Statement { super(ast); } + + public ChildListPropertyDescriptor getArgumentsProperty() { + return ARGUMENTS_PROPERTY; + } - /** + /** * Returns the live ordered list of argument expressions in this * base constructor invocation expression. * @@ -182,4 +186,7 @@ public class TSuperConstructorInvocation extends Statement return this.ast.getBindingResolver().resolveConstructor(this); } + public IMethodBinding resolveMethodBinding() { + return resolveConstructorBinding(); + } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java index 2df191daa..8c17d0765 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java @@ -40,7 +40,7 @@ import java.util.List; * * @author mkr */ -public class TSuperMessageSend extends Expression +public class TSuperMessageSend extends Expression implements Invocation { /** * The "name" structural property of this node type. @@ -133,6 +133,10 @@ public class TSuperMessageSend extends Expression super(ast); } + public ChildListPropertyDescriptor getArgumentsProperty() { + return ARGUMENTS_PROPERTY; + } + @SuppressWarnings("rawtypes") final List internalStructuralPropertiesForType(int apiLevel) { @@ -331,5 +335,4 @@ public class TSuperMessageSend extends Expression public IMethodBinding resolveMethodBinding() { return this.ast.getBindingResolver().resolveMethod(this); } - } |