that's exactly what I am saying...

It always pisses me off to see developers checking in code
that delivers like 50-100 warnings and they don't care.

warnings are a good thing.

not so sure about generics (just kidding :-)


Am 14.05.2008 um 22:41 schrieb Igor Vaynberg:

well, maybe you get used to warnings, i tend to do something about
them and clean up my code. i do not want to turn this warning off,
because as you said yourself it is a very useful warning, if i turn it
off i might as well not be using generics...

-igor


On Wed, May 14, 2008 at 1:38 PM, Peter Ertl <[EMAIL PROTECTED]> wrote:
In IDEA it is annoying when you enable inspection 'Raw use of parametrized
class' which is generally quite useful

it will complain on

protected boolean isPageAuthorized(final Class<? extends Page> pageClass)

so, no, you don't get a warning but a potentially useful inspection is more
or less useless
(warnings have no effect once you get used to them)

Am 14.05.2008 um 22:29 schrieb Johan Compagner:

how do users get in this situation a warning?

if we as a framework say method(RawType type)
then why would that give a warning in the caller method?
We just say we accept raw type there

johan


On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg <[EMAIL PROTECTED] >
wrote:

then our users have to suppress warnings in their code, which is
unacceptable at least to me. the whole generics thing turned out to be
quiet a lot crappier then i thought it would.

-igor


On Wed, May 14, 2008 at 12:48 PM, Johan Compagner <[EMAIL PROTECTED] >
wrote:

yes then all the call to that method must be of a generic type.
cant be raw

i dont know what are we going to do in wicket i think we should decide
it
should we just where we dont care about generic delete/not use the <?>

and

then
supresswarning?

johan


On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg <[EMAIL PROTECTED] >
wrote:

so i just implemented IAuthorizationStrategy and on this line in my

class:

public boolean isInstantiationAuthorized(Class< ? extends Component>
componentClass)

i get: Component is a raw type. References to generic type
Component<T> should be parameterized

so that means we have to change our sig to <? extends Component<?>>
but then we are back to the problem described in this thread.

generics suck.

-igor

On Wed, May 14, 2008 at 12:12 AM, Johan Compagner <[EMAIL PROTECTED]

wrote:

I dont think that user gets a warning if a param is of raw type. But
we have a warning there.
The problem is that for example MarkupContainer.add(Component) or
IVisitor.visit(Component) i dont care what component is put in
generified or not.
In add it really doesnt matter because we dont do anything with it. With visitor it is different because the user could use it inside the method. But it should be useable without warnings for generified and
none generfied components..


On 5/14/08, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

if we have a signature that accepts a raw type, will that also cause

a

warning in user's code?

also having those suppress annotations practically _everywhere_ will

be

annoying

-igor


On Tue, May 13, 2008 at 11:56 PM, Johan Compagner <

[EMAIL PROTECTED]

wrote:

I dont care, because i cant do any thing with the ? The only thing

it

enforces is that it must now be a generic class which is annoying.

Not

to mention that in that area eclipse and javac accept different
things....

So or we in wicket dont use <?> any where and have supress warning everywhere for that or we do use it and then suddenly it is in my

eyes

restricted to much.



On 5/14/08, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:

Johan Compagner wrote:

yes thats the reason

you are calling the method add with a generified component but

that

container itself is not generified

i dont like this about generics expecially the onces like

this:

add(MarkupContainer<?> container)

then suddenly a none generified component cant be added...
thats really stupid <?> should mean anything.. including none

generics

No, that's not correct. For example, List<?> is much more

restrictive

than a raw List (which is a List<Object>). To a raw list you can

add an

instance of any type whatever, i.e., list.add(new Object()). But

in

List<?> the ? is a wildcard which says it could be any type

there,

i.e.,

it could be a List<Integer>. But you can't add a new Object() to

a

List<Integer>!

Thus MarkupContainer<?> means "MarkupContainer parameterized by

some

unknown type", and *not* MarkupContainer parameterized by

Object,

which

is what the raw type means.

Regards,
Sebastiaan

johan


On Tue, May 13, 2008 at 5:55 PM, Stefan Simik

<[EMAIL PROTECTED]>

wrote:

I have one idea,

the reason of the warnigs is, that parent of

AjaxPagingNavigator

is

PagingNavigator,
which has parent Panel ---> that is not parameterized.

The same problem is with LoopItem, which extends the
WebMarkupContainer ---> that is not parameterized.

? could this be the reason ?






Stefan Simik wrote:

Mhmm, it is meaningful ;) I will know in future, thx

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

simple

ListView


-----------------------------------------------------------------------

ListView<Integer> menu = new ListView<Integer>("id",

numbers){

 //....populate metods
}
add(menu);        //warning here

The warning says:
"Type safety: The method add(Component...) belongs to the

raw

type

MarkupContainer.
References to generic type MarkupContainer<T> 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-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html

Sent from the Wicket - User mailing list archive at

Nabble.com.



---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:

[EMAIL PROTECTED]






---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to