Buggy code:
public final class AutoLinkResolver implements IComponentResolver { public abstract static class AbstractAutolinkResolverDelegate implements AutoLinkResolver . IAutolinkResolverDelegate { protected final Component newPackageResourceReferenceAutoComponent ( final MarkupContainer container , final String autoId , final AutoLinkResolver . PathInfo pathInfo , final String attribute ) { } } public static final class AutolinkBookmarkablePageLink < T > extends BookmarkablePageLink < T > implements IComponentResolver { private static final long serialVersionUID = 1L ; private final String anchor ; public static boolean autoEnable = true ; public < C extends Page > AutolinkBookmarkablePageLink ( final String id , final Class < C > pageClass , final PageParameters parameters , final String anchor ) { } @ Override protected CharSequence getURL ( ) { } public Component resolve ( final MarkupContainer container , final MarkupStream markupStream , ComponentTag tag ) { } } public static interface IAutolinkResolverDelegate { Component newAutoComponent ( final MarkupContainer container , final String autoId , final AutoLinkResolver . PathInfo pathInfo ) { } } public static final class PathInfo { private final boolean absolute ; private final String anchor ; private final String extension ; private final PageParameters pageParameters ; private final String path ; private final String reference ; public PathInfo ( final String reference ) { } public final String getAnchor ( ) { } public final String getExtension ( ) { } public final PageParameters getPageParameters ( ) { } public final String getPath ( ) { } public final String getReference ( ) { } public final boolean isAbsolute ( ) { } } private static final class AnchorResolverDelegate extends AutoLinkResolver . AbstractAutolinkResolverDelegate { private static final String attribute = "href" ; private final Set < String > supportedPageExtensions = new HashSet < String > ( 4 ) ; public AnchorResolverDelegate ( ) { } @ SuppressWarnings ( "unchecked" ) public Component newAutoComponent ( final MarkupContainer container , final String autoId , AutoLinkResolver . PathInfo pathInfo ) { } } private static final class AutolinkExternalLink extends ExternalLink implements IComponentResolver { private static final long serialVersionUID = 1L ; public AutolinkExternalLink ( final String id , final String href ) { } public Component resolve ( MarkupContainer container , MarkupStream markupStream , ComponentTag tag ) { } } private static interface ITagReferenceResolver { String getReference ( final ComponentTag tag ) { } } private static final class ResourceReferenceAutolink extends WebMarkupContainer implements IComponentResolver { private static final long serialVersionUID = 1L ; private final String attribute ; private final ResourceReference resourceReference ; private final MarkupContainer parent ; public ResourceReferenceAutolink ( final String id , final Class < ? > clazz , final String href , final String attribute , MarkupContainer parent ) { } @ Override public String getVariation ( ) { } @ Override protected final void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; if ( ( resourceReference ) != null ) { ResourceReferenceRequestHandler handler = new ResourceReferenceRequestHandler ( resourceReference ) ; CharSequence url = getRequestCycle ( ) . urlFor ( handler ) ; <START_BUG> tag . put ( attribute , Strings . replaceAll ( url , "&" , "&amp;" ) ) ; <END_BUG> } } public Component resolve ( MarkupContainer container , MarkupStream markupStream , ComponentTag tag ) { } } private static final class ResourceReferenceResolverDelegate extends AutoLinkResolver . AbstractAutolinkResolverDelegate { private final String attribute ; public ResourceReferenceResolverDelegate ( final String attribute ) { } public Component newAutoComponent ( final MarkupContainer container , final String autoId , final AutoLinkResolver . PathInfo pathInfo ) { } } private static final class TagReferenceResolver implements AutoLinkResolver . ITagReferenceResolver { private final String attribute ; public TagReferenceResolver ( final String attribute ) { } public String getReference ( final ComponentTag tag ) { } } private static final AutoLinkResolver . TagReferenceResolver DEFAULT_ATTRIBUTE_RESOLVER = new AutoLinkResolver . TagReferenceResolver ( "href" ) ; private static final Logger log = LoggerFactory . getLogger ( AutoLinkResolver . class ) ; private static final long serialVersionUID = 1L ; private final Map < String , AutoLinkResolver . IAutolinkResolverDelegate > tagNameToAutolinkResolverDelegates = new HashMap < String , AutoLinkResolver . IAutolinkResolverDelegate > ( ) ; private final Map < String , AutoLinkResolver . ITagReferenceResolver > tagNameToTagReferenceResolvers = new HashMap < String , AutoLinkResolver . ITagReferenceResolver > ( ) ; public AutoLinkResolver ( ) { } public final void addTagReferenceResolver ( final String tagName , final String attributeName , final AutoLinkResolver . IAutolinkResolverDelegate resolver ) { } public final AutoLinkResolver . IAutolinkResolverDelegate getAutolinkResolverDelegate ( final String tagName ) { } public final Component resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { } private final Component resolveAutomaticLink ( final MarkupContainer container , final String id , final ComponentTag tag ) { } }

Fix:
tag . put ( attribute , url ) ;