title: Unchecked casting complain by FindBugs
body: <p>Consider the following code :</p>
  
  <pre><code> public void broadcast(FacesEvent event)
      throws AbortProcessingException {
  
      if(!(event instanceof WrapperEvent)) {
        super.broadcast(event);
        return;
      }
  
      // Sets up the correct context and fire our wrapped event.
      GridWrapperEvent revent = (GridWrapperEvent)event; // FindBugs is complaining here 
      int oldRowIndex = getRowIndex();
      int oldColumnIndex = getColumnIndex();
      boolean oldClientIdRewritting = clientIdRewritting;
      setClientIdRewritting(revent.isClientIdRewritting());
  
      setActiveCell(revent.getRowIndex(), revent.getColumnIndex());
  
      FacesEvent rowEvent = revent.getFacesEvent();
      rowEvent.getComponent().broadcast(rowEvent);
      setActiveCell(oldRowIndex, oldColumnIndex);
      setClientIdRewritting(oldClientIdRewritting);
    }
  </code></pre>
  
  <p><a href="http://findbugs.sourceforge.net/" rel="nofollow">FindBugs</a> is complaining about the commented line. Is there anything that I can do about it? This is what FindBugs says:</p>
  
  <blockquote>
    <p><strong>Unchecked/unconfirmed cast</strong> 
       This cast is unchecked, and not all
    instances of the type casted from can be cast to the type it is being
    cast to. Ensure that your program logic ensures that this cast will
    not fail.</p>
  </blockquote>