Issue in GWT project https://github.com/gwtproject/gwt/issues/9483
-- Stas
On Saturday, January 28, 2017 at 8:32:48 AM UTC+1, foal wrote:
On Saturday, January 28, 2017 at 8:32:48 AM UTC+1, foal wrote:
Hi,I have in code the following lines (few of `Panel` classes implements `TagAware` interface):```Javaprivate final Map<PanelType, Panel<T>> panels;//...panels.values().stream().filter(TagAware.class::isInstance) .map(TagAware.class::cast).forEach(t -> t.setTagsWorkHours(this.tagsWorkHours)); ```The code perfectly compile by javac, but not with GWT compiler:Errors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/ widget/src/main/java/org/ jresearch/gwt/client/date/ widget/Calendar.java' Line 376: The type Class<TagAware> does not define isInstance(Panel<T>) that is applicable hereLine 376: The method filter(Predicate<? super Panel<T>>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::isInstance)The same with castErrors in 'file:/C:/Development/work/repo/JRS/open/gxt/calendar/ widget/src/main/java/org/ jresearch/gwt/client/date/ widget/Calendar.java' Line 377: The method map(Function<? super Panel<T>,? extends R>) in the type Stream<Panel<T>> is not applicable for the arguments (TagAware.class::cast)Line 377: The type Class<TagAware> does not define cast(Panel<T>) that is applicable here##### Known workaroundsRewrite the above lines without method references:```Javapanels.values().stream().filter(p -> p instanceof TagAware).map(p -> (TagAware) p).forEach(t -> t.setTagsWorkHours(this.tagsWorkHours)); ```Best,Stas
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment