You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Daniel Freitas (JIRA)" <ji...@apache.org> on 2008/08/01 05:02:31 UTC
[jira] Created: (WICKET-1765) Extending from org.apache.wicket.Page
causes StackOverflowError
Extending from org.apache.wicket.Page causes StackOverflowError
---------------------------------------------------------------
Key: WICKET-1765
URL: https://issues.apache.org/jira/browse/WICKET-1765
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.3.4
Environment: Windows XP, Eclipse Ganymede, Wicket 1.3.4, Embedded Jetty
Reporter: Daniel Freitas
Priority: Minor
Fix For: 1.3.4
Extending directly from Page, instead of WebPage, causes a StackOverflowError due to a recursive loop.
The problem could be tracked down to the following code:
Example code:
public class ClockPage extends Page{ // Extends page directly
}
//-----------Page extends MarkupContainer
public class MarkupContainer ...
public String getMarkupType()
{
return getPage().getMarkupType();
}
...
}
//---------getPpage() is inherited from Component:
public abstract class Component ... {
...
public final Page getPage()
{
// Search for nearest Page
final Page page = findPage();
// If no Page was found
if (page == null)
{
// Give up with a nice exception
throw new IllegalStateException("No Page found for component " + this);
}
return page;
}
...
}
When extending directly from page, getPage() (inherited from Component) returns an instance to the ClockPage in the example above, which then calls getMarkupType() on itself which will call getPage() again and on an on until a stack overflow occur.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-1765) Extending from
org.apache.wicket.Page causes StackOverflowError
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-1765.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.4-M4
1.3.5
Assignee: Igor Vaynberg
> Extending from org.apache.wicket.Page causes StackOverflowError
> ---------------------------------------------------------------
>
> Key: WICKET-1765
> URL: https://issues.apache.org/jira/browse/WICKET-1765
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.4
> Environment: Windows XP, Eclipse Ganymede, Wicket 1.3.4, Embedded Jetty
> Reporter: Daniel Freitas
> Assignee: Igor Vaynberg
> Priority: Minor
> Fix For: 1.3.5, 1.4-M4
>
>
> Extending directly from Page, instead of WebPage, causes a StackOverflowError due to a recursive loop.
> The problem could be tracked down to the following code:
> Example code:
> public class ClockPage extends Page{ // Extends page directly
> }
> //-----------Page extends MarkupContainer
> public class MarkupContainer ...
> public String getMarkupType()
> {
> return getPage().getMarkupType();
> }
> ...
> }
> //---------getPpage() is inherited from Component:
> public abstract class Component ... {
> ...
> public final Page getPage()
> {
> // Search for nearest Page
> final Page page = findPage();
> // If no Page was found
> if (page == null)
> {
> // Give up with a nice exception
> throw new IllegalStateException("No Page found for component " + this);
> }
> return page;
> }
> ...
> }
> When extending directly from page, getPage() (inherited from Component) returns an instance to the ClockPage in the example above, which then calls getMarkupType() on itself which will call getPage() again and on an on until a stack overflow occur.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1765) Extending from org.apache.wicket.Page
causes StackOverflowError
Posted by "Daniel Freitas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Freitas updated WICKET-1765:
-----------------------------------
Fix Version/s: (was: 1.3.4)
> Extending from org.apache.wicket.Page causes StackOverflowError
> ---------------------------------------------------------------
>
> Key: WICKET-1765
> URL: https://issues.apache.org/jira/browse/WICKET-1765
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.4
> Environment: Windows XP, Eclipse Ganymede, Wicket 1.3.4, Embedded Jetty
> Reporter: Daniel Freitas
> Priority: Minor
>
> Extending directly from Page, instead of WebPage, causes a StackOverflowError due to a recursive loop.
> The problem could be tracked down to the following code:
> Example code:
> public class ClockPage extends Page{ // Extends page directly
> }
> //-----------Page extends MarkupContainer
> public class MarkupContainer ...
> public String getMarkupType()
> {
> return getPage().getMarkupType();
> }
> ...
> }
> //---------getPpage() is inherited from Component:
> public abstract class Component ... {
> ...
> public final Page getPage()
> {
> // Search for nearest Page
> final Page page = findPage();
> // If no Page was found
> if (page == null)
> {
> // Give up with a nice exception
> throw new IllegalStateException("No Page found for component " + this);
> }
> return page;
> }
> ...
> }
> When extending directly from page, getPage() (inherited from Component) returns an instance to the ClockPage in the example above, which then calls getMarkupType() on itself which will call getPage() again and on an on until a stack overflow occur.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.