
| Key: |
IDEABKL-4424
|
| Type: |
New Feature
|
| Status: |
Open
|
| Priority: |
Normal
|
| Assignee: |
Unassigned
|
| Reporter: |
Keith Lea
|
| Votes: |
1
|
| Watchers: |
0
|
|
Available Workflow Actions
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
| Build: |
4,109
|
| Severity: |
Low
|
|
@Nullable and @NotNull are annotations on the return type of the method, so it makes sense to place them after all modifiers, like public static @NotNull String doSomething(). However, @Override is an annotation on the method itself, so it makes sense to place it before all modifiers and possibly on a new line, like @Override public final void something(). Currently IDEA will not allow me to tell the formatter to do things like this. I suggest either providing a new tab in Code Style settings where I could add @Nullable and @NotNull to a list of after-modifiers annotations, OR, preferably, add a new annotation to annotations.jar called @ReturnTypeAnnotation which applies to annotations. Then @Nullable and @NotNull could be declared with this annotation.
|
|
Description
|
@Nullable and @NotNull are annotations on the return type of the method, so it makes sense to place them after all modifiers, like public static @NotNull String doSomething(). However, @Override is an annotation on the method itself, so it makes sense to place it before all modifiers and possibly on a new line, like @Override public final void something(). Currently IDEA will not allow me to tell the formatter to do things like this. I suggest either providing a new tab in Code Style settings where I could add @Nullable and @NotNull to a list of after-modifiers annotations, OR, preferably, add a new annotation to annotations.jar called @ReturnTypeAnnotation which applies to annotations. Then @Nullable and @NotNull could be declared with this annotation. |
Show » |
|
BTW, most of the time we put @Nullable declaration on the previous line like
I.e. like with any other code style aspect it's just a styling aspect and people will tend to change the defautls.