I am trying to create a variable to return which indicates whether a thread was successful in doing its job or not - however, it requires the variable be final which means it cannot be re assigned.
What is needed in order to facilitate something such as this
public static void sendFeedbackEmail(final String user, final FeedbackRating rating, final String feedbackText, final EmailAddress emailToSendTo) {
if (rating != null && !StringUtilities.stringEmptyOrNull(user)) {
boolean result = false;
Thread emailSender = new Thread(new Runnable() {
@Override
public void run() {
feedbackText = (StringUtilities.stringEmptyOrNull(feedbackText)) ? "N/A" : feedbackText;
String message = FEEDBACK_MESSAGE.replace("?", rating.getValue()) + user + " Text: " + feedbackText;
String emailAddress = (emailToSendTo == null) ? USER_FEEDBACK_EMAIL_ADDRESS : emailToSendTo.getValue();
try {
sendVimbaMessage(user, emailAddress, message);
} catch (MessagingException e) {
result = false;
}
result = false;
}
});
emailSender.setDaemon(true);
emailSender.start();
}
return false;
}
Thanks