mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-229842 Convert compact constructor to canonical
GitOrigin-RevId: 6edd200e51ec300bf1068d2f040b837fea3f6e1f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d0f72f2f02
commit
b936699772
+22
@@ -0,0 +1,22 @@
|
||||
// "Convert compact constructor to canonical" "true"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
public record Test(int x, @ParamAnno int y, @FieldAnno int... other) {
|
||||
@ConstructorAnno
|
||||
public Test(int x, @ParamAnno int y, int... other) {
|
||||
this.x = Math.abs(x);
|
||||
if (other == null) other = new int[0];
|
||||
this.y = y;
|
||||
this.other = other;
|
||||
}
|
||||
}
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
@interface ParamAnno {}
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
@interface FieldAnno {}
|
||||
|
||||
@Target(ElementType.CONSTRUCTOR)
|
||||
@interface ConstructorAnno {}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Convert compact constructor to canonical" "true"
|
||||
record R(int x,int y) {
|
||||
/*
|
||||
hello
|
||||
*/
|
||||
public R(int x, int y) {<caret>
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Convert compact constructor to canonical" "true"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
public record Test(int x, @ParamAnno int y, @FieldAnno int... other) {
|
||||
@ConstructorAnno
|
||||
<caret>public Test {
|
||||
this.x = Math.abs(x);
|
||||
if (other == null) other = new int[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Target(ElementType.PARAMETER)
|
||||
@interface ParamAnno {}
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
@interface FieldAnno {}
|
||||
|
||||
@Target(ElementType.CONSTRUCTOR)
|
||||
@interface ConstructorAnno {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Convert compact constructor to canonical" "true"
|
||||
record R(int x,int y) {
|
||||
/*
|
||||
hello
|
||||
*/
|
||||
public R {<caret>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user