Buggy code:
public abstract class Page extends MarkupContainer implements IRedirectListener , IPageMapEntry { public static final int LATEST_VERSION = - 1 ; private static final long serialVersionUID = 1L ; private static final ConcurrentHashMap pageClassToBookmarkableCache = new ConcurrentHashMap ( ) ; private static final short FLAG_IS_RENDERING = FLAG_RESERVED2 ; private static final short FLAG_NEW_VERSION = FLAG_RESERVED3 ; private static final short FLAG_TRACK_CHANGES = FLAG_RESERVED4 ; private static final int FLAG_STATELESS_HINT = FLAG_RESERVED5 ; private static final Log log = LogFactory . getLog ( Page . class ) ; private short autoIndex ; private short numericId ; private transient IPageMap pageMap ; private String pageMapName ; private transient Set renderedComponents ; private transient Boolean stateless = null ; private IPageVersionManager versionManager ; protected Page ( ) { } protected Page ( final IModel model ) { } protected Page ( final IPageMap pageMap ) { } protected Page ( final IPageMap pageMap , final IModel model ) { } public void afterCallComponent ( final Component component , final RequestListenerInterface listener ) { } public void beforeCallComponent ( final Component component , final RequestListenerInterface listener ) { } public final void componentRendered ( final Component component ) { } public void detachModels ( ) { } public final void dirty ( ) { } public final void endComponentRender ( Component component ) { } public final void expireOldestVersion ( ) { } public final int getAjaxVersionNumber ( ) { } public final short getAutoIndex ( ) { } public final int getCurrentVersionNumber ( ) { } public final String getId ( ) { } public int getNumericId ( ) { } public final Class getPageClass ( ) { } public final IPageMap getPageMap ( ) { } public IPageMapEntry getPageMapEntry ( ) { } public final long getSizeInBytes ( ) { } public final boolean getStatelessHint ( ) { } public Page getVersion ( final int versionNumber ) { } public final int getVersions ( ) { } public final String hierarchyAsString ( ) { } public final void ignoreVersionMerge ( ) { } public boolean isBookmarkable ( ) { } public boolean isErrorPage ( ) { } public final boolean isPageStateless ( ) { } public final void onRedirect ( ) { } public final void removePersistedFormData ( final Class formClass , final boolean disablePersistence ) { } public final void renderPage ( ) { } public final Page rollbackPage ( int numberOfVersions ) { } public final void setNumericId ( final int id ) { } public final void setStatelessHint ( boolean value ) { } public final void startComponentRender ( Component component ) { } public String toString ( ) { } private void checkHierarchyChange ( Component component ) { } private final void checkRendering ( final MarkupContainer renderedContainer ) { } private final void endVersion ( ) { } private final void init ( ) { } private final void init ( final IPageMap pageMap ) { } private final boolean mayTrackChangesFor ( final Component component , MarkupContainer parent ) { } protected void configureResponse ( ) { } protected final void internalOnModelChanged ( ) { visitChildren ( new Component . IVisitor ( ) { public Object component ( final Component component ) { <START_BUG> if ( component . sameRootModel ( Page . this ) ) { <END_BUG> component . modelChanged ( ) ; } return IVisitor . CONTINUE_TRAVERSAL ; } } ) ; } protected final void moveToPageMap ( IPageMap map ) { } protected final IPageVersionManager newVersionManager ( ) { } protected void onDetach ( ) { } protected void onRender ( final MarkupStream markupStream ) { } final void componentAdded ( final Component component ) { } final void componentModelChanging ( final Component component ) { } final void componentRemoved ( final Component component ) { } final void componentStateChanging ( final Component component , Change change ) { } final void setFormComponentValuesFromCookies ( ) { } final void setPageMap ( final IPageMap pageMap ) { } void setPageStateless ( Boolean stateless ) { } }

Fix:
if ( component . sameInnermostModel ( Page . this ) ) {