package seedu.todo.ui.components;

import javafx.fxml.FXML;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import seedu.todo.models.Task;
import seedu.todo.ui.UiPartLoader;

public class TaskListTaskItem extends MultiComponent {

    private static final String FXML_PATH = "components/TaskListTaskItem.fxml";
    private static final String DOT = ".";
    
    // Props
    public Task task;
    public int displayIndex;

    // FXML
    @FXML
    private Text taskText;

    public static TaskListTaskItem load(Stage primaryStage, Pane placeholderPane) {
        return UiPartLoader.loadUiPart(primaryStage, placeholderPane, new TaskListTaskItem());
    }

    @Override
    public String getFxmlPath() {
        return FXML_PATH;
    }

    @Override
    public void componentDidMount() {
        taskText.setText(formatTaskText(displayIndex, task.getName()));
    }
    
    private String formatTaskText(int index, String taskName) {
        return String.format("%s %s", index + DOT, taskName);
    }

}

@@ -351,51 +351,8 @@
 l%22;%0A
-    private static final String DOT = %22.%22;%0A
     
@@ -965,16 +965,17 @@
 rmat(%22%25s
+.
  %25s%22, in
@@ -981,14 +981,8 @@
 ndex
- + DOT
 , ta

Remove extract magic string for DOT, use String.format for greater clarity