recrete it in ComponentInitializationTest and fix it :)

-igor

On Sat, Jul 24, 2010 at 2:05 AM, Martin Grigorov <[email protected]> wrote:
> +1 for vote in users@
>
> I just found a problem while creating new wicket-example for the new request
> mappers:
>
> java.lang.StackOverflowError
>  at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:978)
>     at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:168)
>     at
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
>     at org.apache.wicket.Component.initialize(Component.java:970)
>     at
> org.apache.wicket.MarkupContainer.initialize(MarkupContainer.java:992)
>     at org.apache.wicket.Page.componentAdded(Page.java:1130)
>     at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:978)
>     at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:168)
>     at
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
>     at org.apache.wicket.Component.initialize(Component.java:970)
>     at
> org.apache.wicket.MarkupContainer.initialize(MarkupContainer.java:992)
>     at org.apache.wicket.Page.componentAdded(Page.java:1130)
>     at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:978)
>     at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:168)
>     at
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
>     at org.apache.wicket.Component.initialize(Component.java:970)
>     at
> org.apache.wicket.MarkupContainer.initialize(MarkupContainer.java:992)
>     at org.apache.wicket.Page.componentAdded(Page.java:1130)
>     at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:978)
>     at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:168)
>     at
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
>     at org.apache.wicket.Component.initialize(Component.java:970)
>     at
> org.apache.wicket.MarkupContainer.initialize(MarkupContainer.java:992)
>     at org.apache.wicket.Page.componentAdded(Page.java:1130)
>     at
> org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:978)
>     at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:168)
>     at
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
>     at org.apache.wicket.Component.initialize(Component.java:970)
> ....
>
> In 
> org.apache.wicket.examples.WicketExamplePage.onInitialize(WicketExamplePage.java:67)
> I have "add(header)".
>
> My fix looks is:
> Index: wicket/src/main/java/org/apache/wicket/Component.java
> ===================================================================
> --- wicket/src/main/java/org/apache/wicket/Component.java (revision 978819)
> +++ wicket/src/main/java/org/apache/wicket/Component.java (working copy)
> @@ -967,8 +967,8 @@
>  {
>  if (!getFlag(FLAG_INITIALIZED))
>  {
> + setFlag(FLAG_INITIALIZED, true);
>  onInitialize();
> - setFlag(FLAG_INITIALIZED, true);
>  }
>  }
>
> Is this ok ?
>
> On Fri, Jul 23, 2010 at 5:45 PM, Igor Vaynberg <[email protected]>wrote:
>
>> since this has turned into more of a vote should we take it to the
>> user list so we get a wider range of responses?
>>
>> -igor
>>
>> On Fri, Jul 23, 2010 at 1:50 AM, Martijn Dashorst
>> <[email protected]> wrote:
>> > +1 for Johan's changes to make the surface area of the change smaller.
>> >
>> > I didn't find onInitialize and onConfigure in our code base as well.
>> >
>> > The benefits are evident. So that is +0 from me to keep them in.
>> > Pushing them to only 1.5 ensures we get enough folks trying 1.5 though
>> > :)
>> >
>> > Martijn
>> >
>> > On Fri, Jul 23, 2010 at 10:38 AM, Johan Compagner <[email protected]>
>> wrote:
>> >> we (servoy) dont care much about those changes, they can be left in
>> >> (we dont use it and they also dont give us a problem (after my fix ;)
>> >> )
>> >>
>> >>
>> >> the only problem is by the way onInitialize and onConfigure()
>> >>
>> >> Because initialize and also doInitialize() are package scope so they
>> >> are not a problem as far as i know... for example doinitialize() is
>> >> final but a subclass of component in another package can just create
>> >> such a method just fine...
>> >>
>> >> configure() you made public final.. i think we just should do the
>> >> same, make it package scope final...
>> >> then that method shouldnt also be a big problem.
>> >>
>> >> The it is just the 2 overridable protected methods onInitialize and
>> onConfigure
>> >>
>> >> johan
>> >>
>> >>
>> >> On Thu, Jul 22, 2010 at 19:33, Igor Vaynberg <[email protected]>
>> wrote:
>> >>> i just thought of something, i added oninitialize and onconfigure
>> >>> features to 1.4.x as well as trunk, but they can create an
>> >>> incompatibility for 1.4.x users if they have declared a method on
>> >>> their components with the same name.
>> >>>
>> >>> impacted method names are component#configure(), onConfigure(),
>> >>> initialize(), onInitialize().
>> >>>
>> >>> should we remove these features from 1.4.x to remove the chance of an
>> >>> incompatibility?
>> >>>
>> >>> -igor
>> >>>
>> >>
>> >
>> >
>> >
>> > --
>> > Become a Wicket expert, learn from the best: http://wicketinaction.com
>> > Apache Wicket 1.4 increases type safety for web applications
>> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8
>> >
>>
>

Reply via email to