简体   繁体   English

Eclipse自动抽象方法生成器

[英]Eclipse automatic abstract method generator

In my eclipse project, I am making a bunch of classes that implement interfaces. 在我的eclipse项目中,我制作了一堆实现接口的类。 When I check the box in the Create new class window, that says inherit abstract methods, or when I click on the name and say inherit abstract methods, it generates method stubs for those methods that need to be implemented. 当我在“创建新类”窗口中选中“继承抽象方法”复选框时,或者当我单击名称并说“继承抽象方法”时,它将为那些需要实现的方法生成方法存根。 But the problem is, the argument names it generates are not correct. 但是问题是,它生成的参数名称不正确。 Eg the parameters are called sender , cmd , label , and args , but they are generated as arg0 , arg1 , arg2 , and arg3 . 例如,这些参数称为sendercmdlabelargs ,但它们分别生成为arg0arg1arg2arg3 I've added the javadocs for the libraries that contain those interfaces, and I can confirm that they are because when i hover over the method name it shows me the correct arguments, but they still wont generate the names right. 我已经为包含这些接口的库添加了javadocs,并且可以确认它们是因为当我将鼠标悬停在方法名称上时,它会向我显示正确的参数,但是它们仍然无法正确生成名称。 I'd like to know if there's a way to change or fix this. 我想知道是否可以更改或解决此问题。

I figured it out. 我想到了。 Once I added the source, (for me it was a local folder) then it loaded the correct names. 一旦添加了源(对我而言,这是一个本地文件夹),那么它将加载正确的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM