EditorTextField (@NotNull EditorTextField field, @NotNull String text) { if (Objects.equals(text, field.getText())) { return new EditorTextField(field.getDocument(), field.getProject(), field.getFileType()); } else { return new EditorTextField(text, field.getProject(), field.getFileType()); } }