Project: talenddataquality
Issue TDQ-11339: The "String index out of range: -1" shows when the function is Keep n last digits and replace previous ones and parameter is 1 for tDataMasking
1.Design one job such as tFixFlowInput->tDataMasking->tLogrow 2.Add varchar column and set the function is Keep n last digits and replace previous ones and parameter is 1 3.Run job Expected result: It run well Actual result: The error shows. {code} Exception in component tDataMasking_1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 java.lang.String.charAt(String.java:646) org.talend.dataquality.datamasking.Functions.KeepLastAndGenerateString.generateMaskedRow(KeepLastAndGenerateString.java:39) org.talend.dataquality.datamasking.Functions.KeepLastAndGenerateString.generateMaskedRow(KeepLastAndGenerateString.java:21) ss.data_0_1.data$2.modifyOutput(data.java:822) ss.data_0_1.data$2.generateOutput(data.java:811) ss.data_0_1.data$2.generateOutput(data.java:1) org.talend.dataquality.datamasking.DataMasker.process(DataMasker.java:43) ss.data_0_1.data.tFixedFlowInput_1Process(data.java:921) ss.data_0_1.data.runJobInTOS(data.java:1344) ss.data_0_1.data.main(data.java:1178) [FATAL]: ss.data_0_1.data - tDataMasking_1 String index out of range: -1 {code}
Story points: 2