protected List<Method> getAnnotatedListenerMethodsNotCached(Class<?> clazz, Method[] uniqueDeclaredMethods) {
// for legacy screens
if (clazz == AbstractWindow.class
|| clazz == AbstractEditor.class
|| clazz == AbstractLookup.class
|| clazz == AbstractFrame.class) {
return Collections.emptyList();
}
return Arrays.stream(uniqueDeclaredMethods)
.filter(m -> findMergedAnnotation(m, EventListener.class) != null)
.peek(m -> {
if (!m.isAccessible()) {
m.setAccessible(true);
}
})
.collect(ImmutableList.toImmutableList());
}