mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-229694 Generate constructor for records: suggest generation of compact and canonical constructors
GitOrigin-RevId: 95e23c12711c867a1e1f41d42ee5f3cc87876b3d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
39fc484b5d
commit
84c1a10be9
+21
@@ -0,0 +1,21 @@
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
record Test(final int foo, @Anno1 @Anno2 @Anno3 @Anno4 double bar) {
|
||||
public Test(int foo, @Anno2 @Anno3 @Anno4 double bar) {<caret>
|
||||
this.foo = foo;
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
public int foo() {
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
@Target(ElementType.RECORD_COMPONENT)
|
||||
@interface Anno1 { }
|
||||
@Target({ElementType.RECORD_COMPONENT, ElementType.PARAMETER})
|
||||
@interface Anno2 { }
|
||||
@Target({ElementType.PARAMETER})
|
||||
@interface Anno3 { }
|
||||
@Target({ElementType.TYPE_USE})
|
||||
@interface Anno4 { }
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
record R(int x, int y) {
|
||||
public R {<caret>
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
record Test(final int foo, @Anno1 @Anno2 @Anno3 @Anno4 double bar, String... varArg) {
|
||||
<caret>
|
||||
public int foo() {
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
@Target(ElementType.RECORD_COMPONENT)
|
||||
@interface Anno1 { }
|
||||
@Target({ElementType.RECORD_COMPONENT, ElementType.PARAMETER})
|
||||
@interface Anno2 { }
|
||||
@Target({ElementType.PARAMETER})
|
||||
@interface Anno3 { }
|
||||
@Target({ElementType.TYPE_USE})
|
||||
@interface Anno4 { }
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
record R(int x, int y) {
|
||||
<caret>
|
||||
}
|
||||
Reference in New Issue
Block a user