[
https://issues.apache.org/jira/browse/WICKET-6536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16652457#comment-16652457
]
Jezza commented on WICKET-6536:
-------------------------------
The "problem" isn't that Class<?> isn't Class<S>, it's Java not being able to
infer the type without it.
It would work if you did something like:
{noformat}
container.<Label, Void>visitChildren(Label.class, (comp, visit) ->
visit.stop());
{noformat}
If that isn't your style, you can go an explicitly typed lambda.
container.visitChildren(Label.class, (Label comp, IVisit<Void> visit) ->
visit.stop());
> Add generic to MarkupContainer#visitChildren
> --------------------------------------------
>
> Key: WICKET-6536
> URL: https://issues.apache.org/jira/browse/WICKET-6536
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 8.0.0-M8
> Reporter: Kamil
> Assignee: Sven Meier
> Priority: Major
>
> currently MarkupContainer#visitChildren has signature:
> {code:java}
> final <S extends Component, R> R visitChildren(final Class<?> clazz, final
> IVisitor<S, R> visitor){code}
> while im my opinion it should have:
> {code:java}
> final <S extends Component, R> R visitChildren(final Class<S> clazz, final
> IVisitor<S, R> visitor){code}
> Why force user to do class cast while we already know which class we pass to
> the method?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)