Fixpoint
Fixpoint

Reputation: 9860

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 any case.

Upvotes: 1

Views: 280

Answers (1)

Adisesha
Adisesha

Reputation: 5258

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'

Upvotes: 2

Related Questions