mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspections] IDEA-360640 impossible to convert broken records to class
GitOrigin-RevId: 64b99a0edd7c62257d617e21db96acfb14ff65ca
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c65db5b11c
commit
cd43f06815
@@ -122,7 +122,7 @@ public class ConvertRecordToClassFix extends PsiUpdateModCommandAction<PsiElemen
|
||||
}
|
||||
}
|
||||
if (insertFieldsAfter == null) {
|
||||
result.append("{\n");
|
||||
result.append("\n{\n");
|
||||
insertFields(result, recordClass);
|
||||
insertConstructor(result, JavaPsiRecordUtil.findCanonicalConstructor(recordClass), recordClass);
|
||||
insertMethods(result, recordClass, recordClass.getRecordComponents());
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import java.util.Objects;
|
||||
|
||||
// "Convert record to class" "true-preview"
|
||||
public final class TooWidePermissions //simple end comment {
|
||||
{
|
||||
private final String key;
|
||||
|
||||
public TooWidePermissions(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) return true;
|
||||
if (obj == null || obj.getClass() != this.getClass()) return false;
|
||||
var that = (TooWidePermissions) obj;
|
||||
return Objects.equals(this.key, that.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TooWidePermissions[" +
|
||||
"key=" + key + ']';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Convert record to class" "true-preview"
|
||||
public record TooWidePermissions<caret>( String key) //simple end comment {
|
||||
}
|
||||
Reference in New Issue
Block a user