Buggy code:
public final void fatal ( final String message ) { } public final < P extends MarkupContainer > P findParent ( final Class < P > c ) { } public final MarkupContainer findParentWithAssociatedMarkup ( ) { } public Application getApplication ( ) { } public final List < IBehavior > getBehaviors ( ) { } public final String getClassRelativePath ( ) { } public IConverter getConverter ( Class type ) { } public final boolean getEscapeModelStrings ( ) { } public final FeedbackMessage getFeedbackMessage ( ) { } public String getId ( ) { } public Locale getLocale ( ) { } public final Localizer getLocalizer ( ) { } public final IValueMap getMarkupAttributes ( ) { } public String getMarkupId ( ) { } public final Serializable getMetaData ( final MetaDataKey key ) { } public IModel < T > getModel ( ) { } public final T getModelObject ( ) { } public final String getModelObjectAsString ( ) { } public final Page getPage ( ) { } public final IPageFactory getPageFactory ( ) { } public final String getPageRelativePath ( ) { } public final MarkupContainer getParent ( ) { } public final String getPath ( ) { } public final boolean getRenderBodyOnly ( ) { } public Request getRequest ( ) { } public RequestCycle getRequestCycle ( ) { } public 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 hasErrorMessage ( ) { } public final boolean hasFeedbackMessage ( ) { } public final void info ( final String message ) { } public final boolean isActionAuthorized ( Action action ) { } public final boolean isEnableAllowed ( ) { } public boolean isEnabled ( ) { } public boolean isVersioned ( ) { } public boolean isVisible ( ) { } public final boolean isVisibleInHierarchy ( ) { } public final void modelChanged ( ) { } public final void modelChanging ( ) { } public final Page newPage ( final Class < ? extends Page > c ) { } public final Page newPage ( final Class < ? extends Page > c , final PageParameters parameters ) { } public final Component reAttach ( ) { } public final void redirectToInterceptPage ( final Page page ) { } public final void remove ( ) { } public final void render ( ) { } public final void render ( final MarkupStream markupStream ) { } @ SuppressWarnings ( "unchecked" ) public final void renderComponent ( ) { } public final void renderComponent ( final MarkupStream markupStream ) { } public final void rendered ( ) { } public void renderHead ( final HtmlHeaderContainer container ) { } public final boolean sameRootModel ( final Component component ) { } public final boolean sameRootModel ( final IModel model ) { } private final IModel getRootModel ( final IModel model ) { } public final Component setEnabled ( final boolean enabled ) { } public final Component setEscapeModelStrings ( final boolean escapeMarkup ) { } public final void setMetaData ( final MetaDataKey key , final Serializable object ) { } @ SuppressWarnings ( "unchecked" ) public Component setModel ( final IModel < T > model ) { if ( ( this . model ) != null ) { this . model . detach ( ) ; } IModel prevModel = this . model ; if ( prevModel instanceof IWrapModel ) { <START_BUG> prevModel = model . getNestedModel ( ) ; <END_BUG> } if ( prevModel != model ) { if ( prevModel != null ) { addStateChange ( new ComponentModelChange ( prevModel ) ) ; } if ( model instanceof IAssignmentAware ) { this . model = ( ( IAssignmentAware < T > ) ( model ) ) . wrapOnAssignment ( this ) ; } else { this . model = model ; } } modelChanged ( ) ; return this ; } public final Component setModelObject ( final T object ) { } public final Component setOutputMarkupId ( final boolean output ) { } public final boolean getOutputMarkupId ( ) { } public final void setRedirect ( final boolean redirect ) { } public final Component setRenderBodyOnly ( final boolean renderTag ) { } public final void setResponsePage ( final Class < ? extends Page > cls ) { } public final void setResponsePage ( final Class < ? extends Page > cls , PageParameters parameters ) { } public final void setResponsePage ( final Page page ) { } public Component setVersioned ( boolean versioned ) { } public final Component setVisible ( final boolean visible ) { } @ Override public String toString ( ) { } public String toString ( final boolean detailed ) { } public final CharSequence urlFor ( final Class < ? extends Page > pageClass , final PageParameters parameters ) { } public final CharSequence urlFor ( final IRequestTarget requestTarget ) { } public final CharSequence urlFor ( final PageMap pageMap , final Class < ? extends Page > pageClass , final PageParameters parameters ) { } public final CharSequence urlFor ( final RequestListenerInterface listener ) { } public final CharSequence urlFor ( final ResourceReference resourceReference ) { } public final Object visitParents ( final Class c , final Component . IVisitor visitor ) { } public final void warn ( final String message ) { } protected final void addStateChange ( final Change change ) { } protected final void checkComponentTag ( final ComponentTag tag , final String name ) { }

Fix:
prevModel = prevModel . getNestedModel ( ) ;