When you change to String[] Text, did you also change your logic below since Text is no longer a string but an array.
String a = Text.join(",")
Can you try to change it to just a simple logic that is correct Java/Groovy syntax, i.e.
String a = "test";