为什么 eclipse 为方法生成参数名称为 arg0,arg1,arg2....

Why eclipse is generating argument names as arg0,arg1,arg2.... for methods?(为什么 eclipse 为方法生成参数名称为 arg0,arg1,arg2....)

本文介绍了为什么 eclipse 为方法生成参数名称为 arg0,arg1,arg2....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

When I try to access some class's method; eclipse gets that method but arguments inside that method are replaced by arg0, arg1, arg2...

Example:-

Suppose I have this method in some class named ReadFile.java

@Override
public int readXXX(int start, int end, String xxx) throws IOException {
    return 0;
}

When I try to access that method from an instance of class it shows me as follows:

readFile.readXXX(arg0, arg1, arg2);

It becomes hard to identify what I should pass in argument. The same thing also happens for java methods. i.e. when I implement interface all method under that will be generated but arguments in that methods are arg0, arg1.....

Is there any setting I can do prevent this?

I'm using Eclipse Galelio.

解决方案

Eclipse can't work out the arguments because it can't find the source or javadoc attachments.

Make sure your source is attached.

To check, click on the method call readXXX and press F3 which should open the method declaration. If the source is not attached, Eclipse will say "Source not found" and will allow you to "Attach Source...".

这篇关于为什么 eclipse 为方法生成参数名称为 arg0,arg1,arg2....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:为什么 eclipse 为方法生成参数名称为 arg0,arg1,arg2....

基础教程推荐