开发者

Eclipse generates method with fully qualified argument types

Sometimes, when I use content assist in Eclipse to override a method of superclass (or auto-generate method stub in any other way), the generated method signature has all types fully-qualified, has "{}" right after signature (without wrapping) and has ";" after the method. For example:

    public void doSomething(com.company.xyz.First first, java.lang.String string) {};

Why does it do this? I don't have any other classes imported that may clash by name with the auto-generated ones. And I can't see why ";" may be needed after method in 开发者_StackOverflow社区any case.


Windows->Preferences->Java->Editor->Content Assist. Check 'Add import instead of qualified name'. This will disable generation of qualified names.

Line wrapping is something to do with your code formatter. Windows->Preferences->Java->Code Style->Formatter->Edit->New Lines Tab. Check 'in empty method body'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜