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

查看:26
本文介绍了为什么 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...

示例:-

假设我在某个名为 ReadFile.java 的类中有这个方法

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);

很难确定我应该在参数中传递什么.java方法也会发生同样的事情.即当我实现接口时,将生成该接口下的所有方法,但该方法中的参数是 arg0、arg1.....

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?

我使用的是 Eclipse Galelio.

I'm using Eclipse Galelio.

推荐答案

Eclipse 无法计算参数,因为它找不到源代码或 javadoc 附件.

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

确保已附加您的来源.

要检查,请单击方法调用 readXXX 并按 F3,这将打开方法声明.如果未附加源,Eclipse 将显示未找到源"并允许您附加源...".

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....?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆