English 中文(简体)
如何以某种方法自动取而代之和一切援引
原标题:How to automatically replace arguments in a method and all its invocations

附录一采用 Java法:

void method(int a, int b) {}

(a) 说明:

method(10, 12);
method(33, 44); 
...

为了取得以下结果,你将如何自动地反驳替代论点?

void method(int b, int a) {}
method(12, 10);
method(44, 33); 
...

注:我寻求一种通用的解决办法,处理所有方法和论点案件,并更喜欢使用Eclipse工具。

<><>Edit>: 是否有办法在方案上根据不同类别的具体标准制定一套方法?

最佳回答

正确计算方法(在源代码编辑、提纲或任何其他观点中)和选修方法; 变化方法签名。

这将引起一种辩证,使你能够改变对这种方法的许多选择。 改变辩论次序,也改变了对这种方法的援引(使用预约加以核实)。

http://fhc.quickmediasolutions.com/image/1635916007.png

请注意,援引上的改动只有在你拿起职业分类的源代码时才会奏效,并注明了你重新操纵的来源。

问题回答

你们可以支持方法声明。 然后,它将根据您的改动更新所有电话。

http://www.ibm.com/developerwork/library/os-ecref/“rel=“nofollow”>。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签