fix compile error for Java 8
This commit is contained in:
parent
e7aadc42b8
commit
729295cfd3
1 changed files with 10 additions and 10 deletions
|
@ -37,6 +37,8 @@ public class PageContextImpl implements PageContext {
|
|||
|
||||
private static final Logger log = LoggerFactory.getLogger(PageContextImpl.class);
|
||||
|
||||
private static final ListenerComparator LIST_COMPARATOR = new ListenerComparator();
|
||||
|
||||
private final I18nSupport i18nSupport;
|
||||
private final ComposerService composerService;
|
||||
private final Composite root;
|
||||
|
@ -154,7 +156,7 @@ public class PageContextImpl implements PageContext {
|
|||
}
|
||||
|
||||
listeners.stream()
|
||||
.sorted(createListenerComparator())
|
||||
.sorted(LIST_COMPARATOR)
|
||||
.forEach(listener -> listener.notify(event));
|
||||
}
|
||||
|
||||
|
@ -262,15 +264,13 @@ public class PageContextImpl implements PageContext {
|
|||
+ "]";
|
||||
}
|
||||
|
||||
private static final Comparator<PageEventListener<?>> createListenerComparator() {
|
||||
return new Comparator<>() {
|
||||
@Override
|
||||
public int compare(final PageEventListener<?> o1, final PageEventListener<?> o2) {
|
||||
final int x = o1.priority();
|
||||
final int y = o2.priority();
|
||||
return (x < y) ? -1 : ((x == y) ? 0 : 1);
|
||||
}
|
||||
};
|
||||
private static final class ListenerComparator implements Comparator<PageEventListener<?>> {
|
||||
@Override
|
||||
public int compare(final PageEventListener<?> o1, final PageEventListener<?> o2) {
|
||||
final int x = o1.priority();
|
||||
final int y = o2.priority();
|
||||
return (x < y) ? -1 : ((x == y) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue