Buggy code:
@ Controller public class GeneViewController extends AtlasViewController { private GeneSolrDAO geneSolrDAO ; private AtlasProperties atlasProperties ; private AnatomogramFactory anatomogramFactory ; private AtlasStatisticsQueryService atlasStatisticsQueryService ; private BioEntityDAO bioEntityDAO ; private Efo efo ; private final Logger log = LoggerFactory . getLogger ( getClass ( ) ) ; private ExperimentDAO experimentDAO ; @ Autowired public GeneViewController ( GeneSolrDAO geneSolrDAO , AtlasProperties atlasProperties , AnatomogramFactory anatomogramFactory , AtlasStatisticsQueryService atlasStatisticsQueryService , BioEntityDAO bioEntityDao , Efo efo , ExperimentDAO experimentDAO ) { } @ RequestMapping ( value = "//gene//{gid}" , method = RequestMethod . GET ) public String getGeneWithId ( @ PathVariable ( "gid" ) final String geneId , @ RequestParam ( value = "ef" , required = false ) String ef , Model model ) throws IOException , TranscoderException , ResourceNotFoundException { } @ RequestMapping ( value = "//gene//{gid}//{ef}" , method = RequestMethod . GET ) public String getGeneWithIdAndEf ( @ PathVariable ( "gid" ) final String geneId , @ PathVariable ( "ef" ) final String ef , Model model ) throws IOException , TranscoderException , ResourceNotFoundException { } @ RequestMapping ( value = "//gene" , method = RequestMethod . GET ) public String getGene ( @ RequestParam ( "gid" ) String geneId , @ RequestParam ( value = "ef" , required = false ) String ef , Model model ) throws IOException , TranscoderException , ResourceNotFoundException { } @ RequestMapping ( value = "//geneIndex" , method = RequestMethod . GET ) public String getGeneIndex ( @ RequestParam ( value = "offset" , required = false ) Integer offset , @ RequestParam ( value = "prefix" , required = false ) String prefix , Model model ) { } @ RequestMapping ( value = "//anatomogram" , method = RequestMethod . GET ) @ ResponseBody public byte [ ] getAnatomogramImage ( @ RequestParam ( "gid" ) String geneId , @ RequestParam ( value = "type" , required = false ) String aType ) throws IOException , TranscoderException { } @ RequestMapping ( "//geneExpList" ) public String getExperimentList ( @ RequestParam ( "gid" ) String geneId , @ RequestParam ( value = "from" , required = false ) Integer from , @ RequestParam ( value = "to" , required = false ) Integer to , @ RequestParam ( value = "ef" , required = false , defaultValue = "" ) String ef , @ RequestParam ( value = "efv" , required = false , defaultValue = "" ) String efv , @ RequestParam ( value = "efo" , required = false , defaultValue = "" ) String efoId , @ RequestParam ( value = "needPaging" , required = false , defaultValue = "false" ) Boolean needPaging , Model model ) throws ResourceNotFoundException { } private int getNumberOfExperiments ( AtlasGene gene , @ Nonnull Attribute attr ) { <START_BUG> if ( attr instanceof EfvAttribute ) { <END_BUG> return gene . getNumberOfExperiments ( ( ( EfvAttribute ) ( attr ) ) , atlasStatisticsQueryService ) ; } return getRankedGeneExperiments ( gene , attr , ( - 1 ) , ( - 1 ) ) . size ( ) ; } private List < GenePageExperiment > getRankedGeneExperiments ( AtlasGene gene , Attribute attribute , int fromRow , int toRow ) { } private String getGene ( final Model model , final String geneId , @ Nullable final String ef ) throws ResourceNotFoundException { } }

Fix:
if ( ( ( attr . getValue ( ) ) != null ) && ( attr instanceof EfvAttribute ) ) {