# HG changeset patch # Parent 8300e98997b0f335071975d1ea223329e51558eb diff --git a/refactoring.java/apichanges.xml b/refactoring.java/apichanges.xml new file mode 100644 --- /dev/null +++ b/refactoring.java/apichanges.xml @@ -0,0 +1,89 @@ + + + + + + Java Refactoring API + + + + + Method name and return type added, to allow them to be changed from the refactoring. + + + + + +

+ The Change Method Parameters refactoring should be changed to + allow changing the method signature. The api needs to store the + new name for the method, if the method needs to be renamed, and + it needs to store the new return type, if the return type needs + to be changed. +

+
+ + +
+
+ + + Change History for the Java Refactoring API + + + + +

Introduction

+

This document lists changes made to the Java Refactoring API.

+ + +
+ + +

@FOOTER@

+ +
+
diff --git a/refactoring.java/nbproject/project.properties b/refactoring.java/nbproject/project.properties --- a/refactoring.java/nbproject/project.properties +++ b/refactoring.java/nbproject/project.properties @@ -1,7 +1,7 @@ javac.source=1.6 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.24.0 +spec.version.base=1.25.0 #test configs test.config.find.includes=\ **/FindUsagesSuite.class diff --git a/refactoring.java/src/org/netbeans/modules/refactoring/java/api/ChangeParametersRefactoring.java b/refactoring.java/src/org/netbeans/modules/refactoring/java/api/ChangeParametersRefactoring.java --- a/refactoring.java/src/org/netbeans/modules/refactoring/java/api/ChangeParametersRefactoring.java +++ b/refactoring.java/src/org/netbeans/modules/refactoring/java/api/ChangeParametersRefactoring.java @@ -45,6 +45,8 @@ import java.util.Set; import javax.lang.model.element.Modifier; +import org.netbeans.api.annotations.common.CheckForNull; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.api.java.source.TreePathHandle; import org.netbeans.modules.refactoring.api.AbstractRefactoring; import org.openide.util.lookup.Lookups; @@ -61,6 +63,7 @@ * @author Pavel Flaska * @author Tomas Hurka * @author Jan Becicka + * @author Ralph Ruijs */ public final class ChangeParametersRefactoring extends AbstractRefactoring { @@ -70,6 +73,8 @@ private ParameterInfo[] paramTable; // new modifier private Set modifiers; + private String methodName; + private String returnType; /** * Creates a new instance of change parameters refactoring. @@ -97,6 +102,26 @@ } /** + * Get the new return type. + * + * @return returnType, null if it will not change + * @since 1.25 + */ + public @CheckForNull String getReturnType() { + return returnType; + } + + /** + * Get the new method name. + * + * @return methodName, null if it will no change + * @since 1.25 + */ + public @CheckForNull String getMethodName() { + return methodName; + } + + /** * Sets new parameters for a method * @param paramTable new parameters */ @@ -112,6 +137,26 @@ this.modifiers = modifiers; } + /** + * Sets the new method name. + * + * @param methodName the new method name, null if it does not change + * @since 1.25 + */ + public void setMethodName(@NullAllowed String methodName) { + this.methodName = methodName; + } + + /** + * Sets the new return type for the method. + * + * @param returnType the return type to set, null if it does not change + * @since 1.25 + */ + public void setReturnType(@NullAllowed String returnType) { + this.returnType = returnType; + } + //////////////////////////////////////////////////////////////////////////// // INNER CLASSES ////////////////////////////////////////////////////////////////////////////