Buggy code:
@ Override public String toString ( ) { } @ Override public void undo ( ) { } } public static final String AUTO_COMPONENT_PREFIX = "<auto>-" ; public static final Action ENABLE = new Action ( Action . ENABLE ) ; public static final char PATH_SEPARATOR = ':' ; public static final Action RENDER = new Action ( Action . RENDER ) ; protected static final int FLAG_REMOVED_FROM_PARENT = 32768 ; protected static final int FLAG_RESERVED1 = 256 ; protected static final int FLAG_RESERVED2 = 512 ; protected static final int FLAG_RESERVED3 = 1024 ; protected static final int FLAG_RESERVED4 = 2048 ; protected static final int FLAG_RESERVED5 = 65536 ; protected static final int FLAG_RESERVED6 = 131072 ; protected static final int FLAG_RESERVED7 = 262144 ; protected static final int FLAG_RESERVED8 = 524288 ; private static final Object [ ] LISTENER_ARGS = new Object [ ] { } ; private static final MetaDataKey < IComponentBorder > BORDER_KEY = new MetaDataKey < IComponentBorder > ( IComponentBorder . class ) { private static final long serialVersionUID = 1L ; } ; private static final IModelComparator defaultModelComparator = new IModelComparator ( ) { public boolean compare ( Component component , Object b ) { } } ; private static final int FLAG_AUTO = 1 ; private static final int FLAG_ENABLED = 128 ; private static final int FLAG_ESCAPE_MODEL_STRINGS = 2 ; private static final int NOT_USED_ANYMORE_FREE = 4 ; private static final int FLAG_IGNORE_ATTRIBUTE_MODIFIER = 64 ; private static final int FLAG_IS_RENDER_ALLOWED = 8192 ; private static final int FLAG_IS_RENDERED_ONCE = 4096 ; private static final int FLAG_OUTPUT_MARKUP_ID = 16384 ; private static final int FLAG_RENDER_BODY_ONLY = 32 ; private static final int FLAG_VERSIONED = 8 ; private static final int FLAG_VISIBLE = 16 ; private static final int FLAG_HEAD_RENDERED = 1048576 ; private static final Log log = LogFactory . getLog ( Component . class ) ; private static final String MARKUP_ID_ATTR_NAME = "id" ; private static final long serialVersionUID = 1L ; int markupIndex = - 1 ; private List < IBehavior > behaviors = null ; private int flags = ( ( ( ( Component . FLAG_VISIBLE ) | ( Component . FLAG_ESCAPE_MODEL_STRINGS ) ) | ( Component . FLAG_VERSIONED ) ) | ( Component . FLAG_ENABLED ) ) | ( Component . FLAG_IS_RENDER_ALLOWED ) ; private String id ; private MetaDataEntry [ ] metaData ; private IModel < T > model ; private MarkupContainer < ? > parent ; private MarkupAttributeValueMap markupAttributes ; private transient MarkupFragment markupFragment ; public Component ( MarkupContainer parent , final String id ) { } @ SuppressWarnings ( "unchecked" ) public Component ( final MarkupContainer < ? > parent , final String id , final IModel < T > model ) { } Component ( ) { } private MarkupContainer < ? > getRealParent ( MarkupContainer < ? > parent , final String id ) { } public MarkupFragment getMarkupFragment ( ) { } public Component add ( final IBehavior behavior ) { } public final boolean continueToOriginalDestination ( ) { } public final void debug ( final Serializable message ) { } public void detachModels ( ) { } public final void error ( final Serializable message ) { } public final void fatal ( final Serializable 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 ( ) { String markupId = getMarkupAttributes ( ) . getString ( Component . MARKUP_ID_ATTR_NAME ) ; <START_BUG> if ( ( id ) == null ) { <END_BUG> markupId = getMetaData ( Component . MARKUP_ID_KEY ) ; if ( markupId == null ) { markupId = ( getId ( ) ) + ( getPage ( ) . getAutoIndex ( ) ) ; setMetaData ( Component . MARKUP_ID_KEY , markupId ) ; } } return markupId ; } final boolean hasMarkupIdMetaData ( ) { } final void setMarkupIdMetaData ( String markupId ) { } public final < X extends Serializable > X getMetaData ( final MetaDataKey < X > 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 Serializable message ) { } public final boolean isActionAuthorized ( Action action ) { } public final boolean isEnableAllowed ( ) { } public boolean isEnabled ( ) { } public boolean isVersioned ( ) { }

Fix:
if ( markupId == null ) {