I am getting this error in fortify Scan. Code Correctness: Byte Array to String Conversion
final ByteBuffer byteBuffer = Base64.getEncoder().encode(byteCharBuffer);
final String base64EncodedPwd = new String(byteBuffer.array());
technicalUserToSave.setPassword(base64EncodedPwd.toCharArray()); // M getting error at this line
TechnicalUser.java class
public class TechnicalUser implements Serializable
{
/**
* Serialization version uid.
*/
private static final long serialVersionUID = 1L;
/**
* The password or secret of the technical user.
*/
@ApiModelProperty(name = "password", value = "Password")
@JsonProperty("password")
@Setter
private char[] password;
}