Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Peter Ertl
taken from SUN's generic tutorial: http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf end of page 8 snip ::: interface Collection { public boolean containsAll(Collection c); public boolean addAll(Collection c); } We could have used generic methods here instead: interface Collection { p

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Peter Ertl
this one will do: public > void foo(Class clazz); however, the subtle differences between this and igors version are really hard to get. Am 15.05.2008 um 16:31 schrieb Igor Vaynberg: this is the usecase we are talking about. i get a compile error, which sucks. public class Test {

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Johan Compagner
yes and those i already came across some in wicket i changed to and suddenly in extentions and/or examples compile errors all over the place... then i quickly turn it off again... (for now) johan On Thu, May 15, 2008 at 4:31 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > this is the usecase we

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Igor Vaynberg
this is the usecase we are talking about. i get a compile error, which sucks. public class Test { public static void main(String[] args) { Foo foo = new FooImpl(); foo.foo(IntegerComponent.class); // ok foo.foo(Component.class); // compile error } public st

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
Igor Vaynberg wrote: well, apparently johan ran into a situation where component is too restrictive... As I understand it, Johan ran into a situation where Component causes *warnings* for users who use raw types. Which I've been arguing all along that they SHOULD get: they should use Componen

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Gerolf Seitz
i think something similar happend to me with Model.valueOf(Map), so i had to change it back to return Model instead of Model Gerolf On Wed, May 14, 2008 at 11:41 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > well, apparently johan ran into a situation where component is too > restrictive... >

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
well, apparently johan ran into a situation where component is too restrictive... -igor On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote: > Igor Vaynberg wrote: >> >> since then the thread has evolved into whether or not we should use > extends Component> or > >> >>

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
yeah, generics are pretty damn viral -igor On Wed, May 14, 2008 at 2:28 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius > <[EMAIL PROTECTED]> wrote: >>> the whole generics thing turned out to be >>> quiet a lot crappier then i thought it would. >>

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
Igor Vaynberg wrote: since then the thread has evolved into whether or not we should use or > -igor I don't understand how that changes any of my points. The first is incorrect (from a generics point of view) since you're referencing an unparameterized generic type. So the second gives wa

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl
wicket 1.6 = scala-based ? *lol* Am 14.05.2008 um 23:28 schrieb Eelco Hillenius: On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: the whole generics thing turned out to be quiet a lot crappier then i thought it would. :-) Generics for models: great. Generics for

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Eelco Hillenius
On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote: >> the whole generics thing turned out to be >> quiet a lot crappier then i thought it would. > > :-) Generics for models: great. Generics for components: awful. Too bad that stuff is contagious. Eelco --

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
since then the thread has evolved into whether or not we should use or > -igor On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote: > Igor Vaynberg wrote: > >> i do like generics. did i ever say otherwise? the problem here is that >> if we scope something as Class then

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Eelco Hillenius
> the whole generics thing turned out to be > quiet a lot crappier then i thought it would. :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
Igor Vaynberg wrote: i do like generics. did i ever say otherwise? the problem here is that if we scope something as Class then even though you ARE using generics in your code you will still get a warning because we did not scope the class as Class>. on the other hand if we do scope it as Class

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl
MarkupContainer. References to generic type MarkupContainer should be parameterized" I cannot find out, what's the warning reason, because ListView self is parameterized. -- View this message in context: http://www.nabble.com/Using-ge

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
(which is a List). To a raw list you can >>>>> >>>>> add an >>>>>>>>> >>>>>>>>> instance of any type whatever, i.e., list.add(new Object()). But >>> >>> in >>>>>>>>> >>>>>>&g

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
; List! >>>>>>> > >>>>>>> > Thus MarkupContainer means "MarkupContainer parameterized by >>>> >>>> some >>>>>>> >>>>>>> > unknown type", and *not* MarkupContainer param

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl
t find out, what's the warning reason, because ListView self is parameterized. -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html Sent from the Wicket - User mailing list archive at Nabble.com.

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
; >> > > is what the raw type means. >> >> >> > > >> >> >> > > Regards, >> >> >> > > Sebastiaan >> >> >> > > >> >> >> > > > johan >> >> >&g

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
> > > >> >> > > >> I have one idea, > >> >> > > >> > >> >> > > >> the reason of the warnigs is, that parent of > AjaxPagingNavigator &g

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
-- > >>> ListView menu = new ListView("id", numbers){ > >>> //populate metods > >>> } > >>> add(menu);//warning here > >>> > >>> The warning says: > >>> "Type safety: T

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
parameterized. >> >> > > >> >> >> > > >> The same problem is with LoopItem, which extends the >> >> > > >> WebMarkupContainer ---> that is not parameterized. >> >> > > >> >> >> > >

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
e > >> > > >> WebMarkupContainer ---> that is not parameterized. > >> > > >> > >> > > >> ? could this be the reason ? > >> > > >> > >> > > >> > >> > > >> > >> > >

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
; >> >> > > >> >> > > >> >> > > >> >> > > >> Stefan Simik wrote: >> > > >>> Mhmm, it is meaningful ;) I will know in future, thx >> > > >>> >> > > >>> One o

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
rameterized. >>> >> >> >>> >> >> ? could this be the reason ? >>> >> >> >>> >> >> >>> >> >>

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Stefan Simik wrote: >> >> >> > >> >> >> > Mhmm, it is meaningful ;) I will know in f

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
> >> generics", I > >> respectfully disagree. One major point of generics is to avoid code > >> duplication of boilerplate code. It it weren't for the need to > >> create > >> constructors, there wouldn't be any duplicated code. I

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
>> >> > > >> >> > One of the last occuring warning is, when working with > >> >> > MarkupContainer#add(...) or #addOrReplace(...) method. > >> >> > > >> >> > Example: I have a simple AjaxPagingNavig

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Stefan Simik
;> >> > >> >> > The warning says: >> >> > "Type safety: The method add(Component...) belongs to the raw type >> >> > MarkupContainer. >> >> > References to generic type MarkupContainer sho

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe
gt;> generics", I >> respectfully disagree. One major point of generics is to avoid code >> duplication of boilerplate code. It it weren't for the need to >> create >> constructors, there wouldn't be any duplicated code. I agree that >> it i

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl
te: imho, that seems like that adds a lot of unnecessary code. One of the nice things about Wicket is that it keeps the bloat to a minimum. -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2008 8:21 AM To: users@wicket.apache.org Subject: Re: Using generics

RE: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe
readability and maintainability. -Doug Hoover, William wrote: > > imho, that seems like that adds a lot of unnecessary code. One of the > nice things about Wicket is that it keeps the bloat to a minimum. > > -Original Message----- > From: Doug Donohoe [mailto:[EMAIL PROTECTED]

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Martijn Dashorst
t; >> > > > > PagingNavigator, > >> > > > > which has parent Panel ---> that is not parameterized. > >> > > > > > >> > > > > The same problem is with LoopItem, which extends the > >> > > > >

RE: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Hoover, William
generics with some non-generic classes in Wicket Somewhat related to this thread, when I moved to generics win Wicket 1.4, I created some utility classes such as: public class VoidContainer extends WebMarkupContainer<Void> public class VoidPanel extends Panel<Void> public class StringL

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe
gt; simple >> > > > > > ListView >> > > > > > >> > > > > > >> --- >> > > > > > ListView menu = new ListView("id", numbers){ >>

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
future, thx > > > > > > > > > > > > One of the last occuring warning is, when working with > > > > > > MarkupContainer#add(...) or #addOrReplace(...) method. > > > > > > > > > > > > Example: I

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
rized" I cannot find out, what's the warning reason, because ListView self is parameterized. -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
; > > > >>> One of the last occuring warning is, when working with > > > >>> MarkupContainer#add(...) or #addOrReplace(...) method. > > > >>> > > > >>> Example: I have a simple AjaxPagingNavigator, to which I add a

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
View > > >>> ----------------------- > > >>> ListView menu = new ListView("id", numbers){ > > >>> //populate metods > > >>> } > > >>> add(menu);//warning here

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
> >>> ListView menu = new ListView("id", numbers){ > >>> //....populate metods > >>> } > >>> add(menu);//warning here > >>> > >>> The

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Sebastiaan van Erk
ys: "Type safety: The method add(Component...) belongs to the raw type MarkupContainer. References to generic type MarkupContainer should be parameterized" I cannot find out, what's the warning reason, because ListView self is parameterized. -- View this message in context: http://ww

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
this.stringProvider = stringProvider; > >> >> } > >> >> > >> >> public ExtendedLabel(String id, String text) { > >> >>this(id, new Model(text), new BasicStringProvider()); > >> >>//this(id, new Model<T>(text), new >

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Jonathan Locke
ringProvider; >> >> } >> >> >> >> public ExtendedLabel(String id, String text) { >> >>this(id, new Model(text), new BasicStringProvider()); >> >>//this(id, new Model<T>(text), new >> BasicStringProvider()

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
le > >> > ListView > >> > > --- > >> > ListView menu = new ListView("id", numbers){ > >> > //populate metods > >> > } > >> > add(menu);

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
ate metods >> > } >> > add(menu);//warning here >> > >> > The warning says: >> > "Type safety: The method add(Component...) belongs to the raw type >> > MarkupContainer. >> > References to generic type MarkupCont

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
ent...) belongs to the raw type > > MarkupContainer. > > References to generic type MarkupContainer should be parameterized" > > > > I cannot find out, what's the warning reason, because ListView self is > > parameterized

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
the second constructor, which calls this. Its > >> second parameter - "new Model(text)", > >> > >> which I cannot generify. If I write "new Model(text)", I get an error: > >> "The > >> constructor Model(String) is undefined."

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Jonathan Locke
rror >> } >> >> } >> >> >> >> >> The problematic part, is the second constructor, which calls this. Its >> second parameter - "new Model(text)", >> >> which I cannot generify. If I write "new Model(text)",

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
omponent...) belongs to the raw type > MarkupContainer. > References to generic type MarkupContainer should be parameterized" > > I cannot find out, what's the warning reason, because ListView self is > parameterized. > > -- View this message in context: http:/

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
e parameterized" I cannot find out, what's the warning reason, because ListView self is parameterized. -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17211948.html Sent from the Wicket - User mailing l

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
his > > > > public ExtendLabel(String id, T string) > > { > > super(id, new Model(string)); > > } > > > > -- > View this message in context: > http://www.nabble.com/Using-generics-with-some-non-generic-classes-

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
public ExtendLabel(String id, T string) > { > super(id, new Model(string)); > } > -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17211220.html Sent from the Wicket - User mailing li

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Johan Compagner
Its > second parameter - "new Model(text)", > > which I cannot generify. If I write "new Model(text)", I get an error: > "The > constructor Model(String) is undefined." > > > I can't find out, what I am doing wrong. > > > Thx >

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
"new Model(text)", I get an error: "The constructor Model(String) is undefined." I can't find out, what I am doing wrong. Thx Stefan Simik -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208

Re: Using generics with some non-generic classes in Wicket

2008-05-13 Thread Maurice Marrink
g of these classes ? > > Thx, > Stefan Simik > > > > > -- > View this message in context: > http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17208928.html > Sent from the Wicket - User mailing list archive at Nabble.com. &

Using generics with some non-generic classes in Wicket

2008-05-13 Thread Stefan Simik
fying of these classes ? Thx, Stefan Simik -- View this message in context: http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17208928.html Sent from the Wicket - User mailing list archive at Nabbl