You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marcel Barbosa Pinto (JIRA)" <ji...@apache.org> on 2017/03/12 19:32:04 UTC

[jira] [Created] (WICKET-6337) Wrong class type in PageAccessSynchronizer

Marcel Barbosa Pinto created WICKET-6337:
--------------------------------------------

             Summary: Wrong class type in PageAccessSynchronizer
                 Key: WICKET-6337
                 URL: https://issues.apache.org/jira/browse/WICKET-6337
             Project: Wicket
          Issue Type: Bug
            Reporter: Marcel Barbosa Pinto


If you do this:

IPageManager pageManager = getSession().getPageManager();
System.out.println("------>" + pageManager.toString());

It will return PageAccessSynchronizer instead IPageManager:

------>org.apache.wicket.page.PageAccessSynchronizer$2@38834c7b

So I can't cast this to my custom class that extends IPageManager

Possible solution:

org.apache.wicket.page.Session.java

public final IPageManager getPageManager()
	{
		IPageManager pageManager = Application.get().internalGetPageManager();
		return pageAccessSynchronizer.get().adapt(pageManager);
	}

org.apache.wicket.page.PageAccessSynchronizer.java

** The PageManagerDecorator inner class should implement IPageManager

public IPageManager adapt(IPageManager pagemanager)
	{
		return new PageManagerDecorator(pagemanager) *** implements IPageManager ***



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)