Code is malformatted in Script mode every time after save

In Script mode i had created couple of methods which is creating problems

Version: 6.1.0

Original Code

    def projectEngineeringDoc(TestObject tblXpath, int columnIndex1) {
        def varPath = tblXpath.getActiveXpaths().get(0).getValue()

        WebDriver driver = DriverFactory.getWebDriver()

        List<WebElement> rows_table = driver.findElements(By.xpath(varPath + '/tr'))

        int i = rows_table.size()

        String[] fileName = new String[i]

        for (int row = 1; row <= rows_table.size(); row++) {
            WebElement cellObject = driver.findElement(By.xpath(varPath + '/tr['+row+']/td['+columnIndex1+']/a'))

            print(cellObject.getText())

            (fileName[(row - 1)]) = cellObject.getText()
        }
        
        return fileName
    }

After Saving code, it automatically adds some ‘)’ and removes few values in the code which is causing problem

    def projectEngineeringDoc(TestObject tblXpath, int columnIndex1) {
        def varPath = tblXpath.getActiveXpaths().get(0).getValue()

        WebDriver driver = DriverFactory.getWebDriver()

        List<WebElement> rows_table = driver.findElements(By.xpath(varPath + '/tr'))

        int i = rows_table.size()

        String[] fileName = new String[]

        for (int row = 1; row <= rows_table.size(); row++) {
            WebElement cellObject = driver.findElement(By.xpath(((((varPath + '/tr[') + row) + ']/td[') + columnIndex1) + ']/a'))

            print(cellObject.getText())

            (fileName[(row - 1)]) = cellObject.getText()
        }
        
        return fileName
    }

I don’t have time to play spot-the-difference. But I did spot this, try…

String[] fileName = [""] * i

@Russ_Thomas
Thanks for the suggestion. I restarted katalon which fixed the issue. Now everything looks good.