I've searched here for the question but could only found situations in which the person already has a variable with the value "false" or "true". In this case, I have a String variable called "Deactivated", and im trying to convert it to a "False" string, and then to a "False" bool. But I get the "unreachable code" error (Eclipse), even though im instantiating the DTO at the method's declaration... Here's the code:
public class TheController {
public String getData(TheDTO theDTO) {
return "Just returning the variable for debugging reasons: " + theDTO.information; // returns the information without issue
// converting it to String "False", and then to Bool.
if (theDTO.information == "Deactivated") { // At this line is where the "Unreachable code" error appears.
theDTO.information = "False";
// Boolean.parseBoolean(theDTO.information)
}
}
}