How to tell Idea to add "public" modifier for methods automatically created in an interface

Hi,


I like public modifier for all methods defined in an interface. Is it possible to tell Idea to add that modifier when using ALT-ENTER -> "Create method xxx"?


Marcin

0
4 comments
Avatar
Permanently deleted user

No, it is not possible to configure (and also redundant).

0

Sure, this is not necessary, but whitespaces between "if" and "(" as well as ")" and "{" are also redundant and Idea allows to configure it, because there are many styles of coding using Java.

http://youtrack.jetbrains.net/issue/IDEA-52119

0
Avatar
Permanently deleted user

Redundancy and code style are orthogonal concerns.  White space has no meaning in Java, and therefore "redundancy" has no bearing.  Its presence, while of utmost value, affects how the code looks, and not how the code is interpreted by the JVM.  The "public" modifier, on the other hand, certainly has meaning in Java, which makes it a candidate for the type of redundancy Tom refers.

I only wish to draw the distinction, and make no judgment on your request.  In fact, I've been meaning to put in a similar feature request, which I hope you don't mind me mentioning in this thread you've started.   I prefer to repeat each of my import statements like so:

import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;


I find that when people read my code, it really hammers home the classes I'm importing.  However, it sure is a pain doing this by hand!  It'd be swell if I could simply tell IDEA to do so automatically.  I wouldn't even mind if this meant sacrificing other potential features in IDEA, like performance or supporting new language features.

Please vote for this in You Track

~kc

0
Avatar
Permanently deleted user

Keith Collison wrote:

Redundancy and code style are orthogonal concerns.  White space has no meaning in Java, and therefore "redundancy" has no bearing.  Its presence, while of utmost value, affects how the code looks, and not how the code is interpreted by the JVM.  The "public" modifier, on the other hand, certainly has meaning in Java, which makes it a candidate for the type of redundancy Tom refers.

I only wish to draw the distinction, and make no judgment on your request.  In fact, I've been meaning to put in a similar feature request, which I hope you don't mind me mentioning in this thread you've started.   I prefer to repeat each of my import statements like so:

import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;

I find that when people read my code, it really hammers home the classes I'm importing.  However, it sure is a pain doing this by hand!  It'd be swell if I could simply tell IDEA to do so automatically.  I wouldn't even mind if this meant sacrificing other potential features in IDEA, like performance or supporting new language features.

Please vote for this in You Track

~kc

---
Original message URL: http://www.jetbrains.net/devnet/message/5256454#5256454


Heh, nice ;)
N.

0

Please sign in to leave a comment.