Buggy code:
@ Deprecated public final IConverter getConverter ( ) { } public IConverter getConverter ( Class < ? > type ) { } public final boolean getEscapeModelStrings ( ) { } public final FeedbackMessage getFeedbackMessage ( ) { } public String getId ( ) { } public final IModel < ? > getInnermostModel ( ) { } public Locale getLocale ( ) { } public final Localizer getLocalizer ( ) { } public final ValueMap getMarkupAttributes ( ) { } final Object getMarkupIdImpl ( ) { } private final int nextAutoIndex ( ) { } public String getMarkupId ( boolean createIfDoesNotExist ) { } public String getMarkupId ( ) { } public final < M extends Serializable > M getMetaData ( final MetaDataKey < M > key ) { } private MetaDataEntry < ? > [ ] getMetaData ( ) { } public final IModel < ? > getDefaultModel ( ) { } public final Object getDefaultModelObject ( ) { } public final String getDefaultModelObjectAsString ( ) { } public final String getDefaultModelObjectAsString ( final Object modelObject ) { } public final boolean getOutputMarkupId ( ) { } public final boolean getOutputMarkupPlaceholderTag ( ) { } public final Page getPage ( ) { } public final String getPageRelativePath ( ) { } public final MarkupContainer getParent ( ) { } public final String getPath ( ) { } public final boolean getRenderBodyOnly ( ) { } public final Request getRequest ( ) { } public final RequestCycle getRequestCycle ( ) { } public final Response getResponse ( ) { } public Session getSession ( ) { } public long getSizeInBytes ( ) { } public final String getString ( final String key ) { } public final String getString ( final String key , final IModel < ? > model ) { } public final String getString ( final String key , final IModel < ? > model , final String defaultValue ) { } public final String getStyle ( ) { } public String getVariation ( ) { } public final boolean hasBeenRendered ( ) { } public final boolean hasErrorMessage ( ) { } public final boolean hasFeedbackMessage ( ) { } public final void info ( final String message ) { } @ Deprecated public final void internalAttach ( ) { } @ Deprecated public final void internalDetach ( ) { } public final boolean isActionAuthorized ( Action action ) { } @ Deprecated public final boolean isAncestorOf ( final Component component ) { } public final boolean isEnableAllowed ( ) { } public boolean isEnabled ( ) { } public final boolean isRenderAllowed ( ) { } public final boolean isStateless ( ) { } public boolean isVersioned ( ) { } public boolean isVisible ( ) { } public final boolean isVisibleInHierarchy ( ) { } public final void markRendering ( boolean setRenderingFlag ) { } public final void modelChanged ( ) { } public final void modelChanging ( ) { } public final void prepareForRender ( boolean setRenderingFlag ) { } public final void prepareForRender ( ) { } public final void redirectToInterceptPage ( final Page page ) { } public final void remove ( ) { } public Component remove ( final IBehavior behavior ) { } private boolean removeBehavior ( final IBehavior behavior ) { } public final void render ( ) { } public final void render ( final MarkupStream markupStream ) { } public final void renderComponent ( ) { } public final void renderComponent ( final MarkupStream markupStream ) { } public final void rendered ( ) { } public void renderHead ( final HtmlHeaderContainer container ) { <START_BUG> if ( isVisible ( ) ) { <END_BUG> if ( ( this ) instanceof IHeaderContributor ) { ( ( IHeaderContributor ) ( this ) ) . renderHead ( container . getHeaderResponse ( ) ) ; } List < IBehavior > behaviors = getBehaviorsImpl ( ) ; if ( behaviors != null ) { final Iterator < IBehavior > iter = behaviors . iterator ( ) ; while ( iter . hasNext ( ) ) { IBehavior behavior = iter . next ( ) ; if ( ( behavior instanceof IHeaderContributor ) && ( isBehaviorAccepted ( behavior ) ) ) { ( ( IHeaderContributor ) ( behavior ) ) . renderHead ( container . getHeaderResponse ( ) ) ; } } } } } public void replaceWith ( Component replacement ) { } public final boolean sameInnermostModel ( final Component component ) { } public final boolean sameInnermostModel ( final IModel < ? > model ) { } public final Component setComponentBorder ( final IComponentBorder border ) { } public final Component setEnabled ( final boolean enabled ) { } public final Component setEscapeModelStrings ( final boolean escapeMarkup ) { } final void setMarkupIdImpl ( Object markupId ) { } public void setMarkupId ( String markupId ) { } public final < M > void setMetaData ( final MetaDataKey < M > key , final M object ) { } public Component setDefaultModel ( final IModel < ? > model ) { } IModel < ? > getModelImpl ( ) { } void setModelImpl ( IModel < ? > model ) { } @ SuppressWarnings ( "unchecked" ) public final Component setDefaultModelObject ( final Object object ) { } public final Component setOutputMarkupId ( final boolean output ) { } public final Component setOutputMarkupPlaceholderTag ( final boolean outputTag ) { } public final void setRedirect ( final boolean redirect ) { } public final Component setRenderBodyOnly ( final boolean renderTag ) { } public final < C extends Page > void setResponsePage ( final Class < C > cls ) { } public final < C extends Page > void setResponsePage ( final Class < C > cls , PageParameters parameters ) { } public final void setResponsePage ( final Page page ) { } public Component setVersioned ( boolean versioned ) { }

Fix:
if ( ( isVisible ( ) ) && ( isRenderAllowed ( ) ) ) {