Buggy code:
@ Path ( "//competitions//" ) public class CompetitionRS { private static final Logger log = LoggerFactory . getLogger ( CompetitionRS . class ) ; @ Autowired private CompetitionDAO dao ; @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//query//{initDate},{finDate},{genderID},{classID},{competitionClass}" ) public List < Competition > getCompetitions ( @ PathParam ( "initDate" ) String initDate , @ PathParam ( "finDate" ) String finDate , @ PathParam ( "genderID" ) String genderID , @ PathParam ( "classID" ) String classID , @ PathParam ( "competitionClass" ) String competitionClass ) { } private CompetitionClass getCompetitionClass ( String competitionClass ) { } private Long getClassID ( String classID ) { } private Long getGenderID ( String genderID ) { } private Date getDate ( String cadena , boolean nullable ) throws ParseException { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//next//" ) public List < Competition > getNextCompetitions ( ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//year//{year}" ) public List < Competition > getYearCompetitions ( @ PathParam ( "year" ) String year ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//month//{year},{month}" ) public List < Competition > getMonthCompetitions ( @ PathParam ( "year" ) String year , @ PathParam ( "month" ) String month ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//allEditions//{competitionID}" ) public List < Competition > getAllEditions ( @ PathParam ( "competitionID" ) String competitionID ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//stageRaceCompetitions//{competitionID},{eventID},{genderID},{classID}" ) public List < Competition > getStageRaceCompetitionsService ( @ PathParam ( "competitionID" ) String competitionID , @ PathParam ( "eventID" ) String eventID , @ PathParam ( "genderID" ) String genderID , @ PathParam ( "classID" ) String classID ) { } public List < Competition > getStageRaceCompetitions ( Long competitionID , Long eventID , Long genderID , Long classID ) { } private URI getURLStageEvents ( Competition competition ) throws URISyntaxException { } private List < Competition > tratarXmlStageRaceCompetitions ( String html , Competition competition ) { } private URI getURLClassifications ( Competition comp ) throws URISyntaxException { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//loadCompetitions//{genderID},{classID},{initDate},{finishDate}" ) public Boolean loadCompetitionsService ( @ PathParam ( "genderID" ) String genderID , @ PathParam ( "classID" ) String classID , @ PathParam ( "initDate" ) String initDate , @ PathParam ( "finishDate" ) String finishDate ) { } private void loadAndSaveStageCompetitions ( String initDate , String finishDate ) throws CyclingResultsException , ParseException { } private boolean isNeedLoadStagesAndClassifications ( Competition comp ) { boolean ret = false ; <START_BUG> if ( comp . getCompetitionType ( ) . equals ( STAGES ) ) { <END_BUG> if ( ( ( dao . getCompetitionClassifications ( comp ) . size ( ) ) == 0 ) || ( ( dao . getCompetitionStages ( comp ) . size ( ) ) == 0 ) ) { ret = true ; } else if ( ! ( competitionFinalizada ( comp ) ) ) { ret = true ; } } return ret ; } private boolean competitionFinalizada ( Competition comp ) { } private void persistClassifications ( Competition stage ) { } private List < Competition > getClassifications ( Competition competition ) { } private String readClassificationFromUCIWebResults ( Competition comp ) { } private void loadCompetitions ( String genderID , String classID , String initDate , String finishDate ) { } private String getURLCompetitions ( String genderID , String classID , String initDate , String finishDate ) { } private List < Competition > tratarXmlCompetitions ( String html ) { } private void persistCompetition ( Competition comp ) { } private Long getKeyId ( String string , String key ) { } }

Fix:
if ( STAGES . equals ( comp . getCompetitionType ( ) ) ) {