-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add postProcess
from InputMapTemplateTest to InputMapTemplate
#3
Comments
So, I don't really get most of this code (so don't be surprised if this is way off), but by following the test as a model, I came up with this: public static <S, T extends Event> InputMapTemplate<S, T> postProcess(
InputMapTemplate<S, T> imt, BiConsumer<? extends S, ? extends T> postConsumption) {
return new InputMapTemplate<S, T>() {
@Override
protected InputHandlerTemplateMap<S, T> getInputHandlerTemplateMap() {
return imt.getInputHandlerTemplateMap().map(iht -> {
return (s, evt) -> {
Result res = iht.process(s, evt);
if (res == Result.CONSUME) {
// Here's the issue:
// 's': capture<? extends S> cannot be applied to 'S'
// 'evt': capture<? extends T> cannot be applied to 'T'
postConsumption.accept(s, evt);
}
return res;
};
});
}
};
} If I change the |
Looks good. The bounds on type parameters should be
i.e. |
Ok that's easy to fix (turns out the method below the place where I positioned this actually uses Edit: the test I wrote didn't work, but that was because I removed the lines that only applied |
See FXMisc/RichTextFX#288
The text was updated successfully, but these errors were encountered: